Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jgraph/drawio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaudenz Alder <gaudenz@jgraph.com>2018-02-06 20:15:45 +0300
committerGaudenz Alder <gaudenz@jgraph.com>2018-02-06 20:15:45 +0300
commiteff65ddc07a433140e526daa92fb08ff56d5cf19 (patch)
tree29b10f406349f3668e5101635e6069e2cc1918f0
parent5b19b322bea09e706c89e484a12b7739c39fddf2 (diff)
8.0.7 releasev8.0.7
Former-commit-id: 59d9f0cdaab8dd83fcd7dfb22f7d92284e082f52
-rw-r--r--ChangeLog5
-rw-r--r--VERSION2
-rw-r--r--src/main/webapp/cache.manifest2
-rw-r--r--src/main/webapp/connect/confluence/ac.js288
-rw-r--r--src/main/webapp/index.html21
-rw-r--r--src/main/webapp/js/app.min.js1227
-rw-r--r--src/main/webapp/js/atlas-viewer.min.js1191
-rw-r--r--src/main/webapp/js/atlas.min.js1359
-rw-r--r--src/main/webapp/js/diagramly/App.js6
-rw-r--r--src/main/webapp/js/diagramly/Dialogs.js306
-rw-r--r--src/main/webapp/js/diagramly/DrawioFile.js2
-rw-r--r--src/main/webapp/js/diagramly/EditorUi.js34
-rw-r--r--src/main/webapp/js/diagramly/Menus.js2
-rw-r--r--src/main/webapp/js/diagramly/StorageFile.js13
-rw-r--r--src/main/webapp/js/embed-static.min.js22
-rw-r--r--src/main/webapp/js/mxgraph/Graph.js2
-rw-r--r--src/main/webapp/js/reader.min.js22
-rw-r--r--src/main/webapp/js/viewer.min.js1191
-rw-r--r--src/main/webapp/open.html4
-rw-r--r--src/main/webapp/styles/dark.css28
-rw-r--r--src/main/webapp/templates/business/accd.xml2
21 files changed, 3097 insertions, 2632 deletions
diff --git a/ChangeLog b/ChangeLog
index 827357b4..4d7cd249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+06-FEB-2018: 8.0.7
+
+- Adds recent/search in Confluence connect
+- Fixes various bugs
+
02-FEB-2018: 8.0.6
- Fixes Ctrl+connect of orthogonal edges
diff --git a/VERSION b/VERSION
index 53bfcaac..3766c29d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-8.0.6 \ No newline at end of file
+8.0.7 \ No newline at end of file
diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest
index 194936e4..c23eb8ef 100644
--- a/src/main/webapp/cache.manifest
+++ b/src/main/webapp/cache.manifest
@@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 02/02/2018 10:10 PM
+# 02/06/2018 06:05 PM
app.html
index.html?offline=1
diff --git a/src/main/webapp/connect/confluence/ac.js b/src/main/webapp/connect/confluence/ac.js
index 37358b66..a3df37c2 100644
--- a/src/main/webapp/connect/confluence/ac.js
+++ b/src/main/webapp/connect/confluence/ac.js
@@ -468,7 +468,7 @@ AC.init = function(baseUrl, location, pageId, editor, diagramName, initialXml, d
}
else
{
- editor.contentWindow.postMessage(JSON.stringify({action: 'template'}), '*');
+ editor.contentWindow.postMessage(JSON.stringify({action: 'template', enableRecent: true, enableSearch: true}), '*');
}
};
@@ -629,54 +629,268 @@ AC.init = function(baseUrl, location, pageId, editor, diagramName, initialXml, d
}
}
}
+ else if (drawMsg.event == 'searchDocs')
+ {
+ //since we don't use a unique file extension for draw.io diagrams, we need to find pages having draw.io macro also
+ //So, two search requests are needed
+ AP.require('request', function(request) {
+ request({
+ //TODO this query can be enhanced to get part of the name matching but the problem is with the png!
+ url: '/rest/api/content/search?cql=' + encodeURIComponent('type=attachment and (title ~ "' + drawMsg.searchStr + '" or title ~ "' + drawMsg.searchStr + '.png")') + '&limit=100', //limit is 100 and the pages limit is 50 since each diagram has two attachments (and we assume one diagram per page)
+ success: function(resp)
+ {
+ resp = JSON.parse(resp);
+ var retList = [];
+ var list = resp.results;
+ if (list)
+ {
+ var attMap = {};
+ //convert the list to map so we can search by name effeciently
+ for (var i = 0; i < list.length; i++)
+ {
+ //key is pageId + | + att name
+ var pageId = list[i]["_links"]["webui"].match(/pages\/(\d+)/);
+
+ if (pageId != null)
+ {
+ attMap[pageId[1] + '|' + list[i].title] = {att: list[i], pageId: pageId[1]};
+ }
+ }
+
+ //TODO confirm that the attachments are in a page having draw.io macro
+ for (var key in attMap)
+ {
+ var att = attMap[key];
+
+ if (attMap[key+'.png']) //each draw.io attachment should have an associated png preview
+ {
+ //We cannot get the latest version info, it can searched when a diagram is selected
+ retList.push({
+ title: att.att.title,
+ url: "/download/attachments/" + att.pageId + "/"
+ + encodeURIComponent(att.att.title),
+ info: {
+ id: att.att.id,
+ pageId: att.pageId
+ },
+ imgUrl: baseUrl + "/download/attachments/" + att.pageId + "/"
+ + encodeURIComponent(att.att.title)
+ + ".png?api=v2"
+ });
+ }
+ }
+ editor.contentWindow.postMessage(JSON.stringify({action: 'searchDocsList',
+ list: retList}), '*');
+ }
+ },
+ error : function(resp)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'searchDocsList',
+ list: [], errorMsg: "Network Error!"}), '*');
+ }
+ });
+ });
+
+ }
+ else if (drawMsg.event == 'recentDocs')
+ {
+ //since we don't use a unique file extension for draw.io diagrams, we need to find pages having draw.io macro also
+ //So, two search requests are needed
+ AP.require('request', function(request) {
+ request({
+ url: '/rest/api/content/search?cql=type=attachment%20and%20lastmodified%3E%20startOfDay(%22-7d%22)&limit=100', //cql= type=attachment and lastmodified > startOfDay("-7d") //modified in the last 7 days
+ //limit is 100 and the pages limit is 50 since each diagram has two attachments (and we assume one diagram per page)
+ success: function(resp)
+ {
+ resp = JSON.parse(resp);
+ var retList = [];
+ var list = resp.results;
+ if (list)
+ {
+ var attMap = {};
+ //convert the list to map so we can search by name effeciently
+ for (var i = 0; i < list.length; i++)
+ {
+ //key is pageId + | + att name
+ var pageId = list[i]["_links"]["webui"].match(/pages\/(\d+)/);
+
+ if (pageId != null)
+ {
+ attMap[pageId[1] + '|' + list[i].title] = {att: list[i], pageId: pageId[1]};
+ }
+ }
+
+ //confirm that the attachments are in a page having draw.io macro
+ request({
+ url: '/rest/api/content/search?cql=macro=drawio%20and%20lastmodified%3E%20startOfDay(%22-7d%22)&limit=50', //cql= macro=drawio and lastmodified > startOfDay("-7d") //modified in the last 7 days
+ success: function(resp)
+ {
+ resp = JSON.parse(resp);
+ var pages = {};
+ var list = resp.results;
+ if (list)
+ {
+ for (var i = 0; i < list.length; i++)
+ {
+ pages[list[i].id] = list[i];
+ }
+ }
+
+
+ for (var key in attMap)
+ {
+ var att = attMap[key];
+
+ if (attMap[key+'.png'] && pages[att.pageId] != null) //each draw.io attachment should have an associated png preview
+ {
+ //We cannot get the latest version info, it can searched when a diagram is selected
+ retList.push({
+ title: att.att.title,
+ url: "/download/attachments/" + att.pageId + "/"
+ + encodeURIComponent(att.att.title),
+ info: {
+ id: att.att.id,
+ pageId: att.pageId
+ },
+ imgUrl: baseUrl + "/download/attachments/" + att.pageId + "/"
+ + encodeURIComponent(att.att.title)
+ + ".png?api=v2"
+ });
+ }
+ }
+ editor.contentWindow.postMessage(JSON.stringify({action: 'recentDocsList',
+ list: retList}), '*');
+ },
+ error : function(resp)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'recentDocsList',
+ list: [], errorMsg: "Network Error!"}), '*');
+ }
+ });
+ }
+ },
+ error : function(resp)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'recentDocsList',
+ list: [], errorMsg: "Network Error!"}), '*');
+ }
+ });
+ });
+
+
+ }
else if (drawMsg.event == 'template')
{
editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
show: true, messageKey: 'inserting'}), '*');
- checkName(drawMsg.name, function(name)
+ if (drawMsg.docUrl)
{
- editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
- show: false}), '*');
- diagramName = name;
-
- if (AC.draftEnabled)
+ checkName(drawMsg.name, function(name)
{
- draftName = '~drawio~' + user + '~' + diagramName + AC.draftExtension;
- editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
- show: true, messageKey: 'inserting'}), '*');
+ diagramName = name;
- saveDraft(drawMsg.xml, function()
+ AP.require('request', function(request) {
+
+ var loadTemplate = function(version)
+ {
+ request({
+ url: drawMsg.docUrl + (version != null? "?version=" + version : ""),
+ success: function(xml)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'load',
+ autosave: 1, xml: xml, title: diagramName}), '*');
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
+ show: false}), '*');
+ },
+ error : function(resp)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
+ show: false}), '*');
+ editor.contentWindow.postMessage(JSON.stringify({action: 'dialog',
+ titleKey: 'error', message: "Diagram cannot be loaded", messageKey: null,
+ buttonKey: 'ok'}), '*');
+ }
+ });
+ }
+
+ request({
+ url: '/rest/api/content/' + drawMsg.info.id,
+ success: function(resp)
+ {
+ resp = JSON.parse(resp);
+
+ try
+ {
+ loadTemplate(resp.version.number);
+ }
+ catch(e)
+ {
+ loadTemplate();
+ }
+ },
+ error : function(resp)
+ {
+ loadTemplate();
+ }
+ });
+ });
+ },
+ function(name, err, errKey)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
+ show: false}), '*');
+ editor.contentWindow.postMessage(JSON.stringify({action: 'dialog',
+ titleKey: 'error', message: err, messageKey: errKey,
+ buttonKey: 'ok'}), '*');
+ });
+ }
+ else
+ {
+ checkName(drawMsg.name, function(name)
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
+ show: false}), '*');
+ diagramName = name;
+
+ if (AC.draftEnabled)
+ {
+ draftName = '~drawio~' + user + '~' + diagramName + AC.draftExtension;
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
+ show: true, messageKey: 'inserting'}), '*');
+
+ saveDraft(drawMsg.xml, function()
+ {
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner', show: false}), '*');
+ editor.contentWindow.postMessage(JSON.stringify({action: 'load',
+ autosave: 1, xml: drawMsg.xml, title: diagramName}), '*');
+ },
+ function()
+ {
+ editor.parentNode.removeChild(editor);
+ var message = messages.error('Draft Write Error', 'Draft could not be created');
+
+ messages.onClose(message, function()
+ {
+ confluence.closeMacroEditor();
+ });
+ });
+ }
+ else
{
- editor.contentWindow.postMessage(JSON.stringify({action: 'spinner', show: false}), '*');
editor.contentWindow.postMessage(JSON.stringify({action: 'load',
autosave: 1, xml: drawMsg.xml, title: diagramName}), '*');
- },
- function()
- {
- editor.parentNode.removeChild(editor);
- var message = messages.error('Draft Write Error', 'Draft could not be created');
-
- messages.onClose(message, function()
- {
- confluence.closeMacroEditor();
- });
- });
- }
- else
+ }
+ },
+ function(name, err, errKey)
{
- editor.contentWindow.postMessage(JSON.stringify({action: 'load',
- autosave: 1, xml: drawMsg.xml, title: diagramName}), '*');
- }
- },
- function(name, err, errKey)
- {
- editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
- show: false}), '*');
- editor.contentWindow.postMessage(JSON.stringify({action: 'dialog',
- titleKey: 'error', message: err, messageKey: errKey,
- buttonKey: 'ok'}), '*');
- });
+ editor.contentWindow.postMessage(JSON.stringify({action: 'spinner',
+ show: false}), '*');
+ editor.contentWindow.postMessage(JSON.stringify({action: 'dialog',
+ titleKey: 'error', message: err, messageKey: errKey,
+ buttonKey: 'ok'}), '*');
+ });
+ }
}
else if (drawMsg.event == 'autosave')
{
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index 10850e83..7c5841c2 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -208,7 +208,7 @@
}
#geFooterItem1:hover {
background-color: #b0b0b0;
- }
+ }
.geFooterContainer>div>img {
opacity:0.5;
background:#e5e5e5;
@@ -243,9 +243,9 @@
/**
* Synchronously adds scripts to the page.
*/
- function mxscript(src, onLoad, id, dataAppKey)
+ function mxscript(src, onLoad, id, dataAppKey, noWrite)
{
- if (onLoad != null)
+ if (onLoad != null || noWrite)
{
var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
@@ -262,14 +262,17 @@
s.setAttribute('data-app-key', dataAppKey);
}
- s.onload = s.onreadystatechange = function()
+ if (onLoad != null)
{
- if (!r && (!this.readyState || this.readyState == 'complete'))
+ s.onload = s.onreadystatechange = function()
{
- r = true;
- onLoad();
- }
- };
+ if (!r && (!this.readyState || this.readyState == 'complete'))
+ {
+ r = true;
+ onLoad();
+ }
+ };
+ }
var t = document.getElementsByTagName('script')[0];
t.parentNode.insertBefore(s, t);
diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js
index b037a998..3cd4bf2d 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -2498,16 +2498,16 @@ arguments);null!=b&&(b.width+=10,b.height+=4,this.gridEnabled&&(b.width=this.sna
h.setTerminalPoint(k,!1);h.setTerminalPoint(l,!0);b.setGeometry(e,h);var m=this.view.getState(e),D=this.view.getState(f),n=this.view.getState(g);if(null!=m){var p=null!=D?this.getConnectionConstraint(m,D,!0):null,q=null!=n?this.getConnectionConstraint(m,n,!1):null;this.setConnectionConstraint(e,f,!0,q);this.setConnectionConstraint(e,g,!1,p)}c.push(e)}}else if(b.isVertex(e)&&(h=this.getCellGeometry(e),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var t=h.width;h.width=h.height;
h.height=t;b.setGeometry(e,h);var r=this.view.getState(e);if(null!=r){var x=r.style[mxConstants.STYLE_DIRECTION]||"east";"east"==x?x="south":"south"==x?x="west":"west"==x?x="north":"north"==x&&(x="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,x,[e])}c.push(e)}}}finally{b.endUpdate()}return c};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var b=this.model.getDescendants(a.cell);
if(0<b.length)for(var c=0;c<b.length;c++)this.isReplacePlaceholders(b[c])&&this.view.invalidate(b[c],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,b,c){b=this.zapGremlins(b);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),e=a;null!=e;){if(e==this.model.getRoot()||null!=e.value&&"object"==typeof e.value&&e.hasAttribute(d)){this.setAttributeForCell(e,d,b);break}e=
-this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,
-mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=this.view.getState(a[c]);if(null!=d){var e=
-mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=function(a,b,c){var d;
-null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=
-function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&(mxUtils.contains(d.text.boundingBox,
-c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,c=this.container.scrollTop/
-this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+(0==b.height?1:
-2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);d.geometry.offset=
-new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",
-[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
+this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&(this.model.isEdge(e.cell)||this.model.isVertex(e.cell))&&
+this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=
+this.view.getState(a[c]);if(null!=d){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=
+function(a,b,c){var d;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,
+arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&
+(mxUtils.contains(d.text.boundingBox,c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,
+c=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+
+(0==b.height?1:2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);
+d.geometry.offset=new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted",
+"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
d),null!=b&&mxEvent.addGestureListeners(a[c],null,null,b))}});this.model.addListener(mxEvent.CHANGE,d);d();var e=this.container.style.cursor,f=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(b)},mouseMove:function(a,b){if(g.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-b.getGraphX()),d=Math.abs(this.startY-b.getGraphY());(c>f||d>f)&&this.clear()}}else{for(c=b.getSource();null!=c&&"a"!=c.nodeName.toLowerCase();)c=
c.parentNode;null!=c?this.clear():(null==this.currentState||b.getState()!=this.currentState&&null!=b.getState()||!g.intersects(this.currentState,b.getGraphX(),b.getGraphY()))&&this.updateCurrentState(b)}},mouseUp:function(a,d){for(var e=d.getSource(),h=d.getEvent();null!=e&&"a"!=e.nodeName.toLowerCase();)e=e.parentNode;null==e&&Math.abs(this.scrollLeft-g.container.scrollLeft)<f&&Math.abs(this.scrollTop-g.container.scrollTop)<f&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(h)&&
@@ -6211,9 +6211,9 @@ this.createVertexTemplateEntry(a+"vimeo;fillColor=#1AB7EA;strokeColor=none",62.6
"yelp","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yoolink",79.2,79.2,"","Yoolink",null,null,this.getTagsForStencil("mxgraph.weblogos","yoolink","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youmob",76,76.2,"","Youmob",null,null,this.getTagsForStencil("mxgraph.weblogos","youmob","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youtube;fillColor=#FF2626;gradientColor=#B5171F",.2*786,65.8,"","Youtube",null,null,this.getTagsForStencil("mxgraph.weblogos",
"youtube","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youtube_2;fillColor=#FF2626;gradientColor=#B5171F",.2*232,32.6,"","Youtube",null,null,this.getTagsForStencil("mxgraph.weblogos","youtube","web logos logo").join(" "))])}})();
DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.data=b||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};
-DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,b,d,c){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData())};DrawioFile.prototype.saveAs=function(a,b,d){};DrawioFile.prototype.saveFile=function(a,b,d,c){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};
-DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,d){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,d){};DrawioFile.prototype.getHash=function(){return""};
-DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
+DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,b,d,c){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,b,d){};DrawioFile.prototype.saveFile=function(a,b,d,c){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};
+DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,d){};DrawioFile.prototype.isMovable=function(){return!1};
+DrawioFile.prototype.move=function(a,b,d){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
DrawioFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,b){var d=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=d&&d.ignoreEdit||(this.setModified(!0),this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||
this.isModified()||this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))}),mxUtils.bind(this,function(a){this.ui.getCurrentFile()==this&&this.addUnsavedStatus(a)}))):this.addUnsavedStatus())});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener);this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener);this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener);this.ui.addListener("pageFormatChanged",this.changeListener);
this.ui.addListener("pageScaleChanged",this.changeListener);this.ui.addListener("backgroundColorChanged",this.changeListener);this.ui.addListener("backgroundImageChanged",this.changeListener);this.ui.addListener("foldingEnabledChanged",this.changeListener);this.ui.addListener("mathEnabledChanged",this.changeListener);this.ui.addListener("gridEnabledChanged",this.changeListener);this.ui.addListener("guidesEnabledChanged",this.changeListener);this.ui.addListener("pageViewChanged",this.changeListener)};
@@ -6228,249 +6228,253 @@ LocalFile.prototype.saveFile=function(a,b,d,c){this.title=a;this.updateFileData(
LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,b){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};LocalLibrary=function(a,b,d){LocalFile.call(this,a,b,d)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,b,d){this.saveFile(a,!1,b,d)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,b,d){DrawioFile.call(this,a,b);this.title=d};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.autosaveDelay=2E3;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};
StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.save=function(a,b,d){this.saveAs(this.getTitle(),b,d)};StorageFile.prototype.saveAs=function(a,b,d){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,b,d)};
StorageFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable()){var e=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=d&&d()}))}catch(f){null!=c&&c(f)}});this.isRenamable()&&"."==a.charAt(0)&&null!=c?c({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(b){this.isRenamable()&&this.getTitle()!=a&&null!=b?this.ui.confirm(mxResources.get("replaceIt",
-[a]),e,c):e()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,b,d){var c=this.getTitle();c!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(e){this.ui.confirm(mxResources.get("replaceIt",[a]),mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(c,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(c,b)}),d)}),d)})):b()};StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};
-StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,b,d){StorageFile.call(this,a,b,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,b,d){this.saveFile(a,!1,b,d)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
-StorageLibrary.prototype.isRenamable=function(a,b,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,d){StorageFile.call(this,a,b,d);a=d;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,d){return!1};UrlLibrary.prototype.saveAs=function(a,b,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,d){function c(c,e,f,u,t,k){function A(){mxEvent.addListener(p,"click",null!=k?k:function(){f!=App.MODE_GOOGLE||a.isDriveDomain()?f==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,g.checked);b()})):(a.setMode(f,g.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var p=document.createElement("a");p.style.overflow="hidden";p.style.display=
-mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.padding="8px 10px 12px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace="nowrap";p.setAttribute("title",e);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var q=document.createElement("div");q.style.textOverflow="ellipsis";q.style.overflow="hidden";if(null!=c){var x=document.createElement("img");
-x.setAttribute("src",c);x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.style.width="60px";x.style.height="60px";x.style.paddingBottom="6px";p.appendChild(x)}else q.style.paddingTop="5px",q.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(q.style.paddingTop="0px",q.style.marginTop="-2px");p.appendChild(q);mxUtils.write(q,e);if(null!=t)for(c=0;c<t.length;c++)mxUtils.br(q),mxUtils.write(q,t[c]);if(null!=u&&null==a[u]){x.style.visibility=
-"hidden";mxUtils.setOpacity(q,10);var l=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});l.spin(p);var y=window.setTimeout(function(){null==a[u]&&(l.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[u]&&(window.clearTimeout(y),mxUtils.setOpacity(q,100),x.style.visibility="",l.stop(),A(),"drive"==u&&null!=n.parentNode&&n.parentNode.removeChild(n))}))}else A();
-m.appendChild(p);++h>=d&&(mxUtils.br(m),h=0)}d=null!=d?d:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var f=a.addLanguageMenu(e,!0);null!=f&&(f.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){f=document.createElement("a");f.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");f.setAttribute("title",mxResources.get("help"));f.setAttribute("target",
-"_blank");f.style.position="absolute";f.style.textDecoration="none";f.style.cursor="pointer";f.style.fontSize="12px";f.style.bottom="28px";f.style.left="26px";f.style.color="gray";var k=document.createElement("img");k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";f.appendChild(k);mxUtils.write(f,mxResources.get("help"));e.appendChild(f)}var l=document.createElement("div");l.style.position="absolute";l.style.cursor="pointer";
+[a]),e,c):e()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,b,d){var c=this.getTitle();c!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(e){var f=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(c,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(c,b)}),d)});null!=e?this.ui.confirm(mxResources.get("replaceIt",[a]),f,d):f()})):b()};
+StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,b,d){StorageFile.call(this,a,b,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,b,d){this.saveFile(a,!1,b,d)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
+StorageLibrary.prototype.isRenamable=function(a,b,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,d){StorageFile.call(this,a,b,d);a=d;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,d){return!1};UrlLibrary.prototype.saveAs=function(a,b,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,d){function c(c,e,f,u,t,h){function x(){mxEvent.addListener(p,"click",null!=h?h:function(){f!=App.MODE_GOOGLE||a.isDriveDomain()?f==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,g.checked);b()})):(a.setMode(f,g.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var p=document.createElement("a");p.style.overflow="hidden";p.style.display=
+mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.padding="8px 10px 12px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace="nowrap";p.setAttribute("title",e);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var q=document.createElement("div");q.style.textOverflow="ellipsis";q.style.overflow="hidden";if(null!=c){var z=document.createElement("img");
+z.setAttribute("src",c);z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.width="60px";z.style.height="60px";z.style.paddingBottom="6px";p.appendChild(z)}else q.style.paddingTop="5px",q.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(q.style.paddingTop="0px",q.style.marginTop="-2px");p.appendChild(q);mxUtils.write(q,e);if(null!=t)for(c=0;c<t.length;c++)mxUtils.br(q),mxUtils.write(q,t[c]);if(null!=u&&null==a[u]){z.style.visibility=
+"hidden";mxUtils.setOpacity(q,10);var l=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});l.spin(p);var A=window.setTimeout(function(){null==a[u]&&(l.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[u]&&(window.clearTimeout(A),mxUtils.setOpacity(q,100),z.style.visibility="",l.stop(),x(),"drive"==u&&null!=n.parentNode&&n.parentNode.removeChild(n))}))}else x();
+m.appendChild(p);++k>=d&&(mxUtils.br(m),k=0)}d=null!=d?d:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var f=a.addLanguageMenu(e,!0);null!=f&&(f.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){f=document.createElement("a");f.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");f.setAttribute("title",mxResources.get("help"));f.setAttribute("target",
+"_blank");f.style.position="absolute";f.style.textDecoration="none";f.style.cursor="pointer";f.style.fontSize="12px";f.style.bottom="28px";f.style.left="26px";f.style.color="gray";var h=document.createElement("img");h.setAttribute("border","0");h.setAttribute("valign","bottom");h.setAttribute("src",Editor.helpImage);h.style.marginRight="2px";f.appendChild(h);mxUtils.write(f,mxResources.get("help"));e.appendChild(f)}var l=document.createElement("div");l.style.position="absolute";l.style.cursor="pointer";
l.style.fontSize="12px";l.style.bottom="28px";l.style.color="gray";mxUtils.write(l,mxResources.get("decideLater"));a.isOfflineApp()?l.style.right="20px":(mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0)"),l.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)l.style.marginLeft=-Math.round(l.clientWidth/2)+"px"};e.appendChild(l);mxEvent.addListener(l,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,
-null,null,null,null,null,!0);Editor.useLocalStorage=b});var m=document.createElement("div");mxClient.IS_QUIRKS&&(m.style.whiteSpace="nowrap",m.style.cssFloat="left");m.style.border="1px solid #d3d3d3";m.style.borderWidth="1px 0px 1px 0px";m.style.padding="12px 0px 12px 0px";var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=!0;var h=0,n=document.createElement("p"),f=document.createElement("p");f.style.fontSize="16pt";f.style.padding=
+null,null,null,null,null,!0);Editor.useLocalStorage=b});var m=document.createElement("div");mxClient.IS_QUIRKS&&(m.style.whiteSpace="nowrap",m.style.cssFloat="left");m.style.border="1px solid #d3d3d3";m.style.borderWidth="1px 0px 1px 0px";m.style.padding="12px 0px 12px 0px";var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=!0;var k=0,n=document.createElement("p"),f=document.createElement("p");f.style.fontSize="16pt";f.style.padding=
"0px";f.style.paddingTop="4px";f.style.paddingBottom="16px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("saveDiagramsTo")+":");e.appendChild(f);"function"===typeof window.DriveClient&&c(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&c(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");mxClient.IS_IOS&&"device"!=urlParams.storage||c(IMAGE_PATH+
-"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||c(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);e.appendChild(m);f=document.createElement("p");f.style.marginTop="12px";f.style.marginBottom="6px";f.appendChild(g);k=document.createElement("span");k.style.color="gray";k.style.fontSize="12px";mxUtils.write(k," "+mxResources.get("rememberThisSetting"));f.appendChild(k);mxUtils.br(f);var q=
+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||c(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);e.appendChild(m);f=document.createElement("p");f.style.marginTop="12px";f.style.marginBottom="6px";f.appendChild(g);h=document.createElement("span");h.style.color="gray";h.style.fontSize="12px";mxUtils.write(h," "+mxResources.get("rememberThisSetting"));f.appendChild(h);mxUtils.br(f);var q=
a.getRecent();if(null!=q&&0<q.length){var t=document.createElement("select");t.style.marginTop="8px";t.style.width="140px";var p=document.createElement("option");p.setAttribute("value","");p.setAttribute("selected","selected");p.style.textAlign="center";mxUtils.write(p,mxResources.get("openRecent")+"...");t.appendChild(p);for(p=0;p<q.length;p++)(function(a){var b=a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",
a.id);mxUtils.write(c,a.title+" ("+mxResources.get(b)+")");t.appendChild(c)})(q[p]);f.appendChild(t);mxEvent.addListener(t,"change",function(b){""!=t.value&&a.loadFile(t.value)})}else f.style.marginTop="20px",m.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(q=document.createElement("div"),q.style.cursor="pointer",q.style.padding="18px 0px 6px 0px",q.style.fontSize="12px",q.style.color="gray",mxUtils.write(q,mxResources.get("import")+" "+mxResources.get("gliffy")+
-", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(q,"click",function(){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(){null!=b.files&&(a.hideDialog(),a.openFiles(b.files,!0))});b.click()}),f.appendChild(q),m.style.paddingBottom="4px");m.appendChild(f);mxEvent.addListener(k,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&
+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(q,"click",function(){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(){null!=b.files&&(a.hideDialog(),a.openFiles(b.files,!0))});b.click()}),f.appendChild(q),m.style.paddingBottom="4px");m.appendChild(f);mxEvent.addListener(h,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&
"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(n.style.padding="8px",n.style.fontSize="9pt",n.style.marginTop="-14px",n.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",e.appendChild(n))},
5E3);this.container=e},SplashDialog=function(a){var b=document.createElement("div");b.style.textAlign="center";a.addLanguageMenu(b,!0);var d=null,c=a.getServiceCount();!a.isOffline()&&1<c&&(d=document.createElement("a"),d.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage"),d.setAttribute("title",mxResources.get("help")),d.setAttribute("target","_blank"),d.style.position="absolute",d.style.fontSize="12px",d.style.textDecoration="none",d.style.cursor="pointer",d.style.bottom=
"22px",d.style.left="26px",d.style.color="gray",c=document.createElement("img"),c.setAttribute("border","0"),c.setAttribute("valign","bottom"),c.setAttribute("src",Editor.helpImage),c.style.marginRight="2px",d.appendChild(c),mxUtils.write(d,mxResources.get("help")),b.appendChild(d));c=document.createElement("p");c.style.fontSize="16pt";c.style.padding="0px";c.style.paddingTop="2px";c.style.margin="0px";c.style.color="gray";var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("align",
"absmiddle");e.style.width="40px";e.style.height="40px";e.style.marginRight="12px";e.style.paddingBottom="4px";var f="";a.mode==App.MODE_GOOGLE?(e.src=IMAGE_PATH+"/google-drive-logo.svg",f=mxResources.get("googleDrive"),null!=d&&d.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+Google+Drive")):a.mode==App.MODE_DROPBOX?(e.src=IMAGE_PATH+"/dropbox-logo.svg",f=mxResources.get("dropbox"),null!=d&&d.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+Dropbox")):
a.mode==App.MODE_ONEDRIVE?(e.src=IMAGE_PATH+"/onedrive-logo.svg",f=mxResources.get("oneDrive"),null!=d&&d.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+OneDrive")):a.mode==App.MODE_GITHUB?(e.src=IMAGE_PATH+"/github-logo.svg",f=mxResources.get("github")):a.mode==App.MODE_TRELLO?(e.src=IMAGE_PATH+"/trello-logo.svg",f=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(e.src=IMAGE_PATH+"/osa_database.png",f=mxResources.get("browser")):(e.src=IMAGE_PATH+"/osa_drive-harddisk.png",
-f=mxResources.get("device"));var k=document.createElement("div");k.style.margin="4px 0px 0px 0px";var l=document.createElement("button");l.className="geBigButton";l.style.overflow="hidden";l.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(k.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(c.appendChild(e),mxUtils.write(c,f),b.appendChild(c),k.style.border="1px solid #d3d3d3",k.style.borderWidth="1px 0px 1px 0px",k.style.padding="18px 0px 24px 0px",l.style.marginBottom=
-"8px");mxClient.IS_QUIRKS&&(k.style.whiteSpace="nowrap",k.style.cssFloat="left");mxClient.IS_QUIRKS&&(l.style.width="340px");mxUtils.write(l,mxResources.get("createNewDiagram"));mxEvent.addListener(l,"click",function(){a.hideDialog();a.actions.get("new").funct()});k.appendChild(l);mxUtils.br(k);l=document.createElement("button");l.className="geBigButton";l.style.marginBottom="22px";l.style.overflow="hidden";l.style.width="340px";mxClient.IS_QUIRKS&&(l.style.width="340px");mxUtils.write(l,mxResources.get("openExistingDiagram"));
-mxEvent.addListener(l,"click",function(){a.actions.get("open").funct()});k.appendChild(l);d="undefined";a.mode==App.MODE_GOOGLE?d=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?d=mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?d=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?d=mxResources.get("github"):a.mode==App.MODE_TRELLO?d=mxResources.get("trello"):a.mode==App.MODE_DEVICE?d=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(d=mxResources.get("browser"));mxClient.IS_CHROMEAPP||
-EditorUi.isElectronApp||(e=function(b){l.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));l.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});k.appendChild(c)},c=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=c?(l.style.marginBottom=
-"24px",e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="block",e.style.marginTop="6px",mxUtils.write(e,mxResources.get("changeUser")+" ("+c.displayName+")"),l.style.marginBottom="16px",k.style.paddingBottom="18px",mxEvent.addListener(e,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();
-a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),k.appendChild(e)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?e(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?e(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&e(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&e(function(){a.dropbox.logout();
-a.openLink("https://www.dropbox.com/logout")}),e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="block",e.style.marginTop="8px",mxUtils.write(e,mxResources.get("notUsingService",[d])),mxEvent.addListener(e,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),k.appendChild(e));b.appendChild(k);this.container=b},ConfirmDialog=function(a,b,d,c,e,f,k,l,m){var g=document.createElement("div");g.style.textAlign="center";var h=document.createElement("div");
-h.style.padding="6px";h.style.overflow="auto";h.style.maxHeight="44px";mxClient.IS_QUIRKS&&(h.style.height="60px");mxUtils.write(h,b);g.appendChild(h);h=document.createElement("div");h.style.textAlign="center";h.style.whiteSpace="nowrap";var n=document.createElement("input");n.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c(n.checked)});f.className="geBtn";null!=l&&(f.innerHTML=l+"<br>"+f.innerHTML,f.style.paddingBottom="8px",f.style.paddingTop=
-"8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&h.appendChild(f);e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d(n.checked)});h.appendChild(e);null!=k?(e.innerHTML=k+"<br>"+e.innerHTML+"<br>",e.style.paddingBottom="8px",e.style.paddingTop="8px",e.style.height="auto",e.className="geBtn",e.style.width="40%"):e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||h.appendChild(f);g.appendChild(h);m?(h.style.marginTop="10px",h=document.createElement("p"),
-h.style.marginTop="20px",h.appendChild(n),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberThisSetting")),h.appendChild(k),g.appendChild(h),mxEvent.addListener(k,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)})):h.style.marginTop="16px";this.container=g},ErrorDialog=function(a,b,d,c,e,f,k,l,m){m=null!=m?m:!0;var g=document.createElement("div");g.style.textAlign="center";if(null!=b){var h=document.createElement("div");h.style.padding="0px";h.style.margin="0px";
-h.style.fontSize="18px";h.style.paddingBottom="16px";h.style.marginBottom="16px";h.style.borderBottom="1px solid #c0c0c0";h.style.color="gray";mxUtils.write(h,b);g.appendChild(h)}b=document.createElement("div");b.style.padding="6px";b.innerHTML=d;g.appendChild(b);d=document.createElement("div");d.style.marginTop="16px";d.style.textAlign="right";null!=f&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();f()}),b.className="geBtn",d.appendChild(b),d.style.textAlign="center");var n=
-mxUtils.button(c,function(){m&&a.hideDialog();null!=e&&e()});n.className="geBtn";d.appendChild(n);null!=k&&(c=mxUtils.button(k,function(){m&&a.hideDialog();null!=l&&l()}),c.className="geBtn gePrimaryBtn",d.appendChild(c));this.init=function(){n.focus()};g.appendChild(d);this.container=g},EmbedDialog=function(a,b,d,c,e){c=document.createElement("div");var f=/^https?:\/\//.test(b)||/^mailto:\/\//.test(b);mxUtils.write(c,mxResources.get(5E5>b.length?f?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(c);
-var k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.right="30px";k.style.color="gray";mxUtils.write(k,a.formatFileSize(b.length));c.appendChild(k);var l=document.createElement("textarea");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.marginTop="10px";l.style.resize="none";l.style.height="150px";l.style.width="440px";l.style.border="1px solid gray";l.value=
-mxResources.get("updatingDocument");c.appendChild(l);mxUtils.br(c);this.init=function(){window.setTimeout(function(){5E5>b.length?(l.value=b,l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):(l.setAttribute("readonly","true"),l.value=b.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};k=document.createElement("div");k.style.position="absolute";k.style.bottom="36px";k.style.right="32px";var m=
+f=mxResources.get("device"));var h=document.createElement("div");h.style.margin="4px 0px 0px 0px";var l=document.createElement("button");l.className="geBigButton";l.style.overflow="hidden";l.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(h.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(c.appendChild(e),mxUtils.write(c,f),b.appendChild(c),h.style.border="1px solid #d3d3d3",h.style.borderWidth="1px 0px 1px 0px",h.style.padding="18px 0px 24px 0px",l.style.marginBottom=
+"8px");mxClient.IS_QUIRKS&&(h.style.whiteSpace="nowrap",h.style.cssFloat="left");mxClient.IS_QUIRKS&&(l.style.width="340px");mxUtils.write(l,mxResources.get("createNewDiagram"));mxEvent.addListener(l,"click",function(){a.hideDialog();a.actions.get("new").funct()});h.appendChild(l);mxUtils.br(h);l=document.createElement("button");l.className="geBigButton";l.style.marginBottom="22px";l.style.overflow="hidden";l.style.width="340px";mxClient.IS_QUIRKS&&(l.style.width="340px");mxUtils.write(l,mxResources.get("openExistingDiagram"));
+mxEvent.addListener(l,"click",function(){a.actions.get("open").funct()});h.appendChild(l);d="undefined";a.mode==App.MODE_GOOGLE?d=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?d=mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?d=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?d=mxResources.get("github"):a.mode==App.MODE_TRELLO?d=mxResources.get("trello"):a.mode==App.MODE_DEVICE?d=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(d=mxResources.get("browser"));mxClient.IS_CHROMEAPP||
+EditorUi.isElectronApp||(e=function(b){l.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));l.style.marginBottom="16px";h.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});h.appendChild(c)},c=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=c?(l.style.marginBottom=
+"24px",e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="block",e.style.marginTop="6px",mxUtils.write(e,mxResources.get("changeUser")+" ("+c.displayName+")"),l.style.marginBottom="16px",h.style.paddingBottom="18px",mxEvent.addListener(e,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();
+a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),h.appendChild(e)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?e(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?e(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&e(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&e(function(){a.dropbox.logout();
+a.openLink("https://www.dropbox.com/logout")}),e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="block",e.style.marginTop="8px",mxUtils.write(e,mxResources.get("notUsingService",[d])),mxEvent.addListener(e,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),h.appendChild(e));b.appendChild(h);this.container=b},ConfirmDialog=function(a,b,d,c,e,f,h,l,m){var g=document.createElement("div");g.style.textAlign="center";var k=document.createElement("div");
+k.style.padding="6px";k.style.overflow="auto";k.style.maxHeight="44px";mxClient.IS_QUIRKS&&(k.style.height="60px");mxUtils.write(k,b);g.appendChild(k);k=document.createElement("div");k.style.textAlign="center";k.style.whiteSpace="nowrap";var n=document.createElement("input");n.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c(n.checked)});f.className="geBtn";null!=l&&(f.innerHTML=l+"<br>"+f.innerHTML,f.style.paddingBottom="8px",f.style.paddingTop=
+"8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&k.appendChild(f);e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d(n.checked)});k.appendChild(e);null!=h?(e.innerHTML=h+"<br>"+e.innerHTML+"<br>",e.style.paddingBottom="8px",e.style.paddingTop="8px",e.style.height="auto",e.className="geBtn",e.style.width="40%"):e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||k.appendChild(f);g.appendChild(k);m?(k.style.marginTop="10px",k=document.createElement("p"),
+k.style.marginTop="20px",k.appendChild(n),h=document.createElement("span"),mxUtils.write(h," "+mxResources.get("rememberThisSetting")),k.appendChild(h),g.appendChild(k),mxEvent.addListener(h,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)})):k.style.marginTop="16px";this.container=g},ErrorDialog=function(a,b,d,c,e,f,h,l,m){m=null!=m?m:!0;var g=document.createElement("div");g.style.textAlign="center";if(null!=b){var k=document.createElement("div");k.style.padding="0px";k.style.margin="0px";
+k.style.fontSize="18px";k.style.paddingBottom="16px";k.style.marginBottom="16px";k.style.borderBottom="1px solid #c0c0c0";k.style.color="gray";mxUtils.write(k,b);g.appendChild(k)}b=document.createElement("div");b.style.padding="6px";b.innerHTML=d;g.appendChild(b);d=document.createElement("div");d.style.marginTop="16px";d.style.textAlign="right";null!=f&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();f()}),b.className="geBtn",d.appendChild(b),d.style.textAlign="center");var n=
+mxUtils.button(c,function(){m&&a.hideDialog();null!=e&&e()});n.className="geBtn";d.appendChild(n);null!=h&&(c=mxUtils.button(h,function(){m&&a.hideDialog();null!=l&&l()}),c.className="geBtn gePrimaryBtn",d.appendChild(c));this.init=function(){n.focus()};g.appendChild(d);this.container=g},EmbedDialog=function(a,b,d,c,e){c=document.createElement("div");var f=/^https?:\/\//.test(b)||/^mailto:\/\//.test(b);mxUtils.write(c,mxResources.get(5E5>b.length?f?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(c);
+var h=document.createElement("div");h.style.position="absolute";h.style.top="30px";h.style.right="30px";h.style.color="gray";mxUtils.write(h,a.formatFileSize(b.length));c.appendChild(h);var l=document.createElement("textarea");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.marginTop="10px";l.style.resize="none";l.style.height="150px";l.style.width="440px";l.style.border="1px solid gray";l.value=
+mxResources.get("updatingDocument");c.appendChild(l);mxUtils.br(c);this.init=function(){window.setTimeout(function(){5E5>b.length?(l.value=b,l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):(l.setAttribute("readonly","true"),l.value=b.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};h=document.createElement("div");h.style.position="absolute";h.style.bottom="36px";h.style.right="32px";var m=
null;mxClient.IS_CHROMEAPP&&!f||navigator.standalone||!(f||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(mxResources.get(5E5>b.length?"preview":"openInNewWindow"),function(){var c=5E5>b.length?l.value:b;if(null!=e)e(c);else if(f)try{var g=a.openLink(c);null!=g&&(null==d||0<d)&&window.setTimeout(mxUtils.bind(this,function(){null!=g&&null!=g.location.href&&g.location.href.substring(0,8)!=c.substring(0,8)&&(g.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),
-d||500)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}else{var h=window.open().document;h.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+b+"</body></html>");h.close()}}),m.className="geBtn",k.appendChild(m));if(!f||7500<b.length){var g=mxUtils.button(mxResources.get("download"),function(){a.saveData("embed.txt","txt",b,"text/plain")});g.className="geBtn";k.appendChild(g)}if(f&&(!a.isOffline()||
-mxClient.IS_CHROMEAPP)){if(51200>b.length){var h=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(l.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),g=document.createElement("img");g.setAttribute("src",Editor.facebookImage);g.setAttribute("width","18");g.setAttribute("height","18");g.setAttribute("border","0");h.appendChild(g);h.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+
-" max)");h.style.verticalAlign="bottom";h.style.paddingTop="4px";h.style.minWidth="46px";h.className="geBtn";k.appendChild(h)}7168>b.length&&(h=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(l.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),g=document.createElement("img"),g.setAttribute("src",Editor.tweetImage),g.setAttribute("width",
-"18"),g.setAttribute("height","18"),g.setAttribute("border","0"),g.style.marginBottom="5px",h.appendChild(g),h.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),h.style.verticalAlign="bottom",h.style.paddingTop="4px",h.style.minWidth="46px",h.className="geBtn",k.appendChild(h))}g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.appendChild(g);h=mxUtils.button(mxResources.get("copy"),function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>b.length?mxClient.IS_SF||null!=document.documentMode?g.className="geBtn gePrimaryBtn":(k.appendChild(h),h.className="geBtn gePrimaryBtn",g.className="geBtn"):(k.appendChild(m),g.className="geBtn",m.className="geBtn gePrimaryBtn");c.appendChild(k);this.container=c},GoogleSitesDialog=function(a,b){function d(){var a=null!=B.getTitle()?B.getTitle():
-this.defaultFilename;if(z.checked&&""!=q.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<w.length&&(b+="&s="+w);""!=t.value&&"0"!=t.value&&(b+="&border="+t.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(p.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(A.checked?"1":"0");b+="&resize="+(u.checked?"1":"0");b+="&x0="+Number(h.value);b+="&y0="+m;e.mathEnabled&&(b+="&math=1");
-x.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));g.value=b}else B.constructor==DriveFile||B.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=q.value?b+=encodeURIComponent(mxUtils.htmlEntities(q.value))+"&type=3":(b+=B.getHash().substring(1),b=B.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(h.value),b+="&height="+
-a),g.value=b):g.value=""}var c=document.createElement("div"),e=a.editor.graph,f=e.getGraphBounds(),k=e.view.scale,l=Math.floor(f.x/k-e.view.translate.x),m=Math.floor(f.y/k-e.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","text");g.style.marginBottom="8px";g.style.marginTop="2px";g.style.width="410px";c.appendChild(g);mxUtils.br(c);this.init=function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var h=document.createElement("input");h.setAttribute("type","text");h.setAttribute("size","4");h.style.marginRight="16px";h.style.marginLeft="4px";h.value=l;c.appendChild(h);mxUtils.write(c,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(f.height/k);c.appendChild(n);
+d||500)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}else{var k=window.open().document;k.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+b+"</body></html>");k.close()}}),m.className="geBtn",h.appendChild(m));if(!f||7500<b.length){var g=mxUtils.button(mxResources.get("download"),function(){a.saveData("embed.txt","txt",b,"text/plain")});g.className="geBtn";h.appendChild(g)}if(f&&(!a.isOffline()||
+mxClient.IS_CHROMEAPP)){if(51200>b.length){var k=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(l.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),g=document.createElement("img");g.setAttribute("src",Editor.facebookImage);g.setAttribute("width","18");g.setAttribute("height","18");g.setAttribute("border","0");k.appendChild(g);k.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+
+" max)");k.style.verticalAlign="bottom";k.style.paddingTop="4px";k.style.minWidth="46px";k.className="geBtn";h.appendChild(k)}7168>b.length&&(k=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(l.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),g=document.createElement("img"),g.setAttribute("src",Editor.tweetImage),g.setAttribute("width",
+"18"),g.setAttribute("height","18"),g.setAttribute("border","0"),g.style.marginBottom="5px",k.appendChild(g),k.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),k.style.verticalAlign="bottom",k.style.paddingTop="4px",k.style.minWidth="46px",k.className="geBtn",h.appendChild(k))}g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.appendChild(g);k=mxUtils.button(mxResources.get("copy"),function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>b.length?mxClient.IS_SF||null!=document.documentMode?g.className="geBtn gePrimaryBtn":(h.appendChild(k),k.className="geBtn gePrimaryBtn",g.className="geBtn"):(h.appendChild(m),g.className="geBtn",m.className="geBtn gePrimaryBtn");c.appendChild(h);this.container=c},GoogleSitesDialog=function(a,b){function d(){var a=null!=B.getTitle()?B.getTitle():
+this.defaultFilename;if(y.checked&&""!=q.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<v.length&&(b+="&s="+v);""!=t.value&&"0"!=t.value&&(b+="&border="+t.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(p.checked?"1":"0");b+="&zoom="+(w.checked?"1":"0");b+="&fit="+(x.checked?"1":"0");b+="&resize="+(u.checked?"1":"0");b+="&x0="+Number(k.value);b+="&y0="+m;e.mathEnabled&&(b+="&math=1");
+z.checked?b+="&edit=_blank":A.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));g.value=b}else B.constructor==DriveFile||B.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=q.value?b+=encodeURIComponent(mxUtils.htmlEntities(q.value))+"&type=3":(b+=B.getHash().substring(1),b=B.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(k.value),b+="&height="+
+a),g.value=b):g.value=""}var c=document.createElement("div"),e=a.editor.graph,f=e.getGraphBounds(),h=e.view.scale,l=Math.floor(f.x/h-e.view.translate.x),m=Math.floor(f.y/h-e.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","text");g.style.marginBottom="8px";g.style.marginTop="2px";g.style.width="410px";c.appendChild(g);mxUtils.br(c);this.init=function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.setAttribute("size","4");k.style.marginRight="16px";k.style.marginLeft="4px";k.value=l;c.appendChild(k);mxUtils.write(c,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(f.height/h);c.appendChild(n);
mxUtils.br(c);f=document.createElement("hr");f.setAttribute("size","1");f.style.marginBottom="16px";f.style.marginTop="16px";c.appendChild(f);mxUtils.write(c,mxResources.get("publicDiagramUrl")+":");mxUtils.br(c);var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","28");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";q.value=b||"";c.appendChild(q);mxUtils.br(c);mxUtils.write(c,mxResources.get("borderWidth")+":");var t=document.createElement("input");
-t.setAttribute("type","text");t.setAttribute("size","3");t.style.marginBottom="8px";t.style.marginLeft="4px";t.value="0";c.appendChild(t);mxUtils.br(c);var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="16px";c.appendChild(p);mxUtils.write(c,mxResources.get("pan")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft=
-"8px";c.appendChild(v);mxUtils.write(c,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);c.appendChild(y);mxUtils.write(c,mxResources.get("edit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";c.appendChild(x);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var u=document.createElement("input");u.setAttribute("type",
-"checkbox");u.setAttribute("checked","checked");u.defaultChecked=!0;u.style.marginLeft="16px";c.appendChild(u);mxUtils.write(c,mxResources.get("resize")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";c.appendChild(A);mxUtils.write(c,mxResources.get("fit")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";c.appendChild(z);mxUtils.write(c,mxResources.get("embed")+" ");var w=a.getBasenames().join(";"),
-B=a.getCurrentFile();mxEvent.addListener(p,"change",d);mxEvent.addListener(v,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(A,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(z,"change",d);mxEvent.addListener(n,"change",d);mxEvent.addListener(h,"change",d);mxEvent.addListener(t,"change",d);mxEvent.addListener(q,"change",d);d();mxEvent.addListener(g,"click",function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";f.appendChild(k);c.appendChild(f);this.container=c},CreateGraphDialog=function(a,b,d){var c=document.createElement("div");c.style.textAlign="right";this.init=function(){var b=document.createElement("div");b.style.position="relative";b.style.border=
-"1px solid gray";b.style.width="100%";b.style.height="360px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);c.appendChild(b);var f=new Graph(b);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";f.cellRenderer.installCellOverlayListeners=function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,
+t.setAttribute("type","text");t.setAttribute("size","3");t.style.marginBottom="8px";t.style.marginLeft="4px";t.value="0";c.appendChild(t);mxUtils.br(c);var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="16px";c.appendChild(p);mxUtils.write(c,mxResources.get("pan")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft=
+"8px";c.appendChild(w);mxUtils.write(c,mxResources.get("zoom")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";A.setAttribute("title",window.location.href);c.appendChild(A);mxUtils.write(c,mxResources.get("edit")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";c.appendChild(z);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var u=document.createElement("input");u.setAttribute("type",
+"checkbox");u.setAttribute("checked","checked");u.defaultChecked=!0;u.style.marginLeft="16px";c.appendChild(u);mxUtils.write(c,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";c.appendChild(x);mxUtils.write(c,mxResources.get("fit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";c.appendChild(y);mxUtils.write(c,mxResources.get("embed")+" ");var v=a.getBasenames().join(";"),
+B=a.getCurrentFile();mxEvent.addListener(p,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(A,"change",d);mxEvent.addListener(z,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(n,"change",d);mxEvent.addListener(k,"change",d);mxEvent.addListener(t,"change",d);mxEvent.addListener(q,"change",d);d();mxEvent.addListener(g,"click",function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";h=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.className="geBtn gePrimaryBtn";f.appendChild(h);c.appendChild(f);this.container=c},CreateGraphDialog=function(a,b,d){var c=document.createElement("div");c.style.textAlign="right";this.init=function(){var b=document.createElement("div");b.style.position="relative";b.style.border=
+"1px solid gray";b.style.width="100%";b.style.height="360px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);c.appendChild(b);var f=new Graph(b);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var h="curved=1;";f.cellRenderer.installCellOverlayListeners=function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,
arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};f.getAllConnectionConstraints=function(){return null};f.connectionHandler.marker.highlight.keepOnTop=!1;f.connectionHandler.createEdgeState=function(a){a=f.createEdge(null,null,
-null,null,null,k);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var l=f.getDefaultParent(),m=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){f.connectionHandler.reset();f.clearSelection();var d=f.getCellGeometry(a),g;n(function(){g=f.insertVertex(l,null,"Entry",d.x,d.y,80,30,"rounded=1;");m(g);f.view.refresh(g);f.insertEdge(l,null,"",a,g,k)},function(){f.scrollCellToVisible(g)})});
-b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),d=b.getProperty("state");f.popupMenuHandler.hideMenu();f.stopEditing(!1);var g=mxUtils.convertPoint(f.container,mxEvent.getClientX(c),mxEvent.getClientY(c));f.connectionHandler.start(d,g.x,g.y);f.isMouseDown=!0;f.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});f.addCellOverlay(a,b)});f.getModel().beginUpdate();var g;try{g=f.insertVertex(l,null,"Start",0,0,80,30,"ellipse"),m(g)}finally{f.getModel().endUpdate()}var h;
-"horizontalTree"==d?(h=new mxCompactTreeLayout(f),h.edgeRouting=!1,h.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==d?(h=new mxCompactTreeLayout(f,!1),h.edgeRouting=!1,h.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==d?(h=new mxRadialTreeLayout(f,!1),h.edgeRouting=!1,h.levelDistance=80):"verticalFlow"==d?h=new mxHierarchicalLayout(f,mxConstants.DIRECTION_NORTH):"horizontalFlow"==d?h=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):
-"organic"==d?(h=new mxFastOrganicLayout(f,!1),h.forceConstant=80):"circle"==d&&(h=new mxCircleLayout(f));if(null!=h){var n=function(a,b){f.getModel().beginUpdate();try{null!=a&&a(),h.execute(f.getDefaultParent(),g)}catch(u){throw u;}finally{var c=new mxMorphing(f);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},q=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(a,b,c,d,g){q.apply(this,arguments);n()};f.resizeCell=
+null,null,null,h);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var l=f.getDefaultParent(),m=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){f.connectionHandler.reset();f.clearSelection();var d=f.getCellGeometry(a),g;n(function(){g=f.insertVertex(l,null,"Entry",d.x,d.y,80,30,"rounded=1;");m(g);f.view.refresh(g);f.insertEdge(l,null,"",a,g,h)},function(){f.scrollCellToVisible(g)})});
+b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),d=b.getProperty("state");f.popupMenuHandler.hideMenu();f.stopEditing(!1);var g=mxUtils.convertPoint(f.container,mxEvent.getClientX(c),mxEvent.getClientY(c));f.connectionHandler.start(d,g.x,g.y);f.isMouseDown=!0;f.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});f.addCellOverlay(a,b)});f.getModel().beginUpdate();var g;try{g=f.insertVertex(l,null,"Start",0,0,80,30,"ellipse"),m(g)}finally{f.getModel().endUpdate()}var k;
+"horizontalTree"==d?(k=new mxCompactTreeLayout(f),k.edgeRouting=!1,k.levelDistance=30,h="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==d?(k=new mxCompactTreeLayout(f,!1),k.edgeRouting=!1,k.levelDistance=30,h="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==d?(k=new mxRadialTreeLayout(f,!1),k.edgeRouting=!1,k.levelDistance=80):"verticalFlow"==d?k=new mxHierarchicalLayout(f,mxConstants.DIRECTION_NORTH):"horizontalFlow"==d?k=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):
+"organic"==d?(k=new mxFastOrganicLayout(f,!1),k.forceConstant=80):"circle"==d&&(k=new mxCircleLayout(f));if(null!=k){var n=function(a,b){f.getModel().beginUpdate();try{null!=a&&a(),k.execute(f.getDefaultParent(),g)}catch(u){throw u;}finally{var c=new mxMorphing(f);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},q=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(a,b,c,d,g){q.apply(this,arguments);n()};f.resizeCell=
function(){mxGraph.prototype.resizeCell.apply(this,arguments);n()};f.connectionHandler.addListener(mxEvent.CONNECT,function(){n()})}var t=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=b.parentNode&&(f.destroy(),b.parentNode.removeChild(b));a.hideDialog()})});t.className="geBtn";a.editor.cancelFirst&&c.appendChild(t);var p=mxUtils.button(mxResources.get("insert"),function(){f.clearCellOverlays();var c=a.editor.graph.getFreeInsertPoint(),
c=a.editor.graph.importCells(f.getModel().getChildren(f.getDefaultParent()),c.x,c.y),d=a.editor.graph.view,g=d.getBounds(c);g.x-=d.translate.x;g.y-=d.translate.y;a.editor.graph.scrollRectToVisible(g);a.editor.graph.setSelectionCells(c);null!=b.parentNode&&(f.destroy(),b.parentNode.removeChild(b));a.hideDialog()});c.appendChild(p);p.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(t)};this.container=c};
CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":IMAGE_PATH+
"/handle-connect.png",26,26);
var BackgroundImageDialog=function(a,b){var d=document.createElement("div");d.style.whiteSpace="nowrap";var c=document.createElement("h2");mxUtils.write(c,mxResources.get("backgroundImage"));c.style.marginTop="0px";d.appendChild(c);mxUtils.write(d,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(d);var c=a.editor.graph.backgroundImage,e=document.createElement("input");e.setAttribute("type","text");e.style.marginTop="4px";e.style.marginBottom="4px";e.style.width="350px";e.value=
-null!=c?c.src:"";var f=!1,k=function(){f||""==e.value||a.isOffline()?(l.value="",m.value=""):a.loadImage(mxUtils.trim(e.value),function(a){l.value=a.width;m.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));e.value="";l.value="";m.value=""})};this.init=function(){e.focus();if(Graph.fileSupport){e.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=d.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=
-c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,d,g,h){e.value=a;k()},function(){},
-function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&(e.value=decodeURIComponent(d),k())}b.stopPropagation();b.preventDefault()}),!1)}};d.appendChild(e);mxUtils.br(d);mxUtils.br(d);mxUtils.write(d,mxResources.get("width")+":");var l=document.createElement("input");
+null!=c?c.src:"";var f=!1,h=function(){f||""==e.value||a.isOffline()?(l.value="",m.value=""):a.loadImage(mxUtils.trim(e.value),function(a){l.value=a.width;m.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));e.value="";l.value="";m.value=""})};this.init=function(){e.focus();if(Graph.fileSupport){e.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=d.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=
+c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,d,g,k){e.value=a;h()},function(){},
+function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&(e.value=decodeURIComponent(d),h())}b.stopPropagation();b.preventDefault()}),!1)}};d.appendChild(e);mxUtils.br(d);mxUtils.br(d);mxUtils.write(d,mxResources.get("width")+":");var l=document.createElement("input");
l.setAttribute("type","text");l.style.width="60px";l.style.marginLeft="4px";l.style.marginRight="16px";l.value=null!=c?c.width:"";d.appendChild(l);mxUtils.write(d,mxResources.get("height")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=c?c.height:"";d.appendChild(m);c=mxUtils.button(mxResources.get("reset"),function(){e.value="";l.value="";m.value="";f=!1});mxEvent.addListener(c,"mousedown",
-function(){f=!0});mxEvent.addListener(c,"touchstart",function(){f=!0});c.className="geBtn";c.width="100";d.appendChild(c);mxUtils.br(d);mxEvent.addListener(e,"change",k);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(e.value=a.url,k()));e.focus()};c=document.createElement("div");c.style.marginTop="40px";c.style.textAlign="right";var g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
-g.className="geBtn";a.editor.cancelFirst&&c.appendChild(g);if(!a.isOffline()&&"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top){var h=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)});
-h.className="geBtn";c.appendChild(h);null!=a.drive&&"1"==urlParams.photos&&(h=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
-a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),h.className="geBtn",c.appendChild(h))}h=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b(""!=e.value?new mxImage(mxUtils.trim(e.value),l.value,m.value):null)});h.className="geBtn gePrimaryBtn";c.appendChild(h);a.editor.cancelFirst||c.appendChild(g);d.appendChild(c);this.container=d},ParseDialog=function(a,b){function d(b,c){var d=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==
-c){var d="plantUmlPng"==c?"https://exp.draw.io/plantuml2/png/":"https://exp.draw.io/plantuml2/svg/",g=a.editor.graph;if(a.spinner.spin(document.body,mxResources.get("inserting"))){var h=function(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"},n=function(a,b,c){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|c>>6;c4=c&63;r="";r+=h(c1&63);r+=h(c2&63);r+=h(c3&63);return r+=h(c4&63)},f=
-new XMLHttpRequest;f.open("GET",d+function(a){r="";for(l=0;l<a.length;l+=3)r=l+2==a.length?r+n(a.charCodeAt(l),a.charCodeAt(l+1),0):l+1==a.length?r+n(a.charCodeAt(l),0,0):r+n(a.charCodeAt(l),a.charCodeAt(l+1),a.charCodeAt(l+2));return r}(g.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);f.responseType="blob";f.onload=function(c){200<=this.status&&300>this.status?(c=new FileReader,c.readAsDataURL(this.response),c.onload=function(c){var d=new Image;d.onload=function(){a.spinner.stop();
-g.getModel().beginUpdate();try{cell=g.insertVertex(null,null,b,e.x,e.y,d.width,d.height,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c.target.result)+";")}finally{g.getModel().endUpdate()}g.setSelectionCell(cell);g.scrollCellToVisible(g.getSelectionCell())};d.src=c.target.result},c.onerror=function(b){a.handleError(b)}):(a.spinner.stop(),a.handleError(c))};f.onerror=function(b){a.handleError(b)};f.send()}}else if("table"==c){for(var u=null,k=[],q=0,
-l=0;l<d.length;l++)if(f=mxUtils.trim(d[l]),"create table"==f.substring(0,12).toLowerCase())f=mxUtils.trim(f.substring(12)),"("==f.charAt(f.length-1)&&(f=f.substring(0,f.lastIndexOf(" "))),u=new mxCell(f,new mxGeometry(q,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),u.vertex=!0,k.push(u),f=a.editor.graph.getPreferredSizeForCell(m),
-null!=f&&(u.geometry.width=f.width+10);else if(null!=u&&")"==f.charAt(0))q+=u.geometry.width+40,u=null;else if("("!=f&&null!=u&&(f=f.substring(0,","==f.charAt(f.length-1)?f.length-1:f.length),"primary key"!=f.substring(0,11).toLowerCase())){var m=new mxCell(f,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
-m.vertex=!0;f=sb.cloneCell(m,"");f.connectable=!1;f.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";f.geometry.width=30;f.geometry.height=26;m.insert(f);f=a.editor.graph.getPreferredSizeForCell(m);null!=f&&u.geometry.width<f.width+10&&(u.geometry.width=f.width+10);u.insert(m);u.geometry.height+=26}0<k.length&&(g=a.editor.graph,d=g.view,f=g.getGraphBounds(),
-g.setSelectionCells(g.importCells(k,Math.ceil(Math.max(0,f.x/d.scale-d.translate.x)+4*g.gridSize),Math.ceil(Math.max(0,(f.y+f.height)/d.scale-d.translate.y)+4*g.gridSize))),g.scrollCellToVisible(g.getSelectionCell()))}else if("list"==c){if(0<d.length){g=a.editor.graph;m=new mxCell(d[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");m.vertex=!0;
-f=g.getPreferredSizeForCell(m);null!=f&&m.geometry.width<f.width+10&&(m.geometry.width=f.width+10);u=[m];if(1<d.length)for(l=1;l<d.length;l++)"--"==d[l]?(f=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),f.vertex=!0,m.geometry.height+=f.geometry.height,m.insert(f),u.push(f)):0<d[l].length&&";"!=d[l].charAt(0)&&(q=new mxCell(d[l],
-new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),q.vertex=!0,f=g.getPreferredSizeForCell(q),null!=f&&q.geometry.width<f.width&&(q.geometry.width=f.width),m.geometry.width=Math.max(m.geometry.width,q.geometry.width),m.geometry.height+=q.geometry.height,m.insert(q),u.push(q));g.getModel().beginUpdate();try{m=g.importCells([m],e.x,e.y)[0],g.fireEvent(new mxEventObject("cellsInserted",
-"cells",[m].concat(m.children)))}finally{g.getModel().endUpdate()}g.setSelectionCell(m);g.scrollCellToVisible(g.getSelectionCell())}}else{for(var m=function(a){var b=G[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,G[a]=b,k.push(b));return b},G={},k=[],l=0;l<d.length;l++)if(";"!=d[l].charAt(0)){var C=d[l].split("->");if(2<=C.length){var q=m(C[0]),E=m(C[C.length-1]),C=new mxCell(2<C.length?C[1]:"",new mxGeometry);C.edge=!0;q.insertEdge(C,!0);E.insertEdge(C,
-!1);k.push(C)}}if(0<k.length){d=document.createElement("div");d.style.visibility="hidden";document.body.appendChild(d);g=new Graph(d);g.getModel().beginUpdate();try{k=g.importCells(k);for(l=0;l<k.length;l++)g.getModel().isVertex(k[l])&&(f=g.getPreferredSizeForCell(k[l]),k[l].geometry.width=Math.max(k[l].geometry.width,f.width),k[l].geometry.height=Math.max(k[l].geometry.height,f.height));u=new mxFastOrganicLayout(g);u.disableEdgeStyle=!1;u.forceConstant=120;u.execute(g.getDefaultParent())}finally{g.getModel().endUpdate()}g.clearCellOverlays();
+function(){f=!0});mxEvent.addListener(c,"touchstart",function(){f=!0});c.className="geBtn";c.width="100";d.appendChild(c);mxUtils.br(d);mxEvent.addListener(e,"change",h);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(e.value=a.url,h()));e.focus()};c=document.createElement("div");c.style.marginTop="40px";c.style.textAlign="right";var g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
+g.className="geBtn";a.editor.cancelFirst&&c.appendChild(g);if(!a.isOffline()&&"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top){var k=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)});
+k.className="geBtn";c.appendChild(k);null!=a.drive&&"1"==urlParams.photos&&(k=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
+a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),k.className="geBtn",c.appendChild(k))}k=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b(""!=e.value?new mxImage(mxUtils.trim(e.value),l.value,m.value):null)});k.className="geBtn gePrimaryBtn";c.appendChild(k);a.editor.cancelFirst||c.appendChild(g);d.appendChild(c);this.container=d},ParseDialog=function(a,b){function d(b,c){var d=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==
+c){var d="plantUmlPng"==c?"https://exp.draw.io/plantuml2/png/":"https://exp.draw.io/plantuml2/svg/",g=a.editor.graph;if(a.spinner.spin(document.body,mxResources.get("inserting"))){var k=function(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"},n=function(a,b,c){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|c>>6;c4=c&63;r="";r+=k(c1&63);r+=k(c2&63);r+=k(c3&63);return r+=k(c4&63)},f=
+new XMLHttpRequest;f.open("GET",d+function(a){r="";for(q=0;q<a.length;q+=3)r=q+2==a.length?r+n(a.charCodeAt(q),a.charCodeAt(q+1),0):q+1==a.length?r+n(a.charCodeAt(q),0,0):r+n(a.charCodeAt(q),a.charCodeAt(q+1),a.charCodeAt(q+2));return r}(g.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);f.responseType="blob";f.onload=function(c){200<=this.status&&300>this.status?(c=new FileReader,c.readAsDataURL(this.response),c.onload=function(c){var d=new Image;d.onload=function(){a.spinner.stop();
+g.getModel().beginUpdate();try{cell=g.insertVertex(null,null,b,e.x,e.y,d.width,d.height,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c.target.result)+";")}finally{g.getModel().endUpdate()}g.setSelectionCell(cell);g.scrollCellToVisible(g.getSelectionCell())};d.src=c.target.result},c.onerror=function(b){a.handleError(b)}):(a.spinner.stop(),a.handleError(c))};f.onerror=function(b){a.handleError(b)};f.send()}}else if("table"==c){for(var u=null,x=[],h=0,
+q=0;q<d.length;q++)if(f=mxUtils.trim(d[q]),"create table"==f.substring(0,12).toLowerCase())f=mxUtils.trim(f.substring(12)),"("==f.charAt(f.length-1)&&(f=f.substring(0,f.lastIndexOf(" "))),u=new mxCell(f,new mxGeometry(h,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),u.vertex=!0,x.push(u),f=a.editor.graph.getPreferredSizeForCell(l),
+null!=f&&(u.geometry.width=f.width+10);else if(null!=u&&")"==f.charAt(0))h+=u.geometry.width+40,u=null;else if("("!=f&&null!=u&&(f=f.substring(0,","==f.charAt(f.length-1)?f.length-1:f.length),"primary key"!=f.substring(0,11).toLowerCase())){var l=new mxCell(f,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
+l.vertex=!0;f=sb.cloneCell(l,"");f.connectable=!1;f.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";f.geometry.width=30;f.geometry.height=26;l.insert(f);f=a.editor.graph.getPreferredSizeForCell(l);null!=f&&u.geometry.width<f.width+10&&(u.geometry.width=f.width+10);u.insert(l);u.geometry.height+=26}0<x.length&&(g=a.editor.graph,d=g.view,f=g.getGraphBounds(),
+g.setSelectionCells(g.importCells(x,Math.ceil(Math.max(0,f.x/d.scale-d.translate.x)+4*g.gridSize),Math.ceil(Math.max(0,(f.y+f.height)/d.scale-d.translate.y)+4*g.gridSize))),g.scrollCellToVisible(g.getSelectionCell()))}else if("list"==c){if(0<d.length){g=a.editor.graph;l=new mxCell(d[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");l.vertex=!0;
+f=g.getPreferredSizeForCell(l);null!=f&&l.geometry.width<f.width+10&&(l.geometry.width=f.width+10);u=[l];if(1<d.length)for(q=1;q<d.length;q++)"--"==d[q]?(f=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),f.vertex=!0,l.geometry.height+=f.geometry.height,l.insert(f),u.push(f)):0<d[q].length&&";"!=d[q].charAt(0)&&(h=new mxCell(d[q],
+new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),h.vertex=!0,f=g.getPreferredSizeForCell(h),null!=f&&h.geometry.width<f.width&&(h.geometry.width=f.width),l.geometry.width=Math.max(l.geometry.width,h.geometry.width),l.geometry.height+=h.geometry.height,l.insert(h),u.push(h));g.getModel().beginUpdate();try{l=g.importCells([l],e.x,e.y)[0],g.fireEvent(new mxEventObject("cellsInserted",
+"cells",[l].concat(l.children)))}finally{g.getModel().endUpdate()}g.setSelectionCell(l);g.scrollCellToVisible(g.getSelectionCell())}}else{for(var l=function(a){var b=m[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,m[a]=b,x.push(b));return b},m={},x=[],q=0;q<d.length;q++)if(";"!=d[q].charAt(0)){var D=d[q].split("->");if(2<=D.length){var h=l(D[0]),E=l(D[D.length-1]),D=new mxCell(2<D.length?D[1]:"",new mxGeometry);D.edge=!0;h.insertEdge(D,!0);E.insertEdge(D,
+!1);x.push(D)}}if(0<x.length){d=document.createElement("div");d.style.visibility="hidden";document.body.appendChild(d);g=new Graph(d);g.getModel().beginUpdate();try{x=g.importCells(x);for(q=0;q<x.length;q++)g.getModel().isVertex(x[q])&&(f=g.getPreferredSizeForCell(x[q]),x[q].geometry.width=Math.max(x[q].geometry.width,f.width),x[q].geometry.height=Math.max(x[q].geometry.height,f.height));u=new mxFastOrganicLayout(g);u.disableEdgeStyle=!1;u.forceConstant=120;u.execute(g.getDefaultParent())}finally{g.getModel().endUpdate()}g.clearCellOverlays();
u=[];a.editor.graph.getModel().beginUpdate();try{u=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),e.x,e.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(u[0]);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());g.destroy();d.parentNode.removeChild(d)}}}function c(){return"list"==l.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":
"table"==l.value?"CREATE TABLE Persons\n(\nPersonID int,\nLastName varchar(255),\nFirstName varchar(255),\nAddress varchar(255),\nCity varchar(255)\n);":"plantUmlPng"==l.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":"plantUmlSvg"==l.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
-";Example:\na->b\nb->edge label->c\nc->a\n"}var e=a.editor.graph.getFreeInsertPoint(),f=document.createElement("div");f.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height="354px";k.style.marginBottom="16px";var l=document.createElement("select"),m=document.createElement("option");m.setAttribute("value","list");m.setAttribute("selected","selected");mxUtils.write(m,mxResources.get("list"));l.appendChild(m);m=document.createElement("option");
+";Example:\na->b\nb->edge label->c\nc->a\n"}var e=a.editor.graph.getFreeInsertPoint(),f=document.createElement("div");f.style.textAlign="right";var h=document.createElement("textarea");h.style.resize="none";h.style.width="100%";h.style.height="354px";h.style.marginBottom="16px";var l=document.createElement("select"),m=document.createElement("option");m.setAttribute("value","list");m.setAttribute("selected","selected");mxUtils.write(m,mxResources.get("list"));l.appendChild(m);m=document.createElement("option");
m.setAttribute("value","table");mxUtils.write(m,mxResources.get("table"));l.appendChild(m);m=document.createElement("option");m.setAttribute("value","diagram");mxUtils.write(m,mxResources.get("diagram"));l.appendChild(m);m=document.createElement("option");m.setAttribute("value","plantUmlSvg");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");var g=document.createElement("option");g.setAttribute("value","plantUmlPng");mxUtils.write(g,mxResources.get("plantUml")+" ("+
-mxResources.get("formatPng")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&(l.appendChild(m),l.appendChild(g));var h=c();k.value=h;f.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){k.value=a.target.result};
-b.readAsText(a)}},!1));f.appendChild(l);mxEvent.addListener(l,"change",function(){var a=c();if(0==k.value.length||k.value==h)h=a,k.value=h});m=mxUtils.button(mxResources.get("close"),function(){k.value==h?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});m.className="geBtn";a.editor.cancelFirst&&f.appendChild(m);g=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();d(k.value,l.value)});f.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||
-f.appendChild(m);this.container=f},NewDialog=function(a,b,d,c,e,f,k,l,m,g,h){function n(){if(c)d||a.hideDialog(),c(z,u.value);else{var b=u.value;null!=b&&0<b.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null,function(c){a.createFile(b,z,null!=A&&0<A.length?A:null,null,function(){a.hideDialog()},null,c)})}}function q(a,b,c){null!=w&&(w.style.backgroundColor="transparent",w.style.border="1px solid transparent");
-z=b;A=c;w=a;w.style.backgroundColor=l;w.style.border=m}function t(a,b,c,d,g){var h=document.createElement("div");h.className="geTemplate";h.style.height="140px";h.style.width="140px";null!=d&&0<d.length&&h.setAttribute("title",d);if(null!=a&&0<a.length){a.substring(0,a.length-4);h.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";h.style.backgroundPosition="center center";h.style.backgroundRepeat="no-repeat";var e=!1;mxEvent.addListener(h,"click",function(c){B.setAttribute("disabled",
-"disabled");h.style.backgroundColor="transparent";h.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(B.removeAttribute("disabled"),q(h,a.getText(),b),e&&n())}))});mxEvent.addListener(h,"dblclick",function(a){e=!0})}else h.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(c)+"</td></tr></table>",g&&q(h),mxEvent.addListener(h,"click",function(a){q(h)}),mxEvent.addListener(h,
-"dblclick",function(a){n()});G.appendChild(h)}function p(){function a(){for(var a=!0;b<D.length&&(a||0!=mxUtils.mod(b,30));)a=D[b++],t(a.url,a.libs,a.title,a.tooltip,a.select),a=!1}var b=0;mxEvent.addListener(G,"scroll",function(b){G.scrollTop+G.clientHeight>=G.scrollHeight&&(a(),mxEvent.consume(b))});var c=null,d;for(d in E){var h=document.createElement("div"),e=mxResources.get(d),n=E[d];null==e&&(e=d.substring(0,1).toUpperCase()+d.substring(1));18<e.length&&(e=e.substring(0,18)+"&hellip;");h.style.cssText=
-"display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";h.setAttribute("title",e+" ("+n.length+")");mxUtils.write(h,h.getAttribute("title"));null!=g&&(h.style.padding=g);C.appendChild(h);null==c&&(c=h,c.style.backgroundColor=k);(function(d,g){mxEvent.addListener(h,"click",function(){c!=g&&(c.style.backgroundColor="",c=g,c.style.backgroundColor=k,G.scrollTop=0,G.innerHTML="",b=0,D=E[d],a())})})(d,h)}a()}d=null!=d?d:!0;e=null!=e?e:!1;
-k=null!=k?k:"#ebf2f9";l=null!=l?l:"#e6eff8";m=null!=m?m:"1px solid #ccd9ea";h=null!=h?h:TEMPLATE_PATH+"/index.xml";var v=document.createElement("div");v.style.height="100%";var y=document.createElement("div");y.style.whiteSpace="nowrap";y.style.height="46px";v.appendChild(y);var x=document.createElement("img");x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.style.width="40px";x.style.height="40px";x.style.marginRight="10px";x.style.paddingBottom="4px";x.src=a.mode==App.MODE_GOOGLE?
-IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&d&&y.appendChild(x);d&&mxUtils.write(y,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+
-":");x=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?x=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?x=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?x=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?x=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(x=a.trello.extension);var u=document.createElement("input");u.setAttribute("value",a.defaultFilename+x);u.style.marginRight="20px";u.style.marginLeft="10px";u.style.width=b?"220px":"430px";this.init=
-function(){d&&(u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null))};d&&y.appendChild(u);var A=null,z=null,w=null,B=mxUtils.button(mxResources.get("create"),function(){n()});B.className="geBtn gePrimaryBtn";var G=document.createElement("div");G.style.border="1px solid #d3d3d3";G.style.position="absolute";G.style.left="160px";G.style.right="34px";G.style.top=d?"72px":"40px";G.style.bottom="68px";G.style.margin=
-"6px 0 0 -1px";G.style.padding="6px";G.style.overflow="auto";var C=document.createElement("div");C.style.cssText="position:absolute;left:30px;width:128px;top:72px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";d||(C.style.top="40px");var E={},H=1;E.basic=[{title:"blankDiagram",select:!0}];var D=E.basic;if(!b){v.appendChild(C);v.appendChild(G);var F=!1;mxUtils.get(h,function(a){if(!F){F=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=
-a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=E[b];null==c&&(H++,c=[],E[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=a.nextSibling}p()}})}mxEvent.addListener(u,"keypress",function(a){13==a.keyCode&&n()});h=document.createElement("div");h.style.marginTop=b?"4px":"16px";h.style.textAlign="right";h.style.position="absolute";h.style.left="40px";h.style.bottom="24px";h.style.right="40px";
-y=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});y.className="geBtn";!a.editor.cancelFirst||e&&null==f||h.appendChild(y);b||a.isOffline()||!d||null!=c||e||(x=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),x.className="geBtn",h.appendChild(x));b||"1"==urlParams.embed||e||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),
-function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(u.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",h.appendChild(b));h.appendChild(B);a.editor.cancelFirst||null!=c||e&&null==f||h.appendChild(y);v.appendChild(h);this.container=v},CreateDialog=function(a,b,d,c,e,f,k,l,m,g,h,n,q,
-t,p){function v(c,d,g,h){function e(){mxEvent.addListener(u,"click",function(){var c=g;if(k){var d=A.value,h=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>h){var c=null!=c?c:B.value,e="";c==App.MODE_GOOGLE?e=a.drive.extension:c==App.MODE_GITHUB?e=a.gitHub.extension:c==App.MODE_TRELLO?e=a.trello.extension:c==App.MODE_DROPBOX?e=a.dropbox.extension:c==App.MODE_ONEDRIVE?e=a.oneDrive.extension:c==App.MODE_DEVICE&&(e=".xml");0<=h&&(d=d.substring(0,h));A.value=d+e}}y(g)})}var u=document.createElement("a");
-u.style.overflow="hidden";var f=document.createElement("img");f.src=c;f.setAttribute("border","0");f.setAttribute("align","absmiddle");f.style.width="60px";f.style.height="60px";f.style.paddingBottom="6px";u.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";u.className="geBaseButton";u.style.position="relative";u.style.margin="4px";u.style.padding="8px 8px 10px 8px";u.style.whiteSpace="nowrap";u.appendChild(f);mxClient.IS_QUIRKS&&(u.style.cssFloat="left",u.style.zoom="1");u.style.color="gray";
-u.style.fontSize="11px";var l=document.createElement("div");u.appendChild(l);mxUtils.write(l,d);if(null!=h&&null==a[h]){f.style.visibility="hidden";mxUtils.setOpacity(l,10);var t=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});t.spin(u);var p=window.setTimeout(function(){null==a[h]&&(t.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[h]&&(window.clearTimeout(p),
-mxUtils.setOpacity(l,100),f.style.visibility="",t.stop(),e())}))}else e();z.appendChild(u);++w==n&&(mxUtils.br(z),w=0)}function y(b){var c=A.value;if(null==b||null!=c&&0<c.length)a.hideDialog(),d(c,b)}k=null!=k?k:!0;l=null!=l?l:!0;n=null!=n?n:3;var x=document.createElement("div");null==c&&a.addLanguageMenu(x);var u=document.createElement("h2");mxUtils.write(u,e||mxResources.get("create"));u.style.marginTop="0px";u.style.marginBottom="24px";x.appendChild(u);mxUtils.write(x,mxResources.get("filename")+
-":");var A=document.createElement("input");A.setAttribute("value",b);A.style.width="280px";A.style.marginLeft="10px";A.style.marginBottom="20px";this.init=function(){A.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",!1,null)};x.appendChild(A);null!=q&&null!=t&&"image/"==t.substring(0,6)&&(A.style.width="160px",e=null,"image/svg+xml"==t&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(q),q=e.getElementsByTagName("svg")[0],
-t=parseInt(q.getAttribute("width")),p=parseInt(q.getAttribute("height")),q.setAttribute("viewBox","0 0 "+t+" "+p),q.setAttribute("width","120px"),q.setAttribute("height","80px")):(e=document.createElement("img"),e.setAttribute("src","data:"+t+(p?";base64,":";utf8,")+q)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),x.appendChild(e),m&&(e.style.cursor="pointer",
-mxEvent.addListener(e,"click",function(){y("_blank")})));mxUtils.br(x);var z=document.createElement("div");z.style.textAlign="center";var w=0;z.style.marginTop="6px";x.appendChild(z);var B=document.createElement("select");B.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(e,mxResources.get("googleDrive")),B.appendChild(e),v(IMAGE_PATH+"/google-drive-logo.svg",
-mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),null!=a.gitHub&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GITHUB),mxUtils.write(e,mxResources.get("github")),B.appendChild(e),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.DropboxClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(e,mxResources.get("dropbox")),B.appendChild(e),a.mode==App.MODE_DROPBOX&&e.setAttribute("selected",
-"selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),"function"===typeof window.OneDriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(e,mxResources.get("oneDrive")),B.appendChild(e),a.mode==App.MODE_ONEDRIVE&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),null!=a.trello&&(e=document.createElement("option"),e.setAttribute("value",
-App.MODE_TRELLO),mxUtils.write(e,mxResources.get("trello")),B.appendChild(e),v(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&!mxClient.IS_IOS)e=document.createElement("option"),e.setAttribute("value",App.MODE_DEVICE),mxUtils.write(e,mxResources.get("device")),B.appendChild(e),a.mode!=App.MODE_DEVICE&&l||e.setAttribute("selected","selected"),h&&v(IMAGE_PATH+"/osa_drive-harddisk.png",
-mxResources.get("device"),App.MODE_DEVICE);l&&isLocalStorage&&"0"!=urlParams.browser&&(l=document.createElement("option"),l.setAttribute("value",App.MODE_BROWSER),mxUtils.write(l,mxResources.get("browser")),B.appendChild(l),a.mode==App.MODE_BROWSER&&l.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="center";null!=g&&(e=mxUtils.button(mxResources.get("help"),
-function(){a.openLink(g)}),e.className="geBtn",l.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){null!=c?c():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});e.className="geBtn";a.editor.cancelFirst&&l.appendChild(e);null==c&&(q=mxUtils.button(mxResources.get("decideLater"),function(){y(null)}),q.className="geBtn",l.appendChild(q));m&&(m=mxUtils.button(mxResources.get("openInNewWindow"),function(){y("_blank")}),m.className="geBtn",l.appendChild(m));
-mxClient.IS_IOS||(f=mxUtils.button(f||mxResources.get("create"),function(){y(h?"download":App.MODE_DEVICE)}),f.className="geBtn gePrimaryBtn",l.appendChild(f));a.editor.cancelFirst||l.appendChild(e);mxEvent.addListener(A,"keypress",function(b){13==b.keyCode?y(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});x.appendChild(l);this.container=x},PopupDialog=function(a,b,d,c,e){e=null!=e?e:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,
-mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=c&&c()});k.className="geBtn";k.style.marginBottom="8px";k.style.width="280px";f.appendChild(k);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=d&&d();a.openLink(b)});l.className="geBtn gePrimaryBtn";l.style.width=k.style.width;f.appendChild(l);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,
-mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,b,d,c,e,f){f=null!=f?f:!0;var k=a.editor.graph,l=document.createElement("div");mxUtils.write(l,b);b=document.createElement("div");b.className="geTitle";b.style.backgroundColor="transparent";b.style.borderColor="transparent";b.style.whiteSpace="nowrap";b.style.textOverflow="clip";b.style.cursor="default";mxClient.IS_VML||(b.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value",d);m.setAttribute("type",
-"text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));
-d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});b.appendChild(m);b.appendChild(d);l.appendChild(b);var g=function(b,d,g){var h="data:"==b.substring(0,5);!a.isOffline()||h&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,
-mxResources.get("inserting"))?a.loadImage(b,function(h){a.spinner.stop();a.hideDialog();var e=null!=d&&null!=g?Math.max(d/h.width,g/h.height):Math.min(1,Math.min(520/h.width,520/h.height));f&&(b=a.convertDataUri(b));c(b,Math.round(Number(h.width)*e),Math.round(Number(h.height)*e))},function(){a.spinner.stop();c(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),c(b)):(b=a.convertDataUri(b),d=null==d?120:d,g=null==g?100:g,a.hideDialog(),
-c(b,d,g))},h=function(b){if(null!=b){var d=e?null:k.getModel().getGeometry(k.getSelectionCell());null!=d?g(b,d.width,d.height):g(b)}else a.hideDialog(),c(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=l.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==
-c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,d,g,e){h(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,
-"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&h(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};d=document.createElement("div");d.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";d.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});b.className="geBtn";a.editor.cancelFirst&&d.appendChild(b);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&
-null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){var n=document.createElement("input");n.setAttribute("multiple","multiple");n.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(n,"change",function(b){a.importFiles(n.files,0,0,a.maxImageSize,function(a,b,c,d,g,e){h(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},
-!0)});var q=mxUtils.button(mxResources.get("open"),function(){n.click()});q.className="geBtn";d.appendChild(q)}}document.createElement("canvas").getContext&&"data:image/"==m.value.substring(0,11)&&"data:image/svg"!=m.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,m.value,function(a){m.value=a});a.showDialog(b.container,200,180,!0,!0);b.init()}),q.className="geBtn",d.appendChild(q));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&
-window.self===window.top&&(q=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),q.className="geBtn",d.appendChild(q),null!=a.drive&&"1"==urlParams.photos&&(q=mxUtils.button(mxResources.get("googlePlus"),
-function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),
-q.className="geBtn",d.appendChild(q)));mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&h(m.value)});q=mxUtils.button(mxResources.get("apply"),function(){h(m.value)});q.className="geBtn gePrimaryBtn";d.appendChild(q);a.editor.cancelFirst||d.appendChild(b);Graph.fileSupport&&(d.style.marginTop="120px",l.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",l.style.backgroundPosition="center 65%",l.style.backgroundRepeat="no-repeat",b=document.createElement("div"),b.style.position=
-"absolute",b.style.width="420px",b.style.top="58%",b.style.textAlign="center",b.style.fontSize="18px",b.style.color="#a0c3ff",mxUtils.write(b,mxResources.get("dragImagesHere")),l.appendChild(b));l.appendChild(d);this.container=l},LinkDialog=function(a,b,d,c,e){function f(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";
-c.appendChild(b);y.appendChild(c)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";mxClient.IS_VML||(l.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("placeholder",mxResources.get("dragUrlsHere"));m.setAttribute("type","text");
-m.style.marginTop="6px";m.style.width="400px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";var g=document.createElement("div");g.setAttribute("title",mxResources.get("reset"));g.style.position="relative";g.style.left="-16px";g.style.width="12px";g.style.height="14px";g.style.cursor="pointer";g.style.display=mxClient.IS_VML?"inline":"inline-block";g.style.top=(mxClient.IS_VML?
-0:3)+"px";g.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(g,"click",function(){m.value="";m.focus()});var h=document.createElement("input");h.style.cssText="margin-right:8px;margin-bottom:8px;";h.setAttribute("value","url");h.setAttribute("type","radio");h.setAttribute("name","current-linkdialog");var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name",
-"current-linkdialog");var q=document.createElement("select");q.style.width="380px";if(e&&null!=a.pages){null!=b&&a.editor.graph.isPageLink(b)?(n.setAttribute("checked","checked"),n.defaultChecked=!0):(m.setAttribute("value",b),h.setAttribute("checked","checked"),h.defaultChecked=!0);m.style.width="380px";l.appendChild(h);l.appendChild(m);l.appendChild(g);mxUtils.br(l);l.appendChild(n);e=!1;for(g=0;g<a.pages.length;g++){var t=document.createElement("option");mxUtils.write(t,a.pages[g].getName()||mxResources.get("pageWithNumber",
-[g+1]));t.setAttribute("value","data:page/id,"+a.pages[g].getId());b==t.getAttribute("value")&&(t.setAttribute("selected","selected"),e=!0);q.appendChild(t)}if(!e&&n.checked){var p=document.createElement("option");mxUtils.write(p,mxResources.get("pageNotFound"));p.setAttribute("disabled","disabled");p.setAttribute("selected","selected");p.setAttribute("value","pageNotFound");q.appendChild(p);mxEvent.addListener(q,"change",function(){null==p.parentNode||p.selected||p.parentNode.removeChild(p)})}l.appendChild(q)}else m.setAttribute("value",
-b),l.appendChild(m),l.appendChild(g);k.appendChild(l);var v=mxUtils.button(d,function(){a.hideDialog();c(n.checked?"pageNotFound"!==q.value?q.value:b:m.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){n.checked?q.focus():(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){h.removeAttribute("checked");
-n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(m,"focus",function(){n.removeAttribute("checked");h.setAttribute("checked","checked");h.checked=!0});if(Graph.fileSupport){var b=k.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();
-d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(m.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),h.setAttribute("checked","checked"),h.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var y=document.createElement("div");y.style.marginTop="20px";y.style.textAlign="right";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
-d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&y.appendChild(d);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?
-(b=DriveClient.prototype.newAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);m.value=b;m.focus()}else LinkDialog.selectedDocs=null;m.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&f(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,
-function(){a.spinner.stop();if(null==a.linkPicker){var b=gapi.auth.getToken().access_token,c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),g=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(d).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);
-"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&f(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){m.value=a[0].link;m.focus()}})});null!=
-a.oneDrive&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){m.value=b.value[0].webUrl;m.focus()})});null!=a.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],d=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+b+"/"+c+"/blob/"+d+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),
-c(n.checked?q.value:m.value,LinkDialog.selectedDocs))});y.appendChild(v);a.editor.cancelFirst||y.appendChild(d);k.appendChild(y);this.container=k},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):
-(d.setAttribute("width","176"),d.setAttribute("height","219"),d.style.width="170px",d.style.height="219px",d.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));b.appendChild(d);mxUtils.br(b);d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color="#505050";b.appendChild(d);mxUtils.br(b);mxUtils.br(b);d=document.createElement("small");d.style.color="#505050";d.innerHTML='&copy; 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
-b.appendChild(d);mxEvent.addListener(b,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=b},FeedbackDialog=function(a){var b=document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";b.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");b.appendChild(d);var c=document.createElement("input");
-c.setAttribute("type","text");c.style.marginTop="6px";c.style.width="600px";var e=mxUtils.button(mxResources.get("sendMessage"),function(){var b=(k.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(c.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+
-"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+m.value+b),function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});e.className="geBtn gePrimaryBtn";e.setAttribute("disabled","disabled");var f=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
-mxEvent.addListener(c,"change",function(){0<c.value.length&&0<f.test(c.value)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")});mxEvent.addListener(c,"keyup",function(){0<c.value.length&&f.test(c.value)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")});b.appendChild(c);this.init=function(){c.focus()};var k=document.createElement("input");k.setAttribute("type","checkbox");k.setAttribute("checked","checked");k.defaultChecked=!0;d=document.createElement("p");d.style.marginTop=
-"14px";d.appendChild(k);var l=document.createElement("span");mxUtils.write(l," "+mxResources.get("includeCopyOfMyDiagram"));d.appendChild(l);mxEvent.addListener(l,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});b.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("feedback"));b.appendChild(d);var m=document.createElement("textarea");m.style.resize="none";m.style.width="600px";m.style.height="140px";m.style.marginTop="6px";m.setAttribute("placeholder",mxResources.get("commentsNotes"));
+mxResources.get("formatPng")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&(l.appendChild(m),l.appendChild(g));var k=c();h.value=k;f.appendChild(h);this.init=function(){h.focus()};Graph.fileSupport&&(h.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),h.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){h.value=a.target.result};
+b.readAsText(a)}},!1));f.appendChild(l);mxEvent.addListener(l,"change",function(){var a=c();if(0==h.value.length||h.value==k)k=a,h.value=k});m=mxUtils.button(mxResources.get("close"),function(){h.value==k?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});m.className="geBtn";a.editor.cancelFirst&&f.appendChild(m);g=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();d(h.value,l.value)});f.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||
+f.appendChild(m);this.container=f},NewDialog=function(a,b,d,c,e,f,h,l,m,g,k,n,q,t){function p(){for(var a=!0;H<V.length&&(a||0!=mxUtils.mod(H,30));)a=V[H++],z(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info),a=!1}function w(){if(R)a.hideDialog(),t(R,M,B.value);else if(c)d||a.hideDialog(),c(S,B.value);else{var b=B.value;null!=b&&0<b.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?
+a.mode:null,function(c){a.createFile(b,S,null!=P&&0<P.length?P:null,null,function(){a.hideDialog()},null,c)})}}function A(a,b,c,d,g){null!=O&&(O.style.backgroundColor="transparent",O.style.border="1px solid transparent");D.removeAttribute("disabled");S=b;P=c;O=a;R=d;M=g;O.style.backgroundColor=l;O.style.border=m}function z(a,b,c,d,g,k,e){var n=document.createElement("div");n.className="geTemplate";n.style.height=L+"px";n.style.width=X+"px";null!=d&&0<d.length&&n.setAttribute("title",d);if(null!=k)n.style.backgroundImage=
+"url("+k+")",n.style.backgroundSize="contain",n.style.backgroundPosition="center center",n.style.backgroundRepeat="no-repeat",mxEvent.addListener(n,"click",function(b){A(n,null,null,a,e)}),mxEvent.addListener(n,"dblclick",function(a){w()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);n.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";var u=!1;mxEvent.addListener(n,"click",function(c){D.setAttribute("disabled",
+"disabled");n.style.backgroundColor="transparent";n.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(A(n,a.getText(),b),u&&w())}))});mxEvent.addListener(n,"dblclick",function(a){u=!0})}else n.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(c)+"</td></tr></table>",g&&A(n),mxEvent.addListener(n,"click",function(a){A(n)}),mxEvent.addListener(n,"dblclick",function(a){w()});
+J.appendChild(n)}function u(){mxEvent.addListener(J,"scroll",function(a){J.scrollTop+J.clientHeight>=J.scrollHeight&&(p(),mxEvent.consume(a))});var a=null,b;for(b in N){var c=document.createElement("div"),d=mxResources.get(b),k=N[b];null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1));18<d.length&&(d=d.substring(0,18)+"&hellip;");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";c.setAttribute("title",d+" ("+
+k.length+")");mxUtils.write(c,c.getAttribute("title"));null!=g&&(c.style.padding=g);T.appendChild(c);null==a&&(a=c,a.style.backgroundColor=h);(function(b,d){mxEvent.addListener(c,"click",function(){a!=d&&(a.style.backgroundColor="",a=d,a.style.backgroundColor=h,J.scrollTop=0,J.innerHTML="",H=0,V=N[b],G=null,p())})})(b,c)}p()}d=null!=d?d:!0;e=null!=e?e:!1;h=null!=h?h:"#ebf2f9";l=null!=l?l:"#e6eff8";m=null!=m?m:"1px solid #ccd9ea";k=null!=k?k:TEMPLATE_PATH+"/index.xml";var x=document.createElement("div");
+x.style.height="100%";var y=document.createElement("div");y.style.whiteSpace="nowrap";y.style.height="46px";d&&x.appendChild(y);var v=document.createElement("img");v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.width="40px";v.style.height="40px";v.style.marginRight="10px";v.style.paddingBottom="4px";v.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":
+a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&d&&y.appendChild(v);d&&mxUtils.write(y,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");v=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?v=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?v=a.dropbox.extension:
+a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?v=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?v=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(v=a.trello.extension);var B=document.createElement("input");B.setAttribute("value",a.defaultFilename+v);B.style.marginRight="20px";B.style.marginLeft="10px";B.style.width=b?"220px":"430px";this.init=function(){d&&(B.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?B.select():document.execCommand("selectAll",
+!1,null))};d&&y.appendChild(B);var y=!1,H=0,D=mxUtils.button(mxResources.get("create"),function(){w()});D.className="geBtn gePrimaryBtn";if(n||q){var E=[],G=null,C=function(a){D.setAttribute("disabled","disabled");for(var b=0;b<E.length;b++)E[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},y=!0,v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";x.appendChild(v);var F=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){T.style.display="";J.style.left=
+"160px";C(0);J.scrollTop=0;J.innerHTML="";H=0;G!=V&&(V=G,p(),G=null)});E.push(F);v.appendChild(F);var I=function(a){T.style.display="none";J.style.left="30px";C(a?-1:1);null==G&&(G=V);J.scrollTop=0;J.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(J);H=0;var c=function(a,c){b.stop();V=a;c?J.innerHTML=c:0==a.length?J.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(J.innerHTML=
+"",p())};a?q(K.value,c):n(c)};n&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){I()}),v.appendChild(F),E.push(F));if(q){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxResources.get("search")+":";v.appendChild(F);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(a){13==a.keyCode&&I(!0)});v.appendChild(K);F=mxUtils.button(mxResources.get("search"),
+function(){I(!0)});F.className="geBtn";v.appendChild(F)}C(0)}var P=null,S=null,O=null,R=null,M=null,J=document.createElement("div");J.style.border="1px solid #d3d3d3";J.style.position="absolute";J.style.left="160px";J.style.right="34px";y=(d?72:40)+(y?30:0);J.style.top=y+"px";J.style.bottom="68px";J.style.margin="6px 0 0 -1px";J.style.padding="6px";J.style.overflow="auto";var T=document.createElement("div");T.style.cssText="position:absolute;left:30px;width:128px;top:"+y+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
+var L=140,X=140,N={},Y=1;N.basic=[{title:"blankDiagram",select:!0}];var V=N.basic;if(!b){x.appendChild(T);x.appendChild(J);var U=!1;mxUtils.get(k,function(a){if(!U){U=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=N[b];null==c&&(Y++,c=[],N[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=
+a.nextSibling}u()}})}mxEvent.addListener(B,"keypress",function(a){13==a.keyCode&&w()});k=document.createElement("div");k.style.marginTop=b?"4px":"16px";k.style.textAlign="right";k.style.position="absolute";k.style.left="40px";k.style.bottom="24px";k.style.right="40px";y=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});y.className="geBtn";!a.editor.cancelFirst||e&&null==f||k.appendChild(y);b||a.isOffline()||!d||null!=c||e||(v=mxUtils.button(mxResources.get("help"),
+function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),v.className="geBtn",k.appendChild(v));b||"1"==urlParams.embed||e||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(B.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},
+mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",k.appendChild(b));k.appendChild(D);a.editor.cancelFirst||null!=c||e&&null==f||k.appendChild(y);x.appendChild(k);this.container=x},CreateDialog=function(a,b,d,c,e,f,h,l,m,g,k,n,q,t,p){function w(c,d,g,k){function e(){mxEvent.addListener(u,"click",function(){var c=g;if(h){var d=x.value,k=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>k){var c=null!=c?c:B.value,e="";c==App.MODE_GOOGLE?e=a.drive.extension:c==
+App.MODE_GITHUB?e=a.gitHub.extension:c==App.MODE_TRELLO?e=a.trello.extension:c==App.MODE_DROPBOX?e=a.dropbox.extension:c==App.MODE_ONEDRIVE?e=a.oneDrive.extension:c==App.MODE_DEVICE&&(e=".xml");0<=k&&(d=d.substring(0,k));x.value=d+e}}A(g)})}var u=document.createElement("a");u.style.overflow="hidden";var f=document.createElement("img");f.src=c;f.setAttribute("border","0");f.setAttribute("align","absmiddle");f.style.width="60px";f.style.height="60px";f.style.paddingBottom="6px";u.style.display=mxClient.IS_QUIRKS?
+"inline":"inline-block";u.className="geBaseButton";u.style.position="relative";u.style.margin="4px";u.style.padding="8px 8px 10px 8px";u.style.whiteSpace="nowrap";u.appendChild(f);mxClient.IS_QUIRKS&&(u.style.cssFloat="left",u.style.zoom="1");u.style.color="gray";u.style.fontSize="11px";var t=document.createElement("div");u.appendChild(t);mxUtils.write(t,d);if(null!=k&&null==a[k]){f.style.visibility="hidden";mxUtils.setOpacity(t,10);var q=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,
+color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});q.spin(u);var l=window.setTimeout(function(){null==a[k]&&(q.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(l),mxUtils.setOpacity(t,100),f.style.visibility="",q.stop(),e())}))}else e();y.appendChild(u);++v==n&&(mxUtils.br(y),v=0)}function A(b){var c=x.value;if(null==b||null!=c&&0<c.length)a.hideDialog(),d(c,b)}h=null!=h?h:!0;l=null!=l?l:!0;n=null!=
+n?n:4;var z=document.createElement("div");null==c&&a.addLanguageMenu(z);var u=document.createElement("h2");mxUtils.write(u,e||mxResources.get("create"));u.style.marginTop="0px";u.style.marginBottom="24px";z.appendChild(u);mxUtils.write(z,mxResources.get("filename")+":");var x=document.createElement("input");x.setAttribute("value",b);x.style.width="280px";x.style.marginLeft="10px";x.style.marginBottom="20px";this.init=function(){x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
+x.select():document.execCommand("selectAll",!1,null)};z.appendChild(x);null!=q&&null!=t&&"image/"==t.substring(0,6)&&(x.style.width="160px",e=null,"image/svg+xml"==t&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(q),q=e.getElementsByTagName("svg")[0],t=parseInt(q.getAttribute("width")),p=parseInt(q.getAttribute("height")),q.setAttribute("viewBox","0 0 "+t+" "+p),q.setAttribute("width","120px"),q.setAttribute("height","80px")):(e=document.createElement("img"),e.setAttribute("src",
+"data:"+t+(p?";base64,":";utf8,")+q)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),z.appendChild(e),m&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){A("_blank")})));mxUtils.br(z);var y=document.createElement("div");y.style.textAlign="center";var v=0;y.style.marginTop="6px";z.appendChild(y);var B=document.createElement("select");B.style.marginLeft=
+"10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(e,mxResources.get("googleDrive")),B.appendChild(e),w(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(e,mxResources.get("oneDrive")),B.appendChild(e),a.mode==
+App.MODE_ONEDRIVE&&e.setAttribute("selected","selected"),w(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(e,mxResources.get("dropbox")),B.appendChild(e),a.mode==App.MODE_DROPBOX&&e.setAttribute("selected","selected"),w(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(e=
+document.createElement("option"),e.setAttribute("value",App.MODE_GITHUB),mxUtils.write(e,mxResources.get("github")),B.appendChild(e),w(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_TRELLO),mxUtils.write(e,mxResources.get("trello")),B.appendChild(e),w(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||
+null!=a.getCurrentFile()&&!mxClient.IS_IOS)e=document.createElement("option"),e.setAttribute("value",App.MODE_DEVICE),mxUtils.write(e,mxResources.get("device")),B.appendChild(e),a.mode!=App.MODE_DEVICE&&l||e.setAttribute("selected","selected"),k&&w(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);l&&isLocalStorage&&"0"!=urlParams.browser&&(l=document.createElement("option"),l.setAttribute("value",App.MODE_BROWSER),mxUtils.write(l,mxResources.get("browser")),B.appendChild(l),
+a.mode==App.MODE_BROWSER&&l.setAttribute("selected","selected"),w(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="right";null!=g&&(e=mxUtils.button(mxResources.get("help"),function(){a.openLink(g)}),e.className="geBtn",l.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){null!=c?c():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});e.className=
+"geBtn";a.editor.cancelFirst&&l.appendChild(e);null==c&&(q=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),q.className="geBtn",l.appendChild(q));m&&(m=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),m.className="geBtn",l.appendChild(m));mxClient.IS_IOS||(f=mxUtils.button(f||mxResources.get("create"),function(){A(k?"download":App.MODE_DEVICE)}),f.className="geBtn gePrimaryBtn",l.appendChild(f));a.editor.cancelFirst||l.appendChild(e);mxEvent.addListener(x,
+"keypress",function(b){13==b.keyCode?A(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});z.appendChild(l);this.container=z},PopupDialog=function(a,b,d,c,e){e=null!=e?e:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=c&&c()});h.className="geBtn";h.style.marginBottom="8px";h.style.width=
+"280px";f.appendChild(h);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=d&&d();a.openLink(b)});l.className="geBtn gePrimaryBtn";l.style.width=h.style.width;f.appendChild(l);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,b,d,c,e,f){f=null!=f?f:!0;var h=a.editor.graph,l=document.createElement("div");mxUtils.write(l,b);b=document.createElement("div");b.className="geTitle";b.style.backgroundColor=
+"transparent";b.style.borderColor="transparent";b.style.whiteSpace="nowrap";b.style.textOverflow="clip";b.style.cursor="default";mxClient.IS_VML||(b.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value",d);m.setAttribute("type","text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?
+20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+
+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});b.appendChild(m);b.appendChild(d);l.appendChild(b);var g=function(b,d,g){var k="data:"==b.substring(0,5);!a.isOffline()||k&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(k){a.spinner.stop();a.hideDialog();var e=null!=d&&null!=g?Math.max(d/k.width,g/k.height):Math.min(1,Math.min(520/k.width,520/k.height));f&&(b=a.convertDataUri(b));
+c(b,Math.round(Number(k.width)*e),Math.round(Number(k.height)*e))},function(){a.spinner.stop();c(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),c(b)):(b=a.convertDataUri(b),d=null==d?120:d,g=null==g?100:g,a.hideDialog(),c(b,d,g))},k=function(b){if(null!=b){var d=e?null:h.getModel().getGeometry(h.getSelectionCell());null!=d?g(b,d.width,d.height):g(b)}else a.hideDialog(),c(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",
+mxResources.get("dragImagesHere"));var b=l.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,
+0,0,a.maxImageSize,function(a,b,c,d,g,e){k(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&k(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};d=document.createElement("div");d.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";d.style.textAlign=
+"right";b=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});b.className="geBtn";a.editor.cancelFirst&&d.appendChild(b);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){var n=document.createElement("input");n.setAttribute("multiple","multiple");n.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(n,
+"change",function(b){a.importFiles(n.files,0,0,a.maxImageSize,function(a,b,c,d,g,e){k(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var q=mxUtils.button(mxResources.get("open"),function(){n.click()});q.className="geBtn";d.appendChild(q)}}document.createElement("canvas").getContext&&"data:image/"==m.value.substring(0,11)&&"data:image/svg"!=m.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,
+m.value,function(a){m.value=a});a.showDialog(b.container,200,180,!0,!0);b.init()}),q.className="geBtn",d.appendChild(q));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(q=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),
+q.className="geBtn",d.appendChild(q),null!=a.drive&&"1"==urlParams.photos&&(q=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
+a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),q.className="geBtn",d.appendChild(q)));mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&k(m.value)});q=mxUtils.button(mxResources.get("apply"),function(){k(m.value)});q.className="geBtn gePrimaryBtn";d.appendChild(q);a.editor.cancelFirst||d.appendChild(b);Graph.fileSupport&&(d.style.marginTop="120px",l.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",l.style.backgroundPosition=
+"center 65%",l.style.backgroundRepeat="no-repeat",b=document.createElement("div"),b.style.position="absolute",b.style.width="420px",b.style.top="58%",b.style.textAlign="center",b.style.fontSize="18px",b.style.color="#a0c3ff",mxUtils.write(b,mxResources.get("dragImagesHere")),l.appendChild(b));l.appendChild(d);this.container=l},LinkDialog=function(a,b,d,c,e){function f(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";
+b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);A.appendChild(c)}var h=document.createElement("div");mxUtils.write(h,mxResources.get("editLink")+":");var l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";mxClient.IS_VML||(l.style.paddingRight="20px");var m=document.createElement("input");
+m.setAttribute("placeholder",mxResources.get("dragUrlsHere"));m.setAttribute("type","text");m.style.marginTop="6px";m.style.width="400px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";var g=document.createElement("div");g.setAttribute("title",mxResources.get("reset"));g.style.position="relative";g.style.left="-16px";g.style.width="12px";g.style.height="14px";g.style.cursor="pointer";
+g.style.display=mxClient.IS_VML?"inline":"inline-block";g.style.top=(mxClient.IS_VML?0:3)+"px";g.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(g,"click",function(){m.value="";m.focus()});var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","current-linkdialog");var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";
+n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name","current-linkdialog");var q=document.createElement("select");q.style.width="380px";if(e&&null!=a.pages){null!=b&&a.editor.graph.isPageLink(b)?(n.setAttribute("checked","checked"),n.defaultChecked=!0):(m.setAttribute("value",b),k.setAttribute("checked","checked"),k.defaultChecked=!0);m.style.width="380px";l.appendChild(k);l.appendChild(m);l.appendChild(g);mxUtils.br(l);l.appendChild(n);e=!1;for(g=0;g<a.pages.length;g++){var t=
+document.createElement("option");mxUtils.write(t,a.pages[g].getName()||mxResources.get("pageWithNumber",[g+1]));t.setAttribute("value","data:page/id,"+a.pages[g].getId());b==t.getAttribute("value")&&(t.setAttribute("selected","selected"),e=!0);q.appendChild(t)}if(!e&&n.checked){var p=document.createElement("option");mxUtils.write(p,mxResources.get("pageNotFound"));p.setAttribute("disabled","disabled");p.setAttribute("selected","selected");p.setAttribute("value","pageNotFound");q.appendChild(p);mxEvent.addListener(q,
+"change",function(){null==p.parentNode||p.selected||p.parentNode.removeChild(p)})}l.appendChild(q)}else m.setAttribute("value",b),l.appendChild(m),l.appendChild(g);h.appendChild(l);var w=mxUtils.button(d,function(){a.hideDialog();c(n.checked?"pageNotFound"!==q.value?q.value:b:m.value,LinkDialog.selectedDocs)});w.style.verticalAlign="middle";w.className="geBtn gePrimaryBtn";this.init=function(){n.checked?q.focus():(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
+m.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){k.removeAttribute("checked");n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(m,"focus",function(){n.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});if(Graph.fileSupport){var b=h.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",
+mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(m.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),k.setAttribute("checked","checked"),k.checked=!0,w.click());a.stopPropagation();a.preventDefault()}),!1)}};var A=document.createElement("div");
+A.style.marginTop="20px";A.style.textAlign="right";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&A.appendChild(d);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b=
+"https://"+b+"/#G"+a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?(b=DriveClient.prototype.newAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);m.value=b;m.focus()}else LinkDialog.selectedDocs=null;m.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&f(IMAGE_PATH+"/google-drive-logo.svg",
+mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=gapi.auth.getToken().access_token,c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),g=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),
+b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(d).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
+a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&f(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){m.value=a[0].link;m.focus()}})});null!=a.oneDrive&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){m.value=b.value[0].webUrl;
+m.focus()})});null!=a.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],d=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+b+"/"+c+"/blob/"+d+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),c(n.checked?q.value:m.value,LinkDialog.selectedDocs))});A.appendChild(w);a.editor.cancelFirst||A.appendChild(d);h.appendChild(A);this.container=
+h},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(d.setAttribute("width","176"),d.setAttribute("height","219"),d.style.width="170px",d.style.height="219px",d.setAttribute("src",IMAGE_PATH+
+"/logo-flat.png"));b.appendChild(d);mxUtils.br(b);d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color="#505050";b.appendChild(d);mxUtils.br(b);mxUtils.br(b);d=document.createElement("small");d.style.color="#505050";d.innerHTML='&copy; 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';b.appendChild(d);mxEvent.addListener(b,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=
+b},FeedbackDialog=function(a){var b=document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";b.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");b.appendChild(d);var c=document.createElement("input");c.setAttribute("type","text");c.style.marginTop="6px";c.style.width="600px";var e=mxUtils.button(mxResources.get("sendMessage"),
+function(){var b=(h.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(c.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+m.value+b),
+function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});e.className="geBtn gePrimaryBtn";e.setAttribute("disabled","disabled");var f=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;mxEvent.addListener(c,"change",
+function(){0<c.value.length&&0<f.test(c.value)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")});mxEvent.addListener(c,"keyup",function(){0<c.value.length&&f.test(c.value)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")});b.appendChild(c);this.init=function(){c.focus()};var h=document.createElement("input");h.setAttribute("type","checkbox");h.setAttribute("checked","checked");h.defaultChecked=!0;d=document.createElement("p");d.style.marginTop="14px";d.appendChild(h);
+var l=document.createElement("span");mxUtils.write(l," "+mxResources.get("includeCopyOfMyDiagram"));d.appendChild(l);mxEvent.addListener(l,"click",function(a){h.checked=!h.checked;mxEvent.consume(a)});b.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("feedback"));b.appendChild(d);var m=document.createElement("textarea");m.style.resize="none";m.style.width="600px";m.style.height="140px";m.style.marginTop="6px";m.setAttribute("placeholder",mxResources.get("commentsNotes"));
b.appendChild(m);d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right";l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst?(d.appendChild(l),d.appendChild(e)):(d.appendChild(e),d.appendChild(l));b.appendChild(d);this.container=b};FeedbackDialog.maxAttachmentSize=1E6;
-var RevisionDialog=function(a,b,d){var c=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));c.appendChild(e);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";c.appendChild(f);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.left="199px";k.style.width="470px";k.style.height=
-"376px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);c.appendChild(k);var l=new Graph(k);l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;var m=0,g=null,h=0,n=l.getGlobalVariable;l.getGlobalVariable=function(a){return"page"==a&&null!=g&&null!=g[h]?g[h].getAttribute("name"):"pagenumber"==a?h+1:n.apply(this,arguments)};l.getLinkForCell=function(){return null};Editor.MathJaxRender&&
-l.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(l.container)}));var q=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),t=a.getCurrentFile(),p=null,v=null,y=null,x=null,u=mxUtils.button("",function(){null!=y&&l.zoomIn()});u.className="geSprite geSprite-zoomin";u.setAttribute("title",mxResources.get("zoomIn"));
-u.style.outline="none";u.style.border="none";u.style.margin="2px";u.setAttribute("disabled","disabled");mxUtils.setOpacity(u,20);var A=mxUtils.button("",function(){null!=y&&l.zoomOut()});A.className="geSprite geSprite-zoomout";A.setAttribute("title",mxResources.get("zoomOut"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var z=mxUtils.button("",function(){null!=y&&(l.maxFitScale=8,l.fit(8),l.center())});z.className=
-"geSprite geSprite-fit";z.setAttribute("title",mxResources.get("fit"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var w=mxUtils.button("",function(){null!=y&&(l.zoomActual(),l.center())});w.className="geSprite geSprite-actualsize";w.setAttribute("title",mxResources.get("actualSize"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var B=
-document.createElement("div");B.style.position="absolute";B.style.textAlign="right";B.style.color="gray";B.style.marginTop="10px";B.style.backgroundColor="transparent";B.style.top="440px";B.style.right="32px";B.style.maxWidth="380px";B.style.cursor="default";var G=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(y.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
-(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});G.className="geBtn";G.setAttribute("disabled","disabled");var C=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=x&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(x):a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();
-a.replaceFileData(x);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});C.className="geBtn";C.setAttribute("disabled","disabled");var E=document.createElement("select");E.setAttribute("disabled","disabled");E.style.maxWidth="80px";E.style.position="relative";E.style.top="-2px";E.style.verticalAlign="bottom";E.style.marginRight="6px";E.style.display="none";var H=null;mxEvent.addListener(E,"change",function(a){null!=
-H&&(H(a),mxEvent.consume(a))});var D=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),window.openWindow(a.getUrl()))});D.className="geBtn";D.setAttribute("disabled","disabled");null!=d&&(D.style.display="none");var F=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl())});F.className="geBtn gePrimaryBtn";F.setAttribute("disabled",
-"disabled");null!=d&&(F.style.display="none",C.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.padding="2px";I.style.border="none";I.style.left="199px";I.style.top="442px";var J=null;if(null!=b&&0<b.length){k.style.cursor="move";var R=document.createElement("table");R.style.border=
-"1px solid lightGray";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var S=document.createElement("tbody"),O=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var T=b.length-1;0<=T;T--){var L=function(c){var d=new Date(c.modifiedDate),e=null;if(0<=d.getTime()){var n=function(b){q.stop();var c=mxUtils.parseXml(b),n=a.editor.extractGraphModel(c.documentElement,!0);if(null!=n){var f=function(b){null!=b&&(b=
-p(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},p=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};E.style.display="none";E.innerHTML="";y=c;x=b;g=parseSelectFunction=null;h=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");g=[];for(b=0;b<c.length;b++)g.push(c[b]);
-h=Math.min(m,g.length-1);0<g.length&&f(g[h]);if(1<g.length)for(E.removeAttribute("disabled"),E.style.display="",b=0;b<g.length;b++)c=document.createElement("option"),mxUtils.write(c,g[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==h&&c.setAttribute("selected","selected"),E.appendChild(c);H=function(){h=m=parseInt(E.value);f(g[m])}}else p(n);B.innerHTML="";mxUtils.write(B,d.toLocaleDateString()+" "+d.toLocaleTimeString());B.setAttribute("title",e.getAttribute("title"));
-u.removeAttribute("disabled");A.removeAttribute("disabled");z.removeAttribute("disabled");w.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&C.removeAttribute("disabled"),G.removeAttribute("disabled"),F.removeAttribute("disabled"),D.removeAttribute("disabled"));mxUtils.setOpacity(u,60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(w,60)}else E.style.display="none",E.innerHTML="",B.innerHTML="",mxUtils.write(B,mxResources.get("errorLoadingFile"))},
+var RevisionDialog=function(a,b,d){var c=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));c.appendChild(e);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";c.appendChild(f);var h=document.createElement("div");h.style.position="absolute";h.style.border="1px solid lightGray";h.style.left="199px";h.style.width="470px";h.style.height=
+"376px";h.style.overflow="hidden";mxEvent.disableContextMenu(h);c.appendChild(h);var l=new Graph(h);l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;var m=0,g=null,k=0,n=l.getGlobalVariable;l.getGlobalVariable=function(a){return"page"==a&&null!=g&&null!=g[k]?g[k].getAttribute("name"):"pagenumber"==a?k+1:n.apply(this,arguments)};l.getLinkForCell=function(){return null};Editor.MathJaxRender&&
+l.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(l.container)}));var q=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),t=a.getCurrentFile(),p=null,w=null,A=null,z=null,u=mxUtils.button("",function(){null!=A&&l.zoomIn()});u.className="geSprite geSprite-zoomin";u.setAttribute("title",mxResources.get("zoomIn"));
+u.style.outline="none";u.style.border="none";u.style.margin="2px";u.setAttribute("disabled","disabled");mxUtils.setOpacity(u,20);var x=mxUtils.button("",function(){null!=A&&l.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var y=mxUtils.button("",function(){null!=A&&(l.maxFitScale=8,l.fit(8),l.center())});y.className=
+"geSprite geSprite-fit";y.setAttribute("title",mxResources.get("fit"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");mxUtils.setOpacity(y,20);var v=mxUtils.button("",function(){null!=A&&(l.zoomActual(),l.center())});v.className="geSprite geSprite-actualsize";v.setAttribute("title",mxResources.get("actualSize"));v.style.outline="none";v.style.border="none";v.style.margin="2px";v.setAttribute("disabled","disabled");mxUtils.setOpacity(v,20);var B=
+document.createElement("div");B.style.position="absolute";B.style.textAlign="right";B.style.color="gray";B.style.marginTop="10px";B.style.backgroundColor="transparent";B.style.top="440px";B.style.right="32px";B.style.maxWidth="380px";B.style.cursor="default";var H=mxUtils.button(mxResources.get("download"),function(){if(null!=A){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(A.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
+(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});H.className="geBtn";H.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("restore"),function(){null!=A&&null!=z&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(z):a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();
+a.replaceFileData(z);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});D.className="geBtn";D.setAttribute("disabled","disabled");var E=document.createElement("select");E.setAttribute("disabled","disabled");E.style.maxWidth="80px";E.style.position="relative";E.style.top="-2px";E.style.verticalAlign="bottom";E.style.marginRight="6px";E.style.display="none";var G=null;mxEvent.addListener(E,"change",function(a){null!=
+G&&(G(a),mxEvent.consume(a))});var C=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=A&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(A.documentElement)),window.openWindow(a.getUrl()))});C.className="geBtn";C.setAttribute("disabled","disabled");null!=d&&(C.style.display="none");var F=mxUtils.button(mxResources.get("show"),function(){null!=w&&a.openLink(w.getUrl())});F.className="geBtn gePrimaryBtn";F.setAttribute("disabled",
+"disabled");null!=d&&(F.style.display="none",D.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.padding="2px";I.style.border="none";I.style.left="199px";I.style.top="442px";var K=null;if(null!=b&&0<b.length){h.style.cursor="move";var P=document.createElement("table");P.style.border=
+"1px solid lightGray";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var S=document.createElement("tbody"),O=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var R=b.length-1;0<=R;R--){var M=function(c){var d=new Date(c.modifiedDate),e=null;if(0<=d.getTime()){var n=function(b){q.stop();var c=mxUtils.parseXml(b),n=a.editor.extractGraphModel(c.documentElement,!0);if(null!=n){var f=function(b){null!=b&&(b=
+p(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},p=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};E.style.display="none";E.innerHTML="";A=c;z=b;g=parseSelectFunction=null;k=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");g=[];for(b=0;b<c.length;b++)g.push(c[b]);
+k=Math.min(m,g.length-1);0<g.length&&f(g[k]);if(1<g.length)for(E.removeAttribute("disabled"),E.style.display="",b=0;b<g.length;b++)c=document.createElement("option"),mxUtils.write(c,g[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==k&&c.setAttribute("selected","selected"),E.appendChild(c);G=function(){k=m=parseInt(E.value);f(g[m])}}else p(n);B.innerHTML="";mxUtils.write(B,d.toLocaleDateString()+" "+d.toLocaleTimeString());B.setAttribute("title",e.getAttribute("title"));
+u.removeAttribute("disabled");x.removeAttribute("disabled");y.removeAttribute("disabled");v.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&D.removeAttribute("disabled"),H.removeAttribute("disabled"),F.removeAttribute("disabled"),C.removeAttribute("disabled"));mxUtils.setOpacity(u,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(y,60);mxUtils.setOpacity(v,60)}else E.style.display="none",E.innerHTML="",B.innerHTML="",mxUtils.write(B,mxResources.get("errorLoadingFile"))},
e=document.createElement("tr");e.style.borderBottom="1px solid lightGray";e.style.fontSize="12px";e.style.cursor="pointer";var f=document.createElement("td");f.style.padding="6px";f.style.whiteSpace="nowrap";c==b[b.length-1]?mxUtils.write(f,mxResources.get("current")):d.toDateString()===O?mxUtils.write(f,d.toLocaleTimeString()):mxUtils.write(f,d.toLocaleDateString()+" "+d.toLocaleTimeString());e.appendChild(f);e.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+
-(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){v!=c&&(q.stop(),null!=p&&(p.style.backgroundColor=""),v=c,p=e,p.style.backgroundColor="#ebf2f9",x=y=null,B.removeAttribute("title"),B.innerHTML=mxResources.get("loading")+"...",k.style.backgroundColor="#ffffff",l.getModel().clear(),C.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),w.setAttribute("disabled",
-"disabled"),z.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(u,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(w,20),q.spin(k),c.getXml(function(a){v==c&&n(a)},function(a){q.stop();E.style.display="none";E.innerHTML="";B.innerHTML="";mxUtils.write(B,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){F.click();
-window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);S.appendChild(e)}return e}(b[T]);null!=L&&T==b.length-1&&(J=L)}R.appendChild(S);f.appendChild(R)}else null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==window.DropboxFile?(k.style.display="none",I.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(k.style.display="none",I.style.display="none",mxUtils.write(f,
-mxResources.get("noRevisions")));this.init=function(){null!=J&&J.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";I.appendChild(E);I.appendChild(u);I.appendChild(A);I.appendChild(w);I.appendChild(z);a.editor.cancelFirst?(e.appendChild(f),e.appendChild(G),e.appendChild(D),e.appendChild(C),e.appendChild(F)):(e.appendChild(G),e.appendChild(D),e.appendChild(C),e.appendChild(F),e.appendChild(f));c.appendChild(e);c.appendChild(I);c.appendChild(B);this.container=
-c},DraftDialog=function(a,b,d,c,e,f,k,l){var m=document.createElement("div"),g=document.createElement("div");g.style.marginTop="0px";g.style.whiteSpace="nowrap";g.style.overflow="auto";mxUtils.write(g,b);m.appendChild(g);var h=document.createElement("div");h.style.position="absolute";h.style.border="1px solid lightGray";h.style.marginTop="10px";h.style.width="640px";h.style.top="46px";h.style.bottom="74px";h.style.overflow="hidden";mxEvent.disableContextMenu(h);m.appendChild(h);var n=new Graph(h);
-n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;b=mxUtils.parseXml(d);var q=a.editor.extractGraphModel(b.documentElement,!0),t=0,p=null,v=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=p&&null!=p[t]?p[t].getAttribute("name"):"pagenumber"==a?t+1:v.apply(this,arguments)};n.getLinkForCell=function(){return null};b=mxUtils.button("",function(){n.zoomIn()});b.className=
+(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){w!=c&&(q.stop(),null!=p&&(p.style.backgroundColor=""),w=c,p=e,p.style.backgroundColor="#ebf2f9",z=A=null,B.removeAttribute("title"),B.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",l.getModel().clear(),D.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),v.setAttribute("disabled",
+"disabled"),y.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(u,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(y,20),mxUtils.setOpacity(v,20),q.spin(h),c.getXml(function(a){w==c&&n(a)},function(a){q.stop();E.style.display="none";E.innerHTML="";B.innerHTML="";mxUtils.write(B,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){F.click();
+window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);S.appendChild(e)}return e}(b[R]);null!=M&&R==b.length-1&&(K=M)}P.appendChild(S);f.appendChild(P)}else null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==window.DropboxFile?(h.style.display="none",I.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(h.style.display="none",I.style.display="none",mxUtils.write(f,
+mxResources.get("noRevisions")));this.init=function(){null!=K&&K.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";I.appendChild(E);I.appendChild(u);I.appendChild(x);I.appendChild(v);I.appendChild(y);a.editor.cancelFirst?(e.appendChild(f),e.appendChild(H),e.appendChild(C),e.appendChild(D),e.appendChild(F)):(e.appendChild(H),e.appendChild(C),e.appendChild(D),e.appendChild(F),e.appendChild(f));c.appendChild(e);c.appendChild(I);c.appendChild(B);this.container=
+c},DraftDialog=function(a,b,d,c,e,f,h,l){var m=document.createElement("div"),g=document.createElement("div");g.style.marginTop="0px";g.style.whiteSpace="nowrap";g.style.overflow="auto";mxUtils.write(g,b);m.appendChild(g);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.marginTop="10px";k.style.width="640px";k.style.top="46px";k.style.bottom="74px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);m.appendChild(k);var n=new Graph(k);
+n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;b=mxUtils.parseXml(d);var q=a.editor.extractGraphModel(b.documentElement,!0),t=0,p=null,w=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=p&&null!=p[t]?p[t].getAttribute("name"):"pagenumber"==a?t+1:w.apply(this,arguments)};n.getLinkForCell=function(){return null};b=mxUtils.button("",function(){n.zoomIn()});b.className=
"geSprite geSprite-zoomin";b.setAttribute("title",mxResources.get("zoomIn"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);d=mxUtils.button("",function(){n.zoomOut()});d.className="geSprite geSprite-zoomout";d.setAttribute("title",mxResources.get("zoomOut"));d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);g=mxUtils.button("",function(){n.maxFitScale=8;n.fit(8);n.center()});g.className="geSprite geSprite-fit";g.setAttribute("title",
-mxResources.get("fit"));g.style.outline="none";g.style.border="none";g.style.margin="2px";mxUtils.setOpacity(g,60);var y=mxUtils.button("",function(){n.zoomActual();n.center()});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";mxUtils.setOpacity(y,60);e=mxUtils.button(k||mxResources.get("discard"),e);e.className="geBtn";var x=document.createElement("select");x.style.maxWidth="80px";x.style.position=
-"relative";x.style.top="-2px";x.style.verticalAlign="bottom";x.style.marginRight="6px";x.style.display="none";c=mxUtils.button(f||mxResources.get("edit"),c);c.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.width="640px";f.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
-this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(x,"change",function(a){t=parseInt(x.value);c(p[t]);mxEvent.consume(a)});if("mxfile"==q.nodeName){var d=q.getElementsByTagName("diagram");
-p=[];for(var g=0;g<d.length;g++)p.push(d[g]);0<p.length&&c(p[t]);if(1<p.length)for(x.style.display="",g=0;g<p.length;g++)d=document.createElement("option"),mxUtils.write(d,p[g].getAttribute("name")||mxResources.get("pageWithNumber",[g+1])),d.setAttribute("value",g),g==t&&d.setAttribute("selected","selected"),x.appendChild(d)}else b(q)};k.appendChild(x);k.appendChild(b);k.appendChild(d);k.appendChild(y);k.appendChild(g);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className=
-"geBtn";l=null!=l?mxUtils.button(mxResources.get("ignore"),l):null;null!=l&&(l.className="geBtn");a.editor.cancelFirst?(f.appendChild(b),null!=l&&f.appendChild(l),f.appendChild(e),f.appendChild(c)):(f.appendChild(c),f.appendChild(e),null!=l&&f.appendChild(l),f.appendChild(b));m.appendChild(f);m.appendChild(k);this.container=m},FindWindow=function(a,b,d,c,e){function f(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var d=0;d<b.length;d++)if("label"!=b[d].nodeName){var g=
-mxUtils.trim(b[d].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,c.length)===c||null!=a&&a.test(g))return!0}}return!1}function k(){var a=m.model.getDescendants(m.model.getRoot()),b=q.value.toLowerCase(),c=t.checked?new RegExp(b):null,d=null;g!=b&&(g=b,h=null);var e=null==h;if(0<b.length)for(var n=0;n<a.length;n++){var k=m.view.getState(a[n]);if(null!=k&&null!=k.cell.value&&(e||null==d)&&(m.model.isVertex(k.cell)||m.model.isEdge(k.cell))&&(m.isHtmlLabel(k.cell)?
-(p.innerHTML=m.getLabel(k.cell),label=mxUtils.extractTextWithWhitespace([p])):label=m.getLabel(k.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||f(c,k.cell,b))||null!=c&&(c.test(label)||f(c,k.cell,b))))if(e){d=k;break}else null==d&&(d=k);e=e||k==h}null!=d?(h=d,m.scrollCellToVisible(h.cell),m.isEnabled()?m.setSelectionCell(h.cell):m.highlightCell(h.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d}
-var l=a.actions.get("find"),m=a.editor.graph,g=null,h=null,n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var q=document.createElement("input");q.setAttribute("placeholder",mxResources.get("find"));q.setAttribute("type","text");q.style.marginTop="4px";q.style.marginBottom="6px";q.style.width="170px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";n.appendChild(q);var t=document.createElement("input");
-t.setAttribute("type","checkbox");n.appendChild(t);mxUtils.write(n,mxResources.get("regularExpression"));var p=document.createElement("div");mxUtils.br(n);var v=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";g=h=null;q.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.style.backgroundColor="#f5f5f5";v.style.backgroundImage="none";v.className="geBtn";n.appendChild(v);v=mxUtils.button(mxResources.get("find"),
-function(){try{q.style.backgroundColor=k()?"":"#ffcfcf"}catch(y){a.handleError(y)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.style.backgroundColor="#4d90fe";v.style.backgroundImage="none";v.className="geBtn gePrimaryBtn";n.appendChild(v);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)l.funct();else if(g!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=k()?"":"#ffcfcf"}catch(x){q.style.backgroundColor=
+mxResources.get("fit"));g.style.outline="none";g.style.border="none";g.style.margin="2px";mxUtils.setOpacity(g,60);var A=mxUtils.button("",function(){n.zoomActual();n.center()});A.className="geSprite geSprite-actualsize";A.setAttribute("title",mxResources.get("actualSize"));A.style.outline="none";A.style.border="none";A.style.margin="2px";mxUtils.setOpacity(A,60);e=mxUtils.button(h||mxResources.get("discard"),e);e.className="geBtn";var z=document.createElement("select");z.style.maxWidth="80px";z.style.position=
+"relative";z.style.top="-2px";z.style.verticalAlign="bottom";z.style.marginRight="6px";z.style.display="none";c=mxUtils.button(f||mxResources.get("edit"),c);c.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.width="640px";f.style.textAlign="right";h=document.createElement("div");h.className="geToolbarContainer";h.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
+this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(z,"change",function(a){t=parseInt(z.value);c(p[t]);mxEvent.consume(a)});if("mxfile"==q.nodeName){var d=q.getElementsByTagName("diagram");
+p=[];for(var g=0;g<d.length;g++)p.push(d[g]);0<p.length&&c(p[t]);if(1<p.length)for(z.style.display="",g=0;g<p.length;g++)d=document.createElement("option"),mxUtils.write(d,p[g].getAttribute("name")||mxResources.get("pageWithNumber",[g+1])),d.setAttribute("value",g),g==t&&d.setAttribute("selected","selected"),z.appendChild(d)}else b(q)};h.appendChild(z);h.appendChild(b);h.appendChild(d);h.appendChild(A);h.appendChild(g);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className=
+"geBtn";l=null!=l?mxUtils.button(mxResources.get("ignore"),l):null;null!=l&&(l.className="geBtn");a.editor.cancelFirst?(f.appendChild(b),null!=l&&f.appendChild(l),f.appendChild(e),f.appendChild(c)):(f.appendChild(c),f.appendChild(e),null!=l&&f.appendChild(l),f.appendChild(b));m.appendChild(f);m.appendChild(h);this.container=m},FindWindow=function(a,b,d,c,e){function f(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var d=0;d<b.length;d++)if("label"!=b[d].nodeName){var g=
+mxUtils.trim(b[d].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,c.length)===c||null!=a&&a.test(g))return!0}}return!1}function h(){var a=m.model.getDescendants(m.model.getRoot()),b=q.value.toLowerCase(),c=t.checked?new RegExp(b):null,d=null;g!=b&&(g=b,k=null);var e=null==k;if(0<b.length)for(var n=0;n<a.length;n++){var h=m.view.getState(a[n]);if(null!=h&&null!=h.cell.value&&(e||null==d)&&(m.model.isVertex(h.cell)||m.model.isEdge(h.cell))&&(m.isHtmlLabel(h.cell)?
+(p.innerHTML=m.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([p])):label=m.getLabel(h.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||f(c,h.cell,b))||null!=c&&(c.test(label)||f(c,h.cell,b))))if(e){d=h;break}else null==d&&(d=h);e=e||h==k}null!=d?(k=d,m.scrollCellToVisible(k.cell),m.isEnabled()?m.setSelectionCell(k.cell):m.highlightCell(k.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d}
+var l=a.actions.get("find"),m=a.editor.graph,g=null,k=null,n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var q=document.createElement("input");q.setAttribute("placeholder",mxResources.get("find"));q.setAttribute("type","text");q.style.marginTop="4px";q.style.marginBottom="6px";q.style.width="170px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";n.appendChild(q);var t=document.createElement("input");
+t.setAttribute("type","checkbox");n.appendChild(t);mxUtils.write(n,mxResources.get("regularExpression"));var p=document.createElement("div");mxUtils.br(n);var w=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";g=k=null;q.focus()});w.setAttribute("title",mxResources.get("reset"));w.style.marginTop="6px";w.style.marginRight="4px";w.style.backgroundColor="#f5f5f5";w.style.backgroundImage="none";w.className="geBtn";n.appendChild(w);w=mxUtils.button(mxResources.get("find"),
+function(){try{q.style.backgroundColor=h()?"":"#ffcfcf"}catch(A){a.handleError(A)}});w.setAttribute("title",mxResources.get("find")+" (Enter)");w.style.marginTop="6px";w.style.backgroundColor="#4d90fe";w.style.backgroundImage="none";w.className="geBtn gePrimaryBtn";n.appendChild(w);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)l.funct();else if(g!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=h()?"":"#ffcfcf"}catch(z){q.style.backgroundColor=
"#ffcfcf"}});mxEvent.addListener(n,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(l.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),n,b,d,c,e,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
-q.select():document.execCommand("selectAll",!1,null)):m.container.focus()}))},TagsWindow=function(a,b,d,c,e){function f(a){a=null!=a?a:l.model.getDescendants(l.model.getRoot());for(var b=h.value.split(" "),c=[],d=0;d<a.length;d++)if(l.model.isVertex(a[d])||l.model.isEdge(a[d])){var g=null!=a[d].value&&"object"==typeof a[d].value?mxUtils.trim(a[d].value.getAttribute(m)||""):"",e=!0;if(0<g.length)for(var g=g.toLowerCase().split(" "),n=0;n<b.length&&e;n++)var f=mxUtils.trim(b[n]).toLowerCase(),e=e&&
-(0==f.length||0<=mxUtils.indexOf(g,f));else e=0==mxUtils.trim(h.value).length;e&&c.push(a[d])}return c}function k(a,b){l.model.beginUpdate();try{for(var c=0;c<a.length;c++)l.model.setVisible(a[c],b)}finally{l.model.endUpdate()}}var l=a.editor.graph,m="tags",g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var h=document.createElement("input");h.setAttribute("placeholder",mxResources.get("allTags"));h.setAttribute("type",
-"text");h.style.marginTop="4px";h.style.width="260px";h.style.fontSize="12px";h.style.borderRadius="4px";h.style.padding="6px";g.appendChild(h);mxEvent.addListener(h,"dblclick",function(){var b=new FilenameDialog(a,m,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(m=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});h.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(g);var n=mxUtils.button(mxResources.get("hide"),
-function(){k(f(),!1)});n.setAttribute("title",mxResources.get("hide"));n.style.marginTop="8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className="geBtn";g.appendChild(n);n=mxUtils.button(mxResources.get("show"),function(){var a=f();k(a,!0);l.isEnabled()&&l.setSelectionCells(a)});n.setAttribute("title",mxResources.get("show"));n.style.marginTop="8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className=
-"geBtn";g.appendChild(n);var q=a.actions.get("tags"),n=mxUtils.button(mxResources.get("close"),function(){q.funct()});n.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");n.style.marginTop="8px";n.style.backgroundColor="#4d90fe";n.style.backgroundImage="none";n.className="geBtn gePrimaryBtn";g.appendChild(n);mxEvent.addListener(h,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||q.funct()});this.window=new mxWindow(mxResources.get("tags"),g,b,d,c,e,!0,!0);this.window.destroyOnClose=!1;
-this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(h.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?h.select():document.execCommand("selectAll",!1,null)):l.container.focus()}))},AuthDialog=function(a,b,d,c){var e=document.createElement("div");e.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding=
-"0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("authorizationRequired"));var k="Unknown",l=document.createElement("img");l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.marginRight="10px";b==a.drive?(k=mxResources.get("googleDrive"),l.src=IMAGE_PATH+"/google-drive-logo-white.svg"):b==a.dropbox?(k=mxResources.get("dropbox"),l.src=IMAGE_PATH+"/dropbox-logo-white.svg"):b==a.oneDrive?(k=mxResources.get("oneDrive"),l.src=IMAGE_PATH+"/onedrive-logo-white.svg"):
-b==a.gitHub?(k=mxResources.get("github"),l.src=IMAGE_PATH+"/github-logo-white.svg"):b==a.trello&&(k=mxResources.get("trello"),l.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[k]));var m=document.createElement("input");m.setAttribute("type","checkbox");k=mxUtils.button(mxResources.get("authorize"),function(){c(m.checked)});k.insertBefore(l,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";e.appendChild(f);e.appendChild(a);
-e.appendChild(k);d&&(d=document.createElement("p"),d.style.marginTop="20px",d.appendChild(m),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberMe")),d.appendChild(f),e.appendChild(d),m.checked=!0,m.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)}));this.container=e},MoreShapesDialog=function(a,b,d){d=null!=d?d:a.sidebar.entries;var c=document.createElement("div");if(b){b=document.createElement("div");b.className="geDialogTitle";
+q.select():document.execCommand("selectAll",!1,null)):m.container.focus()}))},TagsWindow=function(a,b,d,c,e){function f(a){a=null!=a?a:l.model.getDescendants(l.model.getRoot());for(var b=k.value.split(" "),c=[],d=0;d<a.length;d++)if(l.model.isVertex(a[d])||l.model.isEdge(a[d])){var g=null!=a[d].value&&"object"==typeof a[d].value?mxUtils.trim(a[d].value.getAttribute(m)||""):"",e=!0;if(0<g.length)for(var g=g.toLowerCase().split(" "),n=0;n<b.length&&e;n++)var f=mxUtils.trim(b[n]).toLowerCase(),e=e&&
+(0==f.length||0<=mxUtils.indexOf(g,f));else e=0==mxUtils.trim(k.value).length;e&&c.push(a[d])}return c}function h(a,b){l.model.beginUpdate();try{for(var c=0;c<a.length;c++)l.model.setVisible(a[c],b)}finally{l.model.endUpdate()}}var l=a.editor.graph,m="tags",g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var k=document.createElement("input");k.setAttribute("placeholder",mxResources.get("allTags"));k.setAttribute("type",
+"text");k.style.marginTop="4px";k.style.width="260px";k.style.fontSize="12px";k.style.borderRadius="4px";k.style.padding="6px";g.appendChild(k);mxEvent.addListener(k,"dblclick",function(){var b=new FilenameDialog(a,m,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(m=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});k.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(g);var n=mxUtils.button(mxResources.get("hide"),
+function(){h(f(),!1)});n.setAttribute("title",mxResources.get("hide"));n.style.marginTop="8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className="geBtn";g.appendChild(n);n=mxUtils.button(mxResources.get("show"),function(){var a=f();h(a,!0);l.isEnabled()&&l.setSelectionCells(a)});n.setAttribute("title",mxResources.get("show"));n.style.marginTop="8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className=
+"geBtn";g.appendChild(n);var q=a.actions.get("tags"),n=mxUtils.button(mxResources.get("close"),function(){q.funct()});n.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");n.style.marginTop="8px";n.style.backgroundColor="#4d90fe";n.style.backgroundImage="none";n.className="geBtn gePrimaryBtn";g.appendChild(n);mxEvent.addListener(k,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||q.funct()});this.window=new mxWindow(mxResources.get("tags"),g,b,d,c,e,!0,!0);this.window.destroyOnClose=!1;
+this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null)):l.container.focus()}))},AuthDialog=function(a,b,d,c){var e=document.createElement("div");e.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding=
+"0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("authorizationRequired"));var h="Unknown",l=document.createElement("img");l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.marginRight="10px";b==a.drive?(h=mxResources.get("googleDrive"),l.src=IMAGE_PATH+"/google-drive-logo-white.svg"):b==a.dropbox?(h=mxResources.get("dropbox"),l.src=IMAGE_PATH+"/dropbox-logo-white.svg"):b==a.oneDrive?(h=mxResources.get("oneDrive"),l.src=IMAGE_PATH+"/onedrive-logo-white.svg"):
+b==a.gitHub?(h=mxResources.get("github"),l.src=IMAGE_PATH+"/github-logo-white.svg"):b==a.trello&&(h=mxResources.get("trello"),l.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[h]));var m=document.createElement("input");m.setAttribute("type","checkbox");h=mxUtils.button(mxResources.get("authorize"),function(){c(m.checked)});h.insertBefore(l,h.firstChild);h.style.marginTop="6px";h.className="geBigButton";e.appendChild(f);e.appendChild(a);
+e.appendChild(h);d&&(d=document.createElement("p"),d.style.marginTop="20px",d.appendChild(m),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberMe")),d.appendChild(f),e.appendChild(d),m.checked=!0,m.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)}));this.container=e},MoreShapesDialog=function(a,b,d){d=null!=d?d:a.sidebar.entries;var c=document.createElement("div");if(b){b=document.createElement("div");b.className="geDialogTitle";
mxUtils.write(b,mxResources.get("shapes"));b.style.position="absolute";b.style.top="0px";b.style.left="0px";b.style.lineHeight="40px";b.style.height="40px";b.style.right="0px";mxClient.IS_QUIRKS&&(b.style.width="718px");var e=document.createElement("div"),f=document.createElement("div");e.style.position="absolute";e.style.top="40px";e.style.left="0px";e.style.width="202px";e.style.bottom="60px";e.style.overflow="auto";mxClient.IS_QUIRKS&&(e.style.height="437px",e.style.marginTop="1px");f.style.position=
-"absolute";f.style.left="202px";f.style.right="0px";f.style.top="40px";f.style.bottom="60px";f.style.overflow="auto";f.style.borderLeft="1px solid rgb(211, 211, 211)";f.style.textAlign="center";mxClient.IS_QUIRKS&&(f.style.width=parseInt(b.style.width)-202+"px",f.style.height=e.style.height,f.style.marginTop=e.style.marginTop);var k=null,l=[],m=document.createElement("div");m.style.position="relative";m.style.left="0px";m.style.right="0px";for(var g=0;g<d.length;g++)(function(b){var c=m.cloneNode(!1);
-c.style.fontWeight="bold";c.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,b.title);e.appendChild(c);for(var d=0;d<b.entries.length;d++)(function(b){var c=m.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";var h=document.createElement("input");h.setAttribute("type","checkbox");h.checked=a.sidebar.isEntryVisible(b.id);h.defaultChecked=h.checked;c.appendChild(h);mxUtils.write(c," "+b.title);e.appendChild(c);var n=
-function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCallback?b.imageCallback(f):null!=b.image?f.innerHTML='<img border="0" src="'+b.image+'"/>':(f.innerHTML="<br>",mxUtils.write(f,mxResources.get("noPreview"))),null!=k&&(k.style.backgroundColor=""),k=c,k.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(c,"click",n);mxEvent.addListener(c,"dblclick",function(a){h.checked=!h.checked;mxEvent.consume(a)});l.push(function(){return h.checked?
-b.id:null});0==g&&0==d&&n()})(b.entries[d])})(d[g]);c.style.padding="30px";c.appendChild(b);c.appendChild(e);c.appendChild(f);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=b.style.width,d.style.paddingTop="12px");var h=document.createElement("input");h.setAttribute("type",
-"checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)b=document.createElement("span"),b.style.paddingRight="20px",b.appendChild(h),mxUtils.write(b," "+mxResources.get("rememberThisSetting")),h.checked=!0,h.defaultChecked=!0,mxEvent.addListener(b,"click",function(a){mxEvent.getSource(a)!=h&&(h.checked=!h.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.top="-6px"),d.appendChild(b);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className=
-"geBtn";var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],c=0;c<l.length;c++){var d=l[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),h.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var q=document.createElement("table"),t=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";var p=document.createElement("tr");q.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),v=document.createElement("td"),
-y=mxUtils.bind(this,function(b,c,d){var g=document.createElement("input");g.type="checkbox";q.appendChild(g);g.checked=a.sidebar.isEntryVisible(d);var h=document.createElement("span");mxUtils.write(h,c);c=document.createElement("div");c.style.display="block";c.appendChild(g);c.appendChild(h);mxEvent.addListener(h,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return g.checked?d:null}});p.appendChild(b);p.appendChild(n);p.appendChild(v);t.appendChild(p);
-q.appendChild(t);for(var l=[],x=0,g=0;g<d.length;g++)for(t=0;t<d[g].entries.length;t++)x++;for(var u=[b,n,v],A=0,g=0;g<d.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];l.push(y(u[Math.floor(A/(x/3))],c.title,c.id));A++}})(d[g]);c.appendChild(q);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";h=document.createElement("input");isLocalStorage&&(h.setAttribute("type","checkbox"),h.checked=!0,h.defaultChecked=!0,d.appendChild(h),b=document.createElement("span"),
-mxUtils.write(b," "+mxResources.get("rememberThisSetting")),d.appendChild(b),mxEvent.addListener(b,"click",function(a){h.checked=!h.checked;mxEvent.consume(a)}));c.appendChild(d);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<l.length;c++){var d=l[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(0<b.length?b.join(";"):"",h.checked);a.hideDialog()});n.className=
-"geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(b),d.appendChild(n)):(d.appendChild(n),d.appendChild(b));c.appendChild(d);this.container=c},PluginsDialog=function(a){function b(){if(0==e.length)c.innerHTML=mxResources.get("noPlugins");else{c.innerHTML="";for(var d=0;d<e.length;d++){var h=document.createElement("span");h.style.whiteSpace="nowrap";var n=document.createElement("span");n.className="geSprite geSprite-delete";
-n.style.position="relative";n.style.cursor="pointer";n.style.top="5px";n.style.marginRight="4px";n.style.display="inline-block";h.appendChild(n);mxUtils.write(h,e[d]);c.appendChild(h);mxUtils.br(c);mxEvent.addListener(n,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[c]+'"?',function(){e.splice(c,1);b()})}}(d))}}}var d=document.createElement("div"),c=document.createElement("div");c.style.height="120px";c.style.overflow="auto";var e=mxSettings.getPlugins().slice();
+"absolute";f.style.left="202px";f.style.right="0px";f.style.top="40px";f.style.bottom="60px";f.style.overflow="auto";f.style.borderLeft="1px solid rgb(211, 211, 211)";f.style.textAlign="center";mxClient.IS_QUIRKS&&(f.style.width=parseInt(b.style.width)-202+"px",f.style.height=e.style.height,f.style.marginTop=e.style.marginTop);var h=null,l=[],m=document.createElement("div");m.style.position="relative";m.style.left="0px";m.style.right="0px";for(var g=0;g<d.length;g++)(function(b){var c=m.cloneNode(!1);
+c.style.fontWeight="bold";c.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,b.title);e.appendChild(c);for(var d=0;d<b.entries.length;d++)(function(b){var c=m.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";var k=document.createElement("input");k.setAttribute("type","checkbox");k.checked=a.sidebar.isEntryVisible(b.id);k.defaultChecked=k.checked;c.appendChild(k);mxUtils.write(c," "+b.title);e.appendChild(c);var n=
+function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCallback?b.imageCallback(f):null!=b.image?f.innerHTML='<img border="0" src="'+b.image+'"/>':(f.innerHTML="<br>",mxUtils.write(f,mxResources.get("noPreview"))),null!=h&&(h.style.backgroundColor=""),h=c,h.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(c,"click",n);mxEvent.addListener(c,"dblclick",function(a){k.checked=!k.checked;mxEvent.consume(a)});l.push(function(){return k.checked?
+b.id:null});0==g&&0==d&&n()})(b.entries[d])})(d[g]);c.style.padding="30px";c.appendChild(b);c.appendChild(e);c.appendChild(f);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=b.style.width,d.style.paddingTop="12px");var k=document.createElement("input");k.setAttribute("type",
+"checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)b=document.createElement("span"),b.style.paddingRight="20px",b.appendChild(k),mxUtils.write(b," "+mxResources.get("rememberThisSetting")),k.checked=!0,k.defaultChecked=!0,mxEvent.addListener(b,"click",function(a){mxEvent.getSource(a)!=k&&(k.checked=!k.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.top="-6px"),d.appendChild(b);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className=
+"geBtn";var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],c=0;c<l.length;c++){var d=l[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),k.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var q=document.createElement("table"),t=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";var p=document.createElement("tr");q.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),w=document.createElement("td"),
+A=mxUtils.bind(this,function(b,c,d){var g=document.createElement("input");g.type="checkbox";q.appendChild(g);g.checked=a.sidebar.isEntryVisible(d);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");c.style.display="block";c.appendChild(g);c.appendChild(k);mxEvent.addListener(k,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return g.checked?d:null}});p.appendChild(b);p.appendChild(n);p.appendChild(w);t.appendChild(p);
+q.appendChild(t);for(var l=[],z=0,g=0;g<d.length;g++)for(t=0;t<d[g].entries.length;t++)z++;for(var u=[b,n,w],x=0,g=0;g<d.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];l.push(A(u[Math.floor(x/(z/3))],c.title,c.id));x++}})(d[g]);c.appendChild(q);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,d.appendChild(k),b=document.createElement("span"),
+mxUtils.write(b," "+mxResources.get("rememberThisSetting")),d.appendChild(b),mxEvent.addListener(b,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)}));c.appendChild(d);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<l.length;c++){var d=l[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(0<b.length?b.join(";"):"",k.checked);a.hideDialog()});n.className=
+"geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(b),d.appendChild(n)):(d.appendChild(n),d.appendChild(b));c.appendChild(d);this.container=c},PluginsDialog=function(a){function b(){if(0==e.length)c.innerHTML=mxResources.get("noPlugins");else{c.innerHTML="";for(var d=0;d<e.length;d++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var n=document.createElement("span");n.className="geSprite geSprite-delete";
+n.style.position="relative";n.style.cursor="pointer";n.style.top="5px";n.style.marginRight="4px";n.style.display="inline-block";k.appendChild(n);mxUtils.write(k,e[d]);c.appendChild(k);mxUtils.br(c);mxEvent.addListener(n,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[c]+'"?',function(){e.splice(c,1);b()})}}(d))}}}var d=document.createElement("div"),c=document.createElement("div");c.style.height="120px";c.style.overflow="auto";var e=mxSettings.getPlugins().slice();
d.appendChild(c);b();var f=mxUtils.button(mxResources.get("add"),function(){var c="",d=urlParams.p;if(null!=d&&0<d.length){for(var n=d.split(";"),d=0;d<n.length;d++){var f=App.pluginRegistry[n[d]];null!=f&&(c+=f+";")}";"==c.charAt(c.length-1)&&(c=c.substring(0,c.length-1))}c=new FilenameDialog(a,c,mxResources.get("add"),function(a){if(null!=a&&0<a.length){n=a.split(";");for(a=0;a<n.length;a++)0<n[a].length&&0>mxUtils.indexOf(e,n[a])&&e.push(n[a]);b()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+
-")");a.showDialog(c.container,300,80,!0,!0);c.init()});f.className="geBtn";var k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";var l=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(e);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});l.className="geBtn gePrimaryBtn";var m=document.createElement("div");m.style.marginTop="14px";m.style.textAlign="right";a.editor.cancelFirst?(m.appendChild(k),m.appendChild(f),
-m.appendChild(l)):(m.appendChild(f),m.appendChild(l),m.appendChild(k));d.appendChild(m);this.container=d},CropImageDialog=function(a,b,d){var c=document.createElement("div"),e=document.createElement("table"),f=document.createElement("tbody"),k=document.createElement("tr"),l=document.createElement("td");l.style.whiteSpace="nowrap";l.setAttribute("colspan","2");mxUtils.write(l,mxResources.get("loading")+"...");k.appendChild(l);f.appendChild(k);var k=document.createElement("tr"),m=document.createElement("td"),
-g=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var h=document.createElement("input");h.setAttribute("type","text");h.style.width="100px";h.value="0";this.init=function(){h.focus();h.select()};g.appendChild(h);k.appendChild(m);k.appendChild(g);f.appendChild(k);k=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type",
-"text");n.style.width="100px";n.value="0";g.appendChild(n);k.appendChild(m);k.appendChild(g);f.appendChild(k);k=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("right")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value="0";g.appendChild(q);k.appendChild(m);k.appendChild(g);f.appendChild(k);k=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");
-mxUtils.write(m,mxResources.get("bottom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";g.appendChild(t);k.appendChild(m);k.appendChild(g);f.appendChild(k);k=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("circle")+":");k.appendChild(m);var p=document.createElement("input");p.setAttribute("type","checkbox");g.appendChild(p);k.appendChild(g);f.appendChild(k);e.appendChild(f);
-c.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,y=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),c=b.getContext("2d"),g=v.width,e=v.height,f=parseInt(h.value),k=parseInt(n.value),g=Math.max(1,g-f-parseInt(q.value)),e=Math.max(1,e-k-parseInt(t.value));b.width=g;b.height=e;p.checked&&(c.fillStyle="#000000",c.arc(g/2,e/2,Math.min(g/2,e/2),0,2*Math.PI),c.fill(),c.globalCompositeOperation=
-"source-in");c.drawImage(v,f,k,g,e,0,0,g,e);d(b.toDataURL())});y.setAttribute("disabled","disabled");v.onload=function(){y.removeAttribute("disabled");l.innerHTML="";mxUtils.write(l,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+": "+v.height)};v.src=b;mxEvent.addListener(c,"keypress",function(a){13==a.keyCode&&y.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(y)):(b.appendChild(y),
-b.appendChild(e));c.appendChild(b);this.container=c},EditGeometryDialog=function(a,b){var d=a.editor.graph,c=1==b.length?d.getCellGeometry(b[0]):null,e=document.createElement("div"),f=document.createElement("table"),k=document.createElement("tbody"),l=document.createElement("tr"),m=document.createElement("td"),g=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var h=document.createElement("input");h.setAttribute("type","text");h.style.width="100px";
-h.value=null!=c?c.x:"";this.init=function(){h.focus();h.select()};g.appendChild(h);l.appendChild(m);l.appendChild(g);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=c?c.y:"";g.appendChild(n);l.appendChild(m);l.appendChild(g);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");
-g=document.createElement("td");mxUtils.write(m,mxResources.get("width")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=c?c.width:"";g.appendChild(q);l.appendChild(m);l.appendChild(g);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("height")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=
-c?c.height:"";g.appendChild(t);l.appendChild(m);l.appendChild(g);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("rotation")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=1==b.length?mxUtils.getValue(d.getCellStyle(b[0]),mxConstants.STYLE_ROTATION,0):"";g.appendChild(p);l.appendChild(m);l.appendChild(g);k.appendChild(l);f.appendChild(k);e.appendChild(f);
-var c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var c=0;c<b.length;c++){var g=d.getCellGeometry(b[c]);null!=g&&(g=g.clone(),d.isCellMovable(b[c])&&(0<mxUtils.trim(h.value).length&&(g.x=Number(h.value)),0<mxUtils.trim(n.value).length&&(g.y=Number(n.value))),d.isCellResizable(b[c])&&(0<mxUtils.trim(q.value).length&&(g.width=Number(q.value)),0<mxUtils.trim(t.value).length&&
-(g.height=Number(t.value))),d.getModel().setGeometry(b[c],g));0<mxUtils.trim(p.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(p.value),[b[c]])}}finally{d.getModel().endUpdate()}});mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&v.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(c),f.appendChild(v)):(f.appendChild(v),f.appendChild(c));e.appendChild(f);this.container=e},LibraryDialog=function(a,
-b,d,c,e,f){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=t;)a=a.parentNode;var b=null;if(null!=a)for(var c=t.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function l(b,c,d,g,e,n,f,q,m){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=f||null==v[b]){var x=function(){C.innerHTML="";C.style.cursor="pointer";C.style.whiteSpace="nowrap";C.style.textOverflow="ellipsis";mxUtils.write(C,null!=E.title&&0<E.title.length?E.title:mxResources.get("untitled"));
-C.style.color=null==E.title||0==E.title.length?"#d0d0d0":""};t.style.backgroundImage="";p.style.display="none";var D=e,w=n;if(e>a.maxImageSize||n>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,n));e*=B;n*=B}D>w?(w=Math.round(100*w/D),D=100):(D=Math.round(100*D/w),w=100);var F=document.createElement("div");F.setAttribute("draggable","true");F.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";F.style.position="relative";F.style.cursor="move";
-mxUtils.setPrefixedStyle(F.style,"transition","transform .1s ease-in-out");if(null!=b){var J=document.createElement("img");J.setAttribute("src",A.convert(b));J.style.width=D+"px";J.style.height=w+"px";J.style.margin="10px";J.style.paddingBottom=Math.floor((100-w)/2)+"px";J.style.paddingLeft=Math.floor((100-D)/2)+"px";F.appendChild(J)}else if(null!=f){var G=a.stringToCells(a.editor.graph.decompress(f.xml));0<G.length&&(a.sidebar.createThumb(G,100,100,F,null,!0,!1),F.firstChild.style.display=mxClient.IS_QUIRKS?
-"inline":"inline-block",F.firstChild.style.cursor="")}var I=document.createElement("img");I.setAttribute("src",Editor.closeImage);I.setAttribute("border","0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.marginLeft="-22px";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});null==b&&null!=f&&(I.style.position="relative");(function(a,b,c){mxEvent.addListener(I,"click",function(d){v[b]=null;for(var g=
-0;g<h.length;g++)if(null!=h[g].data&&h[g].data==b||null!=h[g].xml&&null!=c&&h[g].xml==c.xml){h.splice(g,1);break}F.parentNode.removeChild(a);0==h.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",p.style.display="");mxEvent.consume(d)});mxEvent.addListener(I,"dblclick",function(a){mxEvent.consume(a)})})(F,b,f);F.appendChild(I);F.style.marginBottom="30px";var C=document.createElement("div");C.style.position="absolute";C.style.boxSizing="border-box";C.style.bottom="-18px";C.style.left=
-"10px";C.style.right="10px";C.style.backgroundColor="#ffffff";C.style.overflow="hidden";C.style.textAlign="center";var E=null;null!=b?(E={data:b,w:e,h:n,title:m},null!=q&&(E.aspect=q),v[b]=J,h.push(E)):null!=f&&(f.aspect="fixed",h.push(f),E=f);mxEvent.addListener(C,"keydown",function(a){13==a.keyCode&&null!=u&&(u(),u=null,mxEvent.consume(a))});x();F.appendChild(C);mxEvent.addListener(C,"mousedown",function(a){"true"!=C.getAttribute("contentEditable")&&mxEvent.consume(a)});G=function(b){if(mxClient.IS_IOS||
-mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,E.title||"",mxResources.get("ok"),function(a){null!=a&&(E.title=a,x())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=C.getAttribute("contentEditable")){null!=u&&(u(),u=null);if(null==E.title||0==E.title.length)C.innerHTML="";C.style.textOverflow="";C.style.whiteSpace="";C.style.cursor="text";C.style.color="";C.setAttribute("contentEditable",
-"true");C.focus();document.execCommand("selectAll",!1,null);u=function(){C.removeAttribute("contentEditable");C.style.cursor="pointer";E.title=C.innerHTML;x()};mxEvent.consume(b)}};mxEvent.addListener(C,"click",G);mxEvent.addListener(F,"dblclick",G);t.appendChild(F);mxEvent.addListener(F,"dragstart",function(a){null==b&&null!=f&&(I.style.visibility="hidden",C.style.visibility="hidden");mxClient.IS_FF&&null!=f.xml&&a.dataTransfer.setData("Text",f.xml);y=k(a);mxClient.IS_GC&&(F.style.opacity="0.9");
-window.setTimeout(function(){mxUtils.setPrefixedStyle(F.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(F,30);I.style.visibility="";C.style.visibility=""},0)});mxEvent.addListener(F,"dragend",function(a){"hidden"==I.style.visibility&&(I.style.visibility="",C.style.visibility="");y=null;mxUtils.setOpacity(F,100);mxUtils.setPrefixedStyle(F.style,"transform",null)})}else z||(z=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),D=mxUtils.parseXml(b),"mxlibrary"==
-D.documentElement.nodeName){w=JSON.parse(mxUtils.getTextContent(D.documentElement));if(null!=w&&0<w.length)for(var H=0;H<w.length;H++)null!=w[H].xml?l(null,null,0,0,0,0,w[H]):l(w[H].data,null,0,0,w[H].w,w[H].h,null,"fixed",w[H].title);e=!0}else if("mxfile"==D.documentElement.nodeName){for(var R=D.documentElement.getElementsByTagName("diagram"),H=0;H<R.length;H++){var w=mxUtils.getTextContent(R[H]),G=a.stringToCells(a.editor.graph.decompress(w)),M=a.editor.graph.getBoundingBoxFromGeometry(G);l(null,
-null,0,0,0,0,{xml:w,w:M.width,h:M.height})}e=!0}}catch(X){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(X){}return null}function m(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function g(b){b.stopPropagation();b.preventDefault();z=!1;x=k(b);if(null!=y)null!=x&&x<t.children.length?(h.splice(x>y?x-1:x,0,h.splice(y,1)[0]),t.insertBefore(t.children[y],t.children[x])):(h.push(h.splice(y,1)[0]),t.appendChild(t.children[y]));
-else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,w(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){l(c,null,0,0,a.width,a.height);t.scrollTop=t.scrollHeight})}b.stopPropagation();b.preventDefault()}var h=[];d=document.createElement("div");
+")");a.showDialog(c.container,300,80,!0,!0);c.init()});f.className="geBtn";var h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";var l=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(e);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});l.className="geBtn gePrimaryBtn";var m=document.createElement("div");m.style.marginTop="14px";m.style.textAlign="right";a.editor.cancelFirst?(m.appendChild(h),m.appendChild(f),
+m.appendChild(l)):(m.appendChild(f),m.appendChild(l),m.appendChild(h));d.appendChild(m);this.container=d},CropImageDialog=function(a,b,d){var c=document.createElement("div"),e=document.createElement("table"),f=document.createElement("tbody"),h=document.createElement("tr"),l=document.createElement("td");l.style.whiteSpace="nowrap";l.setAttribute("colspan","2");mxUtils.write(l,mxResources.get("loading")+"...");h.appendChild(l);f.appendChild(h);var h=document.createElement("tr"),m=document.createElement("td"),
+g=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";this.init=function(){k.focus();k.select()};g.appendChild(k);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type",
+"text");n.style.width="100px";n.value="0";g.appendChild(n);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("right")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value="0";g.appendChild(q);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");
+mxUtils.write(m,mxResources.get("bottom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";g.appendChild(t);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("circle")+":");h.appendChild(m);var p=document.createElement("input");p.setAttribute("type","checkbox");g.appendChild(p);h.appendChild(g);f.appendChild(h);e.appendChild(f);
+c.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),w=new Image,A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),c=b.getContext("2d"),g=w.width,e=w.height,f=parseInt(k.value),h=parseInt(n.value),g=Math.max(1,g-f-parseInt(q.value)),e=Math.max(1,e-h-parseInt(t.value));b.width=g;b.height=e;p.checked&&(c.fillStyle="#000000",c.arc(g/2,e/2,Math.min(g/2,e/2),0,2*Math.PI),c.fill(),c.globalCompositeOperation=
+"source-in");c.drawImage(w,f,h,g,e,0,0,g,e);d(b.toDataURL())});A.setAttribute("disabled","disabled");w.onload=function(){A.removeAttribute("disabled");l.innerHTML="";mxUtils.write(l,mxResources.get("width")+": "+w.width+" "+mxResources.get("height")+": "+w.height)};w.src=b;mxEvent.addListener(c,"keypress",function(a){13==a.keyCode&&A.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(A)):(b.appendChild(A),
+b.appendChild(e));c.appendChild(b);this.container=c},EditGeometryDialog=function(a,b){var d=a.editor.graph,c=1==b.length?d.getCellGeometry(b[0]):null,e=document.createElement("div"),f=document.createElement("table"),h=document.createElement("tbody"),l=document.createElement("tr"),m=document.createElement("td"),g=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";
+k.value=null!=c?c.x:"";this.init=function(){k.focus();k.select()};g.appendChild(k);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=c?c.y:"";g.appendChild(n);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");
+g=document.createElement("td");mxUtils.write(m,mxResources.get("width")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=c?c.width:"";g.appendChild(q);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("height")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=
+c?c.height:"";g.appendChild(t);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("rotation")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=1==b.length?mxUtils.getValue(d.getCellStyle(b[0]),mxConstants.STYLE_ROTATION,0):"";g.appendChild(p);l.appendChild(m);l.appendChild(g);h.appendChild(l);f.appendChild(h);e.appendChild(f);
+var c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),w=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var c=0;c<b.length;c++){var g=d.getCellGeometry(b[c]);null!=g&&(g=g.clone(),d.isCellMovable(b[c])&&(0<mxUtils.trim(k.value).length&&(g.x=Number(k.value)),0<mxUtils.trim(n.value).length&&(g.y=Number(n.value))),d.isCellResizable(b[c])&&(0<mxUtils.trim(q.value).length&&(g.width=Number(q.value)),0<mxUtils.trim(t.value).length&&
+(g.height=Number(t.value))),d.getModel().setGeometry(b[c],g));0<mxUtils.trim(p.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(p.value),[b[c]])}}finally{d.getModel().endUpdate()}});mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&w.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(c),f.appendChild(w)):(f.appendChild(w),f.appendChild(c));e.appendChild(f);this.container=e},LibraryDialog=function(a,
+b,d,c,e,f){function h(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=t;)a=a.parentNode;var b=null;if(null!=a)for(var c=t.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function l(b,c,d,g,e,n,f,q,m){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=f||null==w[b]){var z=function(){D.innerHTML="";D.style.cursor="pointer";D.style.whiteSpace="nowrap";D.style.textOverflow="ellipsis";mxUtils.write(D,null!=E.title&&0<E.title.length?E.title:mxResources.get("untitled"));
+D.style.color=null==E.title||0==E.title.length?"#d0d0d0":""};t.style.backgroundImage="";p.style.display="none";var v=e,C=n;if(e>a.maxImageSize||n>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,n));e*=B;n*=B}v>C?(C=Math.round(100*C/v),v=100):(v=Math.round(100*v/C),C=100);var F=document.createElement("div");F.setAttribute("draggable","true");F.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";F.style.position="relative";F.style.cursor="move";
+mxUtils.setPrefixedStyle(F.style,"transition","transform .1s ease-in-out");if(null!=b){var I=document.createElement("img");I.setAttribute("src",x.convert(b));I.style.width=v+"px";I.style.height=C+"px";I.style.margin="10px";I.style.paddingBottom=Math.floor((100-C)/2)+"px";I.style.paddingLeft=Math.floor((100-v)/2)+"px";F.appendChild(I)}else if(null!=f){var K=a.stringToCells(a.editor.graph.decompress(f.xml));0<K.length&&(a.sidebar.createThumb(K,100,100,F,null,!0,!1),F.firstChild.style.display=mxClient.IS_QUIRKS?
+"inline":"inline-block",F.firstChild.style.cursor="")}var H=document.createElement("img");H.setAttribute("src",Editor.closeImage);H.setAttribute("border","0");H.setAttribute("title",mxResources.get("delete"));H.setAttribute("align","top");H.style.paddingTop="4px";H.style.marginLeft="-22px";H.style.cursor="pointer";mxEvent.addListener(H,"dragstart",function(a){mxEvent.consume(a)});null==b&&null!=f&&(H.style.position="relative");(function(a,b,c){mxEvent.addListener(H,"click",function(d){w[b]=null;for(var g=
+0;g<k.length;g++)if(null!=k[g].data&&k[g].data==b||null!=k[g].xml&&null!=c&&k[g].xml==c.xml){k.splice(g,1);break}F.parentNode.removeChild(a);0==k.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",p.style.display="");mxEvent.consume(d)});mxEvent.addListener(H,"dblclick",function(a){mxEvent.consume(a)})})(F,b,f);F.appendChild(H);F.style.marginBottom="30px";var D=document.createElement("div");D.style.position="absolute";D.style.boxSizing="border-box";D.style.bottom="-18px";D.style.left=
+"10px";D.style.right="10px";D.style.backgroundColor="#ffffff";D.style.overflow="hidden";D.style.textAlign="center";var E=null;null!=b?(E={data:b,w:e,h:n,title:m},null!=q&&(E.aspect=q),w[b]=I,k.push(E)):null!=f&&(f.aspect="fixed",k.push(f),E=f);mxEvent.addListener(D,"keydown",function(a){13==a.keyCode&&null!=u&&(u(),u=null,mxEvent.consume(a))});z();F.appendChild(D);mxEvent.addListener(D,"mousedown",function(a){"true"!=D.getAttribute("contentEditable")&&mxEvent.consume(a)});K=function(b){if(mxClient.IS_IOS||
+mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,E.title||"",mxResources.get("ok"),function(a){null!=a&&(E.title=a,z())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=D.getAttribute("contentEditable")){null!=u&&(u(),u=null);if(null==E.title||0==E.title.length)D.innerHTML="";D.style.textOverflow="";D.style.whiteSpace="";D.style.cursor="text";D.style.color="";D.setAttribute("contentEditable",
+"true");D.focus();document.execCommand("selectAll",!1,null);u=function(){D.removeAttribute("contentEditable");D.style.cursor="pointer";E.title=D.innerHTML;z()};mxEvent.consume(b)}};mxEvent.addListener(D,"click",K);mxEvent.addListener(F,"dblclick",K);t.appendChild(F);mxEvent.addListener(F,"dragstart",function(a){null==b&&null!=f&&(H.style.visibility="hidden",D.style.visibility="hidden");mxClient.IS_FF&&null!=f.xml&&a.dataTransfer.setData("Text",f.xml);A=h(a);mxClient.IS_GC&&(F.style.opacity="0.9");
+window.setTimeout(function(){mxUtils.setPrefixedStyle(F.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(F,30);H.style.visibility="";D.style.visibility=""},0)});mxEvent.addListener(F,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",D.style.visibility="");A=null;mxUtils.setOpacity(F,100);mxUtils.setPrefixedStyle(F.style,"transform",null)})}else y||(y=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),v=mxUtils.parseXml(b),"mxlibrary"==
+v.documentElement.nodeName){C=JSON.parse(mxUtils.getTextContent(v.documentElement));if(null!=C&&0<C.length)for(var G=0;G<C.length;G++)null!=C[G].xml?l(null,null,0,0,0,0,C[G]):l(C[G].data,null,0,0,C[G].w,C[G].h,null,"fixed",C[G].title);e=!0}else if("mxfile"==v.documentElement.nodeName){for(var P=v.documentElement.getElementsByTagName("diagram"),G=0;G<P.length;G++){var C=mxUtils.getTextContent(P[G]),K=a.stringToCells(a.editor.graph.decompress(C)),Q=a.editor.graph.getBoundingBoxFromGeometry(K);l(null,
+null,0,0,0,0,{xml:C,w:Q.width,h:Q.height})}e=!0}}catch(Z){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(Z){}return null}function m(a){a.dataTransfer.dropEffect=null!=A?"move":"copy";a.stopPropagation();a.preventDefault()}function g(b){b.stopPropagation();b.preventDefault();y=!1;z=h(b);if(null!=A)null!=z&&z<t.children.length?(k.splice(z>A?z-1:z,0,k.splice(A,1)[0]),t.insertBefore(t.children[A],t.children[z])):(k.push(k.splice(A,1)[0]),t.appendChild(t.children[A]));
+else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,v(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){l(c,null,0,0,a.width,a.height);t.scrollTop=t.scrollHeight})}b.stopPropagation();b.preventDefault()}var k=[];d=document.createElement("div");
d.style.height="100%";var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="40px";d.appendChild(n);mxUtils.write(n,mxResources.get("filename")+":");null==b&&(b=a.defaultLibraryName+".xml");var q=document.createElement("input");q.setAttribute("value",b);q.style.marginRight="20px";q.style.marginLeft="10px";q.style.width="500px";null==e||e.isRenamable()||q.setAttribute("disabled","true");this.init=function(){if(null==e||e.isRenamable())q.focus(),mxClient.IS_GC||mxClient.IS_FF||
-5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};n.appendChild(q);var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle="solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==h.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var p=
-document.createElement("div");p.style.position="absolute";p.style.width="640px";p.style.top="260px";p.style.textAlign="center";p.style.fontSize="22px";p.style.color="#a0c3ff";mxUtils.write(p,mxResources.get("dragImagesHere"));d.appendChild(p);var v={},y=null,x=null,u=null;b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=u&&(u(),u=null,mxEvent.consume(a))};mxEvent.addListener(t,"mousedown",b);mxEvent.addListener(t,"pointerdown",b);mxEvent.addListener(t,"touchstart",
-b);var A=new mxUrlConverter,z=!1;if(null!=c)for(b=0;b<c.length;b++)n=c[b],l(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(t,"dragleave",function(a){p.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==t||b==p){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var w=function(b){return function(c,d,g,h,e,n,f,u,k){null!=k&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,k.name)?a.parseFile(k,mxUtils.bind(this,function(c){4==c.readyState&&
-(a.spinner.stop(),200<=c.status&&299>=c.status&&(l(c.responseText,d,g,h,e,n,f,"fixed",mxEvent.isAltDown(b)?null:f.substring(0,f.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(l(c,d,g,h,e,n,f,"fixed",mxEvent.isAltDown(b)?null:f.substring(0,f.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",m);mxEvent.addListener(t,"drop",g);mxEvent.addListener(p,"dragover",m);mxEvent.addListener(p,"drop",g);d.appendChild(t);c=document.createElement("div");
-c.style.textAlign="right";c.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(h),c=q.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,
-"_blank")});n.setAttribute("id","btnDownload");n.className="geBtn";c.appendChild(n);var B=document.createElement("input");B.setAttribute("multiple","multiple");B.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(B,"change",function(b){z=!1;a.importFiles(B.files,0,0,a.maxImageSize,function(a,c,d,g,h,e,n,f,u){w(b)(a,c,d,g,h,e,n,f,u);B.value=""});t.scrollTop=t.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=u&&(u(),u=null);B.click()}),n.setAttribute("id",
-"btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=u&&(u(),u=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){z=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}l(a,null,0,0,b,c);t.scrollTop=t.scrollHeight}})});n.setAttribute("id","btnAddImageUrl");n.className="geBtn";c.appendChild(n);this.saveBtnClickHandler=function(b,c,d,g){a.saveLibrary(b,
-c,d,g)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=u&&(u(),u=null);this.saveBtnClickHandler(q.value,h,e,f)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";c.appendChild(n);a.editor.cancelFirst||c.appendChild(b);d.appendChild(c);this.container=d},EditShapeDialog=function(a,b,d,c,e){c=null!=c?c:300;e=null!=e?e:120;var f,k,l=document.createElement("table"),m=document.createElement("tbody");l.style.cellPadding="4px";f=document.createElement("tr");k=
-document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,d);f.appendChild(k);m.appendChild(f);f=document.createElement("tr");k=document.createElement("td");var g=document.createElement("textarea");g.style.outline="none";g.style.resize="none";g.style.width=c-200+"px";g.style.height=e+"px";this.textarea=g;this.init=function(){g.focus();g.scrollTop=0};k.appendChild(g);f.appendChild(k);k=document.createElement("td");d=document.createElement("div");d.style.position=
-"relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=e+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);k.appendChild(d);var h=new Graph(d);h.setEnabled(!1);var n=a.editor.graph.cloneCells([b])[0];h.addCells([n]);d=h.view.getState(n);var q="";null!=d.shape&&null!=d.shape.stencil&&(q=mxUtils.getPrettyXml(d.shape.stencil.desc));mxUtils.write(g,q||"");d=h.getGraphBounds();e=Math.min(160/d.width,(e-40)/d.height);h.view.scaleAndTranslate(e,
-20/e-d.x,20/e-d.y);f.appendChild(k);m.appendChild(f);f=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&k.appendChild(e);a.isOffline()||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
-d.className="geBtn",k.appendChild(d));var t=function(b,c,d){var h=g.value,e=mxUtils.parseXml(h),h=mxUtils.getPrettyXml(e.documentElement),e=e.documentElement.getElementsByTagName("parsererror");if(null!=e&&0<e.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),e=!b.model.contains(c),!d||e||h!=q){h=a.editor.graph.compress(h);b.getModel().beginUpdate();try{if(e){var n=a.editor.graph.getInsertPoint();c.geometry.x=n.x;
-c.geometry.y=n.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+h+")",[c])}catch(z){throw z;}finally{b.getModel().endUpdate()}e&&b.setSelectionCell(c)}};d=mxUtils.button(mxResources.get("preview"),function(){t(h,n,!1)});d.className="geBtn";k.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,b,!0)});d.className="geBtn gePrimaryBtn";k.appendChild(d);a.editor.cancelFirst||k.appendChild(e);f.appendChild(k);m.appendChild(f);l.appendChild(m);this.container=
-l},CustomDialog=function(a,b,d,c,e,f,k){var l=document.createElement("div");l.appendChild(b);b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="right";null!=k&&b.appendChild(k);k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c()});k.className="geBtn";a.editor.cancelFirst&&b.appendChild(k);if(!a.isOffline()&&null!=f){var m=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)});m.className="geBtn";b.appendChild(m)}e=mxUtils.button(e||
-mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});b.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(k);l.appendChild(b);this.cancelBtn=k;this.okButton=e;this.container=l};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
+5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};n.appendChild(q);var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle="solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==k.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var p=
+document.createElement("div");p.style.position="absolute";p.style.width="640px";p.style.top="260px";p.style.textAlign="center";p.style.fontSize="22px";p.style.color="#a0c3ff";mxUtils.write(p,mxResources.get("dragImagesHere"));d.appendChild(p);var w={},A=null,z=null,u=null;b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=u&&(u(),u=null,mxEvent.consume(a))};mxEvent.addListener(t,"mousedown",b);mxEvent.addListener(t,"pointerdown",b);mxEvent.addListener(t,"touchstart",
+b);var x=new mxUrlConverter,y=!1;if(null!=c)for(b=0;b<c.length;b++)n=c[b],l(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(t,"dragleave",function(a){p.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==t||b==p){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var v=function(b){return function(c,d,g,k,e,n,f,u,h){null!=h&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,h.name)?a.parseFile(h,mxUtils.bind(this,function(c){4==c.readyState&&
+(a.spinner.stop(),200<=c.status&&299>=c.status&&(l(c.responseText,d,g,k,e,n,f,"fixed",mxEvent.isAltDown(b)?null:f.substring(0,f.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(l(c,d,g,k,e,n,f,"fixed",mxEvent.isAltDown(b)?null:f.substring(0,f.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",m);mxEvent.addListener(t,"drop",g);mxEvent.addListener(p,"dragover",m);mxEvent.addListener(p,"drop",g);d.appendChild(t);c=document.createElement("div");
+c.style.textAlign="right";c.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(k),c=q.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,
+"_blank")});n.setAttribute("id","btnDownload");n.className="geBtn";c.appendChild(n);var B=document.createElement("input");B.setAttribute("multiple","multiple");B.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(B,"change",function(b){y=!1;a.importFiles(B.files,0,0,a.maxImageSize,function(a,c,d,g,k,e,n,f,u){v(b)(a,c,d,g,k,e,n,f,u);B.value=""});t.scrollTop=t.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=u&&(u(),u=null);B.click()}),n.setAttribute("id",
+"btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=u&&(u(),u=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){y=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}l(a,null,0,0,b,c);t.scrollTop=t.scrollHeight}})});n.setAttribute("id","btnAddImageUrl");n.className="geBtn";c.appendChild(n);this.saveBtnClickHandler=function(b,c,d,g){a.saveLibrary(b,
+c,d,g)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=u&&(u(),u=null);this.saveBtnClickHandler(q.value,k,e,f)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";c.appendChild(n);a.editor.cancelFirst||c.appendChild(b);d.appendChild(c);this.container=d},EditShapeDialog=function(a,b,d,c,e){c=null!=c?c:300;e=null!=e?e:120;var f,h,l=document.createElement("table"),m=document.createElement("tbody");l.style.cellPadding="4px";f=document.createElement("tr");h=
+document.createElement("td");h.setAttribute("colspan","2");h.style.fontSize="10pt";mxUtils.write(h,d);f.appendChild(h);m.appendChild(f);f=document.createElement("tr");h=document.createElement("td");var g=document.createElement("textarea");g.style.outline="none";g.style.resize="none";g.style.width=c-200+"px";g.style.height=e+"px";this.textarea=g;this.init=function(){g.focus();g.scrollTop=0};h.appendChild(g);f.appendChild(h);h=document.createElement("td");d=document.createElement("div");d.style.position=
+"relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=e+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);h.appendChild(d);var k=new Graph(d);k.setEnabled(!1);var n=a.editor.graph.cloneCells([b])[0];k.addCells([n]);d=k.view.getState(n);var q="";null!=d.shape&&null!=d.shape.stencil&&(q=mxUtils.getPrettyXml(d.shape.stencil.desc));mxUtils.write(g,q||"");d=k.getGraphBounds();e=Math.min(160/d.width,(e-40)/d.height);k.view.scaleAndTranslate(e,
+20/e-d.x,20/e-d.y);f.appendChild(h);m.appendChild(f);f=document.createElement("tr");h=document.createElement("td");h.setAttribute("colspan","2");h.style.paddingTop="2px";h.style.whiteSpace="nowrap";h.setAttribute("align","right");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&h.appendChild(e);a.isOffline()||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
+d.className="geBtn",h.appendChild(d));var t=function(b,c,d){var k=g.value,e=mxUtils.parseXml(k),k=mxUtils.getPrettyXml(e.documentElement),e=e.documentElement.getElementsByTagName("parsererror");if(null!=e&&0<e.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),e=!b.model.contains(c),!d||e||k!=q){k=a.editor.graph.compress(k);b.getModel().beginUpdate();try{if(e){var n=a.editor.graph.getInsertPoint();c.geometry.x=n.x;
+c.geometry.y=n.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+k+")",[c])}catch(y){throw y;}finally{b.getModel().endUpdate()}e&&b.setSelectionCell(c)}};d=mxUtils.button(mxResources.get("preview"),function(){t(k,n,!1)});d.className="geBtn";h.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,b,!0)});d.className="geBtn gePrimaryBtn";h.appendChild(d);a.editor.cancelFirst||h.appendChild(e);f.appendChild(h);m.appendChild(f);l.appendChild(m);this.container=
+l},CustomDialog=function(a,b,d,c,e,f,h){var l=document.createElement("div");l.appendChild(b);b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="right";null!=h&&b.appendChild(h);h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c()});h.className="geBtn";a.editor.cancelFirst&&b.appendChild(h);if(!a.isOffline()&&null!=f){var m=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)});m.className="geBtn";b.appendChild(m)}e=mxUtils.button(e||
+mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});b.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(h);l.appendChild(b);this.cancelBtn=h;this.okButton=e;this.container=l};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
IMAGE_PATH+"/spin.gif";Editor.tweetImage=IMAGE_PATH+"/tweet.png";Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.blankImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";Editor.hiResImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAh1BMVEUAAABMTExERERBQUFBQUFFRUVAQEBCQkJAQEA6OjpDQ0NKSkpBQUFBQUFERERERERBQUFCQkJCQkJCQkJJSUlBQUFCQkJDQ0NDQ0NCQkJDQ0NBQUFBQUFCQkJBQUFCQkJCQkJDQ0NCQkJHR0dBQUFCQkJCQkJAQEBCQkJDQ0NAQEBERERCQkIk1hS2AAAAKnRSTlMAAjj96BL7PgQFRwfu3TYazKuVjRXl1V1DPCn1uLGjnWNVIgy9hU40eGqPkM38AAACG0lEQVRYw+2X63KbMBCFzwZblgGDceN74muatpLe//m6MHV3gHGFAv2RjM94MAbxzdnVsQbBDKwH8AH8MDAyafzjqYeyOG04XE7RS8nIRDXg6BlT+rA0nmtAPh+NQRDxIASIMG44rAMrGunBgHwy3uUldxggIStGKp2f+DQc2O4h4eQsX3O2IFB/oEbsjOKbStnjAEA+zJ0ylZTbgvoDn8xNyn6Dbj5Kd4GsNpABa6duQPfSdEj88TgMAhKuCWjAkgmFXPLnsD0pWd3OFGdrMugQII/eOMPEiGOzqPMIeWrcSoMCg71W1pXBPvCP+gS/OdXqQ3uW23+93XGWLl/OaBb805bNcBPoEIcVJsnHzcxpZH86u5KZ9gDby5dQCcnKqdbke4ItI4Tzd7IW9hZQt4EO6GG9b9sYuuK9Wwn8TIr2xKbF2+3Nhr+qxChJ/AI6pIfCu4z4Zowp4ZUNihz79vewzctnHDwTvQO/hCdFBzrUGDOPn2Y/F8YKT4oOATLvlhOznzmBSdFBJWtc58y7r+UVFOCQczy3wpN6pegDqHtsCPTGvH9JuTO0Dyg8icldYPk+RB6g8Aofj4m2EKBvtTmUPD9xDd1pPcSReV2U5iD/ik2yrngtvvqBfPzOvKiDTKTsCdoHZJ7pLLffgTwlJ5vJdtJV2/jiAYaLvLGhMAEDO5QcDg2M/jOw/8Zn+K3ZwJvHT7ZffgC/NvA3zcybTeIfE4EAAAAASUVORK5CYII=":
@@ -6484,7 +6488,7 @@ c.parentNode.insertBefore(b,c),Editor.prototype.fontCss=a.fontCss);if(null!=a.pl
null!=d&&0<d.length&&(c=d[0]);throw{message:mxUtils.getTextContent(c)};}if("mxGraphModel"==b.nodeName){c=b.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=c&&""!=c)c!=this.graph.currentStyle&&(d=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+"/"+c+".xml").getDocumentElement(),null!=d&&(g=new mxCodec(d.ownerDocument),g.decode(d,this.graph.getStylesheet())));else if(d=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),
null!=d){var g=new mxCodec(d.ownerDocument);g.decode(d,this.graph.getStylesheet())}this.graph.currentStyle=c;this.graph.mathEnabled="1"==urlParams.math||"1"==b.getAttribute("math");c=b.getAttribute("backgroundImage");null!=c?(c=JSON.parse(c),this.graph.setBackgroundImage(new mxImage(c.src,c.width,c.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;this.graph.setShadowVisible("1"==b.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||
"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=b.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?
-"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(A){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==
+"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(x){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==
typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),d=[];if(null!=c&&0<c.length)for(var g=0;g<c.length;g++)if("mxgraph"==c[g].getAttribute("class")){d.push(c[g]);break}0<d.length&&(c=d[0].getAttribute("data-mxgraph"),null!=c?(d=JSON.parse(c),null!=d&&null!=d.xml&&(d=mxUtils.parseXml(d.xml),a=d.documentElement)):(d=d[0].getElementsByTagName("div"),0<d.length&&(c=mxUtils.getTextContent(d[0]),c=this.graph.decompress(c),0<c.length&&(d=mxUtils.parseXml(c),a=d.documentElement))))}if(null!=a&&
"svg"==a.nodeName)if(c=a.getAttribute("content"),null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)a=mxUtils.parseXml(c).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||b||(d=null,"diagram"==a.nodeName?d=a:"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),0<c.length&&(d=c[Math.max(0,Math.min(c.length-1,urlParams.page||0))])),null!=d&&
(c=this.graph.decompress(mxUtils.getTextContent(d)),null!=c&&0<c.length&&(a=mxUtils.parseXml(c).documentElement)));null==a||"mxGraphModel"==a.nodeName||b&&"mxfile"==a.nodeName||(a=null);return a};var d=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;d.apply(this,arguments)};Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
@@ -6493,17 +6497,17 @@ messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(b||{jax:["input/TeX
Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var c=Editor.prototype.init;Editor.prototype.init=function(){c.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,b){this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var d=document.getElementsByTagName("script");if(null!=d&&0<d.length){var g=
document.createElement("script");g.type="text/javascript";g.src=a;d[0].parentNode.appendChild(g)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;var b=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,
function(a,c,d,g){void 0!==c?b.push(c.replace(/\\'/g,"'")):void 0!==d?b.push(d.replace(/\\"/g,'"')):void 0!==g&&b.push(g);return""});/,\s*$/.test(a)&&b.push("");return b};if(window.ColorDialog){var e=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,b){e.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var f=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){f.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
-mxSettings.save()}}if(null!=window.StyleFormatPanel){var k=Format.prototype.init;Format.prototype.init=function(){k.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var l=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?l.apply(this,arguments):this.clear()};var m=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=m.apply(this,
+mxSettings.save()}}if(null!=window.StyleFormatPanel){var h=Format.prototype.init;Format.prototype.init=function(){h.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var l=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?l.apply(this,arguments):this.clear()};var m=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=m.apply(this,
arguments);if(mxClient.IS_SVG){var b=this.editorUi,c=b.editor.graph;a.appendChild(this.createOption(mxResources.get("shadow"),function(){return c.shadowVisible},function(a){var d=new ChangePageSetup(b);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;c.model.execute(d)},{install:function(a){this.listener=function(){a(c.shadowVisible)};b.addListener("shadowVisibleChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}}))}return a};var g=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=g.apply(this,arguments);var b=this.editorUi;if(b.editor.graph.isEnabled()){var c=b.getCurrentFile();null!=c&&c.isAutosaveOptional()&&(c=this.createOption(mxResources.get("autosave"),function(){return b.editor.autosave},function(a){b.editor.setAutosave(a)},{install:function(a){this.listener=function(){a(b.editor.autosave)};b.editor.addListener("autosaveChanged",this.listener)},destroy:function(){b.editor.removeListener(this.listener)}}),a.appendChild(c))}return a};
StyleFormatPanel.prototype.defaultColorSchemes=[[null,{fill:"#f5f5f5",stroke:"#666666"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[null,{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},
-{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];var h=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){"image"!=this.format.createSelectionState().style.shape&&
-this.container.appendChild(this.addStyles(this.createPanel()));h.apply(this,arguments)};var n=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var b=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));b.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";b.style.marginRight="2px";a.appendChild(b);
+{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];var k=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){"image"!=this.format.createSelectionState().style.shape&&
+this.container.appendChild(this.addStyles(this.createPanel()));k.apply(this,arguments)};var n=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var b=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));b.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";b.style.marginRight="2px";a.appendChild(b);
b=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));b.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";a.appendChild(b);mxUtils.br(a);return n.apply(this,arguments)};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){d.getModel().beginUpdate();try{var c=
-d.getSelectionCells();for(b=0;b<c.length;b++){for(var g=d.getModel().getStyle(c[b]),e=0;e<h.length;e++)g=mxUtils.removeStylename(g,h[e]);null!=a?(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,a.fill),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,a.stroke),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,"#000000"),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,
+d.getSelectionCells();for(b=0;b<c.length;b++){for(var g=d.getModel().getStyle(c[b]),e=0;e<k.length;e++)g=mxUtils.removeStylename(g,k[e]);null!=a?(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,a.fill),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,a.stroke),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,"#000000"),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,
null));d.getModel().setStyle(c[b],g)}}finally{d.getModel().endUpdate()}});b.className="geStyleButton";b.style.width="36px";b.style.height="30px";b.style.margin="0px 6px 6px 0px";null!=a?(null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?b.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":b.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":b.style.backgroundColor=
a.fill,b.style.border="1px solid "+a.stroke):(b.style.backgroundColor="#ffffff",b.style.border="1px solid #000000");g.appendChild(b)}g.innerHTML="";for(var c=0;c<a.length;c++)0<c&&0==mxUtils.mod(c,4)&&mxUtils.br(g),b(a[c])}function c(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var d=this.editorUi.editor.graph,g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.paddingLeft="24px";g.style.paddingRight=
-"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(g);var h="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var e=document.createElement("div");e.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
+"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(g);var k="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var e=document.createElement("div");e.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
mxEvent.addListener(e,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));var n=document.createElement("div");n.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
1<this.defaultColorSchemes.length&&(a.appendChild(e),a.appendChild(n));mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));c(e);c(n);b(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var b=this.format.getSelectionState(),c=null;1==this.editorUi.editor.graph.getSelectionCount()&&
(c=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),c.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),c.style.width="202px",c.style.marginBottom="2px",a.appendChild(c));var d=this.editorUi.editor.graph,g=d.view.getState(d.getSelectionCell());1==d.getSelectionCount()&&null!=g&&null!=g.shape&&null!=g.shape.stencil?(b=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
@@ -6513,10 +6517,10 @@ function(a){this.editorUi.actions.get("editShape").funct()})),b.setAttribute("ti
this.getInsertPoint=function(){return null!=b?this.getPointForEvent(b):c.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var b=this.graph.view.getState(a),b=null!=b?b.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==b.childLayout){var c=new mxStackLayout(this.graph,!1);c.setChildGeometry=function(a,b){b.height=Math.max(b.height,20);if(1<b.height/20){var c=b.height%20;b.height+=10<c?20-c:-c}this.graph.getModel().setGeometry(a,
b)};c.fill=!0;c.unitSize=mxRackContainer.unitSize|20;c.marginLeft=b.marginLeft||0;c.marginRight=b.marginRight||0;c.marginTop=b.marginTop||0;c.marginBottom=b.marginBottom||0;c.resizeParent=!1;return c}return d.apply(this,arguments)}};var t=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){t.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.highlightCell=function(a,
b,c){b=null!=b?b:mxConstants.DEFAULT_VALID_COLOR;c=null!=c?c:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),g=new mxCellHighlight(this,b,d,!1);g.highlight(a);window.setTimeout(function(){null!=g.shape&&(mxUtils.setPrefixedStyle(g.shape.node.style,"transition","all 1200ms ease-in-out"),g.shape.node.style.opacity=0);window.setTimeout(function(){g.destroy()},1200)},c)}};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;
-var d=a.ownerDocument,g=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"filter"):d.createElement("filter");g.setAttribute("id",this.shadowId);var h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):d.createElement("feGaussianBlur");h.setAttribute("in","SourceAlpha");h.setAttribute("stdDeviation",this.svgShadowBlur);h.setAttribute("result","blur");g.appendChild(h);h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feOffset"):d.createElement("feOffset");
-h.setAttribute("in","blur");h.setAttribute("dx",this.svgShadowSize);h.setAttribute("dy",this.svgShadowSize);h.setAttribute("result","offsetBlur");g.appendChild(h);h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feFlood"):d.createElement("feFlood");h.setAttribute("flood-color",this.svgShadowColor);h.setAttribute("flood-opacity",this.svgShadowOpacity);h.setAttribute("result","offsetColor");g.appendChild(h);h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feComposite"):
-d.createElement("feComposite");h.setAttribute("in","offsetColor");h.setAttribute("in2","offsetBlur");h.setAttribute("operator","in");h.setAttribute("result","offsetBlur");g.appendChild(h);h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feBlend"):d.createElement("feBlend");h.setAttribute("in","SourceGraphic");h.setAttribute("in2","offsetBlur");g.appendChild(h);h=a.getElementsByTagName("defs");0==h.length?(d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"defs"):d.createElement("defs"),
-null!=a.firstChild?a.insertBefore(d,a.firstChild):a.appendChild(d)):d=h[0];d.appendChild(g);c||((b||a.getElementsByTagName("g")[0]).setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6)));return g};Graph.prototype.setShadowVisible=function(a,b){mxClient.IS_SVG&&(b=null!=b?b:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter",
+var d=a.ownerDocument,g=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"filter"):d.createElement("filter");g.setAttribute("id",this.shadowId);var k=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):d.createElement("feGaussianBlur");k.setAttribute("in","SourceAlpha");k.setAttribute("stdDeviation",this.svgShadowBlur);k.setAttribute("result","blur");g.appendChild(k);k=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feOffset"):d.createElement("feOffset");
+k.setAttribute("in","blur");k.setAttribute("dx",this.svgShadowSize);k.setAttribute("dy",this.svgShadowSize);k.setAttribute("result","offsetBlur");g.appendChild(k);k=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feFlood"):d.createElement("feFlood");k.setAttribute("flood-color",this.svgShadowColor);k.setAttribute("flood-opacity",this.svgShadowOpacity);k.setAttribute("result","offsetColor");g.appendChild(k);k=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feComposite"):
+d.createElement("feComposite");k.setAttribute("in","offsetColor");k.setAttribute("in2","offsetBlur");k.setAttribute("operator","in");k.setAttribute("result","offsetBlur");g.appendChild(k);k=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feBlend"):d.createElement("feBlend");k.setAttribute("in","SourceGraphic");k.setAttribute("in2","offsetBlur");g.appendChild(k);k=a.getElementsByTagName("defs");0==k.length?(d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"defs"):d.createElement("defs"),
+null!=a.firstChild?a.insertBefore(d,a.firstChild):a.appendChild(d)):d=k[0];d.appendChild(g);c||((b||a.getElementsByTagName("g")[0]).setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6)));return g};Graph.prototype.setShadowVisible=function(a,b){mxClient.IS_SVG&&(b=null!=b?b:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter",
"url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),b&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=this.model.getChildCount(this.model.root),b,c=0;do b=this.model.getChildAt(this.model.root,c);while(c++<a&&"1"==mxUtils.getValue(this.getCellStyle(b),"locked","0"));null!=b&&this.setDefaultParent(b)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];
mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=
[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/transmission"]=
@@ -6524,86 +6528,86 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist
[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=
[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",
STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
-[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var p=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,d,g,h,e,n,f,k){if(null!=c&&null==mxMarker.markers[c]){var u=this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return p.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){p.value=Math.max(1,
-Math.min(n,Math.max(parseInt(p.value),parseInt(t.value))));t.value=Math.max(1,Math.min(n,Math.min(parseInt(p.value),parseInt(t.value))))}function d(b){function c(b,c,g){var h=b.getGraphBounds(),e=0,n=0,f=X.get(),u=1/b.pageScale,k=x.checked;if(k)var u=parseInt(P.value),l=parseInt(M.value),u=Math.min(f.height*l/(h.height/b.view.scale),f.width*u/(h.width/b.view.scale));else u=parseInt(y.value)/(100*b.pageScale),isNaN(u)&&(d=1/b.pageScale,y.value="100 %");f=mxRectangle.fromRectangle(f);f.width=Math.ceil(f.width*
-d);f.height=Math.ceil(f.height*d);u*=d;!k&&b.pageVisible?(h=b.getPageLayout(),e-=h.x*f.width,n-=h.y*f.height):k=!0;if(null==c){c=PrintDialog.createPrintPreview(b,u,f,0,e,n,k);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var q=c.writeHead;c.writeHead=function(b){q.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var m=c.renderPage;c.renderPage=
-function(a,b,c,d,g,h){var e=m.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:e.className="geDisableMathJax";return e}}c.open(null,null,g,!0)}else{f=b.background;if(null==f||""==f||f==mxConstants.NONE)f="#ffffff";c.backgroundColor=f;c.autoOrigin=k;c.appendGraph(b,u,e,n,g,!0)}return c}var d=parseInt(V.value)/100;isNaN(d)&&(d=1,V.value="100 %");var d=.75*d,h=t.value,e=p.value,n=!l.checked,u=null;n&&(n=h==f&&e==f);if(!n&&null!=a.pages&&a.pages.length){var k=0,n=a.pages.length-1;l.checked||
-(k=parseInt(h)-1,n=parseInt(e)-1);for(var q=k;q<=n;q++){var m=a.pages[q],h=m==a.currentPage?g:null;if(null==h){var h=a.createTemporaryGraph(g.getStylesheet()),e=!0,k=!1,A=null,v=null;null==m.viewState&&null==m.mapping&&null==m.root&&a.updatePageRoot(m);null!=m.viewState?(e=m.viewState.pageVisible,k=m.viewState.mathEnabled,A=m.viewState.background,v=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(k="0"!=m.mapping.diagramMap.get("mathEnabled"),A=m.mapping.diagramMap.get("background"),
-v=m.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);h.background=A;h.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;h.pageVisible=e;h.mathEnabled=k;var D=h.getGlobalVariable;h.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?q+1:D.apply(this,arguments)};document.body.appendChild(h.container);a.updatePageRoot(m);h.model.setRoot(m.root)}u=c(h,u,q!=n);h!=g&&h.container.parentNode.removeChild(h.container)}}else u=c(g);u.mathEnabled&&
+[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var p=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,d,g,k,e,n,f,h){if(null!=c&&null==mxMarker.markers[c]){var u=this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return p.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){t.value=Math.max(1,
+Math.min(n,Math.max(parseInt(t.value),parseInt(p.value))));p.value=Math.max(1,Math.min(n,Math.min(parseInt(t.value),parseInt(p.value))))}function d(b){function c(b,c,g){var k=b.getGraphBounds(),e=0,n=0,f=Z.get(),u=1/b.pageScale,h=z.checked;if(h)var u=parseInt(U.value),q=parseInt(Q.value),u=Math.min(f.height*q/(k.height/b.view.scale),f.width*u/(k.width/b.view.scale));else u=parseInt(A.value)/(100*b.pageScale),isNaN(u)&&(d=1/b.pageScale,A.value="100 %");f=mxRectangle.fromRectangle(f);f.width=Math.ceil(f.width*
+d);f.height=Math.ceil(f.height*d);u*=d;!h&&b.pageVisible?(k=b.getPageLayout(),e-=k.x*f.width,n-=k.y*f.height):h=!0;if(null==c){c=PrintDialog.createPrintPreview(b,u,f,0,e,n,h);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var l=c.writeHead;c.writeHead=function(b){l.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var p=c.renderPage;c.renderPage=
+function(a,b,c,d,g,k){var e=p.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:e.className="geDisableMathJax";return e}}c.open(null,null,g,!0)}else{f=b.background;if(null==f||""==f||f==mxConstants.NONE)f="#ffffff";c.backgroundColor=f;c.autoOrigin=h;c.appendGraph(b,u,e,n,g,!0)}return c}var d=parseInt(W.value)/100;isNaN(d)&&(d=1,W.value="100 %");var d=.75*d,k=p.value,e=t.value,n=!q.checked,u=null;n&&(n=k==f&&e==f);if(!n&&null!=a.pages&&a.pages.length){var h=0,n=a.pages.length-1;q.checked||
+(h=parseInt(k)-1,n=parseInt(e)-1);for(var l=h;l<=n;l++){var m=a.pages[l],k=m==a.currentPage?g:null;if(null==k){var k=a.createTemporaryGraph(g.getStylesheet()),e=!0,h=!1,x=null,w=null;null==m.viewState&&null==m.mapping&&null==m.root&&a.updatePageRoot(m);null!=m.viewState?(e=m.viewState.pageVisible,h=m.viewState.mathEnabled,x=m.viewState.background,w=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(h="0"!=m.mapping.diagramMap.get("mathEnabled"),x=m.mapping.diagramMap.get("background"),
+w=m.mapping.diagramMap.get("backgroundImage"),w=null!=w&&0<w.length?JSON.parse(w):null);k.background=x;k.backgroundImage=null!=w?new mxImage(w.src,w.width,w.height):null;k.pageVisible=e;k.mathEnabled=h;var C=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?l+1:C.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);k.model.setRoot(m.root)}u=c(k,u,l!=n);k!=g&&k.container.parentNode.removeChild(k.container)}}else u=c(g);u.mathEnabled&&
(n=u.wnd.document,n.writeln('<script type="text/x-mathjax-config">'),n.writeln("MathJax.Hub.Config({"),n.writeln('messageStyle: "none",'),n.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),n.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),n.writeln("TeX: {"),n.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),n.writeln("},"),n.writeln("tex2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("},"),
-n.writeln("asciimath2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("}"),n.writeln("});"),b&&(n.writeln("MathJax.Hub.Queue(function () {"),n.writeln("window.print();"),n.writeln("});")),n.writeln("\x3c/script>"),n.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));u.closeDocument();!u.mathEnabled&&b&&PrintDialog.printPreview(u)}var g=a.editor.graph,h=document.createElement("div"),e=document.createElement("h3");
-e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,b||mxResources.get("print"));h.appendChild(e);var n=1,f=1,k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;";l.setAttribute("value","all");l.setAttribute("type","radio");l.setAttribute("name","pages-printdialog");k.appendChild(l);e=document.createElement("span");
-mxUtils.write(e,mxResources.get("printAllPages"));k.appendChild(e);mxUtils.br(k);var q=l.cloneNode(!0);l.setAttribute("checked","checked");q.setAttribute("value","range");k.appendChild(q);e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");k.appendChild(e);var t=document.createElement("input");t.style.cssText="margin:0 8px 0 8px;";t.setAttribute("value","1");t.setAttribute("type","number");t.setAttribute("min","1");t.style.width="50px";k.appendChild(t);e=document.createElement("span");
-mxUtils.write(e,mxResources.get("to"));k.appendChild(e);var p=t.cloneNode(!0);k.appendChild(p);mxEvent.addListener(t,"focus",function(){q.checked=!0});mxEvent.addListener(p,"focus",function(){q.checked=!0});mxEvent.addListener(t,"change",c);mxEvent.addListener(p,"change",c);if(null!=a.pages&&(n=a.pages.length,null!=a.currentPage))for(e=0;e<a.pages.length;e++)if(a.currentPage==a.pages[e]){f=e+1;t.value=f;p.value=f;break}t.setAttribute("max",n);p.setAttribute("max",n);1<n&&h.appendChild(k);var m=document.createElement("div");
-m.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");m.appendChild(v);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));m.appendChild(e);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","100 %");y.style.width="50px";m.appendChild(y);mxEvent.addListener(y,"focus",function(){v.checked=!0});
-h.appendChild(m);var k=k.cloneNode(!1),x=v.cloneNode(!0);x.setAttribute("value","fit");v.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(x);k.appendChild(e);m=document.createElement("table");m.style.display="inline-block";var T=document.createElement("tbody"),L=document.createElement("tr"),N=L.cloneNode(!0),U=document.createElement("td"),K=U.cloneNode(!0),Y=U.cloneNode(!0),Q=U.cloneNode(!0),
-aa=U.cloneNode(!0),W=U.cloneNode(!0);U.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(U,mxResources.get("fitTo"));var P=document.createElement("input");P.style.cssText="margin:0 8px 0 8px;";P.setAttribute("value","1");P.setAttribute("min","1");P.setAttribute("type","number");P.style.width="40px";K.appendChild(P);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));Y.appendChild(e);mxUtils.write(Q,mxResources.get("fitToBy"));var M=P.cloneNode(!0);
-aa.appendChild(M);mxEvent.addListener(P,"focus",function(){x.checked=!0});mxEvent.addListener(M,"focus",function(){x.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));W.appendChild(e);L.appendChild(U);L.appendChild(K);L.appendChild(Y);N.appendChild(Q);N.appendChild(aa);N.appendChild(W);T.appendChild(L);T.appendChild(N);m.appendChild(T);k.appendChild(m);h.appendChild(k);k=document.createElement("div");e=document.createElement("div");e.style.fontWeight=
-"bold";e.style.marginBottom="12px";mxUtils.write(e,mxResources.get("paperSize"));k.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var X=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);k.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));k.appendChild(e);var V=document.createElement("input");V.style.cssText="margin:0 8px 0 8px;";V.setAttribute("value","100 %");V.style.width=
-"60px";k.appendChild(V);h.appendChild(k);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&e.appendChild(k);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",e.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),
-function(){a.hideDialog();d(!1)}),m.className="geBtn",e.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";e.appendChild(m);a.editor.cancelFirst||e.appendChild(k);h.appendChild(e);this.container=h};var v=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||
-(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(v.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),
-null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.0.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
+n.writeln("asciimath2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("}"),n.writeln("});"),b&&(n.writeln("MathJax.Hub.Queue(function () {"),n.writeln("window.print();"),n.writeln("});")),n.writeln("\x3c/script>"),n.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));u.closeDocument();!u.mathEnabled&&b&&PrintDialog.printPreview(u)}var g=a.editor.graph,k=document.createElement("div"),e=document.createElement("h3");
+e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,b||mxResources.get("print"));k.appendChild(e);var n=1,f=1,h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;";q.setAttribute("value","all");q.setAttribute("type","radio");q.setAttribute("name","pages-printdialog");h.appendChild(q);e=document.createElement("span");
+mxUtils.write(e,mxResources.get("printAllPages"));h.appendChild(e);mxUtils.br(h);var l=q.cloneNode(!0);q.setAttribute("checked","checked");l.setAttribute("value","range");h.appendChild(l);e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");h.appendChild(e);var p=document.createElement("input");p.style.cssText="margin:0 8px 0 8px;";p.setAttribute("value","1");p.setAttribute("type","number");p.setAttribute("min","1");p.style.width="50px";h.appendChild(p);e=document.createElement("span");
+mxUtils.write(e,mxResources.get("to"));h.appendChild(e);var t=p.cloneNode(!0);h.appendChild(t);mxEvent.addListener(p,"focus",function(){l.checked=!0});mxEvent.addListener(t,"focus",function(){l.checked=!0});mxEvent.addListener(p,"change",c);mxEvent.addListener(t,"change",c);if(null!=a.pages&&(n=a.pages.length,null!=a.currentPage))for(e=0;e<a.pages.length;e++)if(a.currentPage==a.pages[e]){f=e+1;p.value=f;t.value=f;break}p.setAttribute("max",n);t.setAttribute("max",n);1<n&&k.appendChild(h);var m=document.createElement("div");
+m.style.marginBottom="10px";var w=document.createElement("input");w.style.marginRight="8px";w.setAttribute("value","adjust");w.setAttribute("type","radio");w.setAttribute("name","printZoom");m.appendChild(w);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));m.appendChild(e);var A=document.createElement("input");A.style.cssText="margin:0 8px 0 8px;";A.setAttribute("value","100 %");A.style.width="50px";m.appendChild(A);mxEvent.addListener(A,"focus",function(){w.checked=!0});
+k.appendChild(m);var h=h.cloneNode(!1),z=w.cloneNode(!0);z.setAttribute("value","fit");w.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(z);h.appendChild(e);m=document.createElement("table");m.style.display="inline-block";var R=document.createElement("tbody"),M=document.createElement("tr"),J=M.cloneNode(!0),T=document.createElement("td"),L=T.cloneNode(!0),X=T.cloneNode(!0),N=T.cloneNode(!0),
+Y=T.cloneNode(!0),V=T.cloneNode(!0);T.style.textAlign="right";N.style.textAlign="right";mxUtils.write(T,mxResources.get("fitTo"));var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","1");U.setAttribute("min","1");U.setAttribute("type","number");U.style.width="40px";L.appendChild(U);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));X.appendChild(e);mxUtils.write(N,mxResources.get("fitToBy"));var Q=U.cloneNode(!0);Y.appendChild(Q);
+mxEvent.addListener(U,"focus",function(){z.checked=!0});mxEvent.addListener(Q,"focus",function(){z.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));V.appendChild(e);M.appendChild(T);M.appendChild(L);M.appendChild(X);J.appendChild(N);J.appendChild(Y);J.appendChild(V);R.appendChild(M);R.appendChild(J);m.appendChild(R);h.appendChild(m);k.appendChild(h);h=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom=
+"12px";mxUtils.write(e,mxResources.get("paperSize"));h.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var Z=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);h.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));h.appendChild(e);var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","100 %");W.style.width="60px";h.appendChild(W);
+k.appendChild(h);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&e.appendChild(h);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",e.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
+d(!1)}),m.className="geBtn",e.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";e.appendChild(m);a.editor.cancelFirst||e.appendChild(h);k.appendChild(e);this.container=k};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
+this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(w.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=
+this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.0.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=
!(!a.getContext||!a.getContext("2d"))}catch(t){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(p){}};c.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{b=
document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(t){}})();EditorUi.prototype.openLink=function(a){return window.open(a)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};
EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||
-!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var d=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),g=d.spin;d.spin=function(c,h){var e=!1;this.active||(g.call(this,c),this.active=!0,null!=h&&(e=document.createElement("div"),e.style.position="absolute",e.style.whiteSpace="nowrap",e.style.background="#4B4243",e.style.color=
-"white",e.style.fontFamily="Helvetica, Arial",e.style.fontSize="9pt",e.style.padding="6px",e.style.paddingLeft="10px",e.style.paddingRight="10px",e.style.zIndex=2E9,e.style.left=Math.max(0,a)+"px",e.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(e.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(e.style,"boxShadow","2px 2px 3px 0px #ddd"),e.innerHTML=h+"...",c.appendChild(e),d.status=e,mxClient.IS_VML&&
-(null==document.documentMode||8>=document.documentMode)&&(e.style.left=Math.round(Math.max(0,a-e.offsetWidth/2))+"px",e.style.top=Math.round(Math.max(0,b+70-e.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,h)}));this.stop();return a}),e=!0);return e};var h=d.stop;d.stop=function(){h.call(this);this.active=!1;null!=d.status&&(d.status.parentNode.removeChild(d.status),d.status=null)};d.pause=function(){return function(){}};
-return d};EditorUi.parsePng=function(a,b,c){function d(a,b){var c=h;h+=b;return a.substring(c,h)}function g(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var h=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(d(a,4),"IHDR"!=d(a,4))null!=c&&c();else{d(a,17);do{c=g(a);var e=d(a,4);if(null!=b&&b(h-8,e,c))break;value=d(a,c);d(a,4);if("IEND"==e)break}while(c)}};EditorUi.prototype.isCompatibleString=function(a){try{var b=
+!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var d=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),g=d.spin;d.spin=function(c,k){var e=!1;this.active||(g.call(this,c),this.active=!0,null!=k&&(e=document.createElement("div"),e.style.position="absolute",e.style.whiteSpace="nowrap",e.style.background="#4B4243",e.style.color=
+"white",e.style.fontFamily="Helvetica, Arial",e.style.fontSize="9pt",e.style.padding="6px",e.style.paddingLeft="10px",e.style.paddingRight="10px",e.style.zIndex=2E9,e.style.left=Math.max(0,a)+"px",e.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(e.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(e.style,"boxShadow","2px 2px 3px 0px #ddd"),e.innerHTML=k+"...",c.appendChild(e),d.status=e,mxClient.IS_VML&&
+(null==document.documentMode||8>=document.documentMode)&&(e.style.left=Math.round(Math.max(0,a-e.offsetWidth/2))+"px",e.style.top=Math.round(Math.max(0,b+70-e.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,k)}));this.stop();return a}),e=!0);return e};var k=d.stop;d.stop=function(){k.call(this);this.active=!1;null!=d.status&&(d.status.parentNode.removeChild(d.status),d.status=null)};d.pause=function(){return function(){}};
+return d};EditorUi.parsePng=function(a,b,c){function d(a,b){var c=k;k+=b;return a.substring(c,k)}function g(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var k=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(d(a,4),"IHDR"!=d(a,4))null!=c&&c();else{d(a,17);do{c=g(a);var e=d(a,4);if(null!=b&&b(k-8,e,c))break;value=d(a,c);d(a,4);if("IEND"==e)break}while(c)}};EditorUi.prototype.isCompatibleString=function(a){try{var b=
mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(q){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var d=b.indexOf("&lt;mxfile ");if(0<=d){var g=b.lastIndexOf("&lt;/mxfile&gt;");g>d&&(c=b.substring(d,g+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var e=
-mxUtils.parseXml(b),f=this.editor.extractGraphModel(e.documentElement,null!=this.pages),c=null!=f?mxUtils.getXml(f):""}catch(v){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,
+mxUtils.parseXml(b),f=this.editor.extractGraphModel(e.documentElement,null!=this.pages),c=null!=f?mxUtils.getXml(f):""}catch(w){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,
!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var g=d.length-1;0<=g;g--){var e=this.updatePageRoot(new DiagramPage(d[g]));null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[g+1]));b.model.execute(new ChangePage(this,e,0==g?e:null,0))}}else"0"!=
urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),b.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=c)for(g=0;g<c.length;g++)b.model.execute(new ChangePage(this,c[g],null))}finally{b.model.endUpdate()}}};
-EditorUi.prototype.createFileData=function(a,b,c,d,e,f,k,l,m,u){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;m=null!=m?m:!0;var g,h=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?g="_blank":h=g=d;if(null==a)return"";var n=a;if("mxfile"!=n.nodeName.toLowerCase()){var q=b.zapGremlins(mxUtils.getXml(a)),n=b.compress(q);if(b.decompress(n)!=q)return q;q=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(q,n);n=a.ownerDocument.createElement("mxfile");n.appendChild(q)}u?
-(n=n.cloneNode(!0),n.removeAttribute("userAgent"),n.removeAttribute("version"),n.removeAttribute("editor"),n.removeAttribute("type")):(n.setAttribute("userAgent",navigator.userAgent),n.setAttribute("version",EditorUi.VERSION),n.setAttribute("editor","www.draw.io"),a=null!=c?c.getMode():this.mode,null!=a&&n.setAttribute("type",a));a=mxUtils.getXml(n);if(!f&&!e&&(k||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(n),b,null!=c?c.getTitle():null,g,h);else if(f||!e&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==
-c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,l,m,h);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var g=
-0;g<this.pages.length;g++){var h=this.pages[g].mapping;this.currentPage!=this.pages[g]&&null!=h&&h.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(h.graphModel),h.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[g].node,d),h.needsUpdate=!1);c.appendChild(this.pages[g].node)}}return c};EditorUi.prototype.getFileData=function(a,b,c,d,e,f,k,l){e=null!=e?e:!0;k=null!=k?k:this.getXmlFileData(e,null!=
-f?f:!1);f=this.editor.graph;var g=this.getCurrentFile();if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=g&&/(\.svg)$/i.test(g.getTitle()))){f=this.createTemporaryGraph(f.getStylesheet());var h=f.getGlobalVariable,n=this.pages[0];f.getGlobalVariable=function(a){return"page"==a?n.getName():"pagenumber"==a?1:h.apply(this,arguments)};document.body.appendChild(f.container);f.model.setRoot(n.root)}a=this.createFileData(k,f,g,window.location.href,a,b,c,d,e,l);f!=this.editor.graph&&f.container.parentNode.removeChild(f.container);
-return a};EditorUi.prototype.getHtml=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=null,h="https://www.draw.io/js/embed-static.min.js";if(null!=b){var g=f?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),n=b.view.scale;f=Math.floor(g.x/n-b.view.translate.x);n=Math.floor(g.y/n-b.view.translate.y);g=b.background;null==e&&(b=this.getBasenames().join(";"),0<b.length&&(h="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",f);a.setAttribute("y0",n)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom",
-"1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=d&&a.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";d=this.editor.graph.compress(a);this.editor.graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':
-">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=g&&g!=mxConstants.NONE?' style="background-color:'+g+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+"</div>\n</div>\n"+(null==e?'<script type="text/javascript" src="'+h+'">\x3c/script>':
-'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,d,e){null!=e&&(e=e.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,
-this.currentPage));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
+EditorUi.prototype.createFileData=function(a,b,c,d,e,f,h,l,m,u){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;m=null!=m?m:!0;var g,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?g="_blank":k=g=d;if(null==a)return"";var n=a;if("mxfile"!=n.nodeName.toLowerCase()){var q=b.zapGremlins(mxUtils.getXml(a)),n=b.compress(q);if(b.decompress(n)!=q)return q;q=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(q,n);n=a.ownerDocument.createElement("mxfile");n.appendChild(q)}u?
+(n=n.cloneNode(!0),n.removeAttribute("userAgent"),n.removeAttribute("version"),n.removeAttribute("editor"),n.removeAttribute("type")):(n.setAttribute("userAgent",navigator.userAgent),n.setAttribute("version",EditorUi.VERSION),n.setAttribute("editor","www.draw.io"),a=null!=c?c.getMode():this.mode,null!=a&&n.setAttribute("type",a));a=mxUtils.getXml(n);if(!f&&!e&&(h||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(n),b,null!=c?c.getTitle():null,g,k);else if(f||!e&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==
+c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,l,m,k);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var g=
+0;g<this.pages.length;g++){var e=this.pages[g].mapping;this.currentPage!=this.pages[g]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[g].node,d),e.needsUpdate=!1);c.appendChild(this.pages[g].node)}}return c};EditorUi.prototype.getFileData=function(a,b,c,d,e,f,h,l,m){e=null!=e?e:!0;h=null!=h?h:this.getXmlFileData(e,null!=
+f?f:!1);m=null!=m?m:this.getCurrentFile();f=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=m&&/(\.svg)$/i.test(m.getTitle()))){f=this.createTemporaryGraph(f.getStylesheet());var g=f.getGlobalVariable,k=this.pages[0];f.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(f.container);f.model.setRoot(k.root)}a=this.createFileData(h,f,m,window.location.href,a,b,c,d,e,l);f!=this.editor.graph&&
+f.container.parentNode.removeChild(f.container);return a};EditorUi.prototype.getHtml=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=null,k="https://www.draw.io/js/embed-static.min.js";if(null!=b){var g=f?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),n=b.view.scale;f=Math.floor(g.x/n-b.view.translate.x);n=Math.floor(g.y/n-b.view.translate.y);g=b.background;null==e&&(b=this.getBasenames().join(";"),0<b.length&&(k="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",f);a.setAttribute("y0",
+n)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=d&&a.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";d=this.editor.graph.compress(a);this.editor.graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=g&&g!=mxConstants.NONE?' style="background-color:'+g+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+
+"</div>\n</div>\n"+(null==e?'<script type="text/javascript" src="'+k+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,d,e){null!=e&&(e=e.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};
+null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==e?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;var b=null!=a&&0<a.length?
mxUtils.parseXml(a).documentElement:null;a=null!=b?this.editor.extractGraphModel(b,!0):null;null!=a&&(b=a);if(null!=b&&"mxfile"==b.nodeName&&(a=b.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<a.length||1==a.length&&a[0].hasAttribute("name"))){this.fileNode=b;this.pages=[];for(b=0;b<a.length;b++){var c=new DiagramPage(a[b]);null==c.getName()&&c.setName(mxResources.get("pageWithNumber",[b+1]));this.pages.push(c)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||
0))];b=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=b&&(this.fileNode=b.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(b.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(b);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(){var a=this.getCurrentFile(),a=null!=a&&null!=
-a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,c,d,e,f){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var g=this.getBaseFilename(),h=g+"."+a;if("xml"==a){var n='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(h,a,n,"text/xml")}else if("html"==
-a)n=this.getHtml2(this.getFileData(!0),this.editor.graph,g),this.saveData(h,a,n,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?h=g+".png":"jpeg"==a&&(h=g+".jpg"),this.saveRequest(h,a,mxUtils.bind(this,function(b,c){try{var g=this.editor.graph.pageVisible;null!=f&&(this.editor.graph.pageVisible=f);var e=this.createDownloadRequest(b,a,d,c);this.editor.graph.pageVisible=g;return e}catch(H){this.handleError(H)}}));else{var k=null,l=
-mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(k)}))});if("svg"==a){var m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);var q=this.editor.graph.getSvg(m,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(q);this.convertImages(q,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();l('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
-mxUtils.getXml(a))})))}else h=g+".svg",k=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();l(a)}),d)}}catch(B){this.handleError(B)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d){var g=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=b);var e="";if(g.width*g.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};g="0";if("xmlpng"==b&&(g="1",b="png",null!=this.pages&&null!=this.currentPage))for(var h=
-0;h<this.pages.length;h++)if(this.pages[h]==this.currentPage){e="&from="+h;break}return new mxXmlRequest(EXPORT_URL,"format="+b+e+"&base64="+d+"&embedXml="+g+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var b=!1;this.hideDialog();var c=this.getCurrentFile();this.setCurrentFile(null);null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
+a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,c,d,e,f){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var g=this.getBaseFilename(),k=g+"."+a;if("xml"==a){var n='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(k,a,n,"text/xml")}else if("html"==
+a)n=this.getHtml2(this.getFileData(!0),this.editor.graph,g),this.saveData(k,a,n,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=g+".png":"jpeg"==a&&(k=g+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(b,c){try{var g=this.editor.graph.pageVisible;null!=f&&(this.editor.graph.pageVisible=f);var e=this.createDownloadRequest(b,a,d,c);this.editor.graph.pageVisible=g;return e}catch(G){this.handleError(G)}}));else{var u=null,h=
+mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);var q=this.editor.graph.getSvg(l,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(q);this.convertImages(q,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();h('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
+mxUtils.getXml(a))})))}else k=g+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();h(a)}),d)}}catch(B){this.handleError(B)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d){var g=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=b);var e="";if(g.width*g.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};g="0";if("xmlpng"==b&&(g="1",b="png",null!=this.pages&&null!=this.currentPage))for(var k=
+0;k<this.pages.length;k++)if(this.pages[k]==this.currentPage){e="&from="+k;break}return new mxXmlRequest(EXPORT_URL,"format="+b+e+"&base64="+d+"&embedXml="+g+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var b=!1;this.hideDialog();var c=this.getCurrentFile();this.setCurrentFile(null);null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);
a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>"));!this.editor.chromeless||this.editor.editable?
(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.lightbox&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));b=!0;this.isOffline()||null==a.getMode()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),
mode:a.getMode()})}catch(t){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(t){}}catch(t){null!=window.console&&console.log("error in fileLoaded:",a,t);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=t&&null!=t.message?":err:"+encodeURIComponent(t.message):"")+(null!=
t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}catch(p){}this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?c.constructor==DriveFile?this.loadFile(c.getHash()):this.fileLoaded(c):d()}))}else d();return b};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
-"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(n){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,f,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
+"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(n){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,f,h){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);return mxUtils.getXml(b)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),
".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;
var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=
this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var e=null,g=mxUtils.bind(this,function(b,c){if(0==b.length&&a.isEditable())null==e&&(e=document.createElement("div"),mxUtils.setPrefixedStyle(e.style,"borderRadius","6px"),e.style.border="3px dotted lightGray",e.style.textAlign="center",e.style.padding=
-"8px",e.style.color="#B3B3B3",mxUtils.write(e,mxResources.get("dragElementsHere"))),c.appendChild(e);else for(var d=0;d<b.length;d++){var g=b[d],h=g.data;if(null!=h){var h=this.convertDataUri(h),f="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==g.aspect&&(f+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(f+"image="+h,g.w,g.h,"",g.title||"",!1,!1,!0))}else null!=g.xml&&(h=this.stringToCells(this.editor.graph.decompress(g.xml)),0<h.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(h,
-g.w,g.h,g.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var h=0;h<b.length;h++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
-mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[h]);c=null!=c&&0<c.length?c:a.getTitle();var f=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){g(b,a)}));this.repositionLibrary(d);var n=f.parentNode.previousSibling;c=n.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&n.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);
-var k=document.createElement("div");k.style.position="absolute";k.style.right="0px";k.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(k.style.backgroundColor="inherit");n.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("align","top");l.setAttribute("border","0");l.className="geButton";l.style.marginRight="1px";l.style.marginTop="-1px";k.appendChild(l);var m=
-null;mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var w=this.editor.graph,B=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);
-a.isAutosave()?(null!=B&&null!=B.parentNode&&B.parentNode.removeChild(B),B=l.cloneNode(!1),B.setAttribute("src",Editor.spinImage),B.setAttribute("title",mxResources.get("saving")),B.style.cursor="default",B.style.marginRight="2px",B.style.marginTop="-2px",k.insertBefore(B,k.firstChild),n.style.paddingRight=18*k.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=B&&null!=B.parentNode&&(B.parentNode.removeChild(B),n.style.paddingRight=18*k.childNodes.length+
-"px")})):null==m&&(m=l.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),k.insertBefore(m,k.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()||(n.style.paddingRight=18*k.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),n.style.paddingRight=18*k.childNodes.length+"px")}),E=
-mxUtils.bind(this,function(a,c,d,g){a=w.cloneCells(mxUtils.sortCells(w.model.getTopmostCells(a)));for(var h=0;h<a.length;h++){var n=w.getCellGeometry(a[h]);null!=n&&n.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,g||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=g&&(a.title=g);b.push(a);C(d);null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)}),
-H=mxUtils.bind(this,function(a){if(w.isSelectionEmpty())w.getRubberband().isActive()?(w.getRubberband().execute(a),w.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=w.getSelectionCells(),c=w.view.getBounds(b),d=w.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=w.view.translate.x;c.y-=w.view.translate.y;E(b,c)}mxEvent.consume(a)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},
-mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.panningManager&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="hidden",null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",w.panningManager.stop(),w.autoScroll=!1,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!1),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){w.isMouseDown&&
-null!=w.panningManager&&null!=w.graphHandler&&(f.style.border="3px solid transparent",null!=e&&(e.style.border="3px dotted lightGray"),f.style.cursor="default",this.sidebar.showTooltips=!0,w.panningManager.stop(),w.graphHandler.reset(),w.isMouseDown=!1,w.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="visible",f.style.border="3px solid transparent",f.style.cursor=
-"",w.autoScroll=!0,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!0),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="visible"),null!=e&&(e.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(a){null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
-mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.border="3px solid transparent";f.style.cursor="";null!=e&&(e.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,h,n,k,u,l,m,q){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,k,u),c)],c[0].vertex=
-!0,E(c,new mxRectangle(0,0,k,u),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null);else{var p=!1,t=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var h=mxUtils.parseXml(c);if("mxlibrary"==h.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(h.documentElement));g(n,f);b=b.concat(n);C(a);this.spinner.stop();p=!0}catch(V){}else if("mxfile"==h.documentElement.nodeName)try{for(var k=
-h.documentElement.getElementsByTagName("diagram"),h=0;h<k.length;h++){var n=mxUtils.getTextContent(k[h]),u=this.stringToCells(this.editor.graph.decompress(n)),l=this.editor.graph.getBoundingBoxFromGeometry(u);E(u,new mxRectangle(0,0,l.width,l.height),a)}p=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}p||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)});!this.isOffline()&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=q?this.parseFile(q,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?t(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):t(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"dragleave",function(a){null!=e?e.style.border="3px dotted lightGray":(f.style.border=
-"3px solid transparent",f.style.cursor="");a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",IMAGE_PATH+"/edit.gif");l.setAttribute("title",mxResources.get("edit"));k.insertBefore(l,k.firstChild);mxEvent.addListener(l,"click",G);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&G(a)});c=l.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",
-H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),k.insertBefore(c,k.firstChild))}n.appendChild(k);n.style.paddingRight=18*k.childNodes.length+"px"}};"1"==urlParams.offline||
+"8px",e.style.color="#B3B3B3",mxUtils.write(e,mxResources.get("dragElementsHere"))),c.appendChild(e);else for(var d=0;d<b.length;d++){var g=b[d],k=g.data;if(null!=k){var k=this.convertDataUri(k),f="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==g.aspect&&(f+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(f+"image="+k,g.w,g.h,"",g.title||"",!1,!1,!0))}else null!=g.xml&&(k=this.stringToCells(this.editor.graph.decompress(g.xml)),0<k.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(k,
+g.w,g.h,g.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var k=0;k<b.length;k++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
+mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[k]);c=null!=c&&0<c.length?c:a.getTitle();var f=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){g(b,a)}));this.repositionLibrary(d);var n=f.parentNode.previousSibling;c=n.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&n.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);
+var h=document.createElement("div");h.style.position="absolute";h.style.right="0px";h.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(h.style.backgroundColor="inherit");n.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("align","top");l.setAttribute("border","0");l.className="geButton";l.style.marginRight="1px";l.style.marginTop="-1px";h.appendChild(l);var m=
+null;mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var v=this.editor.graph,B=null,H=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),D=mxUtils.bind(this,function(c){a.setModified(!0);
+a.isAutosave()?(null!=B&&null!=B.parentNode&&B.parentNode.removeChild(B),B=l.cloneNode(!1),B.setAttribute("src",Editor.spinImage),B.setAttribute("title",mxResources.get("saving")),B.style.cursor="default",B.style.marginRight="2px",B.style.marginTop="-2px",h.insertBefore(B,h.firstChild),n.style.paddingRight=18*h.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=B&&null!=B.parentNode&&(B.parentNode.removeChild(B),n.style.paddingRight=18*h.childNodes.length+
+"px")})):null==m&&(m=l.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),h.insertBefore(m,h.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()||(n.style.paddingRight=18*h.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),n.style.paddingRight=18*h.childNodes.length+"px")}),E=
+mxUtils.bind(this,function(a,c,d,g){a=v.cloneCells(mxUtils.sortCells(v.model.getTopmostCells(a)));for(var k=0;k<a.length;k++){var n=v.getCellGeometry(a[k]);null!=n&&n.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,g||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=g&&(a.title=g);b.push(a);D(d);null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)}),
+G=mxUtils.bind(this,function(a){if(v.isSelectionEmpty())v.getRubberband().isActive()?(v.getRubberband().execute(a),v.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=v.getSelectionCells(),c=v.view.getBounds(b),d=v.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=v.view.translate.x;c.y-=v.view.translate.y;E(b,c)}mxEvent.consume(a)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},
+mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.panningManager&&null!=v.graphHandler.shape&&(v.graphHandler.shape.node.style.visibility="hidden",null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",v.panningManager.stop(),v.autoScroll=!1,null!=v.graphHandler.guide&&v.graphHandler.guide.setVisible(!1),null!=v.graphHandler.hint&&(v.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){v.isMouseDown&&
+null!=v.panningManager&&null!=v.graphHandler&&(f.style.border="3px solid transparent",null!=e&&(e.style.border="3px dotted lightGray"),f.style.cursor="default",this.sidebar.showTooltips=!0,v.panningManager.stop(),v.graphHandler.reset(),v.isMouseDown=!1,v.autoScroll=!0,G(a),mxEvent.consume(a))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.graphHandler.shape&&(v.graphHandler.shape.node.style.visibility="visible",f.style.border="3px solid transparent",f.style.cursor=
+"",v.autoScroll=!0,null!=v.graphHandler.guide&&v.graphHandler.guide.setVisible(!0),null!=v.graphHandler.hint&&(v.graphHandler.hint.style.visibility="visible"),null!=e&&(e.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(a){null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
+mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.border="3px solid transparent";f.style.cursor="";null!=e&&(e.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,k,n,h,u,l,m,q){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,h,u),c)],c[0].vertex=
+!0,E(c,new mxRectangle(0,0,h,u),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null);else{var p=!1,x=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(k.documentElement));g(n,f);b=b.concat(n);D(a);this.spinner.stop();p=!0}catch(W){}else if("mxfile"==k.documentElement.nodeName)try{for(var h=
+k.documentElement.getElementsByTagName("diagram"),k=0;k<h.length;k++){var n=mxUtils.getTextContent(h[k]),u=this.stringToCells(this.editor.graph.decompress(n)),l=this.editor.graph.getBoundingBoxFromGeometry(u);E(u,new mxRectangle(0,0,l.width,l.height),a)}p=!0}catch(W){null!=window.console&&console.log("error in drop handler:",W)}}p||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)});!this.isOffline()&&
+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=q?this.parseFile(q,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"dragleave",function(a){null!=e?e.style.border="3px dotted lightGray":(f.style.border=
+"3px solid transparent",f.style.cursor="");a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",IMAGE_PATH+"/edit.gif");l.setAttribute("title",mxResources.get("edit"));h.insertBefore(l,h.firstChild);mxEvent.addListener(l,"click",H);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&H(a)});c=l.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));h.insertBefore(c,h.firstChild);mxEvent.addListener(c,"click",
+G);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),h.insertBefore(c,h.firstChild))}n.appendChild(h);n.style.paddingRight=18*h.childNodes.length+"px"}};"1"==urlParams.offline||
EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));
a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet","styles/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",
Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet","styles/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",
@@ -6612,142 +6616,142 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM
"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");
a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!=
-this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),h=null;b=null!=b?b:mxResources.get("error");if(null!=e)if(null!=e.retry&&(g=mxResources.get("cancel"),h=function(){d();e.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
+this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=e)if(null!=e.retry&&(g=mxResources.get("cancel"),k=function(){d();e.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
else if(404==e.code||404==e.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var f=window.location.hash;null!=f&&"#G"==f.substring(0,2)&&(f=f.substring(2),a+=' <a href="https://drive.google.com/open?id='+f+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else e.code==App.ERROR_TIMEOUT?a=
-mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=e.message?a=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error&&(a=mxUtils.htmlEntities(e.response.error));this.showError(b,a,g,c,h)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,f,k){a=new ErrorDialog(this,a,b,c,d,e,f,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
+mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=e.message?a=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error&&(a=mxUtils.htmlEntities(e.response.error));this.showError(b,a,g,c,k)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,f,h){a=new ErrorDialog(this,a,b,c,d,e,f,h);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e){var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){g();null!=b&&b()},function(){g();null!=c&&c()},d,e)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};
EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,e=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(e,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};
EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height=
-"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var g=document.createElement("a"),h=!mxClient.IS_SF&&"undefined"!==typeof g.download;if(h||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));h?g.download=b:g.setAttribute("target","_blank");document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(y){}}else this.createEchoRequest(a,
-b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),g=Array(e),h=0;h<e;++h){for(var f=1024*h,k=Math.min(f+1024,d),u=Array(k-f),l=0;f<k;++l,++f)u[l]=
-c[f].charCodeAt(0);g[h]=new Uint8Array(u)}return new Blob(g,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,f,k){f=null!=f?f:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(f);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write(mxUtils.htmlEntities(a,
-!1)),g.document.close())}else this.openInNewWindow(a,c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,d,e,g)}catch(z){this.handleError(z)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,f,k,null,null,4<e?3:4,a,c,d);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};
+"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var g=document.createElement("a"),k=!mxClient.IS_SF&&"undefined"!==typeof g.download;if(k||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?g.download=b:g.setAttribute("target","_blank");document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(A){}}else this.createEchoRequest(a,
+b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),g=Array(e),k=0;k<e;++k){for(var f=1024*k,h=Math.min(f+1024,d),u=Array(h-f),l=0;f<h;++l,++f)u[l]=
+c[f].charCodeAt(0);g[k]=new Uint8Array(u)}return new Blob(g,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,f,h){f=null!=f?f:!1;h=null!=h?h:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(f);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write(mxUtils.htmlEntities(a,
+!1)),g.document.close())}else this.openInNewWindow(a,c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,d,e,g)}catch(y){this.handleError(y)}}))}catch(x){this.handleError(x)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,f,h,null,null,4<e?3:4,a,c,d);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};
EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,
!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");
var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=
d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var e=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});e.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height=
"auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,g){return this.createEchoRequest(c,a,d,e,b,g)}),c,
-e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,f,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var g=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=g&&(e==App.MODE_DEVICE||"_blank"==e?g.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){f=null!=f?f:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,
-a,f,!0,e,c)}catch(w){this.handleError(w)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(w){this.handleError(w)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
-!1,!1,k,null,null,4<g?3:4,d,f,e);this.showDialog(a.container,380,g==(mxClient.IS_IOS?0:1)?160:4<g?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,f){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,f,k,l,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;g=b?null:this.editor.graph.background;
-g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var h=this.editor.graph.getSvg(g,a,k,l,null,c);d&&this.editor.graph.addSvgShadow(h);var n=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,
-this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,h,!1,mxUtils.bind(this,function(){f?(null==
-this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(h,q,this.thumbImageCache)):q(h)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement("input");g.style.marginRight="8px";g.style.marginTop="16px";g.setAttribute("type","checkbox");c&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);d&&g.setAttribute("disabled","disabled");f&&(a.appendChild(g),mxUtils.write(a,b),e||mxUtils.br(a));return g};EditorUi.prototype.addEditButton=function(a,
+e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,f,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var g=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=g&&(e==App.MODE_DEVICE||"_blank"==e?g.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){f=null!=f?f:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,
+a,f,!0,e,c)}catch(v){this.handleError(v)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(v){this.handleError(v)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
+!1,!1,h,null,null,4<g?3:4,d,f,e);this.showDialog(a.container,380,g==(mxClient.IS_IOS?0:1)?160:4<g?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,f){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,f,h,l,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;g=b?null:this.editor.graph.background;
+g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var k=this.editor.graph.getSvg(g,a,h,l,null,c);d&&this.editor.graph.addSvgShadow(k);var n=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,
+this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,k,!1,mxUtils.bind(this,function(){f?(null==
+this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,q,this.thumbImageCache)):q(k)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement("input");g.style.marginRight="8px";g.style.marginTop="16px";g.setAttribute("type","checkbox");c&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);d&&g.setAttribute("disabled","disabled");f&&(a.appendChild(g),mxUtils.write(a,b),e||mxUtils.br(a));return g};EditorUi.prototype.addEditButton=function(a,
b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var g=document.createElement("select");g.style.width="120px";g.style.marginLeft="8px";g.style.marginRight="10px";g.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));g.appendChild(d);d=document.createElement("option");
d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");g.appendChild(d);a.appendChild(g);mxEvent.addListener(g,"change",mxUtils.bind(this,function(){if("custom"==g.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:g.value="blank"},mxResources.get("url"),null,null,null,null,function(){g.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||
-b.checked)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===g.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return g}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){h.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=g&&g!=mxConstants.NONE?"border:1px solid black;background-color:"+g:"background-position:center center;background-repeat:no-repeat;background-image:url('"+
+b.checked)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===g.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return g}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=g&&g!=mxConstants.NONE?"border:1px solid black;background-color:"+g:"background-position:center center;background-repeat:no-repeat;background-image:url('"+
Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option");
-e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var g="#0000ff",h=null,h=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(g||"none",function(a){g=a;c()});mxEvent.consume(a)}));c();h.style.padding=
-mxClient.IS_FF?"4px 2px 4px 2px":"4px";h.style.marginLeft="4px";h.style.height="22px";h.style.width="22px";h.style.position="relative";h.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";h.className="geColorBtn";a.appendChild(h);mxUtils.br(a);return{getColor:function(){return g},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,f,k,l){var g=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=a&&h.push("target="+
-a),null!=b&&b!=mxConstants.NONE&&h.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&h.push("edit="+encodeURIComponent(e)),f&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&h.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(g=this.getCurrentFile(),l||null==g||g.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?
-this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+g.getHash(),a=!1));a&&null!=g&&null!=g.getTitle()&&g.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(g.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,
-b,c,d,e,f,k,l,m,u,A){this.getBasenames();var g={};""!=e&&e!=mxConstants.NONE&&(g.highlight=e);"auto"!==d&&(g.target=d);m||(g.lightbox=!1);g.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(g.zoom=c/100);c=[];k&&(c.push("pages"),g.resize=!0,null!=this.pages&&null!=this.currentPage&&(g.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),g.resize=!0);l&&c.push("layers");0<c.length&&(m&&c.push("lightbox"),g.toolbar=c.join(" "));null!=u&&0<u.length&&(g.edit=u);null!=
-a?g.url=a:g.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(f?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(g))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";A(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
-'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("html"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(g);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
-f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","type-embedhtmldialog");g=f.cloneNode(!0);g.setAttribute("value","copy");h.appendChild(g);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(n);mxUtils.br(h);h.appendChild(f);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));h.appendChild(n);var k=this.getCurrentFile();null==c&&null!=k&&k.constructor==window.DriveFile&&(n=
-document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),h.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));g.setAttribute("checked","checked");null==c&&f.setAttribute("disabled","disabled");e.appendChild(h);var l=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,
-":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";e.appendChild(q);var B=this.addCheckbox(e,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,G=G=this.addCheckbox(e,mxResources.get("allPages"),h,!h),C=this.addCheckbox(e,mxResources.get("layers"),!0),E=this.addCheckbox(e,mxResources.get("lightbox"),!0),H=this.addEditButton(e,E),D=H.getEditInput();
-D.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled");D.checked&&E.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(f.checked?c:null,m.checked,q.value,l.getTarget(),l.getColor(),B.checked,G.checked,C.checked,E.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);g.focus()};
-EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,a||mxResources.get("link"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(h);var n=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=n&&n.constructor==window.DriveFile&&!b){a=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",
-k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));k.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())}));l.style.marginTop="12px";l.className="geBtn";k.appendChild(l);g.appendChild(k);l=document.createElement("a");
-l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));k.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
+e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var g="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(g||"none",function(a){g=a;c()});mxEvent.consume(a)}));c();k.style.padding=
+mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return g},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,f,h,l){var g=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+
+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),f&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&k.push("page="+a);break}a=!0;null!=h?c="#U"+encodeURIComponent(h):(g=this.getCurrentFile(),l||null==g||g.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?
+this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+g.getHash(),a=!1));a&&null!=g&&null!=g.getTitle()&&g.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(g.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,
+b,c,d,e,f,h,l,m,u,x){this.getBasenames();var g={};""!=e&&e!=mxConstants.NONE&&(g.highlight=e);"auto"!==d&&(g.target=d);m||(g.lightbox=!1);g.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(g.zoom=c/100);c=[];h&&(c.push("pages"),g.resize=!0,null!=this.pages&&null!=this.currentPage&&(g.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),g.resize=!0);l&&c.push("layers");0<c.length&&(m&&c.push("lightbox"),g.toolbar=c.join(" "));null!=u&&0<u.length&&(g.edit=u);null!=
+a?g.url=a:g.xml=this.getFileData(!0,null,null,null,null,!h);b='<div class="mxgraph" style="'+(f?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(g))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";x(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("html"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(g);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
+f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","type-embedhtmldialog");g=f.cloneNode(!0);g.setAttribute("value","copy");k.appendChild(g);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(f);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));k.appendChild(n);var h=this.getCurrentFile();null==c&&null!=h&&h.constructor==window.DriveFile&&(n=
+document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(h.getId())})));g.setAttribute("checked","checked");null==c&&f.setAttribute("disabled","disabled");e.appendChild(k);var l=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,
+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";e.appendChild(q);var B=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,H=H=this.addCheckbox(e,mxResources.get("allPages"),k,!k),D=this.addCheckbox(e,mxResources.get("layers"),!0),E=this.addCheckbox(e,mxResources.get("lightbox"),!0),G=this.addEditButton(e,E),C=G.getEditInput();
+C.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled");C.checked&&E.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(f.checked?c:null,m.checked,q.value,l.getTarget(),l.getColor(),B.checked,H.checked,D.checked,E.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);g.focus()};
+EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(k);var n=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=n&&n.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",
+h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));h.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())}));l.style.marginTop="12px";l.className="geBtn";h.appendChild(l);g.appendChild(h);l=document.createElement("a");
+l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));h.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,q=null;if(null!=c||null!=d)a+=30,mxUtils.write(g,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",g.appendChild(m),mxUtils.write(g,mxResources.get("height")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px",
-q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",g.appendChild(q),mxUtils.br(g);var p=this.addLinkSection(g,f);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==n||n.constructor!=window.DriveFile||b)t=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var C=this.addCheckbox(g,mxResources.get("lightbox"),!0),E=this.addEditButton(g,C),H=E.getEditInput(),D=this.addCheckbox(g,mxResources.get("layers"),!0);D.style.marginLeft=H.style.marginLeft;D.style.marginBottom="16px";
-D.style.marginTop="8px";mxEvent.addListener(C,"change",function(){C.checked?(D.removeAttribute("disabled"),H.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&C.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){e(p.getTarget(),p.getColor(),null==t?!0:t.checked,C.checked,E.getLink(),D.checked,null!=m?m.value:null,null!=
-q?q.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,246+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
-e.appendChild(g);var h=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),f=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=f&&(f.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!h.checked,null!=f?f.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,f,k,l){k=null!=k?k:!0;var g=document.createElement("div");g.style.whiteSpace=
-"nowrap";var h=this.editor.graph,n="jpeg"==l?170:280,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";g.appendChild(m);mxUtils.write(g,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";g.appendChild(q);mxUtils.write(g,mxResources.get("borderWidth")+
-":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";g.appendChild(p);mxUtils.br(g);var t=this.addCheckbox(g,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=l),v=this.addCheckbox(g,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),y=document.createElement("input");y.style.marginTop="16px";y.style.marginRight=
-"8px";y.style.marginLeft="24px";y.setAttribute("disabled","disabled");y.setAttribute("type","checkbox");f&&(g.appendChild(y),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),n+=26,mxEvent.addListener(v,"change",function(){v.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var H=this.addCheckbox(g,mxResources.get("shadow"),h.shadowVisible),D=document.createElement("input");D.style.marginTop=
-"16px";D.style.marginRight="8px";D.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||D.setAttribute("disabled","disabled");b&&(g.appendChild(D),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),n+=26);var F=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=l),I=null!=this.pages&&1<this.pages.length,J=this.addCheckbox(g,I?mxResources.get("allPages"):"",I,!I,null,"jpeg"!=l);J.style.marginLeft="24px";J.style.marginBottom="16px";I||(J.style.visibility=
-"hidden");mxEvent.addListener(F,"change",function(){F.checked&&I?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});k&&I||J.setAttribute("disabled","disabled");a=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=q.value;e(q.value,t.checked,!v.checked,H.checked,F.checked,D.checked,p.value,y.checked,!J.checked)}),null,c,d);this.showDialog(a.container,320,n,!0,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var g=document.createElement("div");g.style.whiteSpace="nowrap";var h=this.editor.graph;if(null!=b){var f=document.createElement("h3");mxUtils.write(f,b);f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";g.appendChild(f)}var n=this.addCheckbox(g,mxResources.get("fit"),!0),k=this.addCheckbox(g,mxResources.get("shadow"),h.shadowVisible&&d,
-!d),l=this.addCheckbox(g,c),m=this.addCheckbox(g,mxResources.get("lightbox"),!0),q=this.addEditButton(g,m),t=q.getEditInput(),G=1<h.model.getChildCount(h.model.getRoot()),C=this.addCheckbox(g,mxResources.get("layers"),G,!G);C.style.marginLeft=t.style.marginLeft;C.style.marginBottom="12px";C.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(G&&C.removeAttribute("disabled"),t.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));
-t.checked&&m.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){a(n.checked,k.checked,l.checked,m.checked,q.getLink(),C.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,f,k,l){function g(b){var g=" ",n="";d&&(g=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}})(this);\"",n+="cursor:pointer;");a&&(n+="max-width:100%;");var l="";c&&(l=' width="'+Math.round(h.width)+'" height="'+Math.round(h.height)+'"');k('<img src="'+b+'"'+l+(""!=n?' style="'+n+'"':"")+g+"/>")}var h=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");g(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}),
-null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),h.width*h.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var n="";c&&(n="&w="+Math.round(2*h.width)+"&h="+Math.round(2*h.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+n+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?g("data:image/png;base64,"+m.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,f,k){var g=this.editor.graph.getSvg(),h=g.getElementsByTagName("a");if(null!=h)for(var n=0;n<h.length;n++){var l=h[n].getAttribute("href");null!=l&&"#"==l.charAt(0)&&"_blank"==h[n].getAttribute("target")&&h[n].removeAttribute("target")}d&&g.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(g);if(c){var m=" ",q="";d&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}})(this);\"",q+="cursor:pointer;");a&&(q+="max-width:100%;");this.convertImages(g,mxUtils.bind(this,function(a){k('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=q?' style="'+q+'"':"")+m+"/>")}))}else q="",d&&(g.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}}})(this);"),q+="cursor:pointer;"),a&&(a=parseInt(g.getAttribute("width")),b=parseInt(g.getAttribute("height")),g.setAttribute("viewBox","0 0 "+a+" "+b),q+="max-width:100%;max-height:"+b+"px;",g.removeAttribute("height")),""!=q&&g.setAttribute("style",q),k(mxUtils.getXml(g))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+
+q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",g.appendChild(q),mxUtils.br(g);var p=this.addLinkSection(g,f);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==n||n.constructor!=window.DriveFile||b)t=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var D=this.addCheckbox(g,mxResources.get("lightbox"),!0),E=this.addEditButton(g,D),G=E.getEditInput(),C=this.addCheckbox(g,mxResources.get("layers"),!0);C.style.marginLeft=G.style.marginLeft;C.style.marginBottom="16px";
+C.style.marginTop="8px";mxEvent.addListener(D,"change",function(){D.checked?(C.removeAttribute("disabled"),G.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"));G.checked&&D.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){e(p.getTarget(),p.getColor(),null==t?!0:t.checked,D.checked,E.getLink(),C.checked,null!=m?m.value:null,null!=
+q?q.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,246+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
+e.appendChild(g);var k=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),f=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=f&&(f.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!k.checked,null!=f?f.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,f,h,l){h=null!=h?h:!0;var g=document.createElement("div");g.style.whiteSpace=
+"nowrap";var k=this.editor.graph,n="jpeg"==l?170:280,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";g.appendChild(m);mxUtils.write(g,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";g.appendChild(q);mxUtils.write(g,mxResources.get("borderWidth")+
+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";g.appendChild(p);mxUtils.br(g);var t=this.addCheckbox(g,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=l),w=this.addCheckbox(g,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight=
+"8px";A.style.marginLeft="24px";A.setAttribute("disabled","disabled");A.setAttribute("type","checkbox");f&&(g.appendChild(A),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),n+=26,mxEvent.addListener(w,"change",function(){w.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(A.setAttribute("checked","checked"),A.defaultChecked=!0);var G=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible),C=document.createElement("input");C.style.marginTop=
+"16px";C.style.marginRight="8px";C.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||C.setAttribute("disabled","disabled");b&&(g.appendChild(C),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),n+=26);var F=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=l),I=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(g,I?mxResources.get("allPages"):"",I,!I,null,"jpeg"!=l);K.style.marginLeft="24px";K.style.marginBottom="16px";I||(K.style.visibility=
+"hidden");mxEvent.addListener(F,"change",function(){F.checked&&I?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});h&&I||K.setAttribute("disabled","disabled");a=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=q.value;e(q.value,t.checked,!w.checked,G.checked,F.checked,C.checked,p.value,A.checked,!K.checked)}),null,c,d);this.showDialog(a.container,320,n,!0,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var f=document.createElement("h3");mxUtils.write(f,b);f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";g.appendChild(f)}var n=this.addCheckbox(g,mxResources.get("fit"),!0),h=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible&&d,
+!d),l=this.addCheckbox(g,c),m=this.addCheckbox(g,mxResources.get("lightbox"),!0),q=this.addEditButton(g,m),t=q.getEditInput(),H=1<k.model.getChildCount(k.model.getRoot()),D=this.addCheckbox(g,mxResources.get("layers"),H,!H);D.style.marginLeft=t.style.marginLeft;D.style.marginBottom="12px";D.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(H&&D.removeAttribute("disabled"),t.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));
+t.checked&&m.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){a(n.checked,h.checked,l.checked,m.checked,q.getLink(),D.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,f,h,l){function g(b){var g=" ",n="";d&&(g=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}})(this);\"",n+="cursor:pointer;");a&&(n+="max-width:100%;");var l="";c&&(l=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');h('<img src="'+b+'"'+l+(""!=n?' style="'+n+'"':"")+g+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");g(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}),
+null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),k.width*k.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var n="";c&&(n="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+n+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?g("data:image/png;base64,"+m.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,f,h){var g=this.editor.graph.getSvg(),k=g.getElementsByTagName("a");if(null!=k)for(var n=0;n<k.length;n++){var l=k[n].getAttribute("href");null!=l&&"#"==l.charAt(0)&&"_blank"==k[n].getAttribute("target")&&k[n].removeAttribute("target")}d&&g.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(g);if(c){var m=" ",q="";d&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}})(this);\"",q+="cursor:pointer;");a&&(q+="max-width:100%;");this.convertImages(g,mxUtils.bind(this,function(a){h('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=q?' style="'+q+'"':"")+m+"/>")}))}else q="",d&&(g.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(e?"&edit=_blank":"")+(f?"&layers=1":"")+"');}}})(this);"),q+="cursor:pointer;"),a&&(a=parseInt(g.getAttribute("width")),b=parseInt(g.getAttribute("height")),g.setAttribute("viewBox","0 0 "+a+" "+b),q+="max-width:100%;max-height:"+b+"px;",g.removeAttribute("height")),""!=q&&g.setAttribute("style",q),h(mxUtils.getXml(g))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+
" "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,c,d){d()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0<
d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(p){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){var d=this.editor.graph,
-e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,h=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?h.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);
-d.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var g=c.toDataURL("image/png"),g=this.writeGraphModelToPng(g,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(g.substring(g.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(u){null!=b&&b(u)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg=
-function(a,b,c,d,e,f,k){k=b.background;k==mxConstants.NONE&&(k=null);b=b.getSvg(k,null,null,null,null,f);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
-mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,f,k,l,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,m)}catch(z){"Invalid image"==z.message?this.downloadFile(m):this.handleError(z)}}),null,
-this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,k)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},g=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f<c.length;f++){var h=
-c[f].indexOf(")");g.push('url("');g.push(e[b(c[f].substring(0,h))]);g.push('"'+c[f].substring(h))}this.editor.resolvedFontCss=g.join("");a()}});if(0<c.length)for(var f=1;f<c.length;f++){var k=c[f].indexOf(")"),l=null,m=c[f].indexOf("format(",k);0<m&&(l=b(c[f].substring(m+7,c[f].indexOf(")",m))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b=
+e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,f=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);
+d.model.setRoot(f.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var g=c.toDataURL("image/png"),g=this.writeGraphModelToPng(g,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(g.substring(g.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(u){null!=b&&b(u)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg=
+function(a,b,c,d,e,f,h){h=b.background;h==mxConstants.NONE&&(h=null);b=b.getSvg(h,null,null,null,null,f);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
+mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,f,h,l,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,m)}catch(y){"Invalid image"==y.message?this.downloadFile(m):this.handleError(y)}}),null,
+this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,h)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},g=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f<c.length;f++){var k=
+c[f].indexOf(")");g.push('url("');g.push(e[b(c[f].substring(0,k))]);g.push('"'+c[f].substring(k))}this.editor.resolvedFontCss=g.join("");a()}});if(0<c.length)for(var f=1;f<c.length;f++){var h=c[f].indexOf(")"),l=null,u=c[f].indexOf("format(",h);0<u&&(l=b(c[f].substring(u+7,c[f].indexOf(")",u))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b=
"application/x-font-opentype";else if("woff"==l||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==l||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==l||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==l||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;g()}),mxUtils.bind(this,
-function(a){d--;g()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[f].substring(0,k)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,k,l,m,u,A,z,w,B){f=null!=f?f:!0;z=null!=z?z:this.editor.graph;w=null!=w?w:0;var g=m?null:z.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==m&&(g=this.editor.graph.defaultPageBackgroundColor);this.convertImages(z.getSvg(g,null,null,B,null,null!=k?k:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
-function(){try{var h=document.createElement("canvas"),k=parseInt(c.getAttribute("width")),n=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*n),b/k)):b/k);k=Math.ceil(l*k)+2*w;n=Math.ceil(l*n)+2*w;h.setAttribute("width",k);h.setAttribute("height",n);var m=h.getContext("2d");null!=g&&(m.beginPath(),m.rect(0,0,k,n),m.fillStyle=g,m.fill());m.scale(l,l);m.drawImage(d,w/l,w/l);a(h)}catch(R){null!=e&&e(R)}});d.onerror=function(a){null!=e&&e(a)};try{u&&this.editor.graph.addSvgShadow(c);
-var h=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(z,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(h)}catch(D){null!=e&&e(D)}}),c,A)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
-a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var e=0,g=c||{};c=mxUtils.bind(this,function(c,f){for(var h=a.getElementsByTagName(c),k=0;k<h.length;k++)mxUtils.bind(this,function(c){var h=
-d.convert(c.getAttribute(f));if(null!=h&&"data:"!=h.substring(0,5)){var k=g[h];null==k?(e++,this.convertImageToDataUri(h,function(d){null!=d&&(g[h]=d,c.setAttribute(f,d));e--;0==e&&b(a)})):c.setAttribute(f,k)}})(h[k])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,f){try{var g=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);e=null!=e?e:!0;var h=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
+function(a){d--;g()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[f].substring(0,h)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,h,l,m,u,x,y,v,B){f=null!=f?f:!0;y=null!=y?y:this.editor.graph;v=null!=v?v:0;var g=m?null:y.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==m&&(g=this.editor.graph.defaultPageBackgroundColor);this.convertImages(y.getSvg(g,null,null,B,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
+function(){try{var k=document.createElement("canvas"),h=parseInt(c.getAttribute("width")),n=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*n),b/h)):b/h);h=Math.ceil(l*h)+2*v;n=Math.ceil(l*n)+2*v;k.setAttribute("width",h);k.setAttribute("height",n);var u=k.getContext("2d");null!=g&&(u.beginPath(),u.rect(0,0,h,n),u.fillStyle=g,u.fill());u.scale(l,l);u.drawImage(d,v/l,v/l);a(k)}catch(P){null!=e&&e(P)}});d.onerror=function(a){null!=e&&e(a)};try{u&&this.editor.graph.addSvgShadow(c);
+var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(y,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(C){null!=e&&e(C)}}),c,x)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
+a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var e=0,g=c||{};c=mxUtils.bind(this,function(c,f){for(var k=a.getElementsByTagName(c),h=0;h<k.length;h++)mxUtils.bind(this,function(c){var k=
+d.convert(c.getAttribute(f));if(null!=k&&"data:"!=k.substring(0,5)){var h=g[k];null==h?(e++,this.convertImageToDataUri(k,function(d){null!=d&&(g[k]=d,c.setAttribute(f,d));e--;0==e&&b(a)})):c.setAttribute(f,h)}})(k[h])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,f){try{var g=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);e=null!=e?e:!0;var k=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}f=null!=f?f:"data:image/png;base64,";d=f+this.base64Encode(d)}b(d)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},g,this.timeout,
-function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:h})})});h()}catch(x){null!=c&&c(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=
-function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var g=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var h=mxUtils.parseXml(a),k=this.editor.extractGraphModel(h.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var n=k.getElementsByTagName("diagram");
-if(1==n.length)k=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(n[0]))).documentElement;else if(1<n.length){f.model.beginUpdate();try{for(a=0;a<n.length;a++){var l=this.updatePageRoot(new DiagramPage(n[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=k&&"mxGraphModel"===k.nodeName&&(g=f.importGraphModel(k,b,c,d))}}catch(w){throw e||this.handleError(w,mxResources.get("invalidOrMissingFile")),
-w;}return g};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var g=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(v){this.handleError(v)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(g,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=
+function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:k})})});k()}catch(z){null!=c&&c(z)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=
+function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var g=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var k=mxUtils.parseXml(a),h=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var n=h.getElementsByTagName("diagram");
+if(1==n.length)h=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(n[0]))).documentElement;else if(1<n.length){f.model.beginUpdate();try{for(a=0;a<n.length;a++){var l=this.updatePageRoot(new DiagramPage(n[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=h&&"mxGraphModel"===h.nodeName&&(g=f.importGraphModel(h,b,c,d))}}catch(v){throw e||this.handleError(v,mxResources.get("invalidOrMissingFile")),
+v;}return g};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var g=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(w){this.handleError(w)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(g,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=
[];if(null!=e.state){e=JSON.parse(e.state);for(var g in e.Pages)a.push(e.Pages[g]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=
-function(a,b,c,d,e,f,k){f=null!=f?f:!0;k=null!=k?k:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var g=
-this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var h=this.extractGraphModelFromPng(a),l=this.importXml(h,b,c,f,!0);if(0<l.length)return l}if("data:image/svg+xml;"==a.substring(0,19))try{if(h=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(h=a.substring(a.indexOf(",")+1),h=window.atob&&!mxClient.IS_SF?atob(h):Base64.decode(h,!0)):h=decodeURIComponent(a.substring(a.indexOf(",")+1)),l=this.importXml(h,b,c,f,!0),0<l.length)return l}catch(A){}this.loadImage(a,mxUtils.bind(this,
-function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),k,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),f=Math.round(d.width*e);d=Math.round(d.height*e);g.setSelectionCell(g.insertVertex(null,
+function(a,b,c,d,e,f,h){f=null!=f?f:!0;h=null!=h?h:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var g=
+this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var k=this.extractGraphModelFromPng(a),n=this.importXml(k,b,c,f,!0);if(0<n.length)return n}if("data:image/svg+xml;"==a.substring(0,19))try{if(k=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(k=a.substring(a.indexOf(",")+1),k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0)):k=decodeURIComponent(a.substring(a.indexOf(",")+1)),n=this.importXml(k,b,c,f,!0),0<n.length)return n}catch(x){}this.loadImage(a,mxUtils.bind(this,
+function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),h,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),f=Math.round(d.width*e);d=Math.round(d.height*e);g.setSelectionCell(g.insertVertex(null,
null,"",g.snap(b),g.snap(c),f,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;g.getModel().beginUpdate();try{e=g.insertVertex(g.getDefaultParent(),null,a,g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.updateCellSize(e),g.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{g.getModel().endUpdate()}g.setSelectionCell(e)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
if(this.isCompatibleString(a))return this.importXml(a,b,c,f);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,f);else{g=this.editor.graph;e=null;g.getModel().beginUpdate();try{e=g.insertVertex(g.getDefaultParent(),null,"",g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.fireEvent(new mxEventObject("textInserted","cells",[e])),e.value=a,g.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(e.value)&&
g.setLinkForCell(e,e.value),e.geometry.width+=g.gridSize,e.geometry.height+=g.gridSize}finally{g.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=
-function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,c,d,e,f,k,l,m,u,A){u=null!=u?u:!0;var g=!1,h=null;"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=A?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(h=this.importXml(b,c,d,u),m=!0)),m||(h=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
-1))),u&&h.isGridEnabled()&&(c=h.snap(c),d=h.snap(d)),h=[h.insertVertex(null,null,"",c,d,e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,u);null!=l&&l(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,k)?(g=!0,this.parseFile(null!=
-m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=k&&".vssx"==k.toLowerCase().substring(k.length-5)&&(k=k.substring(0,k.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,k))):b=this.importXml(a,c,d,u));null!=l&&l(b)}}),k)):/(\.vsd)($|\?)/i.test(k)||(h=this.insertTextAt(this.validateFileData(a),c,d,!0,null,u));g||null==l||l(h);return h};
-EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,f;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&
-240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}f=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(f&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f&63)}return b};
-EditorUi.prototype.importFiles=function(a,b,c,d,e,f,k,l,m,u,A,z){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;u=null!=u?u:this.maxImageBytes;var g=null!=b&&null!=c,h=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var q=A||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>q){n=!0;break}var t=mxUtils.bind(this,function(){var n=this.editor.graph,m=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,h,k,l){return null!=a&&"<mxlibrary"==a.substring(0,
-10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,d,e,f,h,k,l,g,z)});f=null!=f?f:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,p=q,t=[],w=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--p){this.spinner.stop();if(null!=l)l(t);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<t.length;d++){var e=t[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}f(c)}}),
-v=0;v<q;v++)mxUtils.bind(this,function(f){var g=a[f],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==k||k(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var l=a.target.result,q=l.indexOf(","),p=decodeURIComponent(escape(atob(l.substring(q+1)))),t=mxUtils.parseXml(p),p=t.getElementsByTagName("svg");if(0<p.length){var p=p[0],D=z?null:p.getAttribute("content");null!=D&&"<"!=D.charAt(0)&&"%"!=D.charAt(0)&&(D=unescape(window.atob?atob(D):Base64.decode(D,!0)));
-null!=D&&"%"==D.charAt(0)&&(D=decodeURIComponent(D));null==D||"<mxfile "!==D.substring(0,8)&&"<mxGraphModel "!==D.substring(0,14)?w(f,mxUtils.bind(this,function(){try{if(l.substring(0,q+1),null!=t){var a=t.getElementsByTagName("svg");if(0<a.length){var h=a[0],k=parseFloat(h.getAttribute("width")),u=parseFloat(h.getAttribute("height")),p=h.getAttribute("viewBox");if(null==p||0==p.length)h.setAttribute("viewBox","0 0 "+k+" "+u);else if(isNaN(k)||isNaN(u)){var A=p.split(" ");3<A.length&&(k=parseFloat(A[2]),
-u=parseFloat(A[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var D=Math.min(1,Math.min(d/Math.max(1,k)),d/Math.max(1,u)),z=e(l,g.type,b+f*m,c+f*m,Math.max(1,Math.round(k*D)),Math.max(1,Math.round(u*D)),g.name);if(isNaN(k)||isNaN(u)){var F=new Image;F.onload=mxUtils.bind(this,function(){k=Math.max(1,F.width);u=Math.max(1,F.height);z[0].geometry.width=k;z[0].geometry.height=u;h.setAttribute("viewBox","0 0 "+k+" "+u);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0,
-a)+l.substring(l.indexOf(",",a+1)));n.setCellStyles("image",l,[z[0]])});F.src=this.createSvgDataUri(mxUtils.getXml(h))}return z}}}catch(Z){}return null})):w(f,mxUtils.bind(this,function(){return e(D,"text/xml",b+f*m,c+f*m,0,0,g.name)}))}}else{p=!1;if("image/png"==g.type){var F=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=F&&0<F.length){var v=new Image;v.src=a.target.result;w(f,mxUtils.bind(this,function(){return e(F,"text/xml",b+f*m,c+f*m,v.width,v.height,g.name)}));p=!0}}p||(mxClient.IS_CHROMEAPP?
-(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(k){this.resizeImage(k,a.target.result,mxUtils.bind(this,function(k,l,n){w(f,mxUtils.bind(this,function(){if(null!=k&&k.length<u){var q=h&&this.isResampleImage(a.target.result,A)?Math.min(1,
-Math.min(d/l,d/n)):1;return e(k,g.type,b+f*m,c+f*m,Math.round(l*q),Math.round(n*q),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),h,d,A)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*m,c+f*m,240,160,g.name,function(a){w(f,function(){return a})})});/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(g.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(g,
-mxUtils.bind(this,function(a){w(f,mxUtils.bind(this,function(){var b=g.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(g,mxUtils.bind(this,function(a){w(f,mxUtils.bind(this,function(){return this.importXml(a,b+f*m,c+f*m)}))})):e(null,g.type,b+f*m,c+f*m,240,160,g.name,function(a){w(f,function(){return a})},g):"image"==g.type.substring(0,5)?l.readAsDataURL(g):
-l.readAsText(g)})(v)});n?this.confirmImageResize(function(a){h=a;t()},m):t()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},
+function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,c,d,e,f,h,l,m,u,x){u=null!=u?u:!0;var g=!1,k=null;"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=x?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,u),m=!0)),m||(k=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
+1))),u&&k.isGridEnabled()&&(c=k.snap(c),d=k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,u);null!=l&&l(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,h)?(g=!0,this.parseFile(null!=
+m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=h&&".vssx"==h.toLowerCase().substring(h.length-5)&&(h=h.substring(0,h.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,h))):b=this.importXml(a,c,d,u));null!=l&&l(b)}}),h)):/(\.vsd)($|\?)/i.test(h)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,u));g||null==l||l(k);return k};
+EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,f,g;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&
+240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};
+EditorUi.prototype.importFiles=function(a,b,c,d,e,f,h,l,m,u,x,y){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;u=null!=u?u:this.maxImageBytes;var g=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var q=x||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>q){n=!0;break}var t=mxUtils.bind(this,function(){var n=this.editor.graph,m=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,k,h,l){return null!=a&&"<mxlibrary"==a.substring(0,
+10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,f,k,h,l,g,y)});f=null!=f?f:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,p=q,t=[],v=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--p){this.spinner.stop();if(null!=l)l(t);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<t.length;d++){var e=t[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}f(c)}}),
+w=0;w<q;w++)mxUtils.bind(this,function(f){var g=a[f],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var l=a.target.result,q=l.indexOf(","),p=decodeURIComponent(escape(atob(l.substring(q+1)))),t=mxUtils.parseXml(p),p=t.getElementsByTagName("svg");if(0<p.length){var p=p[0],C=y?null:p.getAttribute("content");null!=C&&"<"!=C.charAt(0)&&"%"!=C.charAt(0)&&(C=unescape(window.atob?atob(C):Base64.decode(C,!0)));
+null!=C&&"%"==C.charAt(0)&&(C=decodeURIComponent(C));null==C||"<mxfile "!==C.substring(0,8)&&"<mxGraphModel "!==C.substring(0,14)?v(f,mxUtils.bind(this,function(){try{if(l.substring(0,q+1),null!=t){var a=t.getElementsByTagName("svg");if(0<a.length){var k=a[0],h=parseFloat(k.getAttribute("width")),u=parseFloat(k.getAttribute("height")),p=k.getAttribute("viewBox");if(null==p||0==p.length)k.setAttribute("viewBox","0 0 "+h+" "+u);else if(isNaN(h)||isNaN(u)){var x=p.split(" ");3<x.length&&(h=parseFloat(x[2]),
+u=parseFloat(x[3]))}l=this.createSvgDataUri(mxUtils.getXml(k));var C=Math.min(1,Math.min(d/Math.max(1,h)),d/Math.max(1,u)),y=e(l,g.type,b+f*m,c+f*m,Math.max(1,Math.round(h*C)),Math.max(1,Math.round(u*C)),g.name);if(isNaN(h)||isNaN(u)){var v=new Image;v.onload=mxUtils.bind(this,function(){h=Math.max(1,v.width);u=Math.max(1,v.height);y[0].geometry.width=h;y[0].geometry.height=u;k.setAttribute("viewBox","0 0 "+h+" "+u);l=this.createSvgDataUri(mxUtils.getXml(k));var a=l.indexOf(";");0<a&&(l=l.substring(0,
+a)+l.substring(l.indexOf(",",a+1)));n.setCellStyles("image",l,[y[0]])});v.src=this.createSvgDataUri(mxUtils.getXml(k))}return y}}}catch(aa){}return null})):v(f,mxUtils.bind(this,function(){return e(C,"text/xml",b+f*m,c+f*m,0,0,g.name)}))}}else{p=!1;if("image/png"==g.type){var w=y?null:this.extractGraphModelFromPng(a.target.result);if(null!=w&&0<w.length){var I=new Image;I.src=a.target.result;v(f,mxUtils.bind(this,function(){return e(w,"text/xml",b+f*m,c+f*m,I.width,I.height,g.name)}));p=!0}}p||(mxClient.IS_CHROMEAPP?
+(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,l,n){v(f,mxUtils.bind(this,function(){if(null!=h&&h.length<u){var q=k&&this.isResampleImage(a.target.result,x)?Math.min(1,
+Math.min(d/l,d/n)):1;return e(h,g.type,b+f*m,c+f*m,Math.round(l*q),Math.round(n*q),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,x)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*m,c+f*m,240,160,g.name,function(a){v(f,function(){return a})})});/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(g.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(g,
+mxUtils.bind(this,function(a){v(f,mxUtils.bind(this,function(){var b=g.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(g,mxUtils.bind(this,function(a){v(f,mxUtils.bind(this,function(){return this.importXml(a,b+f*m,c+f*m)}))})):e(null,g.type,b+f*m,c+f*m,240,160,g.name,function(a){v(f,function(){return a})},g):"image"==g.type.substring(0,5)?l.readAsDataURL(g):
+l.readAsText(g)})(w)});n?this.confirmImageResize(function(a){k=a;t()},m):t()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},
function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=
-function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),h=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var k=Math.max(g/e,h/e);if(1<k){var l=Math.round(g/k),n=Math.round(h/k),m=document.createElement("canvas");m.width=l;m.height=n;m.getContext("2d").drawImage(a,0,0,l,n);var q=m.toDataURL();if(q.length<b.length){var p=
-document.createElement("canvas");p.width=l;p.height=n;var t=p.toDataURL();q!==t&&(b=q,g=l,h=n)}}}catch(C){}c(b,g,h)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,e=0;8>e;e++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=k;k+=b;return a.substring(c,k)}
-function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function h(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,k);do{var l=g(a);if("IDAT"==f(a,4)){e=a.substring(0,k-8);c=c+String.fromCharCode(0)+
-("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=h(c.length)+b+c+h(d^4294967295);e+=a.substring(k-8,a.length);break}e+=a.substring(k-8,k-4+l);f(a,l);f(a,4)}while(l);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
+function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var h=Math.max(g/e,k/e);if(1<h){var l=Math.round(g/h),n=Math.round(k/h),m=document.createElement("canvas");m.width=l;m.height=n;m.getContext("2d").drawImage(a,0,0,l,n);var q=m.toDataURL();if(q.length<b.length){var p=
+document.createElement("canvas");p.width=l;p.height=n;var t=p.toDataURL();q!==t&&(b=q,g=l,k=n)}}}catch(D){}c(b,g,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,e=0;8>e;e++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=h;h+=b;return a.substring(c,h)}
+function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var h=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,h);do{var l=g(a);if("IDAT"==f(a,4)){e=a.substring(0,h-8);c=c+String.fromCharCode(0)+
+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(h-8,a.length);break}e+=a.substring(h-8,h-4+l);f(a,l);f(a,4)}while(l);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(t){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=
function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph,d=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=c.addClickHandler;c.addClickHandler=function(b,d,f){var g=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(d),mxEvent.consume(b));null!=g&&g(b,d)};e.call(this,b,d,f)};f.apply(this,arguments);
-mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:k.apply(this,
+mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,
arguments)};var l=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var g=d.indexOf(",");0<g&&(g=b.getPageById(d.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=l.call(this,d,e);f&&mxEvent.addListener(g,"click",function(b){a(d);mxEvent.consume(b)});return g};var m=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");null==f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?m.apply(this,arguments):
-(c.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var x=this.actions.get("print");x.setEnabled(!mxClient.IS_IOS||!navigator.standalone);x.visible=x.isEnabled();if(!this.editor.chromeless||this.editor.editable){var u=function(){window.setTimeout(function(){A.innerHTML="&nbsp;";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
+(c.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var z=this.actions.get("print");z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);z.visible=z.isEnabled();if(!this.editor.chromeless||this.editor.editable){var u=function(){window.setTimeout(function(){x.innerHTML="&nbsp;";x.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,
-d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(T){}}),
-!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML="&nbsp;";var z=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||
-c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||z||(A.style.left=c.container.scrollLeft+10+"px",A.style.top=c.container.scrollTop+10+"px",c.container.appendChild(A),z=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll",!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
-function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!z||224!=b&&17!=b&&91!=b||(z=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(A),u())}));mxEvent.addListener(A,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&(this.copyCells(A,!0),u())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&
-!c.isCellLocked(c.getDefaultParent())&&(A.innerHTML="&nbsp;",A.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML="&nbsp;"}),0))}),!0);var w=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:w.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
+d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(R){}}),
+!1);var x=document.createElement("div");x.style.position="absolute";x.style.whiteSpace="nowrap";x.style.overflow="hidden";x.style.display="block";x.contentEditable=!0;mxUtils.setOpacity(x,0);x.style.width="1px";x.style.height="1px";x.innerHTML="&nbsp;";var y=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||
+c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||y||(x.style.left=c.container.scrollLeft+10+"px",x.style.top=c.container.scrollTop+10+"px",c.container.appendChild(x),y=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){x.focus();document.execCommand("selectAll",!1,null)},0):(x.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
+function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!y||224!=b&&17!=b&&91!=b||(y=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),x.parentNode.removeChild(x))}),0)}));mxEvent.addListener(x,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(x),u())}));mxEvent.addListener(x,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&(this.copyCells(x,!0),u())}));mxEvent.addListener(x,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&
+!c.isCellLocked(c.getDefaultParent())&&(x.innerHTML="&nbsp;",x.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,x);x.innerHTML="&nbsp;"}),0))}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==x?!0:v.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),
d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=
Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));
-a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){x=document.createElement("div");x.style.position="absolute";x.style.top="95px";x.style.left="250px";x.style.width="2000px";x.style.height="30px";x.style.background="whiteSmoke";document.body.appendChild(x);var B=document.createElement("div");B.style.position="absolute";B.style.top="125px";B.style.left="220px";B.style.width="30px";B.style.height="1000px";B.style.background="whiteSmoke";document.body.appendChild(B);
-var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,B,!0);this.hRuler=new mxRuler(this.editor.graph,x,!1)}if("1"==urlParams.test){x=document.getElementById("geFooter");null!=x&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
-this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),x.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
-this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var C=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:C.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(c.container,
+a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){z=document.createElement("div");z.style.position="absolute";z.style.top="95px";z.style.left="250px";z.style.width="2000px";z.style.height="30px";z.style.background="whiteSmoke";document.body.appendChild(z);var B=document.createElement("div");B.style.position="absolute";B.style.top="125px";B.style.left="220px";B.style.width="30px";B.style.height="1000px";B.style.background="whiteSmoke";document.body.appendChild(B);
+var H=document.createElement("div");H.style.position="absolute";H.style.top="95px";H.style.left="220px";H.style.width="30px";H.style.height="30px";H.style.background="whiteSmoke";document.body.appendChild(H);this.vRuler=new mxRuler(this.editor.graph,B,!0);this.hRuler=new mxRuler(this.editor.graph,z,!1)}if("1"==urlParams.test){z=document.getElementById("geFooter");null!=z&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
+this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),z.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
+this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:D.apply(this,arguments)}}z=document.getElementById("geInfo");null!=z&&z.parentNode.removeChild(z);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(c.container,
"dragleave",function(a){c.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E),E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(c.isEnabled()){var b=
-mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
-if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var l=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(l=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var m=!0,n=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(k,
-f,g,!0,l,null,m))});l&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;n()},mxEvent.isControlDown(a)):n()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",f,g,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-h+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
+mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
+if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var h=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=h;var l=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(l=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(h=b[0].getAttribute("href")));var n=!0,m=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(h,
+f,g,!0,l,null,n))});l&&h.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;m()},mxEvent.isControlDown(a)):m()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",f,g,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+k+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(k,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);
mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),
e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&
-(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(x){}try{var c=b.getElementsByTagName("span"),h=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(h)&&(f=!0,e=h)}catch(x){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=
-e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(x){}}}}};
+(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(z){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e=k)}catch(z){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=
+e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(z){}}}}};
EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),
mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:
a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==
@@ -6757,7 +6761,7 @@ c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.
d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length)if(!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml"),Graph.fileSupport&&
!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml",this.parseFile(a,mxUtils.bind(this,function(a){if(4==a.readyState)if(this.spinner.stop(),200<=a.status&&299>=a.status)if(a=a.responseText,"<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);null!=e&&".vssx"==e.toLowerCase().substring(e.length-5)&&(e=e.substring(0,
filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(u){this.handleError(u,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
-0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(x){this.handleError(x,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),
+0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),
this.openLocalFile(d,e,b)});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),
this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),
null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,
@@ -6766,36 +6770,37 @@ function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatCont
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
-f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function k(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
-JSON.parse(h)}catch(F){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",
-value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):k(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
-function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(F){g.postMessage(JSON.stringify({event:"draft",
-error:F.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
-return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
-null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var n=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,p=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(n);g.postMessage(JSON.stringify(b),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
-h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);p(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,y=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,
-function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?p("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");
-if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";
-if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
-this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
-(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
-l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=k(h);c=!0;try{a(h,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var D=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
-e=D();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=D();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
-b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=
-function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
-"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
-mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
-(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",k="auto",l=40,m=40,A=0,z=this.editor.graph;z.getGraphBounds();for(var w=function(){z.setSelectionCells(P);
-z.scrollCellToVisible(z.getSelectionCell())},B=z.getFreeInsertPoint(),G=B.x,C=B.y,B=C,E=null,H="auto",D=[],F=null,I=null,J=0;J<b.length&&"#"==b[J].charAt(0);){a=b[J];for(J++;J<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[J].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[J].substring(1)),J++;if("#"!=a.charAt(1)){var R=a.indexOf(":");if(0<R){var S=mxUtils.trim(a.substring(1,R)),O=mxUtils.trim(a.substring(R+1));"label"==S?E=z.sanitizeHtml(O):"style"==S?e=O:"identity"==S&&0<O.length&&"-"!=O?f=
-O:"width"==S?g=O:"height"==S?k=O:"ignore"==S?I=O.split(","):"connect"==S?D.push(JSON.parse(O)):"link"==S?F=O:"padding"==S?A=parseFloat(O):"edgespacing"==S?l=parseFloat(O):"nodespacing"==S?m=parseFloat(O):"layout"==S&&(H=O)}}}var T=this.editor.csvToArray(b[J]);a=null;if(null!=f)for(var L=0;L<T.length;L++)if(f==T[L]){a=L;break}null==E&&(E="%"+T[0]+"%");if(null!=D)for(var N=0;N<D.length;N++)null==d[D[N].to]&&(d[D[N].to]={});z.model.beginUpdate();try{for(L=J+1;L<b.length;L++){var U=this.editor.csvToArray(b[L]);
-if(U.length==T.length){var K=null,Y=null!=a?U[a]:null;null!=Y&&(K=z.model.getCell(Y));null==K&&(K=new mxCell(E,new mxGeometry(G,B,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=Y);for(var Q=0;Q<U.length;Q++)z.setAttributeForCell(K,T[Q],U[Q]);z.setAttributeForCell(K,"placeholders","1");K.style=z.replacePlaceholders(K,K.style);for(N=0;N<D.length;N++)d[D[N].to][K.getAttribute(D[N].to)]=K;null!=F&&"link"!=F&&(z.setLinkForCell(K,K.getAttribute(F)),z.setAttributeForCell(K,F,null));z.fireEvent(new mxEventObject("cellsInserted",
-"cells",[K]));var aa=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==g?aa.width+A:parseFloat(g);K.geometry.height="auto"==k?aa.height+A:parseFloat(k);B+=K.geometry.height+m;c.push(z.addCell(K))}}for(var W=c.slice(),P=c.slice(),N=0;N<D.length;N++)for(var M=D[N],L=0;L<c.length;L++){var K=c[L],X=K.getAttribute(M.from);if(null!=X){z.setAttributeForCell(K,M.from,null);for(var V=X.split(","),Q=0;Q<V.length;Q++){var ba=d[M.to][V[Q]];null!=ba&&(E=M.label,null!=M.fromlabel&&(E=(K.getAttribute(M.fromlabel)||
-"")+(E||"")),null!=M.tolabel&&(E=(E||"")+(ba.getAttribute(M.tolabel)||"")),P.push(z.insertEdge(null,null,E||"",M.invert?ba:K,M.invert?K:ba,M.style||z.createCurrentEdgeStyle())),mxUtils.remove(M.invert?K:ba,W))}}}if(null!=I)for(L=0;L<c.length;L++)for(K=c[L],Q=0;Q<I.length;Q++)z.setAttributeForCell(K,mxUtils.trim(I[Q]),null);var ca=new mxParallelEdgeLayout(z);ca.spacing=l;var ga=function(){ca.execute(z.getDefaultParent());for(var a=0;a<c.length;a++){var b=z.getCellGeometry(c[a]);b.x=Math.round(z.snap(b.x));
-b.y=Math.round(z.snap(b.y));"auto"==g&&(b.width=Math.round(z.snap(b.width)));"auto"==k&&(b.height=Math.round(z.snap(b.height)))}};if("circle"==H){var da=new mxCircleLayout(z);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(z.getDefaultParent());ga()},!0,w);w=null}else if("horizontaltree"==H||"verticaltree"==H||"auto"==H&&P.length==2*c.length-1&&1==W.length){z.view.validate();
-var ea=new mxCompactTreeLayout(z,"horizontaltree"==H);ea.levelDistance=m;ea.edgeRouting=!1;ea.resetEdges=!1;this.executeLayout(function(){ea.execute(z.getDefaultParent(),0<W.length?W[0]:null)},!0,w);w=null}else if("horizontalflow"==H||"verticalflow"==H||"auto"==H&&1==W.length){z.view.validate();var fa=new mxHierarchicalLayout(z,"horizontalflow"==H?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=m;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(z.getDefaultParent(),
-P);z.moveCells(P,G,C)},!0,w);w=null}else if("organic"==H||"auto"==H&&P.length>c.length){z.view.validate();var Z=new mxFastOrganicLayout(z);Z.forceConstant=3*m;Z.resetEdges=!1;var ia=Z.isVertexIgnored;Z.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(z);ca.spacing=l;this.executeLayout(function(){Z.execute(z.getDefaultParent());ga()},!0,w);w=null}this.hideDialog()}finally{z.model.endUpdate()}null!=w&&w()}}catch(ja){this.handleError(ja)}};
-EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
-d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
+f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(K){}return a}if(f.source==(window.opener||window.parent)){var k=f.data;if("json"==urlParams.proto){try{k=
+JSON.parse(k)}catch(I){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();var l=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",
+value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){l=null;l="data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):h(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(I){g.postMessage(JSON.stringify({event:"draft",
+error:I.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var l=1==k.enableRecent,m=1==k.enableSearch,l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=
+a;g.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==
+k.action)this.recentReadyCallback(k.list,k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==k.action){if("png"==
+k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var q=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(q);g.postMessage(JSON.stringify(b),"*")}),w=mxUtils.bind(this,function(a){null==
+a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(q))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),A=p.getGlobalVariable,C=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?C.getName():"pagenumber"==a?1:A.apply(this,arguments)};document.body.appendChild(p.container);
+p.model.setRoot(C.root)}this.exportToCanvas(mxUtils.bind(this,function(a){w(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){w(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):w(null)}),mxUtils.bind(this,function(){w(null)}))}}else{null!=
+k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)q=this.editor.getGraphXml(),n.data=this.getHtml(q,this.editor.graph),n.xml=mxUtils.getXml(q),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
+l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),
+mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(n),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=
+k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
+this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):null!=k.xml&&"data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):k.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}}k=h(k);c=!0;try{a(k,f)}catch(I){this.handleError(I)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var F=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
+1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=F();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=F();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
+b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):
+urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
+"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
+a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
+function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",h="auto",l=40,m=40,x=0,y=this.editor.graph;y.getGraphBounds();
+for(var v=function(){y.setSelectionCells(U);y.scrollCellToVisible(y.getSelectionCell())},B=y.getFreeInsertPoint(),H=B.x,D=B.y,B=D,E=null,G="auto",C=[],F=null,I=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var S=mxUtils.trim(a.substring(1,P)),O=mxUtils.trim(a.substring(P+1));"label"==S?E=y.sanitizeHtml(O):"style"==
+S?e=O:"identity"==S&&0<O.length&&"-"!=O?f=O:"width"==S?g=O:"height"==S?h=O:"ignore"==S?I=O.split(","):"connect"==S?C.push(JSON.parse(O)):"link"==S?F=O:"padding"==S?x=parseFloat(O):"edgespacing"==S?l=parseFloat(O):"nodespacing"==S?m=parseFloat(O):"layout"==S&&(G=O)}}}var R=this.editor.csvToArray(b[K]);a=null;if(null!=f)for(var M=0;M<R.length;M++)if(f==R[M]){a=M;break}null==E&&(E="%"+R[0]+"%");if(null!=C)for(var J=0;J<C.length;J++)null==d[C[J].to]&&(d[C[J].to]={});y.model.beginUpdate();try{for(M=K+
+1;M<b.length;M++){var T=this.editor.csvToArray(b[M]);if(T.length==R.length){var L=null,X=null!=a?T[a]:null;null!=X&&(L=y.model.getCell(X));null==L&&(L=new mxCell(E,new mxGeometry(H,B,0,0),e||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=X);for(var N=0;N<T.length;N++)y.setAttributeForCell(L,R[N],T[N]);y.setAttributeForCell(L,"placeholders","1");L.style=y.replacePlaceholders(L,L.style);for(J=0;J<C.length;J++)d[C[J].to][L.getAttribute(C[J].to)]=L;null!=F&&"link"!=F&&(y.setLinkForCell(L,L.getAttribute(F)),
+y.setAttributeForCell(L,F,null));y.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var Y=this.editor.graph.getPreferredSizeForCell(L);L.geometry.width="auto"==g?Y.width+x:parseFloat(g);L.geometry.height="auto"==h?Y.height+x:parseFloat(h);B+=L.geometry.height+m;c.push(y.addCell(L))}}for(var V=c.slice(),U=c.slice(),J=0;J<C.length;J++)for(var Q=C[J],M=0;M<c.length;M++){var L=c[M],Z=L.getAttribute(Q.from);if(null!=Z){y.setAttributeForCell(L,Q.from,null);for(var W=Z.split(","),N=0;N<W.length;N++){var ba=
+d[Q.to][W[N]];null!=ba&&(E=Q.label,null!=Q.fromlabel&&(E=(L.getAttribute(Q.fromlabel)||"")+(E||"")),null!=Q.tolabel&&(E=(E||"")+(ba.getAttribute(Q.tolabel)||"")),U.push(y.insertEdge(null,null,E||"",Q.invert?ba:L,Q.invert?L:ba,Q.style||y.createCurrentEdgeStyle())),mxUtils.remove(Q.invert?L:ba,V))}}}if(null!=I)for(M=0;M<c.length;M++)for(L=c[M],N=0;N<I.length;N++)y.setAttributeForCell(L,mxUtils.trim(I[N]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=l;var ga=function(){ca.execute(y.getDefaultParent());
+for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==g&&(b.width=Math.round(y.snap(b.width)));"auto"==h&&(b.height=Math.round(y.snap(b.height)))}};if("circle"==G){var da=new mxCircleLayout(y);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ga()},!0,v);v=null}else if("horizontaltree"==G||
+"verticaltree"==G||"auto"==G&&U.length==2*c.length-1&&1==V.length){y.view.validate();var ea=new mxCompactTreeLayout(y,"horizontaltree"==G);ea.levelDistance=m;ea.edgeRouting=!1;ea.resetEdges=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),0<V.length?V[0]:null)},!0,v);v=null}else if("horizontalflow"==G||"verticalflow"==G||"auto"==G&&1==V.length){y.view.validate();var fa=new mxHierarchicalLayout(y,"horizontalflow"==G?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=
+m;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(y.getDefaultParent(),U);y.moveCells(U,H,D)},!0,v);v=null}else if("organic"==G||"auto"==G&&U.length>c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*m;aa.resetEdges=!1;var ia=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=l;this.executeLayout(function(){aa.execute(y.getDefaultParent());ga()},!0,v);v=null}this.hideDialog()}finally{y.model.endUpdate()}null!=
+v&&v()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
+d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
@@ -6811,8 +6816,8 @@ EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return
this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("rename").setEnabled(null!=c&&c.isRenamable());this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());
a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var m=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);m.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=a.editor.graph;if("xml"==
-c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=g.getGraphBounds(),l=Math.floor(h.width*e/g.view.scale),m=Math.floor(h.height*e/g.view.scale);k.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+
-encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+f+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
+c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null,null,!0),k=g.getGraphBounds(),l=Math.floor(k.width*e/g.view.scale),m=Math.floor(k.height*e/g.view.scale);h.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+
+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+f+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
@@ -6827,28 +6832,28 @@ Graph.prototype.defaultThemes.darkTheme=mxUtils.parseXml('<mxStylesheet><add as=
mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxAsyncCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};mxAsyncCanvas.prototype.rotate=function(a,b,d,c,e){};
mxAsyncCanvas.prototype.setAlpha=function(a){this.state.alpha=a};mxAsyncCanvas.prototype.setFontColor=function(a){this.state.fontColor=a};mxAsyncCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAsyncCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAsyncCanvas.prototype.setFontSize=function(a){this.state.fontSize=a};
mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,b,d,c){};mxAsyncCanvas.prototype.roundrect=function(a,b,d,c,e,f){};mxAsyncCanvas.prototype.ellipse=function(a,b,d,c){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a};
-mxAsyncCanvas.prototype.image=function(a,b,d,c,e,f,k,l){e=this.rewriteImageSource(e);a=this.htmlCanvas.images[e];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[e]=a,a.src=e)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
-mxAsyncCanvas.prototype.text=function(a,b,d,c,e,f,k,l,m,g,h,n){if(null!=e&&0!=e.length&&(a=this.state.scale,"html"==m&&"function"===typeof html2canvas)){this.incWaitCounter();var q=this.canvasIndex++;html2canvas(e,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[q]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
+mxAsyncCanvas.prototype.image=function(a,b,d,c,e,f,h,l){e=this.rewriteImageSource(e);a=this.htmlCanvas.images[e];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[e]=a,a.src=e)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
+mxAsyncCanvas.prototype.text=function(a,b,d,c,e,f,h,l,m,g,k,n){if(null!=e&&0!=e.length&&(a=this.state.scale,"html"==m&&"function"===typeof html2canvas)){this.incWaitCounter();var q=this.canvasIndex++;html2canvas(e,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[q]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,d,c,e){return d+d+c+c+e+e});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};
mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a;this.ctx.scale(a,a)};mxJsCanvas.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b;this.ctx.translate(a,b)};
mxJsCanvas.prototype.rotate=function(a,b,d,c,e){c-=this.state.dx;e-=this.state.dy;this.ctx.translate(c,e);(b||d)&&this.ctx.scale(b?-1:1,d?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-c,-e)};mxJsCanvas.prototype.setAlpha=function(a){this.state.alpha=a;this.ctx.globalAlpha=a};mxJsCanvas.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null;this.ctx.fillStyle=a};
-mxJsCanvas.prototype.setGradient=function(a,b,d,c,e,f,k,l,m){d=this.ctx.createLinearGradient(0,c,0,c+f);c=this.state;c.fillColor=a;c.fillAlpha=null!=l?l:1;c.gradientColor=b;c.gradientAlpha=null!=m?m:1;c.gradientDirection=k;a=this.hexToRgb(a);b=this.hexToRgb(b);null!=a&&d.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+c.fillAlpha+")");null!=b&&d.addColorStop(1,"rgba("+b.r+","+b.g+","+b.b+","+c.gradientAlpha+")");this.ctx.fillStyle=d};
+mxJsCanvas.prototype.setGradient=function(a,b,d,c,e,f,h,l,m){d=this.ctx.createLinearGradient(0,c,0,c+f);c=this.state;c.fillColor=a;c.fillAlpha=null!=l?l:1;c.gradientColor=b;c.gradientAlpha=null!=m?m:1;c.gradientDirection=h;a=this.hexToRgb(a);b=this.hexToRgb(b);null!=a&&d.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+c.fillAlpha+")");null!=b&&d.addColorStop(1,"rgba("+b.r+","+b.g+","+b.b+","+c.gradientAlpha+")");this.ctx.fillStyle=d};
mxJsCanvas.prototype.setStrokeColor=function(a){null!=a&&(a==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=a,this.state.strokeColor=a))};mxJsCanvas.prototype.setStrokeWidth=function(a){this.ctx.lineWidth=a};mxJsCanvas.prototype.setDashed=function(a){if(this.state.dashed=a){a=this.state.dashPattern.split(" ");for(var b=0;b<a.length;b++)a[b]=parseInt(a[b],10);this.setLineDash(a)}else this.setLineDash([0])};
mxJsCanvas.prototype.setLineDash=function(a){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(a)}catch(b){}};mxJsCanvas.prototype.setDashPattern=function(a){this.state.dashPattern=a;if(this.state.dashed){a=a.split(" ");for(var b=0;b<a.length;b++)a[b]=parseInt(a[b],10);this.ctx.setLineDash(a)}};mxJsCanvas.prototype.setLineCap=function(a){this.ctx.lineCap=a};mxJsCanvas.prototype.setLineJoin=function(a){this.ctx.lineJoin=a};
mxJsCanvas.prototype.setMiterLimit=function(a){this.ctx.lineJoin=a};mxJsCanvas.prototype.setFontColor=function(a){this.ctx.fillStyle=a};mxJsCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxJsCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxJsCanvas.prototype.setFontSize=function(a){this.state.fontSize=a};
mxJsCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxJsCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxJsCanvas.prototype.setShadow=function(a){(this.state.shadow=a)?(this.setShadowOffset(this.state.shadowDx,this.state.shadowDy),this.setShadowAlpha(this.state.shadowAlpha)):(this.ctx.shadowColor="transparent",this.ctx.shadowBlur=0,this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0)};
mxJsCanvas.prototype.setShadowColor=function(a){if(null==a||a==mxConstants.NONE)a=null,this.ctx.shadowColor="transparent";this.state.shadowColor=a;if(this.state.shadow&&null!=a){var b=null!=this.state.shadowAlpha?this.state.shadowAlpha:1;a=this.hexToRgb(a);this.ctx.shadowColor="rgba("+a.r+","+a.g+","+a.b+","+b+")"}};mxJsCanvas.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a;this.setShadowColor(this.state.shadowColor)};
mxJsCanvas.prototype.setShadowOffset=function(a,b){this.state.shadowDx=a;this.state.shadowDy=b;this.state.shadow&&(this.ctx.shadowOffsetX=a,this.ctx.shadowOffsetY=b)};mxJsCanvas.prototype.moveTo=function(a,b){this.ctx.moveTo(a,b);this.lastMoveX=a;this.lastMoveY=b};mxJsCanvas.prototype.lineTo=function(a,b){this.ctx.lineTo(a,b);this.lastMoveX=a;this.lastMoveY=b};mxJsCanvas.prototype.quadTo=function(a,b,d,c){this.ctx.quadraticCurveTo(a,b,d,c);this.lastMoveX=d;this.lastMoveY=c};
-mxJsCanvas.prototype.arcTo=function(a,b,d,c,e,f,k){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,b,d,c,e,f,k);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxJsCanvas.prototype.curveTo=function(a,b,d,c,e,f){this.ctx.bezierCurveTo(a,b,d,c,e,f);this.lastMoveX=e;this.lastMoveY=f};mxJsCanvas.prototype.rect=function(a,b,d,c){this.begin();this.moveTo(a,b);this.lineTo(a+d,b);this.lineTo(a+d,b+c);this.lineTo(a,b+c);this.close()};
+mxJsCanvas.prototype.arcTo=function(a,b,d,c,e,f,h){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,b,d,c,e,f,h);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxJsCanvas.prototype.curveTo=function(a,b,d,c,e,f){this.ctx.bezierCurveTo(a,b,d,c,e,f);this.lastMoveX=e;this.lastMoveY=f};mxJsCanvas.prototype.rect=function(a,b,d,c){this.begin();this.moveTo(a,b);this.lineTo(a+d,b);this.lineTo(a+d,b+c);this.lineTo(a,b+c);this.close()};
mxJsCanvas.prototype.roundrect=function(a,b,d,c,e,f){this.begin();this.moveTo(a+e,b);this.lineTo(a+d-e,b);this.quadTo(a+d,b,a+d,b+f);this.lineTo(a+d,b+c-f);this.quadTo(a+d,b+c,a+d-e,b+c);this.lineTo(a+e,b+c);this.quadTo(a,b+c,a,b+c-f);this.lineTo(a,b+f);this.quadTo(a,b,a+e,b)};mxJsCanvas.prototype.ellipse=function(a,b,d,c){this.ctx.save();this.ctx.translate(a+d/2,b+c/2);this.ctx.scale(d/2,c/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};
mxJsCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a};
-mxJsCanvas.prototype.image=function(a,b,d,c,e,f,k,l){e=this.rewriteImageSource(e);e=this.images[e];if(null!=e&&0<e.height&&0<e.width){var m=this.ctx;m.save();if(f){f=e.width;var g=e.height,h=Math.min(d/f,c/g);a+=(d-f*h)/2;b+=(c-g*h)/2;d=f*h;c=g*h}k&&(m.translate(2*a+d,0),m.scale(-1,1));l&&(m.translate(0,2*b+c),m.scale(1,-1));m.drawImage(e,a,b,d,c);m.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
+mxJsCanvas.prototype.image=function(a,b,d,c,e,f,h,l){e=this.rewriteImageSource(e);e=this.images[e];if(null!=e&&0<e.height&&0<e.width){var m=this.ctx;m.save();if(f){f=e.width;var g=e.height,k=Math.min(d/f,c/g);a+=(d-f*k)/2;b+=(c-g*k)/2;d=f*k;c=g*k}h&&(m.translate(2*a+d,0),m.scale(-1,1));l&&(m.translate(0,2*b+c),m.scale(1,-1));m.drawImage(e,a,b,d,c);m.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var a=this.ctx.shadowColor,b=this.ctx.shadowOffsetX,d=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=a;this.ctx.shadowOffsetX=b;this.ctx.shadowOffsetY=d}else this.ctx.fill(),this.ctx.stroke()};
-mxJsCanvas.prototype.text=function(a,b,d,c,e,f,k,l,m,g,h,n){if(null!=e&&0!=e.length){d=this.state.scale;0!=n&&(this.ctx.translate(Math.round(a),Math.round(b)),this.ctx.rotate(n*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-b)));if("html"==m){e=this.subCanvas[this.canvasIndex++];m=e.height;n=e.width;switch(k){case mxConstants.ALIGN_MIDDLE:b-=m/2/d;break;case mxConstants.ALIGN_BOTTOM:b-=m/d}switch(f){case mxConstants.ALIGN_CENTER:a-=n/2/d;break;case mxConstants.ALIGN_RIGHT:a-=n/d}this.ctx.save();
+mxJsCanvas.prototype.text=function(a,b,d,c,e,f,h,l,m,g,k,n){if(null!=e&&0!=e.length){d=this.state.scale;0!=n&&(this.ctx.translate(Math.round(a),Math.round(b)),this.ctx.rotate(n*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-b)));if("html"==m){e=this.subCanvas[this.canvasIndex++];m=e.height;n=e.width;switch(h){case mxConstants.ALIGN_MIDDLE:b-=m/2/d;break;case mxConstants.ALIGN_BOTTOM:b-=m/d}switch(f){case mxConstants.ALIGN_CENTER:a-=n/2/d;break;case mxConstants.ALIGN_RIGHT:a-=n/d}this.ctx.save();
if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(a)-.5,Math.round(b)-.5,Math.round(e.width/d),Math.round(e.height/d))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(b)-.5,Math.round(e.width/d),Math.round(e.height/d)));this.ctx.scale(1/d,1/d);this.ctx.drawImage(e,
-Math.round(a*d),Math.round(b*d))}else{this.ctx.save();this.updateFont();n=document.createElement("div");n.innerHTML=e;n.style.position="absolute";n.style.top="-9999px";n.style.left="-9999px";n.style.fontFamily=this.state.fontFamily;n.style.fontWeight="bold";n.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(n);m=[n.offsetWidth,n.offsetHeight];document.body.removeChild(n);e=e.split("\n");n=m[1];this.ctx.textBaseline="top";m=b;switch(k){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
-"middle";b-=(e.length-1)*n/2;m=b-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",b-=n*(e.length-1),m=b-this.state.fontSize}k=[];n=[];for(d=0;d<e.length;d++)n[d]=a,k[d]=this.ctx.measureText(e[d]).width,null!=f&&f!=mxConstants.ALIGN_LEFT&&(n[d]-=k[d],f==mxConstants.ALIGN_CENTER&&(n[d]+=k[d]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=n[0];f=k[0];for(d=1;d<e.length;d++)a=Math.min(a,n[d]),f=Math.max(f,k[d]);this.ctx.save();
+Math.round(a*d),Math.round(b*d))}else{this.ctx.save();this.updateFont();n=document.createElement("div");n.innerHTML=e;n.style.position="absolute";n.style.top="-9999px";n.style.left="-9999px";n.style.fontFamily=this.state.fontFamily;n.style.fontWeight="bold";n.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(n);m=[n.offsetWidth,n.offsetHeight];document.body.removeChild(n);e=e.split("\n");n=m[1];this.ctx.textBaseline="top";m=b;switch(h){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
+"middle";b-=(e.length-1)*n/2;m=b-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",b-=n*(e.length-1),m=b-this.state.fontSize}h=[];n=[];for(d=0;d<e.length;d++)n[d]=a,h[d]=this.ctx.measureText(e[d]).width,null!=f&&f!=mxConstants.ALIGN_LEFT&&(n[d]-=h[d],f==mxConstants.ALIGN_CENTER&&(n[d]+=h[d]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=n[0];f=h[0];for(d=1;d<e.length;d++)a=Math.min(a,n[d]),f=Math.max(f,h[d]);this.ctx.save();
a=Math.round(a)-.5;m=Math.round(m)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,m,f,this.state.fontSize*mxConstants.LINE_HEIGHT*e.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(a,m,f,this.state.fontSize*mxConstants.LINE_HEIGHT*e.length));this.ctx.restore()}for(d=0;d<e.length;d++)this.ctx.fillText(e[d],n[d],b),b+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};
mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};DrawioClient=function(a,b){mxEventSource.call(this);this.ui=a;this.cookieName=b;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(a){this.user=a;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user};
DrawioClient.prototype.clearPersistentToken=function(){if(isLocalStorage)localStorage.removeItem("."+this.cookieName);else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie=this.cookieName+"=; expires="+a.toUTCString()}};
@@ -6950,7 +6955,7 @@ RealtimeMapping.prototype.installRealtimeCellListeners=function(a){a.addEventLis
RealtimeMapping.prototype.handleValueChanged=function(a,b){var d=a.cell;if(!this.driveRealtime.isLocalEvent(b)&&null!=d){var c=b.newValue,e=b.property,f=this.beginUpdate();"type"==e?(d.vertex="vertex"==c,d.edge="edge"==c):"connectable"==e?d.connectable="1"==c:"source"==e||"target"==e?null==c?null!=b.oldValue&&f.setTerminal(d,null,"source"==e):null!=c.cell&&this.containsRealtimeCell(c)&&null!=f.getCell(c.cellId)?f.setTerminal(d,c.cell,"source"==e):(null!=a.parent&&(a.parent.children.removeValue(a),a.parent=
null),f.setTerminal(d,null,"source"==e),f.remove(a.cell),a[e]=null):"value"==e?f.setValue(d,c):"xmlValue"==e?f.setValue(d,mxUtils.parseXml(c).documentElement):"style"==e?f.setStyle(d,c):"geometry"==e?(c=null!=c?this.driveRealtime.codec.decode(mxUtils.parseXml(c).documentElement):null,f.setGeometry(d,c)):"collapsed"==e?f.setCollapsed(d,"1"==c):"visible"==e?f.setVisible(d,"1"==c):"parent"==e&&(null!=b.oldValue?b.oldValue.children.removeValue(a):(this.createCell(a),this.restoreCell(a)),null==c?f.remove(d):
(d=c.children.indexOf(a),0<=d&&f.add(c.cell,a.cell,d)))}};
-RealtimeMapping.prototype.handleValuesAdded=function(a,b){if(!this.driveRealtime.isLocalEvent(b))for(var d=this.beginUpdate(),c=0;c<b.values.length;c++){var e=b.values[c];if(null!=e.parent)if(e.parent!=a)a.children.removeValue(e);else{if(null==e.cell||null==e.cell.parent)this.createCell(e),this.restoreCell(e);for(var f=a.children.indexOf(e),k=a.children.lastIndexOf(e);f!=k;)a.children.remove(k),k=a.children.lastIndexOf(e);e.parent==a&&d.add(a.cell,e.cell,Math.min(f,b.index+c))}}};
+RealtimeMapping.prototype.handleValuesAdded=function(a,b){if(!this.driveRealtime.isLocalEvent(b))for(var d=this.beginUpdate(),c=0;c<b.values.length;c++){var e=b.values[c];if(null!=e.parent)if(e.parent!=a)a.children.removeValue(e);else{if(null==e.cell||null==e.cell.parent)this.createCell(e),this.restoreCell(e);for(var f=a.children.indexOf(e),h=a.children.lastIndexOf(e);f!=h;)a.children.remove(h),h=a.children.lastIndexOf(e);e.parent==a&&d.add(a.cell,e.cell,Math.min(f,b.index+c))}}};
RealtimeMapping.prototype.handleValuesRemoved=function(a,b){if(!this.driveRealtime.isLocalEvent(b))for(var d=this.beginUpdate(),c=0;c<b.values.length;c++){var e=b.values[c];if(null!=e.cell)if(null!=e.parent&&e.parent!=a&&e.cell.parent!=e.parent.cell){var f=e.parent.children.indexOf(e);d.add(e.parent.cell,e.cell,f)}else f=a.children.indexOf(e),0<=f&&d.add(a.cell,e.cell,f)}};
RealtimeMapping.prototype.realtimePageFormatChanged=function(a,b){if(null!=a){var d=a.split(",");1<d.length&&(this.isActive()?b?this.graph.pageFormat=new mxRectangle(0,0,parseInt(d[0]),parseInt(d[1])):(this.driveRealtime.ignorePageFormatChanged=!0,this.ui.setPageFormat(new mxRectangle(0,0,parseInt(d[0]),parseInt(d[1]))),this.driveRealtime.ignorePageFormatChanged=!1):null!=this.page.viewState&&(this.page.viewState.pageFormat=new mxRectangle(0,0,parseInt(d[0]),parseInt(d[1]))))}};
RealtimeMapping.prototype.realtimePageScaleChanged=function(a,b){null!=a&&(this.isActive()?b?this.graph.pageScale=parseFloat(a):(this.driveRealtime.ignorePageScaleChanged=!0,this.ui.setPageScale(parseFloat(a)),this.driveRealtime.ignorePageScaleChanged=!1):null!=this.page.viewState&&(this.page.viewState.pageScale=parseFloat(a)))};
@@ -6964,8 +6969,8 @@ RealtimeMapping.prototype.removeAllRealtimeCellListeners=function(a){if(null!=a)
DriveFile.prototype.getPublicUrl=function(a){gapi.client.drive.permissions.list({fileId:this.desc.id}).execute(mxUtils.bind(this,function(b){if(null!=b&&null!=b.items)for(var d=0;d<b.items.length;d++)if("anyoneWithLink"===b.items[d].id||"anyone"===b.items[d].id){a(this.desc.webContentLink);return}a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};DriveFile.prototype.isAutosave=function(){return this.ui.editor.autosave||this.isAutosaveRevision()};
DriveFile.prototype.isAutosaveNow=function(){if(null!=this.realtime&&null!=this.realtime.root){var a=parseInt(this.realtime.root.get("backupDate")),b=parseInt(this.realtime.root.get("modifiedDate"));return isNaN(a)||isNaN(b)||a<b}return!0};DriveFile.prototype.autosaveCompleted=function(){null!=this.realtime&&null!=this.realtime.root&&this.realtime.root.set("backupDate",(new Date).getTime())};
DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.save=function(a,b,d,c){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(null,a,b,d,c)};
-DriveFile.prototype.saveFile=function(a,b,d,c,e){if(!this.isEditable())null!=d&&d();else if(!this.savingFile){this.savingFile=!0;var f=this.isModified,k=this.isModified();this.setModified(!1);this.ui.drive.saveFile(this,b,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=f;0!=a?(b&&(this.lastAutosaveRevision=(new Date).getTime()),this.desc=a,this.contentChanged(),null!=d&&d(a)):(this.setModified(k||this.isModified()),null!=c&&c())}),mxUtils.bind(this,function(a){this.savingFile=!1;
-this.isModified=f;this.setModified(k||this.isModified());null!=c&&c(a)}),e,e)}};DriveFile.prototype.saveAs=function(a,b,d){this.ui.drive.copyFile(this.getId(),a,b,d)};DriveFile.prototype.rename=function(a,b,d){this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(c){this.hasSameExtension(a,this.getTitle())?(this.desc=c,this.descriptorChanged(),null!=b&&b(c)):(this.desc=c,this.save(!0,b,d))}),d)};
+DriveFile.prototype.saveFile=function(a,b,d,c,e){if(!this.isEditable())null!=d&&d();else if(!this.savingFile){this.savingFile=!0;var f=this.isModified,h=this.isModified();this.setModified(!1);this.ui.drive.saveFile(this,b,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=f;0!=a?(b&&(this.lastAutosaveRevision=(new Date).getTime()),this.desc=a,this.contentChanged(),null!=d&&d(a)):(this.setModified(h||this.isModified()),null!=c&&c())}),mxUtils.bind(this,function(a){this.savingFile=!1;
+this.isModified=f;this.setModified(h||this.isModified());null!=c&&c(a)}),e,e)}};DriveFile.prototype.saveAs=function(a,b,d){this.ui.drive.copyFile(this.getId(),a,b,d)};DriveFile.prototype.rename=function(a,b,d){this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(c){this.hasSameExtension(a,this.getTitle())?(this.desc=c,this.descriptorChanged(),null!=b&&b(c)):(this.desc=c,this.save(!0,b,d))}),d)};
DriveFile.prototype.move=function(a,b,d){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=b&&b(a)}),d)};DriveFile.prototype.getTitle=function(){return this.desc.title};DriveFile.prototype.getHash=function(){return"G"+this.getId()};DriveFile.prototype.getId=function(){return this.desc.id};
DriveFile.prototype.isEditable=function(){var a=DrawioFile.prototype.isEditable.apply(this,arguments);return null!=this.realtime?a&&!this.realtime.rtModel.isReadOnly:a&&this.desc.editable};DriveFile.prototype.open=function(){null!=this.realtime?this.realtime.start():DrawioFile.prototype.open.apply(this,arguments)};DriveFile.prototype.close=function(a){a=null!=a?a:!1;DrawioFile.prototype.close.apply(this,arguments);null!=this.realtime&&(this.realtime.destroy(a),this.realtime=null)};DriveLibrary=function(a,b,d){DriveFile.call(this,a,b);this.desc=d};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,b,d){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=b&&b(a)}),d)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);this.ui=a;this.ui.editor.chromeless&&"1"!=urlParams.rt?(this.appId="850530949725",this.clientId="850530949725.apps.googleusercontent.com",this.scopes=["https://www.googleapis.com/auth/drive.readonly","openid"],this.mimeType="all_types_supported"):this.ui.isDriveDomain()?(this.appId="671128082532",this.clientId="671128082532.apps.googleusercontent.com",this.mimeType="application/vnd.jgraph.mxfile.realtime"):(this.appId="420247213240",this.clientId="420247213240-hnbju1pt13seqrc1hhd5htpotk4g9q7u.apps.googleusercontent.com",
this.mimeType="application/vnd.jgraph.mxfile.rtlegacy");this.mimeTypes="application/mxe,application/vnd.jgraph.mxfile,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy"};mxUtils.extend(DriveClient,mxEventSource);
@@ -6978,9 +6983,9 @@ DriveClient.prototype.setUserId=function(a,b){if(b)if(isLocalStorage)localStorag
DriveClient.prototype.getUserId=function(){var a=null;null!=this.user&&(a=this.user.id);null==a&&isLocalStorage&&(a=localStorage.getItem(".guid"));if(null==a&&"undefined"!=typeof Storage){for(var b=document.cookie.split(";"),d=0;d<b.length;d++){var c=mxUtils.trim(b[d]);if("GUID="==c.substring(0,5)){a=c.substring(5);break}}null!=a&&isLocalStorage&&(b=new Date,b.setYear(b.getFullYear()-1),document.cookie="GUID=; expires="+b.toUTCString(),localStorage.setItem(".guid",a))}return a};
DriveClient.prototype.execute=function(a){var b=mxUtils.bind(this,function(b){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,d){this.authorize(!1,function(){null!=d&&d();a()},mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.ui.drive.clearUserId();this.ui.drive.setUser(null);gapi.auth.signOut();this.ui.showError(mxResources.get("error"),
b,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,b)};
-DriveClient.prototype.executeRequest=function(a,b,d){var c=!0,e=null,f=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var k=mxUtils.bind(this,function(){this.requestThread=null;this.currentRequest=a;null!=e&&window.clearTimeout(e);e=window.setTimeout(mxUtils.bind(this,function(){c=!1;null!=d&&d({code:App.ERROR_TIMEOUT,retry:k})}),this.ui.timeout);a.execute(mxUtils.bind(this,function(l){window.clearTimeout(e);c&&(null!=l&&null==l.error?null!=b&&b(l):null!=d&&null!=l&&null!=l.error&&
-403==l.error.code&&("The requested mime type change is forbidden."==l.error.message||null!=l.error.data&&"domainPolicy"==l.error.data[0].reason)?d(l):null==l||null==l.error||401!=l.error.code&&403!=l.error.code?null!=l&&null!=l.error&&404!=l.error.code&&this.currentRequest==a&&f<this.maxRetries?(f++,this.requestThread=window.setTimeout(k,Math.round(Math.pow(2,f)*(1+.1*(Math.random()-.5))*1E3))):null!=d&&d(l):403==l.error.code&&null!=this.user?null!=d&&d(l):this.execute(k))}))});null==gapi.auth.getToken()?
-this.execute(k):k()};DriveClient.prototype.authorize=function(a,b,d,c){var e=this.getUserId();null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(e=this.ui.stateArg.userId);if(a&&null==e)null!=d&&d();else{var f={scope:this.scopes,client_id:this.clientId};a&&null!=e?(f.immediate=!0,f.user_id=e):(f.immediate=!1,f.authuser=-1);gapi.auth.authorize(f,mxUtils.bind(this,function(f){null!=f&&null==f.error?null!=this.user&&a&&this.user.id==e?null!=b&&b():this.updateUser(b,d,c):null!=d&&d(f);this.resetTokenRefresh(f)}))}};
+DriveClient.prototype.executeRequest=function(a,b,d){var c=!0,e=null,f=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var h=mxUtils.bind(this,function(){this.requestThread=null;this.currentRequest=a;null!=e&&window.clearTimeout(e);e=window.setTimeout(mxUtils.bind(this,function(){c=!1;null!=d&&d({code:App.ERROR_TIMEOUT,retry:h})}),this.ui.timeout);a.execute(mxUtils.bind(this,function(l){window.clearTimeout(e);c&&(null!=l&&null==l.error?null!=b&&b(l):null!=d&&null!=l&&null!=l.error&&
+403==l.error.code&&("The requested mime type change is forbidden."==l.error.message||null!=l.error.data&&"domainPolicy"==l.error.data[0].reason)?d(l):null==l||null==l.error||401!=l.error.code&&403!=l.error.code?null!=l&&null!=l.error&&404!=l.error.code&&this.currentRequest==a&&f<this.maxRetries?(f++,this.requestThread=window.setTimeout(h,Math.round(Math.pow(2,f)*(1+.1*(Math.random()-.5))*1E3))):null!=d&&d(l):403==l.error.code&&null!=this.user?null!=d&&d(l):this.execute(h))}))});null==gapi.auth.getToken()?
+this.execute(h):h()};DriveClient.prototype.authorize=function(a,b,d,c){var e=this.getUserId();null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(e=this.ui.stateArg.userId);if(a&&null==e)null!=d&&d();else{var f={scope:this.scopes,client_id:this.clientId};a&&null!=e?(f.immediate=!0,f.user_id=e):(f.immediate=!1,f.authuser=-1);gapi.auth.authorize(f,mxUtils.bind(this,function(f){null!=f&&null==f.error?null!=this.user&&a&&this.user.id==e?null!=b&&b():this.updateUser(b,d,c):null!=d&&d(f);this.resetTokenRefresh(f)}))}};
DriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=a&&null==a.error&&0<a.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(a.expires_in),this.lastTokenRefresh=(new Date).getTime(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*a.expires_in))};
DriveClient.prototype.checkToken=function(a){var b=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();b&&this.fireEvent(new mxEventObject("disconnected"))})):a()};
DriveClient.prototype.updateUser=function(a,b,d){var c=gapi.auth.getToken().access_token;this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token="+c,mxUtils.bind(this,function(c){var e=JSON.parse(c);this.executeRequest(gapi.client.drive.about.get(),mxUtils.bind(this,function(b){this.setUser(new DrawioUser(e.id,b.user.emailAddress,b.user.displayName,null!=b.user.picture?b.user.picture.url:null,e.locale));this.setUserId(e.id,d);null!=a&&a()}),b)}),b)};
@@ -6991,22 +6996,22 @@ a.downloadUrl+"&access_token="+gapi.auth.getToken().access_token,this.ui.convert
a,c))}catch(m){d(m)}}),d)}else d({message:mxResources.get("loggedOut")})}),d)};
DriveClient.prototype.loadRealtime=function(a,b,d){if("1"==urlParams.ignoremime||"420247213240"!=this.appId||"application/vnd.jgraph.mxfile.realtime"!=a.mimeType&&"application/mxr"!=a.mimeType)if("850530949725"!=this.appId&&(a.editable||"application/mxe"!=a.mimeType&&"application/vnd.jgraph.mxfile"!=a.mimeType)){var c=mxUtils.bind(this,function(){var e=!0,f=window.setTimeout(mxUtils.bind(this,function(){e=!1;d({code:App.ERROR_TIMEOUT,retry:c})}),this.ui.timeout);gapi.drive.realtime.load(a.id,mxUtils.bind(this,
function(a){window.clearTimeout(f);e&&b(a)}))});c()}else b();else this.redirectToNewApp(d,a.id)};
-DriveClient.prototype.getXmlFile=function(a,b,d,c,e,f){var k=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+k,mxUtils.bind(this,function(k){if(null==k)c({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||f)a.mimeType!=this.libraryMimeType||f?d(new DriveLibrary(this.ui,k,a)):c({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var l=k.lastIndexOf(",");0<l&&(l=this.ui.extractGraphModelFromPng(k.substring(l+
-1)),null!=l&&0<l.length&&(k=l))}var g=new DriveFile(this.ui,k,a,b);!e&&"850530949725"!=this.appId&&g.isEditable()&&a.mimeType!=this.mimeType?this.saveFile(g,!0,mxUtils.bind(this,function(a){g.desc=a;d(g)}),c,!0):d(g)}}),c,"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))};
-DriveClient.prototype.saveFile=function(a,b,d,c,e,f){if(a.isEditable()){var k=(new Date).getTime();e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;f=null!=f?f:!1;var l=mxUtils.bind(this,function(e,h,l){var g={mimeType:a.constructor==DriveLibrary?this.libraryMimeType:this.mimeType,title:a.getTitle()};l||(null!=e||f||(e=this.placeholderThumbnail,h=this.placeholderMimeType),null!=e&&null!=h&&(g.thumbnail={image:e,mimeType:h}));var m=function(){a.saveDelay=(new Date).getTime()-k;
+DriveClient.prototype.getXmlFile=function(a,b,d,c,e,f){var h=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+h,mxUtils.bind(this,function(h){if(null==h)c({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||f)a.mimeType!=this.libraryMimeType||f?d(new DriveLibrary(this.ui,h,a)):c({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var l=h.lastIndexOf(",");0<l&&(l=this.ui.extractGraphModelFromPng(h.substring(l+
+1)),null!=l&&0<l.length&&(h=l))}var g=new DriveFile(this.ui,h,a,b);!e&&"850530949725"!=this.appId&&g.isEditable()&&a.mimeType!=this.mimeType?this.saveFile(g,!0,mxUtils.bind(this,function(a){g.desc=a;d(g)}),c,!0):d(g)}}),c,"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))};
+DriveClient.prototype.saveFile=function(a,b,d,c,e,f){if(a.isEditable()){var h=(new Date).getTime();e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;f=null!=f?f:!1;var l=mxUtils.bind(this,function(e,k,l){var g={mimeType:a.constructor==DriveLibrary?this.libraryMimeType:this.mimeType,title:a.getTitle()};l||(null!=e||f||(e=this.placeholderThumbnail,k=this.placeholderMimeType),null!=e&&null!=k&&(g.thumbnail={image:e,mimeType:k}));var m=function(){a.saveDelay=(new Date).getTime()-h;
d.apply(this,arguments)},n=mxUtils.bind(this,function(d,e){this.executeRequest(this.createUploadRequest(a.getId(),g,d,b||a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,e),m,c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){n(a,!0)}),c,this.ui.getCurrentFile()!=a?a.getData():null):n(a.getData(),!1)}),m=mxUtils.bind(this,function(){!f&&a.constructor!=DriveLibrary&&this.enableThumbnails&&"0"!=urlParams.thumb&&this.ui.getThumbnail(this.thumbnailWidth,
mxUtils.bind(this,function(a){var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(n){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");l(b,"image/png")}))||l(null,null,a.constructor!=DriveLibrary)});e||!b?m():this.verifyMimeType(a.getId(),m,!0)}else this.ui.editor.graph.reset(),null!=c&&c({message:mxResources.get("readOnly")})};
DriveClient.prototype.verifyMimeType=function(a,b,d,c){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(d||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(d){this.checkingMimeType=!1;null!=d&&"application/vnd.jgraph.mxfile.realtime"==d.mimeType?this.redirectToNewApp(c,a):null!=
b&&b()})))};
DriveClient.prototype.redirectToNewApp=function(a,b){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var d=window.location.protocol+"//"+this.newAppHostname+"/"+this.ui.getSearch("create title mode url drive splash".split(" "))+"#G"+b;null!=a?this.ui.confirm(mxResources.get("redirectToNewApp"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href=d}),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"),
mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href=d}))}};
-DriveClient.prototype.insertFile=function(a,b,d,c,e,f,k,l){f=null!=f?f:this.mimeType;l=null!=l?l:!0;a={mimeType:f,title:a};null!=d&&(a.parents=[{kind:"drive#fileLink",id:d}]);this.executeRequest(this.createUploadRequest(null,a,b,!1,k),mxUtils.bind(this,function(a){f==this.libraryMimeType?c(new DriveLibrary(this.ui,b,a)):0==a?null!=e&&e({message:mxResources.get("errorSavingFile")}):l?this.loadRealtime(a,mxUtils.bind(this,function(d){null!=this.user?(d=new DriveFile(this.ui,b,a,d),d.lastAutosaveRevision=
+DriveClient.prototype.insertFile=function(a,b,d,c,e,f,h,l){f=null!=f?f:this.mimeType;l=null!=l?l:!0;a={mimeType:f,title:a};null!=d&&(a.parents=[{kind:"drive#fileLink",id:d}]);this.executeRequest(this.createUploadRequest(null,a,b,!1,h),mxUtils.bind(this,function(a){f==this.libraryMimeType?c(new DriveLibrary(this.ui,b,a)):0==a?null!=e&&e({message:mxResources.get("errorSavingFile")}):l?this.loadRealtime(a,mxUtils.bind(this,function(d){null!=this.user?(d=new DriveFile(this.ui,b,a,d),d.lastAutosaveRevision=
(new Date).getTime(),c(d)):null!=e&&e({message:mxResources.get("loggedOut")})}),e):c(a)}),e)};
DriveClient.prototype.createUploadRequest=function(a,b,d,c,e){e=null!=e?e:!1;a={path:"/upload/drive/v2/files"+(null!=a?"/"+a:""),method:null!=a?"PUT":"POST",params:{uploadType:"multipart"},headers:{"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'},body:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(b)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=
d?e?d:Base64.encode(d):"")+"\r\n---------314159265358979323846--"};c||(a.params.newRevision=!1);a.params.supportsTeamDrives=!0;return gapi.client.request(a)};
DriveClient.prototype.pickFile=function(a,b){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,c=b?"genericPicker":"filePicker",e=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==
-mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",e),this[c].setVisible(!1))});if(null==this[c]||this[c+"Token"]!=a){this[c+"Token"]=a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),f=(new google.picker.DocsView).setIncludeFolders(!0),k=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),l=(new google.picker.DocsUploadView).setIncludeFolders(!0);b?(a.setMimeTypes("*/*"),f.setMimeTypes("*/*"),k.setMimeTypes("*/*")):
-(a.setMimeTypes(this.mimeTypes),f.setMimeTypes(this.mimeTypes),k.setMimeTypes(this.mimeTypes));this[c]=(new google.picker.PickerBuilder).setOAuthToken(this[c+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(a).addView(f).addView(k).addView(google.picker.ViewId.RECENTLY_PICKED).addView(l).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
+mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",e),this[c].setVisible(!1))});if(null==this[c]||this[c+"Token"]!=a){this[c+"Token"]=a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),f=(new google.picker.DocsView).setIncludeFolders(!0),h=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),l=(new google.picker.DocsUploadView).setIncludeFolders(!0);b?(a.setMimeTypes("*/*"),f.setMimeTypes("*/*"),h.setMimeTypes("*/*")):
+(a.setMimeTypes(this.mimeTypes),f.setMimeTypes(this.mimeTypes),h.setMimeTypes(this.mimeTypes));this[c]=(new google.picker.PickerBuilder).setOAuthToken(this[c+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(a).addView(f).addView(h).addView(google.picker.ViewId.RECENTLY_PICKED).addView(l).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
"click",e);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",e);this[c].setVisible(!0)}))};
DriveClient.prototype.pickFolder=function(a){this.folderPickerCallback=a;this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&mxUtils.bind(this,function(){this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,d=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",d),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=
a){this.folderPickerToken=a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),e=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=
@@ -7017,119 +7022,119 @@ DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.fil
e=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),f=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(d).addView(c).addView(e).addView(google.picker.ViewId.RECENTLY_PICKED).addView(f).setCallback(mxUtils.bind(this,
function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}))};DriveClient.prototype.showPermissions=function(a){this.checkToken(mxUtils.bind(this,function(){var b=new gapi.drive.share.ShareClient(this.appId);b.setOAuthToken(gapi.auth.getToken().access_token);b.setItemIds([a]);b.showSettingsDialog()}))};DropboxFile=function(a,b,d){DrawioFile.call(this,a,b);this.stat=d};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.stat.path_display.substring(1))};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};DropboxFile.prototype.isRenamable=function(){return!0};
DropboxFile.prototype.save=function(a,b,d){this.doSave(this.getTitle(),b,d)};DropboxFile.prototype.saveAs=function(a,b,d){this.doSave(a,b,d)};DropboxFile.prototype.doSave=function(a,b,d){var c=this.stat.name;this.stat.name=a;DrawioFile.prototype.save.apply(this,arguments);this.stat.name=c;this.saveFile(a,!1,b,d)};
-DropboxFile.prototype.saveFile=function(a,b,d,c){this.isEditable()?this.savingFile?null!=c&&c({code:App.ERROR_BUSY}):(b=mxUtils.bind(this,function(b){if(b){this.savingFile=!0;var e=this.isModified,k=this.isModified(),l=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return k}});l();var m=mxUtils.bind(this,function(b){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a,b,mxUtils.bind(this,function(a){this.savingFile=
-!1;this.isModified=e;this.stat=a;this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(k||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){l();b()}}c(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(this.ui.base64ToBlob(a,"image/png"))}),c,this.ui.getCurrentFile()!=this?this.getData():null):m(this.getData())}else null!=
+DropboxFile.prototype.saveFile=function(a,b,d,c){this.isEditable()?this.savingFile?null!=c&&c({code:App.ERROR_BUSY}):(b=mxUtils.bind(this,function(b){if(b){this.savingFile=!0;var e=this.isModified,h=this.isModified(),l=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return h}});l();var m=mxUtils.bind(this,function(b){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a,b,mxUtils.bind(this,function(a){this.savingFile=
+!1;this.isModified=e;this.stat=a;this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(h||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){l();b()}}c(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(this.ui.base64ToBlob(a,"image/png"))}),c,this.ui.getCurrentFile()!=this?this.getData():null):m(this.getData())}else null!=
c&&c()}),this.getTitle()==a?b(!0):this.ui.dropbox.checkExists(a,b)):null!=d&&d()};DropboxFile.prototype.rename=function(a,b,d){this.ui.dropbox.renameFile(this,a,mxUtils.bind(this,function(c){this.hasSameExtension(a,this.getTitle())?(this.stat=c,this.descriptorChanged(),null!=b&&b()):(this.stat=c,this.descriptorChanged(),this.save(!0,b,d))}),d)};DropboxLibrary=function(a,b,d){DropboxFile.call(this,a,b,d)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(a,b,d){this.saveFile(a,!1,b,d)};DropboxLibrary.prototype.open=function(){};DropboxClient=function(a){DrawioClient.call(this,a,"dbauth");this.client=new Dropbox({clientId:App.DROPBOX_APPKEY});this.client.setAccessToken(this.token)};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio/";DropboxClient.prototype.extension=".html";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4;
DropboxClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null;this.client.authTokenRevoke().then(mxUtils.bind(this,function(){this.client.setAccessToken(null)}))};
DropboxClient.prototype.updateUser=function(a,b,d){var c=!0,e=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),f=this.client.usersGetCurrentAccount();f.then(mxUtils.bind(this,function(b){window.clearTimeout(e);c&&(this.setUser(new DrawioUser(b.account_id,b.email,b.name.display_name)),a())}));f["catch"](mxUtils.bind(this,function(f){window.clearTimeout(e);c&&(null==f||401!==f.status||d?b({message:mxResources.get("accessDenied")}):(this.setUser(null),
this.client.setAccessToken(null),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,b,!0)}),b)))}))};
-DropboxClient.prototype.authenticate=function(a,b){if(null==window.onDropboxCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(k,l){if(c){window.onDropboxCallback=null;c=!1;try{null==k?b({message:mxResources.get("accessDenied"),retry:d}):(null!=f&&f(),this.client.setAccessToken(k),
-this.setUser(null),e&&this.setPersistentToken(k),a())}catch(m){b(m)}finally{null!=l&&l.close()}}else null!=l&&l.close()}):b({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){c&&(window.onDropboxCallback=null,c=!1,b({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else b({code:App.ERROR_BUSY})};
-DropboxClient.prototype.executePromise=function(a,b,d){var c=mxUtils.bind(this,function(f){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(l);k&&null!=b&&b(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(l);k&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?d({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null),
+DropboxClient.prototype.authenticate=function(a,b){if(null==window.onDropboxCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(h,l){if(c){window.onDropboxCallback=null;c=!1;try{null==h?b({message:mxResources.get("accessDenied"),retry:d}):(null!=f&&f(),this.client.setAccessToken(h),
+this.setUser(null),e&&this.setPersistentToken(h),a())}catch(m){b(m)}finally{null!=l&&l.close()}}else null!=l&&l.close()}):b({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){c&&(window.onDropboxCallback=null,c=!1,b({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else b({code:App.ERROR_BUSY})};
+DropboxClient.prototype.executePromise=function(a,b,d){var c=mxUtils.bind(this,function(f){var h=!0,l=window.setTimeout(mxUtils.bind(this,function(){h=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(l);h&&null!=b&&b(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(l);h&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?d({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null),
f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){c(!0)},d)))}))}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},d,a):c(a)});null===this.client.getAccessToken()?this.authenticate(function(){e(!0)},d):e(!1)};DropboxClient.prototype.getLibrary=function(a,b,d){this.getFile(a,b,d,!0)};
-DropboxClient.prototype.getFile=function(a,b,d,c){c=null!=c?c:!1;var e=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.vsdx$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&e)if(null!=this.token){var f=a.split("/");this.ui.convertFile(a,0<f.length?f[f.length-1]:a,null,this.extension,b,d)}else d({message:mxResources.get("accessDenied")});else f={path:"/"+a},null!=urlParams.rev&&(f.rev=urlParams.rev),this.readFile(f,mxUtils.bind(this,function(d,f){var k=e?d.lastIndexOf(","):-1,g=null;
-0<k&&(k=this.ui.extractGraphModelFromPng(d.substring(k+1)),null!=k&&0<k.length?d=k:g=new LocalFile(this,d,a,!0));b(null!=g?g:c?new DropboxLibrary(this.ui,d,f):new DropboxFile(this.ui,d,f))}),d,e)};
-DropboxClient.prototype.readFile=function(a,b,d,c){var e=mxUtils.bind(this,function(k){var l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),g=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});g.then(mxUtils.bind(this,function(a){}));g["catch"](function(a){window.clearTimeout(m);l&&null!=a&&409==a.status&&(l=!1,d({message:mxResources.get("fileNotFound")}))});g=this.client.filesDownload(a);g.then(mxUtils.bind(this,
-function(a){window.clearTimeout(m);if(l){l=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(c){b(e.result,a)});c?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(q){d(q)}}}));g["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);l&&(l=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?d({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),k?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){f(!0)},
+DropboxClient.prototype.getFile=function(a,b,d,c){c=null!=c?c:!1;var e=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.vsdx$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&e)if(null!=this.token){var f=a.split("/");this.ui.convertFile(a,0<f.length?f[f.length-1]:a,null,this.extension,b,d)}else d({message:mxResources.get("accessDenied")});else f={path:"/"+a},null!=urlParams.rev&&(f.rev=urlParams.rev),this.readFile(f,mxUtils.bind(this,function(d,f){var h=e?d.lastIndexOf(","):-1,g=null;
+0<h&&(h=this.ui.extractGraphModelFromPng(d.substring(h+1)),null!=h&&0<h.length?d=h:g=new LocalFile(this,d,a,!0));b(null!=g?g:c?new DropboxLibrary(this.ui,d,f):new DropboxFile(this.ui,d,f))}),d,e)};
+DropboxClient.prototype.readFile=function(a,b,d,c){var e=mxUtils.bind(this,function(h){var l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),g=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});g.then(mxUtils.bind(this,function(a){}));g["catch"](function(a){window.clearTimeout(m);l&&null!=a&&409==a.status&&(l=!1,d({message:mxResources.get("fileNotFound")}))});g=this.client.filesDownload(a);g.then(mxUtils.bind(this,
+function(a){window.clearTimeout(m);if(l){l=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(c){b(e.result,a)});c?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(q){d(q)}}}));g["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);l&&(l=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?d({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),h?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){f(!0)},
d)})}):this.authenticate(function(){e(!0)},d)))}))}),f=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){f(!0)},d,a):e(a)});null===this.client.getAccessToken()?this.authenticate(function(){f(!0)},d):f(!1)};
DropboxClient.prototype.checkExists=function(a,b,d){var c=this.client.filesGetMetadata({path:"/"+a.toLowerCase(),include_deleted:!1});this.executePromise(c,mxUtils.bind(this,function(c){d?b(!1,!0,c):this.ui.confirm(mxResources.get("replaceIt",[a]),function(){b(!0,!0,c)},function(){b(!1,!0,c)})}),function(a){b(!0,!1)})};
DropboxClient.prototype.renameFile=function(a,b,d,c){if(/[\\\/:\?\*"\|]/.test(b))c({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=b){var e=a.stat.path_display.substring(1),f=e.lastIndexOf("/");0<f&&(b=e.substring(0,f+1)+b)}null!=a&&null!=b&&a.stat.path_lower.substring(1)!==b.toLowerCase()?this.checkExists(b,mxUtils.bind(this,function(e,f,m){e?(e=mxUtils.bind(this,function(e){e=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+b,autorename:!1});this.executePromise(e,
d,c)}),f&&m.path_lower.substring(1)!==b.toLowerCase()?(f=this.client.filesDelete({path:"/"+b.toLowerCase()}),this.executePromise(f,e,c)):e()):c()})):c({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(a,b,d,c){this.insertFile(a,b,d,c,!0)};
DropboxClient.prototype.insertFile=function(a,b,d,c,e){e=null!=e?e:!1;this.checkExists(a,mxUtils.bind(this,function(f){f?this.saveFile(a,b,mxUtils.bind(this,function(a){e?d(new DropboxLibrary(this.ui,b,a)):d(new DropboxFile(this.ui,b,a))}),c):c()}))};
DropboxClient.prototype.saveFile=function(a,b,d,c,e){/[\\\/:\?\*"\|]/.test(a)?c({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=b.length?c({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=e?e:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([b],{type:"text/plain"})}),this.executePromise(a,d,c))};
-DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(b){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var d=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),c=b[0].link.indexOf(this.appPath);if(0<c){var e=decodeURIComponent(b[0].link.substring(c+this.appPath.length-1));this.readFile({path:e},mxUtils.bind(this,function(c,k){if(null!=k&&k.id==b[0].id)try{this.ui.spinner.stop(),
-a(e.substring(1),new DropboxLibrary(this.ui,c,k))}catch(l){this.ui.handleError(l)}else this.createLibrary(b[0],a,d)}),d)}else this.createLibrary(b[0],a,d)}})})};
+DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(b){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var d=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),c=b[0].link.indexOf(this.appPath);if(0<c){var e=decodeURIComponent(b[0].link.substring(c+this.appPath.length-1));this.readFile({path:e},mxUtils.bind(this,function(c,h){if(null!=h&&h.id==b[0].id)try{this.ui.spinner.stop(),
+a(e.substring(1),new DropboxLibrary(this.ui,c,h))}catch(l){this.ui.handleError(l)}else this.createLibrary(b[0],a,d)}),d)}else this.createLibrary(b[0],a,d)}})})};
DropboxClient.prototype.createLibrary=function(a,b,d){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(c){this.insertFile(a.name,c,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),b(a.getHash().substring(1),a)}catch(f){d(f)}}),d,!0)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};
DropboxClient.prototype.pickFile=function(a,b){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,b){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):b.getHash(),null,b)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(d){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(b)this.ui.spinner.stop(),a(d[0].link);else{var c=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),e=mxUtils.bind(this,
-function(b,c){this.ui.spinner.stop();a(b,c)}),f=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!this.ui.useCanvasForExport&&f)e(d[0].link);else{var k=d[0].link.indexOf(this.appPath);if(0<k){var l=decodeURIComponent(d[0].link.substring(k+this.appPath.length-1));this.readFile({path:l},mxUtils.bind(this,function(b,g){if(null!=g&&g.id==d[0].id){var k=f?b.lastIndexOf(","):-1;this.ui.spinner.stop();var m=null;0<k&&(k=this.ui.extractGraphModelFromPng(b.substring(k+
-1)),null!=k&&0<k.length?b=k:m=new LocalFile(this,b,l,!0));a(l.substring(1),null!=m?m:new DropboxFile(this.ui,b,g))}else this.createFile(d[0],e,c)}),c,f)}else this.createFile(d[0],e,c)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
+function(b,c){this.ui.spinner.stop();a(b,c)}),f=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!this.ui.useCanvasForExport&&f)e(d[0].link);else{var h=d[0].link.indexOf(this.appPath);if(0<h){var l=decodeURIComponent(d[0].link.substring(h+this.appPath.length-1));this.readFile({path:l},mxUtils.bind(this,function(b,g){if(null!=g&&g.id==d[0].id){var h=f?b.lastIndexOf(","):-1;this.ui.spinner.stop();var m=null;0<h&&(h=this.ui.extractGraphModelFromPng(b.substring(h+
+1)),null!=h&&0<h.length?b=h:m=new LocalFile(this,b,l,!0));a(l.substring(1),null!=m?m:new DropboxFile(this.ui,b,g))}else this.createFile(d[0],e,c)}),c,f)}else this.createFile(d[0],e,c)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
DropboxClient.prototype.createFile=function(a,b,d){var c=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(e){null!=e&&0<e.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var f=c?e.lastIndexOf(","):-1;0<f&&(f=this.ui.extractGraphModelFromPng(e.substring(f+1)),null!=f&&0<f.length&&(e=f));this.insertFile(a.name,e,mxUtils.bind(this,function(c){b(a.name,c)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):
(this.ui.spinner.stop(),d({message:mxResources.get("errorLoadingFile")}))}),d,c)};OneDriveFile=function(a,b,d){DrawioFile.call(this,a,b);this.meta=d};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getHash=function(){return"W"+encodeURIComponent(this.meta.id)};OneDriveFile.prototype.getMode=function(){return App.MODE_ONEDRIVE};OneDriveFile.prototype.isAutosaveOptional=function(){return!0};OneDriveFile.prototype.getTitle=function(){return this.meta.name};OneDriveFile.prototype.isRenamable=function(){return!0};
OneDriveFile.prototype.save=function(a,b,d){this.doSave(this.getTitle(),b,d)};OneDriveFile.prototype.saveAs=function(a,b,d){this.doSave(a,b,d)};OneDriveFile.prototype.doSave=function(a,b,d){var c=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=c;this.saveFile(a,!1,b,d)};
-OneDriveFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&c({code:App.ERROR_BUSY});else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});k();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.meta=a;this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=
-!1;this.isModified=e;this.setModified(f||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}c(a)}}))}else this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}));else null!=d&&d()};
+OneDriveFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&c({code:App.ERROR_BUSY});else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),h=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});h();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.meta=a;this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=
+!1;this.isModified=e;this.setModified(f||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){h();b()}}c(a)}}))}else this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}));else null!=d&&d()};
OneDriveFile.prototype.rename=function(a,b,d){this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(c){this.hasSameExtension(a,this.getTitle())?(this.meta=c,this.descriptorChanged(),null!=b&&b()):(this.meta=c,this.save(!0,b,d))}),d)};OneDriveFile.prototype.move=function(a,b,d){this.ui.oneDrive.moveFile(this.meta.id,a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=b&&b(a)}),d)};OneDriveLibrary=function(a,b,d){OneDriveFile.call(this,a,b,d)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.doSave=function(a,b,d){this.saveFile(a,!1,b,d)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a){DrawioClient.call(this,a,"odauth");this.token=this.token};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId="test.draw.io"==window.location.hostname?"2e598409-107f-4b59-89ca-d7723c8e00a4":"45c10911-200f-4e27-a666-9e9fca147395";OneDriveClient.prototype.scopes="user.read";OneDriveClient.prototype.redirectUri="https://"+window.location.hostname+"/onedrive3.html";OneDriveClient.prototype.extension=".html";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";
OneDriveClient.prototype.get=function(a,b,d){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(b,d);return a};
OneDriveClient.prototype.updateUser=function(a,b,d){var c=!0,e=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(f){window.clearTimeout(e);c&&(200>f.getStatus()||300<=f.getStatus()?d?b({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,b,!0)}),b)):(f=JSON.parse(f.getText()),this.setUser(new DrawioUser(f.id,null,f.displayName)),
a()))}),b)};
-OneDriveClient.prototype.authenticate=function(a,b){if(null==window.onOneDriveCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){var k="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=token&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes)+"&response_mode=fragment",k=window.open(k,"odauth",["width=525,height=525","top="+(window.screenY+
-Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=k&&(window.onOneDriveCallback=mxUtils.bind(this,function(k,m){if(c){window.onOneDriveCallback=null;c=!1;try{null==k?b({message:mxResources.get("accessDenied"),retry:d}):(null!=f&&f(),this.setUser(null),this.token=k,e&&this.setPersistentToken(k),a())}catch(g){b(g)}finally{null!=m&&m.close()}}else null!=m&&m.close()}),k.focus())}),
+OneDriveClient.prototype.authenticate=function(a,b){if(null==window.onOneDriveCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){var h="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=token&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes)+"&response_mode=fragment",h=window.open(h,"odauth",["width=525,height=525","top="+(window.screenY+
+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=h&&(window.onOneDriveCallback=mxUtils.bind(this,function(h,m){if(c){window.onOneDriveCallback=null;c=!1;try{null==h?b({message:mxResources.get("accessDenied"),retry:d}):(null!=f&&f(),this.setUser(null),this.token=h,e&&this.setPersistentToken(h),a())}catch(g){b(g)}finally{null!=m&&m.close()}}else null!=m&&m.close()}),h.focus())}),
mxUtils.bind(this,function(){c&&(window.onOneDriveCallback=null,c=!1,b({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else b({code:App.ERROR_BUSY})};
-OneDriveClient.prototype.executeRequest=function(a,b,d){var c=mxUtils.bind(this,function(f){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(l);k&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?b(a):401===a.getStatus()||400===a.getStatus()?(this.clearPersistentToken(),this.setUser(null),this.token=null,f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
+OneDriveClient.prototype.executeRequest=function(a,b,d){var c=mxUtils.bind(this,function(f){var h=!0,l=window.setTimeout(mxUtils.bind(this,function(){h=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(l);h&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?b(a):401===a.getStatus()||400===a.getStatus()?(this.clearPersistentToken(),this.setUser(null),this.token=null,f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){c(!0)},d)):d(this.parseRequestText(a)))}),d)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},d,a):c(a)});null==this.token?this.authenticate(function(){e(!0)},d):e(!1)};OneDriveClient.prototype.getLibrary=function(a,b,d){this.getFile(a,b,d,!1,!0)};
OneDriveClient.prototype.getFile=function(a,b,d,c,e){e=null!=e?e:!1;this.executeRequest(this.baseUrl+"/me/drive/items/"+a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var c=JSON.parse(a.getText()),f=/\.png$/i.test(c.name);if(/\.vsdx$/i.test(c.name)||/\.gliffy$/i.test(c.name)||!this.ui.useCanvasForExport&&f)this.ui.convertFile(c["@microsoft.graph.downloadUrl"],c.name,null!=c.file?c.file.mimeType:null,this.extension,b,d);else{var m=!0,g=window.setTimeout(mxUtils.bind(this,
-function(){m=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(c["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){window.clearTimeout(g);if(m){var d=f?a.lastIndexOf(","):-1,k=null;0<d&&(d=this.ui.extractGraphModelFromPng(a.substring(d+1)),null!=d&&0<d.length?a=d:k=new LocalFile(this.ui,a,c.name,!0));null!=k?b(k):e?b(new OneDriveLibrary(this.ui,a,c)):b(new OneDriveFile(this.ui,a,c))}}),mxUtils.bind(this,function(a){window.clearTimeout(g);m&&d(this.parseRequestText(a))}),
+function(){m=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(c["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){window.clearTimeout(g);if(m){var d=f?a.lastIndexOf(","):-1,h=null;0<d&&(d=this.ui.extractGraphModelFromPng(a.substring(d+1)),null!=d&&0<d.length?a=d:h=new LocalFile(this.ui,a,c.name,!0));null!=h?b(h):e?b(new OneDriveLibrary(this.ui,a,c)):b(new OneDriveFile(this.ui,a,c))}}),mxUtils.bind(this,function(a){window.clearTimeout(g);m&&d(this.parseRequestText(a))}),
f||null!=c.file&&null!=c.file.mimeType&&"image/"==c.file.mimeType.substring(0,6))}}else d(this.parseRequestText(a))}),d)};OneDriveClient.prototype.renameFile=function(a,b,d,c){null!=a&&null!=b&&this.checkExists(a.meta.parentReference.id,b,!1,mxUtils.bind(this,function(e){e?this.writeFile(this.baseUrl+"/me/drive/items/"+a.meta.id,JSON.stringify({name:b}),"PATCH","application/json",d,c):c()}))};
OneDriveClient.prototype.moveFile=function(a,b,d,c){this.writeFile(this.baseUrl+"/me/drive/items/"+a,JSON.stringify({parentReference:{id:b}}),"PATCH","application/json",d,c)};OneDriveClient.prototype.insertLibrary=function(a,b,d,c,e){this.insertFile(a,b,d,c,!0,e)};
-OneDriveClient.prototype.insertFile=function(a,b,d,c,e,f){e=null!=e?e:!1;this.checkExists(f,a,!0,mxUtils.bind(this,function(k){k?this.writeFile(this.baseUrl+(null!=f?"/me/drive/items/"+f:"/me/drive/root")+"/children/"+a+"/content",b,"PUT",null,mxUtils.bind(this,function(a){e?d(new OneDriveLibrary(this.ui,b,a)):d(new OneDriveFile(this.ui,b,a))}),c):c()}))};
+OneDriveClient.prototype.insertFile=function(a,b,d,c,e,f){e=null!=e?e:!1;this.checkExists(f,a,!0,mxUtils.bind(this,function(h){h?this.writeFile(this.baseUrl+(null!=f?"/me/drive/items/"+f:"/me/drive/root")+"/children/"+a+"/content",b,"PUT",null,mxUtils.bind(this,function(a){e?d(new OneDriveLibrary(this.ui,b,a)):d(new OneDriveFile(this.ui,b,a))}),c):c()}))};
OneDriveClient.prototype.checkExists=function(a,b,d,c){this.executeRequest(this.baseUrl+(null!=a?"/me/drive/items/"+a:"/me/drive/root")+"/children/"+b,mxUtils.bind(this,function(a){404==a.getStatus()?c(!0):d?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[b]),function(){c(!0)},function(){c(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)}))}),function(a){c(!1)},!0)};
OneDriveClient.prototype.saveFile=function(a,b,d){var c=mxUtils.bind(this,function(c){this.writeFile(this.baseUrl+"/me/drive/items/"+a.meta.id+"/content/",c,"PUT",null,b,d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){c(this.ui.base64ToBlob(a,"image/png"))}),d,this.ui.getCurrentFile()!=a?a.getData():null):c(a.getData())};
-OneDriveClient.prototype.writeFile=function(a,b,d,c,e,f){if(null!=a&&null!=b){var k=mxUtils.bind(this,function(m){var g=!0,h=window.setTimeout(mxUtils.bind(this,function(){g=!1;f({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout),n=new mxXmlRequest(a,b,d);n.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Content-Type",c||" ");a.setRequestHeader("Authorization","Bearer "+this.token)});n.send(mxUtils.bind(this,function(a){window.clearTimeout(h);g&&(200<=a.getStatus()&&299>=a.getStatus()?
-e(JSON.parse(a.getText())):401===a.getStatus()?(this.clearPersistentToken(),this.setUser(null),this.token=null,m?f({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){l(!0)},f)})}):this.authenticate(function(){k(!0)},f)):f(this.parseRequestText(a)))}),mxUtils.bind(this,function(a){window.clearTimeout(h);g&&f(this.parseRequestText(a))}))}),l=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){l(!0)},f,a):k(a)});null==this.token?
+OneDriveClient.prototype.writeFile=function(a,b,d,c,e,f){if(null!=a&&null!=b){var h=mxUtils.bind(this,function(m){var g=!0,k=window.setTimeout(mxUtils.bind(this,function(){g=!1;f({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout),n=new mxXmlRequest(a,b,d);n.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Content-Type",c||" ");a.setRequestHeader("Authorization","Bearer "+this.token)});n.send(mxUtils.bind(this,function(a){window.clearTimeout(k);g&&(200<=a.getStatus()&&299>=a.getStatus()?
+e(JSON.parse(a.getText())):401===a.getStatus()?(this.clearPersistentToken(),this.setUser(null),this.token=null,m?f({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){l(!0)},f)})}):this.authenticate(function(){h(!0)},f)):f(this.parseRequestText(a)))}),mxUtils.bind(this,function(a){window.clearTimeout(k);g&&f(this.parseRequestText(a))}))}),l=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){l(!0)},f,a):h(a)});null==this.token?
this.authenticate(function(){l(!0)},f):l(!1)}else f({message:mxResources.get("unknownError")})};OneDriveClient.prototype.parseRequestText=function(a){var b={message:mxResources.get("unknownError")};try{b=JSON.parse(a.getText())}catch(d){}return b};OneDriveClient.prototype.pickLibrary=function(a){this.pickFile(a)};
OneDriveClient.prototype.pickFolder=function(a){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{redirectUri:this.redirectUri},success:mxUtils.bind(this,function(b){this.token=b.accessToken;a(b)}),cancel:function(){},error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})};
OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("W"+encodeURIComponent(a))});OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{redirectUri:this.redirectUri},success:mxUtils.bind(this,function(b){null!=b&&null!=b.value&&0<b.value.length&&(this.token=b.accessToken,a(b.value[0].id,b))}),cancel:function(){},error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})};
OneDriveClient.prototype.logout=function(){if(isLocalStorage){var a=localStorage.getItem("odpickerv7cache");null!=a&&'{"odsdkLoginHint":{'==a.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}this.clearPersistentToken();this.setUser(null);this.token=null};GitHubFile=function(a,b,d){DrawioFile.call(this,a,b);this.meta=d};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):""))};
GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(b){a(200<=b.getStatus()&&299>=b.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};GitHubFile.prototype.isRenamable=function(){return!1};
GitHubFile.prototype.save=function(a,b,d){this.doSave(this.getTitle(),b,d)};GitHubFile.prototype.saveAs=function(a,b,d){this.doSave(a,b,d)};GitHubFile.prototype.doSave=function(a,b,d){var c=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=c;this.saveFile(a,!1,b,d)};
-GitHubFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&c({code:App.ERROR_BUSY});else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});k();this.ui.gitHub.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.meta.sha=a.content.sha;this.meta.html_url=a.content.html_url;this.meta.download_url=a.content.download_url;
-this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());this.isModified()&&this.addUnsavedStatus();if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}c(a)}}))}else this.ui.pickFolder(App.MODE_GITHUB,mxUtils.bind(this,function(b){this.ui.gitHub.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=
+GitHubFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&c({code:App.ERROR_BUSY});else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),h=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});h();this.ui.gitHub.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.meta.sha=a.content.sha;this.meta.html_url=a.content.html_url;this.meta.download_url=a.content.download_url;
+this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());this.isModified()&&this.addUnsavedStatus();if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){h();b()}}c(a)}}))}else this.ui.pickFolder(App.MODE_GITHUB,mxUtils.bind(this,function(b){this.ui.gitHub.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=
!1;null!=c&&c()}),!1,b)}));else null!=d&&d()};GitHubLibrary=function(a,b,d){GitHubFile.call(this,a,b,d)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(a,b,d){this.saveFile(a,!1,b,d)};GitHubLibrary.prototype.open=function(){};GitHubClient=function(a){DrawioClient.call(this,a,"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"23bc97120b9035515661":"89c9e4624ca416554489";GitHubClient.prototype.scope="repo";GitHubClient.prototype.extension=".xml";GitHubClient.prototype.baseUrl="https://api.github.com";GitHubClient.prototype.maxFileSize=1E6;
GitHubClient.prototype.updateUser=function(a,b,d){var c=!0,e=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(f){window.clearTimeout(e);c&&(401===f.getStatus()?d?b({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,b,!0)}),b)):200>f.getStatus()||300<=f.getStatus()?b({message:mxResources.get("accessDenied")}):
(f=JSON.parse(f.getText()),this.setUser(new DrawioUser(f.id,f.email,f.name)),a()))}))};
-GitHubClient.prototype.authenticate=function(a,b){if(null==window.onGitHubCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,l){if(c)if(window.onGitHubCallback=null,c=!1,null==k)b({message:mxResources.get("accessDenied"),retry:d});else{var m=mxUtils.bind(this,function(){var c=
-!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(g){window.clearTimeout(d);if(c)try{if(200>g.getStatus()||300<=g.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=f&&f();var k=g.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){b(t)}finally{null!=l&&
+GitHubClient.prototype.authenticate=function(a,b){if(null==window.onGitHubCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(h,l){if(c)if(window.onGitHubCallback=null,c=!1,null==h)b({message:mxResources.get("accessDenied"),retry:d});else{var m=mxUtils.bind(this,function(){var c=
+!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+h,mxUtils.bind(this,function(g){window.clearTimeout(d);if(c)try{if(200>g.getStatus()||300<=g.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=f&&f();var h=g.getText();this.token=h.substring(h.indexOf("=")+1,h.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){b(t)}finally{null!=l&&
l.close()}}))});m()}else null!=l&&l.close()}):b({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){c&&(window.onGitHubCallback=null,c=!1,b({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else b({code:App.ERROR_BUSY})};
-GitHubClient.prototype.executeRequest=function(a,b,d){var c=mxUtils.bind(this,function(f){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),m=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+m)};a.send(mxUtils.bind(this,function(){window.clearTimeout(l);if(k)if(200<=a.getStatus()&&299>=a.getStatus())b(a);else if(401===a.getStatus())f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
-function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){c(!0)},d);else if(403===a.getStatus()){var g=!1;try{var h=JSON.parse(a.getText());null!=h&&null!=h.errors&&0<h.errors.length&&(g="too_large"==h.errors[0].code)}catch(n){}d({message:mxResources.get(g?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?d({message:mxResources.get("fileNotFound")}):409===a.getStatus()?d({status:409}):d({message:mxResources.get("error")+" "+a.getStatus()})}),d)}),e=mxUtils.bind(this,
+GitHubClient.prototype.executeRequest=function(a,b,d){var c=mxUtils.bind(this,function(f){var h=!0,l=window.setTimeout(mxUtils.bind(this,function(){h=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),m=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+m)};a.send(mxUtils.bind(this,function(){window.clearTimeout(l);if(h)if(200<=a.getStatus()&&299>=a.getStatus())b(a);else if(401===a.getStatus())f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
+function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){c(!0)},d);else if(403===a.getStatus()){var g=!1;try{var k=JSON.parse(a.getText());null!=k&&null!=k.errors&&0<k.errors.length&&(g="too_large"==k.errors[0].code)}catch(n){}d({message:mxResources.get(g?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?d({message:mxResources.get("fileNotFound")}):409===a.getStatus()?d({status:409}):d({message:mxResources.get("error")+" "+a.getStatus()})}),d)}),e=mxUtils.bind(this,
function(a){null==this.user?this.updateUser(function(){e(!0)},d,a):c(a)});null==this.token?this.authenticate(function(){e(!0)},d):e(!1)};GitHubClient.prototype.getLibrary=function(a,b,d){this.getFile(a,b,d,!0)};
-GitHubClient.prototype.getFile=function(a,b,d,c,e){c=null!=c?c:!1;var f=a.split("/"),k=f[0],l=f[1],m=f[2];a=f.slice(3,f.length).join("/");f=/\.png$/i.test(a);!e&&(/\.vsdx$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&f)?null!=this.token?(e=this.baseUrl+"/repos/"+k+"/"+l+"/contents/"+a+"?ref="+m+"&token="+this.token,f=a.split("/"),this.ui.convertFile(e,0<f.length?f[f.length-1]:a,null,this.extension,b,d)):d({message:mxResources.get("accessDenied")}):(a=new mxXmlRequest(this.baseUrl+
-"/repos/"+k+"/"+l+"/contents/"+a+"?ref="+m,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.createGitHubFile(k,l,m,JSON.parse(a.getText()),c))}catch(h){d(h)}}),d))};
+GitHubClient.prototype.getFile=function(a,b,d,c,e){c=null!=c?c:!1;var f=a.split("/"),h=f[0],l=f[1],m=f[2];a=f.slice(3,f.length).join("/");f=/\.png$/i.test(a);!e&&(/\.vsdx$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&f)?null!=this.token?(e=this.baseUrl+"/repos/"+h+"/"+l+"/contents/"+a+"?ref="+m+"&token="+this.token,f=a.split("/"),this.ui.convertFile(e,0<f.length?f[f.length-1]:a,null,this.extension,b,d)):d({message:mxResources.get("accessDenied")}):(a=new mxXmlRequest(this.baseUrl+
+"/repos/"+h+"/"+l+"/contents/"+a+"?ref="+m,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.createGitHubFile(h,l,m,JSON.parse(a.getText()),c))}catch(k){d(k)}}),d))};
GitHubClient.prototype.createGitHubFile=function(a,b,d,c,e){a={org:a,repo:b,ref:d,name:c.name,path:c.path,sha:c.sha,html_url:c.html_url,download_url:c.download_url};b=c.content;"base64"===c.encoding&&(/\.jpe?g$/i.test(c.name)?b="data:image/jpeg;base64,"+b:/\.gif$/i.test(c.name)?b="data:image/gif;base64,"+b:/\.png$/i.test(c.name)?(c=this.ui.extractGraphModelFromPng(b),b=null!=c&&0<c.length?c:"data:image/png;base64,"+b):b=Base64.decode(b));return e?new GitHubLibrary(this.ui,b,a):new GitHubFile(this.ui,
b,a)};GitHubClient.prototype.insertLibrary=function(a,b,d,c,e){this.insertFile(a,b,d,c,!0,e,!1)};
-GitHubClient.prototype.insertFile=function(a,b,d,c,e,f,k){e=null!=e?e:!1;f=f.split("/");var l=f[0],m=f[1],g=f[2],h=f.slice(3,f.length).join("/");0<h.length&&(h+="/");h+=a;this.checkExists(l+"/"+m+"/"+g+"/"+h,!0,mxUtils.bind(this,function(f,q){f?e?(k||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(l,m,g,h,a,b,q,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());d(this.createGitHubFile(l,m,g,b.content,e))}catch(y){c(y)}}),c)}),c)):d(new GitHubFile(this.ui,
-b,{org:l,repo:m,ref:g,name:a,path:h,sha:q,isNew:!0})):c()}))};GitHubClient.prototype.showCommitDialog=function(a,b,d,c){var e=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(b?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){e();d(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){c()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
-GitHubClient.prototype.writeFile=function(a,b,d,c,e,f,k,l,m){f.length>=this.maxFileSize?m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 1 MB)"}):(d={path:c,branch:decodeURIComponent(d),message:e,content:f},null!=k&&(d.sha=k),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+b+"/contents/"+c,JSON.stringify(d),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){l(a)}),m))};
+GitHubClient.prototype.insertFile=function(a,b,d,c,e,f,h){e=null!=e?e:!1;f=f.split("/");var l=f[0],m=f[1],g=f[2],k=f.slice(3,f.length).join("/");0<k.length&&(k+="/");k+=a;this.checkExists(l+"/"+m+"/"+g+"/"+k,!0,mxUtils.bind(this,function(f,q){f?e?(h||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(l,m,g,k,a,b,q,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());d(this.createGitHubFile(l,m,g,b.content,e))}catch(A){c(A)}}),c)}),c)):d(new GitHubFile(this.ui,
+b,{org:l,repo:m,ref:g,name:a,path:k,sha:q,isNew:!0})):c()}))};GitHubClient.prototype.showCommitDialog=function(a,b,d,c){var e=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(b?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){e();d(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){c()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
+GitHubClient.prototype.writeFile=function(a,b,d,c,e,f,h,l,m){f.length>=this.maxFileSize?m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 1 MB)"}):(d={path:c,branch:decodeURIComponent(d),message:e,content:f},null!=h&&(d.sha=h),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+b+"/contents/"+c,JSON.stringify(d),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){l(a)}),m))};
GitHubClient.prototype.checkExists=function(a,b,d){this.getFile(a,mxUtils.bind(this,function(c){if(b&&null!=c.meta){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();d(!0,c.meta.sha)},function(){e();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(a){d(!0)}),null,!0)};
-GitHubClient.prototype.saveFile=function(a,b,d){var c=a.meta.org,e=a.meta.repo,f=a.meta.ref,k=a.meta.path;this.showCommitDialog(a.meta.name,null==a.meta.sha||a.meta.isNew,mxUtils.bind(this,function(l){var m=mxUtils.bind(this,function(g,h){this.writeFile(c,e,f,k,l,h,g,mxUtils.bind(this,function(c){delete a.meta.isNew;b(JSON.parse(c.getText()))}),mxUtils.bind(this,function(a){null!=a&&409==a.status?(resume=this.ui.spinner.pause(),a=new ErrorDialog(this.ui,mxResources.get("errorSavingFile"),mxResources.get("fileChangedOverwrite"),
-mxResources.get("cancel"),mxUtils.bind(this,function(){d()}),null,mxResources.get("overwrite"),mxUtils.bind(this,function(){resume();this.getFile(c+"/"+e+"/"+f+"/"+k,mxUtils.bind(this,function(a){m(a.meta.sha,h)}),mxUtils.bind(this,function(){m(null,h)}))})),this.ui.showDialog(a.container,340,150,!0,!1),a.init()):d(a)}))});this.ui.useCanvasForExport&&/(\.png)$/i.test(k)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){m(a.meta.sha,b)}),d,this.ui.getCurrentFile()!=a?a.getData():null):m(a.meta.sha,
+GitHubClient.prototype.saveFile=function(a,b,d){var c=a.meta.org,e=a.meta.repo,f=a.meta.ref,h=a.meta.path;this.showCommitDialog(a.meta.name,null==a.meta.sha||a.meta.isNew,mxUtils.bind(this,function(l){var m=mxUtils.bind(this,function(g,k){this.writeFile(c,e,f,h,l,k,g,mxUtils.bind(this,function(c){delete a.meta.isNew;b(JSON.parse(c.getText()))}),mxUtils.bind(this,function(a){null!=a&&409==a.status?(resume=this.ui.spinner.pause(),a=new ErrorDialog(this.ui,mxResources.get("errorSavingFile"),mxResources.get("fileChangedOverwrite"),
+mxResources.get("cancel"),mxUtils.bind(this,function(){d()}),null,mxResources.get("overwrite"),mxUtils.bind(this,function(){resume();this.getFile(c+"/"+e+"/"+f+"/"+h,mxUtils.bind(this,function(a){m(a.meta.sha,k)}),mxUtils.bind(this,function(){m(null,k)}))})),this.ui.showDialog(a.container,340,150,!0,!1),a.init()):d(a)}))});this.ui.useCanvasForExport&&/(\.png)$/i.test(h)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){m(a.meta.sha,b)}),d,this.ui.getCurrentFile()!=a?a.getData():null):m(a.meta.sha,
Base64.encode(a.getData()))}),mxUtils.bind(this,function(){d()}))};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
-GitHubClient.prototype.showGitHubDialog=function(a,b){var d=null,c=null,e=null,f=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,mxResources.get(a?"selectFile":"selectFolder"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(l);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.height="194px";
-k.appendChild(m);var g=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+f)}));this.ui.showDialog(g.container,340,270,!0,!0);a&&g.okButton.parentNode.removeChild(g.okButton);var h=mxUtils.bind(this,function(a,b){var c=document.createElement("a");c.setAttribute("href","javascript:void(0);");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);return c}),n=mxUtils.bind(this,function(a){var b=document.createElement("div");b.style.marginBottom="8px";b.appendChild(h(d+
-"/"+c,mxUtils.bind(this,function(){f=null;x()})));a||(mxUtils.write(b," / "),b.appendChild(h(decodeURIComponent(e),mxUtils.bind(this,function(){f=null;y()}))));if(null!=f&&0<f.length){var g=f.split("/");for(a=0;a<g.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(h(g[a],mxUtils.bind(this,function(){f=g.slice(0,a+1).join("/");t()})))})(a)}m.appendChild(b)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
-(f=e=c=d=null,x()):this.ui.hideDialog()}))}),t=mxUtils.bind(this,function(){var k=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/contents/"+f+"?ref="+encodeURIComponent(e),null,"GET");g.okButton.removeAttribute("disabled");m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));this.executeRequest(k,mxUtils.bind(this,function(g){n();this.ui.spinner.stop();var k=JSON.parse(g.getText());m.appendChild(h("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,x();else{var a=f.split("/");
-f=a.slice(0,a.length-1).join("/");t()}})));mxUtils.br(m);null==k||0==k.length?mxUtils.write(m,mxResources.get("noFiles")):(g=mxUtils.bind(this,function(g){for(var l=0;l<k.length;l++)mxUtils.bind(this,function(k){g==("dir"==k.type)&&(m.appendChild(h(k.name+("dir"==k.type?"/":""),mxUtils.bind(this,function(){"dir"==k.type?(f=k.path,t()):a&&"file"==k.type&&(this.ui.hideDialog(),b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+k.path))}))),mxUtils.br(m))})(k[l])}),g(!0),a&&g(!1))}),q)}),p=null,v=null,y=mxUtils.bind(this,
-function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/branches?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p);p=document.createElement("a");p.style.display="block";p.setAttribute("href","javascript:void(0);");mxUtils.write(p,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(m,
-"scroll",v);y(a+1)});mxEvent.addListener(p,"click",k);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(n(!0),m.appendChild(h("../ [Up]",mxUtils.bind(this,function(){f=null;x()}))),mxUtils.br(m));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){m.appendChild(h(a.name,mxUtils.bind(this,function(){e=a.name;f="";t()})));mxUtils.br(m)})(b[c]);100==b.length&&(m.appendChild(p),
-v=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",v))}}),q)}),x=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p);p=document.createElement("a");p.style.display="block";p.setAttribute("href","javascript:void(0);");
-mxUtils.write(p,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",v);x(a+1)});mxEvent.addListener(p,"click",k);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==a&&(m.appendChild(h(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,
-function(a){if(null!=a){var b=a.split("/");if(1<b.length){a=b[0];var g=b[1];3>b.length?(d=a,c=g,f=e=null,y()):this.ui.spinner.spin(m,mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+g+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();d=a.meta.org;c=a.meta.repo;e=decodeURIComponent(a.meta.ref);f="";t()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
-this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){m.appendChild(h(a.full_name,mxUtils.bind(this,function(){d=a.owner.login;c=a.name;e=a.default_branch;f="";t()})));mxUtils.br(m)})(b[g])}100==b.length&&(m.appendChild(p),v=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",
-v))}),q)});x()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,b,d){DrawioFile.call(this,a,b);this.meta=d;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};
+GitHubClient.prototype.showGitHubDialog=function(a,b){var d=null,c=null,e=null,f=null,h=document.createElement("div");h.style.whiteSpace="nowrap";h.style.overflow="hidden";h.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,mxResources.get(a?"selectFile":"selectFolder"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";h.appendChild(l);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.height="194px";
+h.appendChild(m);var g=new CustomDialog(this.ui,h,mxUtils.bind(this,function(){b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+f)}));this.ui.showDialog(g.container,340,270,!0,!0);a&&g.okButton.parentNode.removeChild(g.okButton);var k=mxUtils.bind(this,function(a,b){var c=document.createElement("a");c.setAttribute("href","javascript:void(0);");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);return c}),n=mxUtils.bind(this,function(a){var b=document.createElement("div");b.style.marginBottom="8px";b.appendChild(k(d+
+"/"+c,mxUtils.bind(this,function(){f=null;z()})));a||(mxUtils.write(b," / "),b.appendChild(k(decodeURIComponent(e),mxUtils.bind(this,function(){f=null;A()}))));if(null!=f&&0<f.length){var g=f.split("/");for(a=0;a<g.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(k(g[a],mxUtils.bind(this,function(){f=g.slice(0,a+1).join("/");t()})))})(a)}m.appendChild(b)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
+(f=e=c=d=null,z()):this.ui.hideDialog()}))}),t=mxUtils.bind(this,function(){var h=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/contents/"+f+"?ref="+encodeURIComponent(e),null,"GET");g.okButton.removeAttribute("disabled");m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));this.executeRequest(h,mxUtils.bind(this,function(g){n();this.ui.spinner.stop();var h=JSON.parse(g.getText());m.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,z();else{var a=f.split("/");
+f=a.slice(0,a.length-1).join("/");t()}})));mxUtils.br(m);null==h||0==h.length?mxUtils.write(m,mxResources.get("noFiles")):(g=mxUtils.bind(this,function(g){for(var l=0;l<h.length;l++)mxUtils.bind(this,function(h){g==("dir"==h.type)&&(m.appendChild(k(h.name+("dir"==h.type?"/":""),mxUtils.bind(this,function(){"dir"==h.type?(f=h.path,t()):a&&"file"==h.type&&(this.ui.hideDialog(),b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+h.path))}))),mxUtils.br(m))})(h[l])}),g(!0),a&&g(!1))}),q)}),p=null,w=null,A=mxUtils.bind(this,
+function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/branches?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p);p=document.createElement("a");p.style.display="block";p.setAttribute("href","javascript:void(0);");mxUtils.write(p,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(m,
+"scroll",w);A(a+1)});mxEvent.addListener(p,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(n(!0),m.appendChild(k("../ [Up]",mxUtils.bind(this,function(){f=null;z()}))),mxUtils.br(m));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){m.appendChild(k(a.name,mxUtils.bind(this,function(){e=a.name;f="";t()})));mxUtils.br(m)})(b[c]);100==b.length&&(m.appendChild(p),
+w=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&h()},mxEvent.addListener(m,"scroll",w))}}),q)}),z=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p);p=document.createElement("a");p.style.display="block";p.setAttribute("href","javascript:void(0);");
+mxUtils.write(p,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",w);z(a+1)});mxEvent.addListener(p,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==a&&(m.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,
+function(a){if(null!=a){var b=a.split("/");if(1<b.length){a=b[0];var g=b[1];3>b.length?(d=a,c=g,f=e=null,A()):this.ui.spinner.spin(m,mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+g+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();d=a.meta.org;c=a.meta.repo;e=decodeURIComponent(a.meta.ref);f="";t()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
+this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){m.appendChild(k(a.full_name,mxUtils.bind(this,function(){d=a.owner.login;c=a.name;e=a.default_branch;f="";t()})));mxUtils.br(m)})(b[g])}100==b.length&&(m.appendChild(p),w=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&h()},mxEvent.addListener(m,"scroll",
+w))}),q)});z()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,b,d){DrawioFile.call(this,a,b);this.meta=d;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};
TrelloFile.prototype.save=function(a,b,d){this.doSave(this.getTitle(),b,d)};TrelloFile.prototype.saveAs=function(a,b,d){this.doSave(a,b,d)};TrelloFile.prototype.doSave=function(a,b,d){var c=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=c;this.saveFile(a,!1,b,d)};
-TrelloFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&(this.saveNeededCounter++,c({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});k();this.ui.trello.saveFile(this,mxUtils.bind(this,function(f){this.savingFile=!1;this.isModified=e;this.meta=f;this.contentChanged();null!=d&&d();0<this.saveNeededCounter&&
-(this.saveNeededCounter--,this.saveFile(a,b,d,c))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}c(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(e);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,
+TrelloFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&(this.saveNeededCounter++,c({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),h=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});h();this.ui.trello.saveFile(this,mxUtils.bind(this,function(f){this.savingFile=!1;this.isModified=e;this.meta=f;this.contentChanged();null!=d&&d();0<this.saveNeededCounter&&
+(this.saveNeededCounter--,this.saveFile(a,b,d,c))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){h();b()}}c(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(e);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,
b,d,c))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}),!1,e)}));else null!=d&&d()};TrelloLibrary=function(a,b,d){TrelloFile.call(this,a,b,d)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,b,d){this.saveFile(a,!1,b,d)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";
TrelloClient.prototype.authenticate=function(a,b,d){d&&this.logout();d=mxUtils.bind(this,function(c,d){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:c?"never":"1hour",success:function(){null!=d&&d();a()},error:function(){null!=d&&d();null!=b&&b(mxResources.get("loggedOut"))}})});this.isAuthorized()?d(!0):this.ui.showAuthDialog(this,!0,d)};TrelloClient.prototype.getLibrary=function(a,b,d){this.getFile(a,b,d,!1,!0)};
TrelloClient.prototype.getFile=function(a,b,d,c,e){e=null!=e?e:!1;var f=mxUtils.bind(this,function(){var c=a.split(this.SEPARATOR),l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;d({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout);Trello.cards.get(c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(c){window.clearTimeout(m);if(l){var g=/\.png$/i.test(c.name);/\.vsdx$/i.test(c.name)||/\.gliffy$/i.test(c.name)||!this.ui.useCanvasForExport&&g?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(c.url),
c.name,c.mimeType,this.extension,b,d):(l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(c.url),mxUtils.bind(this,function(d){window.clearTimeout(m);if(l){c.compoundId=a;var f=g?d.lastIndexOf(","):-1;0<f&&(f=this.ui.extractGraphModelFromPng(d.substring(f+1)),null!=f&&0<f.length&&(d=f));e?b(new TrelloLibrary(this.ui,d,c)):b(new TrelloFile(this.ui,d,c))}}),mxUtils.bind(this,function(a,b){window.clearTimeout(m);
l&&(401==b.status?this.authenticate(f,d,!0):d())}),g||null!=c.mimeType&&"image/"==c.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(m);l&&(401==a.status?this.authenticate(f,d,!0):d())}))});this.authenticate(f,d)};TrelloClient.prototype.insertLibrary=function(a,b,d,c,e){this.insertFile(a,b,d,c,!0,e)};
-TrelloClient.prototype.insertFile=function(a,b,d,c,e,f){e=null!=e?e:!1;var k=mxUtils.bind(this,function(){var k=mxUtils.bind(this,function(k){this.writeFile(a,k,f,mxUtils.bind(this,function(a){e?d(new TrelloLibrary(this.ui,b,a)):d(new TrelloFile(this.ui,b,a))}),c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){k(this.ui.base64ToBlob(a,"image/png"))}),c,b):k(b)});this.authenticate(k,c)};
+TrelloClient.prototype.insertFile=function(a,b,d,c,e,f){e=null!=e?e:!1;var h=mxUtils.bind(this,function(){var h=mxUtils.bind(this,function(h){this.writeFile(a,h,f,mxUtils.bind(this,function(a){e?d(new TrelloLibrary(this.ui,b,a)):d(new TrelloFile(this.ui,b,a))}),c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){h(this.ui.base64ToBlob(a,"image/png"))}),c,b):h(b)});this.authenticate(h,c)};
TrelloClient.prototype.saveFile=function(a,b,d){var c=a.meta.compoundId.split(this.SEPARATOR),e=mxUtils.bind(this,function(e){Trello.del("cards/"+c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(){this.writeFile(a.meta.name,e,c[0],b,d)}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(f,d,!0):d()}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,"image/png"))}),
d,this.ui.getCurrentFile()!=a?a.getData():null):e(a.getData())});this.authenticate(f,d)};
-TrelloClient.prototype.writeFile=function(a,b,d,c,e){if(null!=a&&null!=b)if(b.length>=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;e({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),m=new FormData;m.append("key",Trello.key());m.append("token",Trello.token());m.append("file","string"===typeof b?new Blob([b]):b,a);m.append("name",
-a);var g=new XMLHttpRequest;g.responseType="json";g.onreadystatechange=mxUtils.bind(this,function(){if(4===g.readyState&&(window.clearTimeout(l),k))if(200==g.status){var a=g.response;a.compoundId=d+this.SEPARATOR+a.id;c(a)}else 401==g.status?this.authenticate(f,e,!0):e()});g.open("POST",this.baseUrl+"cards/"+d+"/attachments");g.send(m)});this.authenticate(f,e)}else e({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
+TrelloClient.prototype.writeFile=function(a,b,d,c,e){if(null!=a&&null!=b)if(b.length>=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){var h=!0,l=window.setTimeout(mxUtils.bind(this,function(){h=!1;e({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),m=new FormData;m.append("key",Trello.key());m.append("token",Trello.token());m.append("file","string"===typeof b?new Blob([b]):b,a);m.append("name",
+a);var g=new XMLHttpRequest;g.responseType="json";g.onreadystatechange=mxUtils.bind(this,function(){if(4===g.readyState&&(window.clearTimeout(l),h))if(200==g.status){var a=g.response;a.compoundId=d+this.SEPARATOR+a.id;c(a)}else 401==g.status?this.authenticate(f,e,!0):e()});g.open("POST",this.baseUrl+"cards/"+d+"/attachments");g.send(m)});this.authenticate(f,e)}else e({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};TrelloClient.prototype.pickFile=function(a,b){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a,mxResources.get("ok"))}))};
-TrelloClient.prototype.showTrelloDialog=function(a,b){var d=null,c="@me",e=0,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.height="224px";var k=document.createElement("h3");mxUtils.write(k,a?mxResources.get("selectFile"):mxResources.get("selectCard"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="auto";l.style.height=
+TrelloClient.prototype.showTrelloDialog=function(a,b){var d=null,c="@me",e=0,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.height="224px";var h=document.createElement("h3");mxUtils.write(h,a?mxResources.get("selectFile"):mxResources.get("selectCard"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(h);var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="auto";l.style.height=
"194px";f.appendChild(l);f=new CustomDialog(this.ui,f);this.ui.showDialog(f.container,340,270,!0,!0);f.okButton.parentNode.removeChild(f.okButton);var m=mxUtils.bind(this,function(a,b,c){e++;var d=document.createElement("div");d.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;background:"+(0==e%2?"#eee":"#fff");var f=document.createElement("a");f.setAttribute("href","javascript:void(0);");if(null!=c){var g=document.createElement("img");g.src=c.url;g.width=c.width;g.height=
-c.height;g.style="border: 1px solid black;margin:5px;vertical-align:middle";f.appendChild(g)}mxUtils.write(f,a);mxEvent.addListener(f,"click",b);d.appendChild(f);return d}),g=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),h=mxUtils.bind(this,function(){e=0;l.innerHTML="";this.ui.spinner.spin(l,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(d+"/attachments",{fields:"id,name,previews"},
+c.height;g.style="border: 1px solid black;margin:5px;vertical-align:middle";f.appendChild(g)}mxUtils.write(f,a);mxEvent.addListener(f,"click",b);d.appendChild(f);return d}),g=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),k=mxUtils.bind(this,function(){e=0;l.innerHTML="";this.ui.spinner.spin(l,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(d+"/attachments",{fields:"id,name,previews"},
mxUtils.bind(this,function(a){this.ui.spinner.stop();l.appendChild(m("../ [Up]",mxUtils.bind(this,function(){t()})));mxUtils.br(l);null==a||0==a.length?mxUtils.write(l,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){l.appendChild(m(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();b(d+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[c])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,g,!0):
-null!=g&&g(b)}))});a()}),n=null,q=null,t=mxUtils.bind(this,function(f){null==f&&(e=0,l.innerHTML="",f=1);this.ui.spinner.spin(l,mxResources.get("loading"));null!=n&&null!=n.parentNode&&n.parentNode.removeChild(n);n=document.createElement("a");n.style.display="block";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(l,"scroll",q);t(f+1)});mxEvent.addListener(n,"click",k);var p=mxUtils.bind(this,function(){Trello.get("search",
+null!=g&&g(b)}))});a()}),n=null,q=null,t=mxUtils.bind(this,function(f){null==f&&(e=0,l.innerHTML="",f=1);this.ui.spinner.spin(l,mxResources.get("loading"));null!=n&&null!=n.parentNode&&n.parentNode.removeChild(n);n=document.createElement("a");n.style.display="block";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(l,"scroll",q);t(f+1)});mxEvent.addListener(n,"click",h);var p=mxUtils.bind(this,function(){Trello.get("search",
{query:""==mxUtils.trim(c)?"is:open":c,cards_limit:100,cards_page:f-1},mxUtils.bind(this,function(e){this.ui.spinner.stop();e=null!=e?e.cards:null;if(null==e||0==e.length)mxUtils.write(l,mxResources.get("noFiles"));else{1==f&&(l.appendChild(m(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,c,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(c=a,t())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
-this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(l));for(var g=0;g<e.length;g++)mxUtils.bind(this,function(c){l.appendChild(m(c.name,mxUtils.bind(this,function(){a?(d=c.id,h()):(this.ui.hideDialog(),b(c.id))})))})(e[g]);100==e.length&&(l.appendChild(n),q=function(){l.scrollTop>=l.scrollHeight-l.offsetHeight&&k()},mxEvent.addListener(l,"scroll",q))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(p,g,!0):null!=g&&g({message:a.responseText})}))});p()});t()};
-TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};function ChatWindow(a,b,d,c,e,f,k,l){this.editorUi=a;this.doc=l.doc;this.rtModel=l.rt;this.chatHistory=l.chatHistory;this.chatMap=l.chatMap;this.configCollabInfo();d=document.createElement("div");d.id="mainDiv";l=document.createElement("div");l.style.padding="3px";d.appendChild(l);var m=document.createElement("div");m.style.paddingLeft="3px";m.style.paddingRight="15px";a.editor.graph.isEnabled()&&d.appendChild(m);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
+this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(l));for(var g=0;g<e.length;g++)mxUtils.bind(this,function(c){l.appendChild(m(c.name,mxUtils.bind(this,function(){a?(d=c.id,k()):(this.ui.hideDialog(),b(c.id))})))})(e[g]);100==e.length&&(l.appendChild(n),q=function(){l.scrollTop>=l.scrollHeight-l.offsetHeight&&h()},mxEvent.addListener(l,"scroll",q))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(p,g,!0):null!=g&&g({message:a.responseText})}))});p()});t()};
+TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};function ChatWindow(a,b,d,c,e,f,h,l){this.editorUi=a;this.doc=l.doc;this.rtModel=l.rt;this.chatHistory=l.chatHistory;this.chatMap=l.chatMap;this.configCollabInfo();d=document.createElement("div");d.id="mainDiv";l=document.createElement("div");l.style.padding="3px";d.appendChild(l);var m=document.createElement("div");m.style.paddingLeft="3px";m.style.paddingRight="15px";a.editor.graph.isEnabled()&&d.appendChild(m);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
this.chatArea.style.overflowX="hidden";this.chatArea.style.overflowY="auto";this.chatArea.style.width="98%";this.chatArea.style.resize="none";l.appendChild(this.chatArea);this.chatLineArea=document.createElement("textarea");this.chatLineArea.style.resize="none";this.chatLineArea.rows=1;this.chatLineArea.onkeydown=mxUtils.bind(this,function(a){13==(a.keyCode||window.event.keyCode)&&""!=this.chatLineArea.value&&this.sendMessage()});this.sendBtn=document.createElement("button");this.sendBtn.style.cssFloat=
-"right";this.sendBtn.style.styleFloat="right";mxUtils.write(this.sendBtn,mxResources.get("sendMessage"));mxEvent.addListener(this.sendBtn,"click",mxUtils.bind(this,function(a){""!=this.chatLineArea.value&&this.sendMessage()}));m.appendChild(this.chatLineArea);m.appendChild(this.sendBtn);this.window=new mxWindow(b,d,c,e,f,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!0);this.window.setScrollable(!0);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
+"right";this.sendBtn.style.styleFloat="right";mxUtils.write(this.sendBtn,mxResources.get("sendMessage"));mxEvent.addListener(this.sendBtn,"click",mxUtils.bind(this,function(a){""!=this.chatLineArea.value&&this.sendMessage()}));m.appendChild(this.chatLineArea);m.appendChild(this.sendBtn);this.window=new mxWindow(b,d,c,e,f,h,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!0);this.window.setScrollable(!0);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
this.handleResize();this.window.addListener(mxEvent.RESIZE,mxUtils.bind(this,this.handleResize));this.window.addListener(mxEvent.MAXIMIZE,mxUtils.bind(this,this.handleResize));this.window.addListener(mxEvent.NORMALIZE,mxUtils.bind(this,this.handleResize));if(null!=this.chatHistory){for(a=Math.max(0,this.chatHistory.length-this.chatHistoryShow);a<this.chatHistory.length;a++)this.updateChatArea(this.chatHistory.get(a));this.chatHistory.addEventListener(gapi.drive.realtime.EventType.VALUES_ADDED,mxUtils.bind(this,
function(a){this.updateChatArea(a.target.get(a.index))}))}this.doc.addEventListener(gapi.drive.realtime.EventType.COLLABORATOR_JOINED,mxUtils.bind(this,this.collaboratorListener));this.doc.addEventListener(gapi.drive.realtime.EventType.COLLABORATOR_LEFT,mxUtils.bind(this,this.collaboratorListener));null!=this.chatMap&&this.chatMap.addEventListener(gapi.drive.realtime.EventType.VALUE_CHANGED,mxUtils.bind(this,function(a){this.updateChatArea(a.target.get(a.property))}))}
ChatWindow.prototype.window=null;ChatWindow.prototype.doc=null;ChatWindow.prototype.chatHistory=null;ChatWindow.prototype.chatMap=null;ChatWindow.prototype.chatHistoryShow=10;ChatWindow.prototype.chatHistorySize=0;ChatWindow.prototype.setChatMap=function(a){this.chatMap=a};
@@ -7145,19 +7150,19 @@ App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugin
replay:"/plugins/replay.js",anon:"/plugins/anonymize.js",tr:"/plugins/trello.js"};
App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var b=document.cookie.split(";"),d=0;d<b.length;d++){var c=mxUtils.trim(b[d]);if("MODE="==c.substring(0,5)){a=c.substring(5);break}}null!=a&&isLocalStorage&&(b=new Date,b.setYear(b.getFullYear()-1),document.cookie="MODE=; expires="+b.toUTCString(),localStorage.setItem(".mode",a))}return a};
(function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode,null==App.mode&&(App.mode=App.getStoredMode())),null!=window.mxscript&&("1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&
-"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0,
-2)?(mxscript(App.DROPBOX_URL),mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=
-null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?(mxscript(App.TRELLO_JQUERY_URL),mxscript(App.TRELLO_URL)):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})();
-App.main=function(a,b){var d=null;EditorUi.enableLogging&&(window.onerror=function(a,b,c,e,f){try{if(a!=d&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){d=a;var g=new Image,k=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";g.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+k+"&v="+encodeURIComponent(EditorUi.VERSION)+
-"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=f&&null!=f.stack?"&stack="+encodeURIComponent(f.stack):"")}}catch(v){}});if(null!=window.mxscript){if("1"==urlParams.offline){mxscript("js/shapes.min.js");var c=document.createElement("iframe");c.setAttribute("width","0");c.setAttribute("height","0");c.setAttribute("src","offline.html");document.body.appendChild(c)}if("0"!=urlParams.plugins&&
-"1"!=urlParams.offline){var c=mxSettings.getPlugins(),e=urlParams.p;App.initPluginCallback();if(null!=e){var f="";"1"==urlParams.drawdev&&(f=document.location.protocol+"//drawhost.jgraph.com/");for(var k=e.split(";"),e=0;e<k.length;e++){var l=App.pluginRegistry[k[e]];null!=l?mxscript(f+l):null!=window.console&&console.log("Unknown plugin:",k[e])}}else"0"==urlParams.chrome||EditorUi.isElectronApp||mxscript(App.FOOTER_PLUGIN_URL);if(null!=c&&0<c.length&&"0"!=urlParams.plugins){f=window.location.protocol+
-"//"+window.location.host;k=!0;for(e=0;e<c.length&&k;e++)"/"!=c[e].charAt(0)&&c[e].substring(0,f.length)!=f&&(k=!1);if(k||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[c.join("\n")]).replace(/\\n/g,"\n")))for(e=0;e<c.length;e++)try{mxscript(c[e])}catch(m){}}}"function"===typeof window.DriveClient&&
-"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback"):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;c=mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,
-mxLanguage);mxUtils.getAll("1"!=urlParams.dev?[c]:[c,"dark"==uiTheme?STYLE_PATH+"/dark-default.xml":STYLE_PATH+"/default.xml"],function(c){mxResources.parse(c[0].getText());1<c.length&&(Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=c[1].getDocumentElement());c=null!=b?b():new App(new Editor("0"==urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||
-"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=
-urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?
-mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML=
-'Error loading page. <a href="javascript:void(0);" onclick="location.reload();">Please try refreshing.</a>'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
+"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js",null,null,null,mxClient.IS_SVG):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==
+window.location.hash.substring(0,2)?(mxscript(App.DROPBOX_URL),mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=
+null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?(mxscript(App.TRELLO_JQUERY_URL),mxscript(App.TRELLO_URL)):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})();
+App.main=function(a,b){var d=null;EditorUi.enableLogging&&(window.onerror=function(a,b,c,e,f){try{if(a!=d&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){d=a;var g=new Image,h=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";g.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+h+"&v="+encodeURIComponent(EditorUi.VERSION)+
+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=f&&null!=f.stack?"&stack="+encodeURIComponent(f.stack):"")}}catch(w){}});if(null!=window.mxscript){if("1"==urlParams.offline){mxscript("js/shapes.min.js");var c=document.createElement("iframe");c.setAttribute("width","0");c.setAttribute("height","0");c.setAttribute("src","offline.html");document.body.appendChild(c)}if("0"!=urlParams.plugins&&
+"1"!=urlParams.offline){var c=mxSettings.getPlugins(),e=urlParams.p;App.initPluginCallback();if(null!=e){var f="";"1"==urlParams.drawdev&&(f=document.location.protocol+"//drawhost.jgraph.com/");for(var h=e.split(";"),e=0;e<h.length;e++){var l=App.pluginRegistry[h[e]];null!=l?mxscript(f+l):null!=window.console&&console.log("Unknown plugin:",h[e])}}else"0"==urlParams.chrome||EditorUi.isElectronApp||mxscript(App.FOOTER_PLUGIN_URL,null,null,null,mxClient.IS_SVG);if(null!=c&&0<c.length&&"0"!=urlParams.plugins){f=
+window.location.protocol+"//"+window.location.host;h=!0;for(e=0;e<c.length&&h;e++)"/"!=c[e].charAt(0)&&c[e].substring(0,f.length)!=f&&(h=!1);if(h||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[c.join("\n")]).replace(/\\n/g,"\n")))for(e=0;e<c.length;e++)try{mxscript(c[e])}catch(m){}}}"function"===
+typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;c=mxResources.getDefaultBundle(RESOURCE_BASE,
+mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage);mxUtils.getAll("1"!=urlParams.dev?[c]:[c,"dark"==uiTheme?STYLE_PATH+"/dark-default.xml":STYLE_PATH+"/default.xml"],function(c){mxResources.parse(c[0].getText());1<c.length&&(Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=c[1].getDocumentElement());c=null!=b?b():new App(new Editor("0"==urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&
+("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&
+("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||
+10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},
+function(){document.getElementById("geStatus").innerHTML='Error loading page. <a href="javascript:void(0);" onclick="location.reload();">Please try refreshing.</a>'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
App.prototype.chevronUpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUY1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NjA1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1RDUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1RTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg+qUokAAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAAL0lEQVR42mJgRgMMRAswMKAKMDDARBjg8lARBoR6KImkH0wTbygT6YaS4DmAAAMAYPkClOEDDD0AAAAASUVORK5CYII=":
IMAGE_PATH+"/chevron-up.png";
App.prototype.chevronDownImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUI1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NUM1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1OTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1QTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsCtve8AAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAALUlEQVR42mJgRgMMRAkwQEXBNAOcBSPhclB1cNVwfcxI+vEZykSpoSR6DiDAAF23ApT99bZ+AAAAAElFTkSuQmCC":IMAGE_PATH+
@@ -7178,9 +7183,9 @@ IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.ge
App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"cdn.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"jgraph.github.io"==window.location.hostname)};App.prototype.isLegacyDriveDomain=function(){return 0==urlParams.drive||"legacy.draw.io"==window.location.hostname};
App.prototype.checkLicense=function(){var a=this.drive.getUser(),b=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=b){var d=b.lastIndexOf("@"),c=b;0<=d&&(c=b.substring(d+1));mxUtils.post("/license","domain="+encodeURIComponent(c)+"&email="+encodeURIComponent(b)+"&ds="+encodeURIComponent(a.displayName)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=a.getStatus()&&299>=a.getStatus()){var b=
a.getText();if(0<b.length){var d=JSON.parse(b);null!=d&&this.handleLicense(d,c)}}}catch(l){}}))}};
-App.prototype.handleLicense=function(a,b){var d=document.getElementById("geFooter"),c=null;if(null!=d&&null!=a)if(c=a.expiry,null!=a.footer)d.innerHTML=decodeURIComponent(a.footer);else if(this.hideFooter(),null!=c&&"never"!=c){var e=new Date(Date.parse(c)),f=Math.round((e-Date.now())/864E5);if(90>f){var k="https://support.draw.io/display/DKB/draw.io+footer+state+that+license+is+expiring+on+Google+For+Work+account?domain="+encodeURIComponent(b);d.style.height="100%";d.style.margin="0px";d.style.display=
-"";0>f?(this.footerHeight=80,d.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert geBlink"><a href="'+k+'" style="padding-top:16px;" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseHasExpired",[b,e.toLocaleDateString()])+"</a></td></tr></table>"):(this.footerHeight=46,d.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert"><a href="'+
-k+'" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseWillExpire",[b,e.toLocaleDateString()])+"</a></td></tr></table>");this.refresh()}}return c};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.chromeless&&this.editor.graph.lightbox&&null==a.realtime?a.getData():this.getFileData(!0)};
+App.prototype.handleLicense=function(a,b){var d=document.getElementById("geFooter"),c=null;if(null!=d&&null!=a)if(c=a.expiry,null!=a.footer)d.innerHTML=decodeURIComponent(a.footer);else if(this.hideFooter(),null!=c&&"never"!=c){var e=new Date(Date.parse(c)),f=Math.round((e-Date.now())/864E5);if(90>f){var h="https://support.draw.io/display/DKB/draw.io+footer+state+that+license+is+expiring+on+Google+For+Work+account?domain="+encodeURIComponent(b);d.style.height="100%";d.style.margin="0px";d.style.display=
+"";0>f?(this.footerHeight=80,d.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert geBlink"><a href="'+h+'" style="padding-top:16px;" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseHasExpired",[b,e.toLocaleDateString()])+"</a></td></tr></table>"):(this.footerHeight=46,d.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert"><a href="'+
+h+'" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseWillExpire",[b,e.toLocaleDateString()])+"</a></td></tr></table>");this.refresh()}}return c};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.chromeless&&this.editor.graph.lightbox&&null==a.realtime?a.getData():this.getFileData(!0)};
App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);var a=this.getCurrentFile();this.actions.get("revisionHistory").setEnabled(null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile))};App.prototype.updateDraft=function(){isLocalStorage&&null!=localStorage&&localStorage.setItem(".draft",JSON.stringify({modified:(new Date).getTime(),data:this.getFileData()}))};App.prototype.getDraft=function(){return null};
App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var b=this.getRecent();if(null==b)b=[];else for(var d=0;d<b.length;d++)b[d].id==a.id&&b.splice(d,1);null!=b&&(b.unshift(a),b=b.slice(0,5),localStorage.setItem(".recent",JSON.stringify(b)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(b){}return null}};
App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(b){}};App.prototype.removeDraft=function(){if(isLocalStorage&&null!=localStorage&&"0"==urlParams.splash)try{localStorage.removeItem(".draft")}catch(a){}};
@@ -7188,9 +7193,9 @@ App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.mod
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.lightbox){var a=this.editor.appName,b=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=b&&(a=(null!=b.getTitle()?b.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],b,d=0;256>d;d++){b=d;for(var c=0;8>c;c++)b=b&1?3988292384^b>>>1:b>>>1;a[d]=b}return a};
App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,d=0;d<a.length;d++)b=b>>>8^this.crcTable[(b^a.charCodeAt(d))&255];return(b^-1)>>>0};
App.prototype.getThumbnail=function(a,b){var d=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var c=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),e=c.getGlobalVariable,f=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(f.root)}if(mxClient.IS_CHROMEAPP||!c.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
-function(a){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(a)}),a,this.thumbImageCache,"#ffffff",function(){b()},null,null,null,null,null,null,c),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var k=document.createElement("canvas"),l=c.getGraphBounds(),m=a/l.width,m=Math.min(1,Math.min(3*a/(4*l.height),m)),g=Math.floor(l.x),h=Math.floor(l.y);k.setAttribute("width",Math.ceil(m*(l.width+4)));k.setAttribute("height",Math.ceil(m*(l.height+4)));var n=k.getContext("2d");
-n.scale(m,m);n.translate(-g,-h);var q=c.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";n.save();n.fillStyle=q;n.fillRect(g,h,Math.ceil(l.width+4),Math.ceil(l.height+4));n.restore();var t=new mxJsCanvas(k),p=new mxAsyncCanvas(this.thumbImageCache);t.images=this.thumbImageCache.images;var v=new mxImageExport;v.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};v.drawText=function(a,
-b){};v.drawState(c.getView().getState(c.model.root),p);p.finish(mxUtils.bind(this,function(){v.drawState(c.getView().getState(c.model.root),t);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(k)}));d=!0}}catch(y){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}return d};
+function(a){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(a)}),a,this.thumbImageCache,"#ffffff",function(){b()},null,null,null,null,null,null,c),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var h=document.createElement("canvas"),l=c.getGraphBounds(),m=a/l.width,m=Math.min(1,Math.min(3*a/(4*l.height),m)),g=Math.floor(l.x),k=Math.floor(l.y);h.setAttribute("width",Math.ceil(m*(l.width+4)));h.setAttribute("height",Math.ceil(m*(l.height+4)));var n=h.getContext("2d");
+n.scale(m,m);n.translate(-g,-k);var q=c.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";n.save();n.fillStyle=q;n.fillRect(g,k,Math.ceil(l.width+4),Math.ceil(l.height+4));n.restore();var t=new mxJsCanvas(h),p=new mxAsyncCanvas(this.thumbImageCache);t.images=this.thumbImageCache.images;var w=new mxImageExport;w.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};w.drawText=function(a,
+b){};w.drawState(c.getView().getState(c.model.root),p);p.finish(mxUtils.bind(this,function(){w.drawState(c.getView().getState(c.model.root),t);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(h)}));d=!0}}catch(A){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}return d};
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(b,d){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(d)if(isLocalStorage)localStorage.setItem(".mode",b);else if("undefined"!=typeof Storage){var c=new Date;c.setYear(c.getFullYear()+1);document.cookie="MODE="+b+"; expires="+c.toUTCString()}null!=this.appIcon&&(c=this.getCurrentFile(),b=null!=c?c.getMode():null,b==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):b==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):b==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default"))}})();
@@ -7224,39 +7229,39 @@ gapi.drive.realtime.custom.collaborativeField("children"),mxRtCell.prototype.sou
App.prototype.pickFile=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var b=this.getPeerForMode(a);if(null!=b)b.pickFile();else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var d=
Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,c){this.useCanvasForExport||".png"!=c.substring(c.length-4)||(c=c.substring(0,c.length-4)+".xml");this.fileLoaded(a==App.MODE_BROWSER?new StorageFile(this,b,c):new LocalFile(this,b,c))}));var c=this.dialog,e=c.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(c,arguments);null==this.getCurrentFile()&&this.showSplash()})}else{var f=
document.createElement("input");f.setAttribute("type","file");mxEvent.addListener(f,"change",mxUtils.bind(this,function(){null!=f.files&&this.openFiles(f.files)}));f.click()}}};
-App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_TRELLO){var b=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=b&&b.pickLibrary(mxUtils.bind(this,function(a,c){if(null!=c)try{this.loadLibrary(c)}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
+App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_TRELLO){var b=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=b&&b.pickLibrary(mxUtils.bind(this,function(a,c){if(null!=c)try{this.loadLibrary(c)}catch(h){this.handleError(h,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
mxResources.get("loading"))&&b.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){window.openNew=!1;window.openKey="open";var d=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=
-new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,c){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,c):new LocalLibrary(this,b,c))}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=d;window.openFile=null})}else{var c=document.createElement("input");
+new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,c){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,c):new LocalLibrary(this,b,c))}catch(h){this.handleError(h,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=d;window.openFile=null})}else{var c=document.createElement("input");
c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){if(null!=c.files)for(var a=0;a<c.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(c.files[a])}));c.click()}};
-App.prototype.saveLibrary=function(a,b,d,c,e,f,k){c=null!=c?c:this.mode;e=null!=e?e:!1;f=null!=f?f:!1;var l=this.createLibraryDataFromImages(b),m=mxUtils.bind(this,function(a){this.spinner.stop();null!=k&&k();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==d&&c==App.MODE_DEVICE&&(d=new LocalLibrary(this,l,a));if(null==d)this.pickFolder(c,mxUtils.bind(this,function(d){c==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
+App.prototype.saveLibrary=function(a,b,d,c,e,f,h){c=null!=c?c:this.mode;e=null!=e?e:!1;f=null!=f?f:!1;var l=this.createLibraryDataFromImages(b),m=mxUtils.bind(this,function(a){this.spinner.stop();null!=h&&h();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==d&&c==App.MODE_DEVICE&&(d=new LocalLibrary(this,l,a));if(null==d)this.pickFolder(c,mxUtils.bind(this,function(d){c==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
l,d,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,b)}),m,this.drive.libraryMimeType):c==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,l,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,b)}),m,d):c==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,l,mxUtils.bind(this,
function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,b)}),m,d):c==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,l,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,b)}),m,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,l,mxUtils.bind(this,function(a){this.spinner.stop();
this.hideDialog(!0);this.libraryLoaded(a,b)}),m,d):c==App.MODE_BROWSER?(d=mxUtils.bind(this,function(){var c=new StorageLibrary(this,l,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(c,b)}),m)}),null==localStorage.getItem(a)?d():this.confirm(mxResources.get("replaceIt",[a]),d)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(e||this.spinner.spin(document.body,mxResources.get("saving"))){d.setData(l);var g=mxUtils.bind(this,
-function(){d.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);f||this.libraryLoaded(d,b);null!=k&&k()}),m)});if(a!=d.getTitle()){var h=d.getHash();d.rename(a,mxUtils.bind(this,function(a){d.constructor!=LocalLibrary&&h!=d.getHash()&&(mxSettings.removeCustomLibrary(h),mxSettings.addCustomLibrary(d.getHash()));this.removeLibrarySidebar(h);g()}),m)}else g()}};
-App.prototype.saveFile=function(a){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==b.getTitle()||null==this.mode){var c=null!=b.getTitle()?b.getTitle():this.defaultFilename,e=!mxClient.IS_IOS||!navigator.standalone,f=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var k=4>=a?2:6<a?4:3,c=new CreateDialog(this,
+function(){d.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);f||this.libraryLoaded(d,b);null!=h&&h()}),m)});if(a!=d.getTitle()){var k=d.getHash();d.rename(a,mxUtils.bind(this,function(a){d.constructor!=LocalLibrary&&k!=d.getHash()&&(mxSettings.removeCustomLibrary(k),mxSettings.addCustomLibrary(d.getHash()));this.removeLibrarySidebar(k);g()}),m)}else g()}};
+App.prototype.saveFile=function(a){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==b.getTitle()||null==this.mode){var c=null!=b.getTitle()?b.getTitle():this.defaultFilename,e=!mxClient.IS_IOS||!navigator.standalone,f=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var h=4>=a?2:6<a?4:3,c=new CreateDialog(this,
c,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==f&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname))):f!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf("."),/(\.svg)$/i.test(a),
-/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,e,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,k);this.showDialog(c.container,460,a>k?390:270,!0,!0);c.init()}else this.save(b.getTitle(),d)}};
+/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,e,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,h);this.showDialog(c.container,460,a>h?390:270,!0,!0);c.init()}else this.save(b.getTitle(),d)}};
EditorUi.prototype.loadTemplate=function(a,b,d){var c=a;this.isCorsEnabledForUrl(c)||(c="t="+(new Date).getTime(),c=PROXY_URL+"?url="+encodeURIComponent(a)+"&"+c);this.loadUrl(c,mxUtils.bind(this,function(c){!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&b(a.responseText)}),a):(/(\.png)($|\?)/i.test(a)&&
(c=this.extractGraphModelFromPng(c)),b(c))}),d,/(\.png)($|\?)/i.test(a))};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
-App.prototype.createFile=function(a,b,d,c,e,f,k,l){c=l?null:null!=c?c:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){b=null!=b?b:this.emptyDiagramXml;var m=mxUtils.bind(this,function(){this.spinner.stop()}),g=mxUtils.bind(this,function(a){m();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});c==App.MODE_GOOGLE&&null!=this.drive?(k=null!=this.stateArg?this.stateArg.folderId:k,this.drive.insertFile(a,b,k,mxUtils.bind(this,
-function(a){m();this.fileCreated(a,d,f,e)}),g)):c==App.MODE_GITHUB&&null!=this.gitHub?this.pickFolder(c,mxUtils.bind(this,function(c){this.gitHub.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g,!1,c)})):c==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g,!1,k):c==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g):
-c==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g,!1,k):c==App.MODE_BROWSER?(m(),c=mxUtils.bind(this,function(){var c=new StorageFile(this,b,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(c,d,f,e)}),g)}),null==localStorage.getItem(a)?c():this.confirm(mxResources.get("replaceIt",[a]),c,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(m(),this.fileCreated(new LocalFile(this,
+App.prototype.createFile=function(a,b,d,c,e,f,h,l){c=l?null:null!=c?c:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){b=null!=b?b:this.emptyDiagramXml;var m=mxUtils.bind(this,function(){this.spinner.stop()}),g=mxUtils.bind(this,function(a){m();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});c==App.MODE_GOOGLE&&null!=this.drive?(h=null!=this.stateArg?this.stateArg.folderId:h,this.drive.insertFile(a,b,h,mxUtils.bind(this,
+function(a){m();this.fileCreated(a,d,f,e)}),g)):c==App.MODE_GITHUB&&null!=this.gitHub?this.pickFolder(c,mxUtils.bind(this,function(c){this.gitHub.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g,!1,c)})):c==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g,!1,h):c==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g):
+c==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(a,b,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,f,e)}),g,!1,h):c==App.MODE_BROWSER?(m(),c=mxUtils.bind(this,function(){var c=new StorageFile(this,b,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(c,d,f,e)}),g)}),null==localStorage.getItem(a)?c():this.confirm(mxResources.get("replaceIt",[a]),c,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(m(),this.fileCreated(new LocalFile(this,
b,a,null==c),d,f,e))}};
-App.prototype.fileCreated=function(a,b,d,c){var e=window.location.pathname;null!=b&&0<b.length&&(e+="?libs="+b);e=this.getUrl(e);a.getMode()!=App.MODE_DEVICE&&(e+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var f=a.getData(),f=0<f.length?this.editor.extractGraphModel(mxUtils.parseXml(f).documentElement,!0):null,k=window.location.protocol+"//"+window.location.hostname+e,l=f,m=null;null!=f&&/\.svg$/i.test(a.getTitle())&&(m=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(m.container),
-l=this.decodeNodeIntoGraph(l,m));a.setData(this.createFileData(f,m,a,k));null!=m&&m.container.parentNode.removeChild(m.container);var g=mxUtils.bind(this,function(){this.spinner.stop()}),h=mxUtils.bind(this,function(){g();var f=this.getCurrentFile();null==d&&null!=f&&(d=!f.isModified()&&null==f.getMode());var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);d&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));null!=b&&this.sidebar.showEntries(b)}),
-h=mxUtils.bind(this,function(){d||null==f||!f.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=c&&c();null==d||d?h():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=c&&c(),window.openWindow(e,null,h))});a.constructor==LocalFile||a.constructor==DriveFile?h():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,
-function(){h()}),mxUtils.bind(this,function(a){g();this.handleError(a)}))}};
+App.prototype.fileCreated=function(a,b,d,c){var e=window.location.pathname;null!=b&&0<b.length&&(e+="?libs="+b);e=this.getUrl(e);a.getMode()!=App.MODE_DEVICE&&(e+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var f=a.getData(),f=0<f.length?this.editor.extractGraphModel(mxUtils.parseXml(f).documentElement,!0):null,h=window.location.protocol+"//"+window.location.hostname+e,l=f,m=null;null!=f&&/\.svg$/i.test(a.getTitle())&&(m=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(m.container),
+l=this.decodeNodeIntoGraph(l,m));a.setData(this.createFileData(f,m,a,h));null!=m&&m.container.parentNode.removeChild(m.container);var g=mxUtils.bind(this,function(){this.spinner.stop()}),k=mxUtils.bind(this,function(){g();var f=this.getCurrentFile();null==d&&null!=f&&(d=!f.isModified()&&null==f.getMode());var h=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);d&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));null!=b&&this.sidebar.showEntries(b)}),
+k=mxUtils.bind(this,function(){d||null==f||!f.isModified()?h():this.confirm(mxResources.get("allChangesLost"),null,h,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=c&&c();null==d||d?k():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=c&&c(),window.openWindow(e,null,k))});a.constructor==LocalFile||a.constructor==DriveFile?k():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,
+function(){k()}),mxUtils.bind(this,function(a){g();this.handleError(a)}))}};
App.prototype.loadFile=function(a,b,d){this.hideDialog();var c=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var c=localStorage.getItem(a);if(null!=c)this.fileLoaded(new StorageFile(this,c,a));else throw{message:mxResources.get("fileNotFound")};}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"),
mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=d)this.spinner.stop(),this.fileLoaded(d);else if("R"==a.charAt(0))this.spinner.stop(),c=decodeURIComponent(a.substring(1)),"<"!=c.charAt(0)&&(c=this.editor.graph.decompress(c)),
-c=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),c.getHash=function(){return a},this.fileLoaded(c);else if("U"==a.charAt(0)){var e=decodeURIComponent(a.substring(1));this.loadTemplate(e,mxUtils.bind(this,function(c){this.spinner.stop();if(null!=c&&0<c.length){var d=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var f=e,k=e.lastIndexOf("."),l=f.lastIndexOf("/");k>l&&0<l&&(f=f.substring(l+1,k),k=e.substring(k),this.useCanvasForExport||
-".png"!=k||(k=".xml"),".svg"===k||".xml"===k||".html"===k||".png"===k)&&(d=f+k)}c=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):d,!0);c.getHash=function(){return a};this.fileLoaded(c)||"https://drive.google.com/uc?id="!=e.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient||(this.hideDialog(),c=mxUtils.bind(this,function(){return null!=this.drive?(this.spinner.stop(),this.loadFile("G"+e.substring(31,e.lastIndexOf("&")),b),!0):!1}),!c()&&this.spinner.spin(document.body,
+c=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),c.getHash=function(){return a},this.fileLoaded(c);else if("U"==a.charAt(0)){var e=decodeURIComponent(a.substring(1));this.loadTemplate(e,mxUtils.bind(this,function(c){this.spinner.stop();if(null!=c&&0<c.length){var d=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var f=e,h=e.lastIndexOf("."),l=f.lastIndexOf("/");h>l&&0<l&&(f=f.substring(l+1,h),h=e.substring(h),this.useCanvasForExport||
+".png"!=h||(h=".xml"),".svg"===h||".xml"===h||".html"===h||".png"===h)&&(d=f+h)}c=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):d,!0);c.getHash=function(){return a};this.fileLoaded(c)||"https://drive.google.com/uc?id="!=e.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient||(this.hideDialog(),c=mxUtils.bind(this,function(){return null!=this.drive?(this.spinner.stop(),this.loadFile("G"+e.substring(31,e.lastIndexOf("&")),b),!0):!1}),!c()&&this.spinner.spin(document.body,
mxResources.get("loading"))&&this.addListener("clientLoaded",c))}}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}))}else c=null,"G"==a.charAt(0)?c=this.drive:"D"==a.charAt(0)?c=this.dropbox:"W"==a.charAt(0)?c=this.oneDrive:"H"==a.charAt(0)?c=this.gitHub:"T"==a.charAt(0)&&(c=this.trello),null==c?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),
mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""})):(a=decodeURIComponent(a.substring(1)),c.getFile(a,mxUtils.bind(this,function(a){this.spinner.stop();this.fileLoaded(a)}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):
window.location.hash=a.getHash()}))})))}),e=this.getCurrentFile(),f=mxUtils.bind(this,function(){null!=e&&e.isModified()?this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=e&&(window.location.hash=e.getHash())}),c,mxResources.get("cancel"),mxResources.get("discardChanges")):c()});null==a||0==a.length?f():null!=e&&e.isModified()&&!b?window.openWindow(this.getUrl()+"#"+a,null,f):f()};
App.prototype.getLibraryStorageHint=function(a){var b=a.getTitle();a.constructor!=LocalLibrary&&(b+="\n"+a.getHash());a.constructor==DriveLibrary?b+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?b+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?b+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?b+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?b+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?b+=" ("+
mxResources.get("browser")+")":a.constructor==LocalLibrary&&(b+=" ("+mxResources.get("device")+")");return b};
App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a){mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=mxUtils.bind(this,function(b){if(null!=b)for(var c=0;c<b.length;c++){var d=encodeURIComponent(decodeURIComponent(b[c]));mxUtils.bind(this,function(b){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){this.pendingLibraries[b]=!0;var c=b.substring(0,
-1);if("L"==c){if(isLocalStorage||mxClient.IS_CHROMEAPP)try{var d=decodeURIComponent(b.substring(1));this.getLocalData(d,mxUtils.bind(this,function(c){".scratchpad"==d&&null==c&&(c=this.emptyLibraryXml);null!=c?this.loadLibrary(new StorageLibrary(this,c,d)):a(b)}))}catch(h){a(b)}}else if("U"==c){var e=decodeURIComponent(b.substring(1));this.isOffline()||(c=e,this.isCorsEnabledForUrl(c)||(c="t="+(new Date).getTime(),c=PROXY_URL+"?url="+encodeURIComponent(e)+"&"+c),mxUtils.get(c,mxUtils.bind(this,function(c){if(200<=
+1);if("L"==c){if(isLocalStorage||mxClient.IS_CHROMEAPP)try{var d=decodeURIComponent(b.substring(1));this.getLocalData(d,mxUtils.bind(this,function(c){".scratchpad"==d&&null==c&&(c=this.emptyLibraryXml);null!=c?this.loadLibrary(new StorageLibrary(this,c,d)):a(b)}))}catch(k){a(b)}}else if("U"==c){var e=decodeURIComponent(b.substring(1));this.isOffline()||(c=e,this.isCorsEnabledForUrl(c)||(c="t="+(new Date).getTime(),c=PROXY_URL+"?url="+encodeURIComponent(e)+"&"+c),mxUtils.get(c,mxUtils.bind(this,function(c){if(200<=
c.getStatus()&&299>=c.getStatus())try{this.loadLibrary(new UrlLibrary(this,c.getText(),e)),delete this.pendingLibraries[b]}catch(n){a(b)}else a(b)}),function(){a(b)}))}else{var f=null;"G"==c?null!=this.drive&&null!=this.drive.user&&(f=this.drive):"H"==c?null!=this.gitHub&&null!=this.gitHub.getUser()&&(f=this.gitHub):"T"==c?null!=this.trello&&this.trello.isAuthorized()&&(f=this.trello):"D"==c?null!=this.dropbox&&null!=this.dropbox.getUser()&&(f=this.dropbox):"W"==c&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&
(f=this.oneDrive);null!=f?f.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(c){try{this.loadLibrary(c),delete this.pendingLibraries[b]}catch(n){a(b)}}),function(c){a(b)}):delete this.pendingLibraries[b]}}})(d)}});b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"))}};
App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile?null==this.shareButton&&(this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.padding="0 10px 0 10px",this.shareButton.style.marginTop="-4px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight="28px",this.shareButton.style.minWidth=
@@ -7272,10 +7277,10 @@ function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop
d():this.confirm(mxResources.get("replaceIt",[b]),d))};
App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var b=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,b);this.fname.setAttribute("title",b+" - "+mxResources.get("rename"))}this.editor.graph.setEnabled(a.isEditable());null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?window.location.hash=a:0<window.location.hash.length&&(window.location.hash=
""))}};App.prototype.toggleChat=function(){var a=this.getCurrentFile();if(null!=a){if(null==a.chatWindow){var b=document.body.offsetWidth-300;a.chatWindow=new ChatWindow(this,mxResources.get("chatWindowTitle"),document.getElementById("geChat"),b,80,250,350,a.realtime);a.chatWindow.window.setVisible(!1)}a.chatWindow.window.setVisible(!a.chatWindow.window.isVisible())}};
-App.prototype.showAuthDialog=function(a,b,d,c){var e=this.spinner.pause();this.showDialog((new AuthDialog(this,a,b,mxUtils.bind(this,function(a){try{null!=d&&d(a,mxUtils.bind(this,function(){this.hideDialog();e()}))}catch(k){this.editor.setStatus(mxUtils.htmlEntities(k.message))}}))).container,300,b?180:140,!0,!0,mxUtils.bind(this,function(a){null!=c&&c();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
-App.prototype.convertFile=function(a,b,d,c,e,f){var k=b;/\.svg$/i.test(k)||(k=k.substring(0,b.lastIndexOf("."))+c);var l=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(l=!0);if(/\.vsdx$/i.test(b)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var m=new XMLHttpRequest;m.open("GET",a,!0);l||(m.responseType="blob");m.onload=mxUtils.bind(this,function(){var a=null;l?(a=JSON.parse(m.responseText),a=this.base64ToBlob(a.content,
-"application/octet-stream")):a=new Blob([m.response],{type:"application/octet-stream"});this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this,a.responseText,k,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),b)});m.send()}else{var g=mxUtils.bind(this,function(c){try{/\.png$/i.test(b)?(temp=this.extractGraphModelFromPng(c),null!=temp?e(new LocalFile(this,temp,k,!0)):e(new LocalFile(this,c,b,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&
-this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this,a.responseText,k,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),b):e(new LocalFile(this,c,k,!0))}catch(n){null!=f&&f(n)}});d=/\.png$/i.test(b)||/\.jpe?g$/i.test(b)||null!=d&&"image/"==d.substring(0,6);l?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
+App.prototype.showAuthDialog=function(a,b,d,c){var e=this.spinner.pause();this.showDialog((new AuthDialog(this,a,b,mxUtils.bind(this,function(a){try{null!=d&&d(a,mxUtils.bind(this,function(){this.hideDialog();e()}))}catch(h){this.editor.setStatus(mxUtils.htmlEntities(h.message))}}))).container,300,b?180:140,!0,!0,mxUtils.bind(this,function(a){null!=c&&c();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
+App.prototype.convertFile=function(a,b,d,c,e,f){var h=b;/\.svg$/i.test(h)||(h=h.substring(0,b.lastIndexOf("."))+c);var l=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(l=!0);if(/\.vsdx$/i.test(b)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var m=new XMLHttpRequest;m.open("GET",a,!0);l||(m.responseType="blob");m.onload=mxUtils.bind(this,function(){var a=null;l?(a=JSON.parse(m.responseText),a=this.base64ToBlob(a.content,
+"application/octet-stream")):a=new Blob([m.response],{type:"application/octet-stream"});this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this,a.responseText,h,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),b)});m.send()}else{var g=mxUtils.bind(this,function(c){try{/\.png$/i.test(b)?(temp=this.extractGraphModelFromPng(c),null!=temp?e(new LocalFile(this,temp,h,!0)):e(new LocalFile(this,c,b,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&
+this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this,a.responseText,h,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),b):e(new LocalFile(this,c,h,!0))}catch(n){null!=f&&f(n)}});d=/\.png$/i.test(b)||/\.jpe?g$/i.test(b)||null!=d&&"image/"==d.substring(0,6);l?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
e){a=JSON.parse(a.getText());var c=a.content;"base64"===a.encoding&&(c=/\.png$/i.test(b)?"data:image/png;base64,"+c:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(c):atob(c));g(c)}}else null!=f&&f({code:App.ERROR_UNKNOWN})}),function(){null!=f&&f({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=f&&f({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,g,f,d)}};
App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="40px";this.appIcon.style.backgroundColor="#f18808";this.appIcon.style.height=this.menubarHeight+"px";mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(a){this.appIconClicked(a)}));var a=mxClient.IS_SVG?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+)":
"url('"+IMAGE_PATH+"/logo-white.png')";this.appIcon.style.backgroundImage=a;this.appIcon.style.backgroundPosition="center center";this.appIcon.style.backgroundRepeat="no-repeat";mxUtils.setPrefixedStyle(this.appIcon.style,"transition","all 125ms linear");mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a=a.getMode(),a==App.MODE_GOOGLE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)":a==App.MODE_DROPBOX?
@@ -7309,32 +7314,32 @@ function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==TrelloFile){va
mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(a){mxEvent.isConsumed(a)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)})));var a=null;null!=this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?a=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?a=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(a=this.gitHub.getUser());
null!=a?(this.userElement.innerHTML="",560<screen.width&&(mxUtils.write(this.userElement,a.displayName),this.userElement.style.display="block")):this.userElement.style.display="none"}else null!=this.userElement&&(this.userElement.parentNode.removeChild(this.userElement),this.userElement=null)};var editorResetGraph=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);this.graph.pageFormat=mxSettings.getPageFormat()};(function(){var a=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){a.apply(this,arguments);this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px"};Menus.prototype.createHelpLink=function(a){var b=document.createElement("span");b.setAttribute("title",mxResources.get("help"));b.style.cssText="color:blue;text-decoration:underline;margin-left:12px;cursor:help;";
var c=document.createElement("img");c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);b.appendChild(c);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){null!=this.editorUi.menubar&&this.editorUi.menubar.hideMenu();this.editorUi.openLink(a);mxEvent.consume(b)}));return b};Menus.prototype.addLinkToItem=function(a,b){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(b))};var b=Menus.prototype.init;Menus.prototype.init=function(){b.apply(this,
-arguments);var a=this.editorUi,d=a.editor.graph,f=mxUtils.bind(d,d.isEnabled),k=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),l=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),m=("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||
+arguments);var a=this.editorUi,d=a.editor.graph,f=mxUtils.bind(d,d.isEnabled),h=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),l=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),m=("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||
"drive.draw.io"==window.location.hostname||"legacy.draw.io"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),g=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);a.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");
-a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,h,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/
-100,c,d,e,f,g,k,!h,l)}),!0,null,"svg")}));a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatXml"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(e);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?
+a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/
+100,c,d,e,f,g,h,!k,l)}),!0,null,"svg")}));a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatXml"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(e);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?
"compressed":"allPages"),!0);g.style.marginBottom="16px";mxEvent.addListener(f,"change",function(){f.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",c?!g.checked:null,null,!f.checked,c?null:!g.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){a.showPublishLinkDialog(mxResources.get("url"),
-!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,k,h,l,m){a.createHtml(b,c,d,e,f,g,k,h,l,m,mxUtils.bind(this,function(b,c){var d=
+!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,h,k,l,m){a.createHtml(b,c,d,e,f,g,h,k,l,m,mxUtils.bind(this,function(b,c){var d=
a.getBaseFilename(),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,mxResources.get("formatPdf"))).container,
360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=document.createElement("h3");mxUtils.write(c,mxResources.get("formatPdf"));c.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(c);var e=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),f=a.addCheckbox(b,mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport);f.style.marginBottom="16px";a.pdfPageExport||
mxEvent.addListener(e,"change",function(){e.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!e.checked,null,!f.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){a.fileLoaded(null)});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();
if(1==d.getSelectionCount()){var b=d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();if(null==b||b.constructor!=DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile||null==a.dropbox&&b.constructor==DropboxFile)a.showError(mxResources.get("error"),
mxResources.get("notAvailable"),mxResources.get("ok"));else if(a.spinner.spin(document.body,mxResources.get("loading")))if(b.constructor==DropboxFile){var c=a.dropbox.client.filesListRevisions({path:b.stat.path_lower,limit:100});c.then(mxUtils.bind(this,function(c){a.spinner.stop();try{for(var d=[],e=c.entries.length-1;0<=e;e--)(function(c){d.push({modifiedDate:c.client_modified,fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+
-"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(C){a.handleError(C)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-
+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(D){a.handleError(D)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-
1]===d?b.desc.headRevisionId:d.id}),function(b){a.drive.getXmlFile(b,null,function(a){e(a.getData())},function(a){f(a)})},function(a){f(a)})};d.getUrl=function(){return a.getUrl(window.location.pathname+"?rev="+d.id+"&chrome=0&edit=_blank")+window.location.hash}})(c.items[d]);d=new RevisionDialog(a,c.items);a.showDialog(d.container,640,480,!0,!0);d.init()},function(b){a.spinner.stop();a.handleError(b)})});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+
-"+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))});if("undefined"!==typeof MathJax){var h=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=
-!a.isMathEnabled();d.model.execute(b)});h.setToggleAction(!0);h.setSelectedCallback(function(){return a.isMathEnabled()});h.isEnabled=f}isLocalStorage&&(h=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),h.setToggleAction(!0),h.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var n=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});n.setToggleAction(!0);n.setSelectedCallback(function(){return n.isEnabled()&&
+"+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))});if("undefined"!==typeof MathJax){var k=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=
+!a.isMathEnabled();d.model.execute(b)});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.isMathEnabled()});k.isEnabled=f}isLocalStorage&&(k=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),k.setToggleAction(!0),k.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var n=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});n.setToggleAction(!0);n.setSelectedCallback(function(){return n.isEnabled()&&
a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=d.getSelectionCells(),c=[],e=0;e<b.length;e++)d.getModel().isVertex(b[e])&&c.push(b[e]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,180,180,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var q="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" ");
a.actions.addAction("copyStyle",function(){var b=d.view.getState(d.getSelectionCell());if(d.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=d.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var e=b[c],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f),e=e.substring(f+1);null==a.copiedStyle[g]&&"none"==e&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&
-null!=a.copiedStyle){d.getModel().beginUpdate();try{for(var b=d.getSelectionCells(),c=0;c<b.length;c++)for(var e=d.view.getState(b[c]),f=0;f<q.length;f++){var g=q[f],k=a.copiedStyle[g];e.style[g]!=k&&d.setCellStyles(g,k,[b[c]])}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,
-320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,h,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,k,!h,l)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,
-function(b,c){a.downloadFile(c?"xmlpng":"png",null,null,b)}))}));a.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,h,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,k,!h,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),
-null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg",null,null,b)}),!0)}));h=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){d.setShadowVisible(!d.shadowVisible)}));h.setToggleAction(!0);h.setSelectedCallback(function(){return d.shadowVisible});var t=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){t||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){t=!1}),t=!0)},null,null,"F1"));a.actions.addAction("userManual...",
+null!=a.copiedStyle){d.getModel().beginUpdate();try{for(var b=d.getSelectionCells(),c=0;c<b.length;c++)for(var e=d.view.getState(b[c]),f=0;f<q.length;f++){var g=q[f],h=a.copiedStyle[g];e.style[g]!=h&&d.setCellStyles(g,h,[b[c]])}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,
+320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!k,l)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,
+function(b,c){a.downloadFile(c?"xmlpng":"png",null,null,b)}))}));a.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,h,!k,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),
+null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg",null,null,b)}),!0)}));k=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){d.setShadowVisible(!d.shadowVisible)}));k.setToggleAction(!0);k.setSelectedCallback(function(){return d.shadowVisible});var t=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){t||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){t=!1}),t=!0)},null,null,"F1"));a.actions.addAction("userManual...",
function(){a.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")});a.actions.addAction("support...",function(){a.openLink("https://about.draw.io/support/")});a.actions.addAction("exportOptionsDisabled...",function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP?a.openLink("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?a.openLink("shortcuts.svg"):
-a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});h=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",
-function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));h.setToggleAction(!0);h.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));h=a.actions.addAction("find...",mxUtils.bind(this,function(){null==
-this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,204,140),this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));h.setToggleAction(!0);h.setSelectedCallback(mxUtils.bind(this,function(){return null!=
-this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){var b=mxUtils.bind(this,function(){if("undefined"!==typeof VsdxExport)try{(new VsdxExport(a)).exportCurrentDiagrams()}catch(A){}});"undefined"!==typeof VsdxExport||this.loadingVsdx||a.isOffline()?window.setTimeout(b,0):(this.loadingVsdx=!0,mxscript("js/vsdx.min.js",b))}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",
+a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});k=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",
+function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));k.setToggleAction(!0);k.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));k=a.actions.addAction("find...",mxUtils.bind(this,function(){null==
+this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,204,140),this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));k.setToggleAction(!0);k.setSelectedCallback(mxUtils.bind(this,function(){return null!=
+this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){var b=mxUtils.bind(this,function(){if("undefined"!==typeof VsdxExport)try{(new VsdxExport(a)).exportCurrentDiagrams()}catch(x){}});"undefined"!==typeof VsdxExport||this.loadingVsdx||a.isOffline()?window.setTimeout(b,0):(this.loadingVsdx=!0,mxscript("js/vsdx.min.js",b))}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",
new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);
for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var p=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=p.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",
c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"]);else{var e=b.addItem("Search:",null,null,c,null,null,!1);e.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";e.style.cursor="default";var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","25");f.style.marginLeft="8px";
@@ -7343,55 +7348,55 @@ function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeo
this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);
this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=d.getGraphBounds(),b=d.view.translate,e=d.view.scale;d.insertVertex(c,null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),
mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){d.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+d.compress(mxUtils.getXml(d.encodeCells(d.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",
-mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));e.scale(1/c);var g=0,k=e.save;e.save=function(){g++;k.apply(this,arguments)};var h=e.restore;e.restore=function(){g--;h.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);l.apply(this,arguments);mxLog.debug("leaving shape",
+mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));e.scale(1/c);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var k=e.restore;e.restore=function(){g--;k.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);l.apply(this,arguments);mxLog.debug("leaving shape",
a,g)};a.drawState(d.getView().getState(d.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&
(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&
(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&
this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],c),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-","testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?
mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(d.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",
-function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,k,h,l,m){a.createHtml(b,c,d,e,f,g,k,h,l,m,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");
+function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,l,m){a.createHtml(b,c,d,e,f,g,h,k,l,m,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");
d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft="26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+
window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&
a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();
b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);
-b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=d.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-d.view.translate.y)/d.view.scale)+2,function(b,c,d,e,f,g,k,h){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),
-function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+k+";height:"+h+';" src="'+a.createLink(b,c,d,e,f,g,l)+'"></iframe>');a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(k){a.spinner.stop();k=new EmbedDialog(a,
-a.createLink(b,c,d,e,f,g,k));a.showDialog(k.container,440,240,!0,!0);k.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)h=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),
-h.setToggleAction(!0),h.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,156,!0,!1)});h=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});h.setToggleAction(!0);h.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=
+b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=d.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-d.view.translate.y)/d.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),
+function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+h+";height:"+k+';" src="'+a.createLink(b,c,d,e,f,g,l)+'"></iframe>');a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(h){a.spinner.stop();h=new EmbedDialog(a,
+a.createLink(b,c,d,e,f,g,h));a.showDialog(h.container,440,240,!0,!0);h.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)k=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),
+k.setToggleAction(!0),k.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,156,!0,!1)});k=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=
function(b){d.isEditing()&&d.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=c;b&&(e.exit=!0);c=JSON.stringify(e)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),
a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,
["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],
c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,c){function e(b){if(b&&Graph.fileSupport&&!mxClient.IS_IE&&!mxClient.IS_IE11){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(){null!=c.files&&a.importFiles(c.files,
null,null,a.maxImageSize)});c.click()}else{window.openNew=!1;window.openKey="import";var e=Editor.useLocalStorage;Editor.useLocalStorage=!b;window.openFile=new OpenFile(function(b){a.hideDialog(b)});window.openFile.setConsumer(function(b,c){d.setSelectionCells(a.importXml(b))});a.showDialog((new OpenDialog(a)).container,360,220,!0,!0,function(){window.openFile=null});var f=a.dialog,g=f.close;a.dialog.close=function(b){Editor.useLocalStorage=e;g.apply(f,arguments);b&&null==a.getCurrentFile()&&"1"!=
-urlParams.embed&&a.showSplash()}}}function f(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=n(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");h(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var h=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),
-k=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),h=d.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,l=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,l,m){f=g?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,k,h,Math.round(l*f),Math.round(m*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),
-g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,k,h,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),n=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=
-typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){f(a.drive)},c):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){f(a.gitHub)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){f(a.dropbox)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
+urlParams.embed&&a.showSplash()}}}function f(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=n(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");k(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var k=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),
+h=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),k=d.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,l=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,l,m){f=g?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,h,k,Math.round(l*f),Math.round(m*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),
+g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,h,k,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),n=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=
+typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){f(a.drive)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){f(a.gitHub)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){f(a.dropbox)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){f(a.oneDrive)},c):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){f(a.trello)},c):g&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
-"...",null,function(){e(!1)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){e(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){h(a,c,b)},function(){a.spinner.stop();
+"...",null,function(){e(!1)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){e(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){k(a,c,b)},function(){a.spinner.stop();
a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c));b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})).isEnabled=f;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&b.addCheckmark(d,
Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));this.editorUi.actions.addAction("rename...",mxUtils.bind(this,
function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),
b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}})).isEnabled=function(){return this.enabled&&f.apply(this,arguments)};a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():
a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,
-function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(a.getEditBlankXml(),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=
-a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://www.draw.io/app")}));
+function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,
+function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://www.draw.io/app")}));
a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://download.draw.io")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||
-this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var v="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle - fromText".split(" "),y=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),
-c)},x=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.container.focus();d.setSelectionCell(a);d.scrollCellToVisible(a);return a};a.actions.addAction("insertText",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(x("Text",40,20,
-"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=f;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},
-null,null,Editor.ctrlKey+"+Shift+K").isEnabled=f;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=f;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<v.length;c++)"-"==v[c]?a.addSeparator(b):y(a,b,mxResources.get(v[c])+"...",v[c])})));
+this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var w="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle - fromText".split(" "),A=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),
+c)},z=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.container.focus();d.setSelectionCell(a);d.scrollCellToVisible(a);return a};a.actions.addAction("insertText",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(z("Text",40,20,
+"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&z("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=f;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&z("",80,80,"ellipse;whiteSpace=wrap;html=1;")},
+null,null,Editor.ctrlKey+"+Shift+K").isEnabled=f;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&z("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=f;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<w.length;c++)"-"==w[c]?a.addSeparator(b):A(a,b,mxResources.get(w[c])+"...",w[c])})));
this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},
-c):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,
+c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,
function(){a.pickFile(App.MODE_ONEDRIVE)},c):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):g&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},
c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},
-mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,
+mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,
function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):m&&b.addItem(mxResources.get("oneDrive")+" ("+
mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):g&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+
-"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)}));this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},
+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)}));this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},
c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",
null,function(){a.pickLibrary(App.MODE_TRELLO)},c):g&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=
-new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(C){a.handleError(C,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},
+new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(D){a.handleError(D,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},
function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,
(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,
"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&
@@ -7412,8 +7417,8 @@ EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mx
null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";c!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var d=!1,c=null,e=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=c&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.lightbox&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=
a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),c=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?d||(1!=MathJax.Hub.queue.pending||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})),MathJax.Hub.Queue(mxUtils.bind(this,function(){d=!0}))):"undefined"===typeof Editor.MathJaxClear||
this.editor.graph.mathEnabled||(d=!0,Editor.MathJaxClear())});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var c=b.getProperty("edit").changes,d=0;d<c.length;d++)if(c[d]instanceof SelectPage||c[d]instanceof RenamePage||c[d]instanceof MovePage||c[d]instanceof mxRootChange){e();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
-Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),d=a.getAttribute("pageScale"),c=a.getAttribute("pageWidth"),e=a.getAttribute("pageHeight"),f=a.getAttribute("background"),k=a.getAttribute("backgroundImage"),k=null!=k&&0<k.length?JSON.parse(k):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
-a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=f&&0<f.length?f:this.defaultGraphBackground,backgroundImage:null!=k?new mxImage(k.src,k.width,k.height):null,pageScale:null!=d?d:mxGraph.prototype.pageScale,pageFormat:null!=c&&null!=e?new mxRectangle(0,0,parseFloat(c),parseFloat(e)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
+Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),d=a.getAttribute("pageScale"),c=a.getAttribute("pageWidth"),e=a.getAttribute("pageHeight"),f=a.getAttribute("background"),h=a.getAttribute("backgroundImage"),h=null!=h&&0<h.length?JSON.parse(h):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
+a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=f&&0<f.length?f:this.defaultGraphBackground,backgroundImage:null!=h?new mxImage(h.src,h.width,h.height):null,pageScale:null!=d?d:mxGraph.prototype.pageScale,pageFormat:null!=c&&null!=e?new mxRectangle(0,0,parseFloat(c),parseFloat(e)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}};
Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),
arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled}};
@@ -7431,9 +7436,9 @@ EditorUi.prototype.createTabContainer=function(){var a=document.createElement("d
EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="12px";b.style.marginLeft="30px";for(var d=this.editor.chromeless?29:59,c=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
d)/this.pages.length)+1),e=null,f=0;f<this.pages.length;f++)mxUtils.bind(this,function(c,d){this.pages[c]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",d.style.fontWeight="bold",d.style.borderTopStyle="none"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),e=c):mxEvent.consume(b)}));mxEvent.addListener(d,
"dragend",mxUtils.bind(this,function(a){e=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=e&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=e&&c!=e&&this.movePage(e,c);a.stopPropagation();a.preventDefault()}));b.appendChild(d)})(f,this.createTabForPage(this.pages[f],c,this.pages[f]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);
-c=this.createPageMenuTab();this.tabContainer.appendChild(c);c=null;this.isPageInsertTabVisible()&&(c=this.createPageInsertTab(),this.tabContainer.appendChild(c));if(b.clientWidth>this.tabContainer.clientWidth-d){null!=c&&(c.style.position="absolute",c.style.right="0px",b.style.marginRight="30px");var k=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");k.style.position="absolute";k.style.right=this.editor.chromeless?"29px":"55px";k.style.fontSize="13pt";this.tabContainer.appendChild(k);var l=this.createControlTab(4,
-"&nbsp;&#10095;");l.style.position="absolute";l.style.right=this.editor.chromeless?"0px":"29px";l.style.fontSize="13pt";this.tabContainer.appendChild(l);var m=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=m+"px";mxEvent.addListener(k,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,m-20);mxUtils.setOpacity(k,0<b.scrollLeft?100:50);mxUtils.setOpacity(l,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(k,
-0<b.scrollLeft?100:50);mxUtils.setOpacity(l,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,m-20);mxUtils.setOpacity(k,0<b.scrollLeft?100:50);mxUtils.setOpacity(l,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
+c=this.createPageMenuTab();this.tabContainer.appendChild(c);c=null;this.isPageInsertTabVisible()&&(c=this.createPageInsertTab(),this.tabContainer.appendChild(c));if(b.clientWidth>this.tabContainer.clientWidth-d){null!=c&&(c.style.position="absolute",c.style.right="0px",b.style.marginRight="30px");var h=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");h.style.position="absolute";h.style.right=this.editor.chromeless?"29px":"55px";h.style.fontSize="13pt";this.tabContainer.appendChild(h);var l=this.createControlTab(4,
+"&nbsp;&#10095;");l.style.position="absolute";l.style.right=this.editor.chromeless?"0px":"29px";l.style.fontSize="13pt";this.tabContainer.appendChild(l);var m=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=m+"px";mxEvent.addListener(h,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,m-20);mxUtils.setOpacity(h,0<b.scrollLeft?100:50);mxUtils.setOpacity(l,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(h,
+0<b.scrollLeft?100:50);mxUtils.setOpacity(l,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,m-20);mxUtils.setOpacity(h,0<b.scrollLeft?100:50);mxUtils.setOpacity(l,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(a){var b=document.createElement("div");b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.whiteSpace="nowrap";b.style.boxSizing="border-box";b.style.position="relative";b.style.overflow="hidden";b.style.marginLeft="-1px";b.style.height=this.tabContainer.clientHeight+"px";b.style.padding="8px 4px 8px 4px";b.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #c0c0c0";b.style.borderBottomStyle="solid";b.style.backgroundColor=this.tabContainer.style.backgroundColor;
b.style.cursor="default";b.style.color="gray";a&&(mxEvent.addListener(b,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(b.style.backgroundColor="dark"==uiTheme?"black":"#d3d3d3",mxEvent.consume(a))})),mxEvent.addListener(b,"mouseleave",mxUtils.bind(this,function(a){b.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return b};
EditorUi.prototype.createControlTab=function(a,b){var d=this.createTab(!0);d.style.paddingTop=a+"px";d.style.cursor="pointer";d.style.width="30px";d.style.lineHeight="30px";d.innerHTML=b;null!=d.firstChild&&null!=d.firstChild.style&&mxUtils.setOpacity(d.firstChild,40);return d};
@@ -7443,45 +7448,45 @@ null,mxUtils.bind(this,function(){this.renamePage(d,d.getName())}),b),a.addSepar
mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a};
EditorUi.prototype.createTabForPage=function(a,b,d){d=this.createTab(d);var c=a.getName();d.setAttribute("title",c);mxUtils.write(d,c);d.style.maxWidth=b+"px";d.style.width=b+"px";this.addTabListeners(a,d);42<b&&(d.style.textOverflow="ellipsis");return d};
EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var d=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var c=!1,e=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){c=null!=this.currentMenu;e=a==this.currentPage;d.isMouseDown||e||this.selectPage(a)}),null,mxUtils.bind(this,function(f){if(d.isEnabled()&&!d.isMouseDown&&(mxEvent.isTouchEvent(f)&&e||mxEvent.isPopupTrigger(f))){d.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(f)||!c){var k=new mxPopupMenu(this.createPageMenu(a));k.div.className+=" geMenubarMenu";k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);this.resetCurrentMenu();k.destroy()});var l=mxEvent.getClientX(f),m=mxEvent.getClientY(f);k.popup(l,m,null,f);this.setCurrentMenu(k,b)}mxEvent.consume(f)}}))};
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(f)||!c){var h=new mxPopupMenu(this.createPageMenu(a));h.div.className+=" geMenubarMenu";h.smartSeparators=!0;h.showDisabled=!0;h.autoExpand=!0;h.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(h,arguments);this.resetCurrentMenu();h.destroy()});var l=mxEvent.getClientX(f),m=mxEvent.getClientY(f);h.popup(l,m,null,f);this.setCurrentMenu(h,b)}mxEvent.consume(f)}}))};
EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(d,c){d.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),c);d.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),c);d.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),c);d.addSeparator(c);d.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
mxResources.get("copyOf",[a.getName()]))}),c)})};(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,d,c){c.setAttribute("page",d.page.getId());return c};a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.page=a.ui.getPageById(d.getAttribute("page"));c.previous=c.name;return c};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","neverShown"]);a.afterEncode=function(a,d,c){c.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(c.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,c));return c};a.beforeDecode=function(a,d,c){c.ui=a.ui;c.relatedPage=c.ui.getPageById(d.getAttribute("relatedPage"));if(null==c.relatedPage){var b=document.createElement("diagram");b.setAttribute("id",d.getAttribute("relatedPage"));
b.setAttribute("name",d.getAttribute("name"));c.relatedPage=new DiagramPage(b);d=d.cloneNode(!0);b=d.firstChild;if(null!=b)for(c.relatedPage.root=a.decodeCell(b,!1),c=b.nextSibling,b.parentNode.removeChild(b),b=c;null!=b;){c=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var f=b.getAttribute("id");null==a.lookup(f)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=c}}return d};a.afterDecode=function(a,d,c){c.index=c.previousIndex;return c};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",b=Graph.prototype.foldCells;
-Graph.prototype.foldCells=function(a,c,d,l,m){c=null!=c?c:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var e=d.slice(),f=[],k=0;k<d.length;k++){var q=this.view.getState(d[k]),t=null!=q?q.style:this.getCellStyle(d[k]);"1"==mxUtils.getValue(t,"treeFolding","0")&&(this.traverse(d[k],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=d[k]&&f.push(a);return a==d[k]||!this.model.isCollapsed(a)})),this.model.setCollapsed(d[k],
-a))}for(k=0;k<f.length;k++)this.model.setVisible(f[k],!a);d=e;d=b.apply(this,arguments)}finally{this.model.endUpdate()}return d};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return v.isVertex(a)&&c(a)}function c(a){var b=!1;null!=a&&(a=v.getParent(a),b=p.view.getState(a),p.view.getState(a),b="tree"==(null!=b?b.style:p.getCellStyle(a)).containerType);
-return b}function d(a){var b=!1;null!=a&&(a=v.getParent(a),b=p.view.getState(a),p.view.getState(a),b=null!=(null!=b?b.style:p.getCellStyle(a)).childLayout);return b}function l(a){a=p.view.getState(a);if(null!=a){var b=p.getIncomingEdges(a.cell);if(0<b.length&&(b=p.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
+Graph.prototype.foldCells=function(a,c,d,l,m){c=null!=c?c:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var e=d.slice(),f=[],h=0;h<d.length;h++){var q=this.view.getState(d[h]),t=null!=q?q.style:this.getCellStyle(d[h]);"1"==mxUtils.getValue(t,"treeFolding","0")&&(this.traverse(d[h],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=d[h]&&f.push(a);return a==d[h]||!this.model.isCollapsed(a)})),this.model.setCollapsed(d[h],
+a))}for(h=0;h<f.length;h++)this.model.setVisible(f[h],!a);d=e;d=b.apply(this,arguments)}finally{this.model.endUpdate()}return d};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return w.isVertex(a)&&c(a)}function c(a){var b=!1;null!=a&&(a=w.getParent(a),b=p.view.getState(a),p.view.getState(a),b="tree"==(null!=b?b.style:p.getCellStyle(a)).containerType);
+return b}function d(a){var b=!1;null!=a&&(a=w.getParent(a),b=p.view.getState(a),p.view.getState(a),b=null!=(null!=b?b.style:p.getCellStyle(a)).childLayout);return b}function l(a){a=p.view.getState(a);if(null!=a){var b=p.getIncomingEdges(a.cell);if(0<b.length&&(b=p.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function m(a,b){b=null!=b?b:!0;p.model.beginUpdate();try{var c=p.model.getParent(a),d=p.getIncomingEdges(a),e=p.cloneCells([d[0],a]);p.model.setTerminal(e[0],p.model.getTerminal(d[0],!0),!0);var f=l(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
-10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);p.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=p.view.getState(a),h=p.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*h:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*h;var n=p.getOutgoingEdges(p.model.getTerminal(d[0],
-!0));if(null!=n){for(var q=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<n.length;t++){var D=p.model.getTerminal(n[t],!1);if(f==l(D)){var u=p.view.getState(D);D!=a&&null!=u&&(q&&b!=u.getCenterX()<k.getCenterX()||!q&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,u)&&(d=10+Math.max(d,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/h),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/h))}}q?g=0:d=0;for(t=0;t<n.length;t++)if(D=p.model.getTerminal(n[t],
-!1),f==l(D)&&(u=p.view.getState(D),D!=a&&null!=u&&(q&&b!=u.getCenterX()<k.getCenterX()||!q&&b!=u.getCenterY()<k.getCenterY()))){var v=[];p.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});p.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return p.addCells(e,c)}finally{p.model.endUpdate()}}function g(a){p.model.beginUpdate();try{var b=l(a),c=p.getIncomingEdges(a),d=p.cloneCells([c[0],a]);p.model.setTerminal(c[0],d[1],!1);p.model.setTerminal(d[0],d[1],!0);p.model.setTerminal(d[0],a,!1);
-var e=p.model.getParent(a),f=e.geometry,g=[];p.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);p.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,h=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,h=-40):b==mxConstants.DIRECTION_WEST?(k=-40,h=0):b==mxConstants.DIRECTION_EAST&&(h=0);p.moveCells(g,k,h);return p.addCells(d,e)}finally{p.model.endUpdate()}}function h(a){p.model.beginUpdate();try{var b=
-p.model.getParent(a),c=p.getIncomingEdges(a),d=p.cloneCells([c[0],a]);p.model.setTerminal(d[0],a,!0);var c=p.getOutgoingEdges(a),e=b.geometry,f=[];p.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=p.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var h=p.view.getBounds(f),m=l(a),n=p.view.translate,q=p.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==h?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(h.x+h.width)/q-n.x-e.x+10,d[1].geometry.y+=a.geometry.height-
-e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==h?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(h.x+h.width)/q-n.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=m==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==h?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(h.y+h.height)/q-n.y+-e.y+10);return p.addCells(d,b)}finally{p.model.endUpdate()}}function n(a,
+10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);p.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=p.view.getState(a),k=p.view.scale;if(null!=h){var m=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var n=p.getOutgoingEdges(p.model.getTerminal(d[0],
+!0));if(null!=n){for(var q=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,C=g=d=0;C<n.length;C++){var t=p.model.getTerminal(n[C],!1);if(f==l(t)){var u=p.view.getState(t);t!=a&&null!=u&&(q&&b!=u.getCenterX()<h.getCenterX()||!q&&b!=u.getCenterY()<h.getCenterY())&&mxUtils.intersects(m,u)&&(d=10+Math.max(d,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/k),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/k))}}q?g=0:d=0;for(C=0;C<n.length;C++)if(t=p.model.getTerminal(n[C],
+!1),f==l(t)&&(u=p.view.getState(t),t!=a&&null!=u&&(q&&b!=u.getCenterX()<h.getCenterX()||!q&&b!=u.getCenterY()<h.getCenterY()))){var v=[];p.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});p.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return p.addCells(e,c)}finally{p.model.endUpdate()}}function g(a){p.model.beginUpdate();try{var b=l(a),c=p.getIncomingEdges(a),d=p.cloneCells([c[0],a]);p.model.setTerminal(c[0],d[1],!1);p.model.setTerminal(d[0],d[1],!0);p.model.setTerminal(d[0],a,!1);
+var e=p.model.getParent(a),f=e.geometry,g=[];p.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);p.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,k=-40):b==mxConstants.DIRECTION_WEST?(h=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);p.moveCells(g,h,k);return p.addCells(d,e)}finally{p.model.endUpdate()}}function k(a){p.model.beginUpdate();try{var b=
+p.model.getParent(a),c=p.getIncomingEdges(a),d=p.cloneCells([c[0],a]);p.model.setTerminal(d[0],a,!0);var c=p.getOutgoingEdges(a),e=b.geometry,f=[];p.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=p.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=p.view.getBounds(f),m=l(a),n=p.view.translate,q=p.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/q-n.x-e.x+10,d[1].geometry.y+=a.geometry.height-
+e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/q-n.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=m==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/q-n.y+-e.y+10);return p.addCells(d,b)}finally{p.model.endUpdate()}}function n(a,
b,c){a=p.getOutgoingEdges(a);c=p.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=p.view.getState(p.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function q(a,b){var c=l(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
-c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=p.getOutgoingEdges(a),null!=d&&0<d.length&&p.setSelectionCell(p.model.getTerminal(d[0],!1))):(c=p.getIncomingEdges(a),null!=c&&0<c.length&&(d=n(p.model.getTerminal(c[0],!0),d,a),c=p.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&p.setSelectionCell(d[c].cell)))))}var t=this,p=t.editor.graph,v=p.getModel();mxResources.parse("selectChildren=Select Children");
-mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var y=t.menus.createPopupMenu;t.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);if(1==p.getSelectionCount()){c=p.getSelectionCell();var e=p.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(p.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(p.getSelectionCell())&&
+c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=p.getOutgoingEdges(a),null!=d&&0<d.length&&p.setSelectionCell(p.model.getTerminal(d[0],!1))):(c=p.getIncomingEdges(a),null!=c&&0<c.length&&(d=n(p.model.getTerminal(c[0],!0),d,a),c=p.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&p.setSelectionCell(d[c].cell)))))}var t=this,p=t.editor.graph,w=p.getModel();mxResources.parse("selectChildren=Select Children");
+mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var A=t.menus.createPopupMenu;t.menus.createPopupMenu=function(a,c,d){A.apply(this,arguments);if(1==p.getSelectionCount()){c=p.getSelectionCell();var e=p.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(p.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(p.getSelectionCell())&&
(a.addSeparator(),0<p.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};t.actions.addAction("selectChildren",function(){if(p.isEnabled()&&1==p.getSelectionCount()){var a=p.getSelectionCell(),a=p.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(p.model.getTerminal(a[c],!1));p.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(p.isEnabled()&&1==p.getSelectionCount()){var a=p.getSelectionCell(),
a=p.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=p.getOutgoingEdges(p.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(p.model.getTerminal(a[c],!1));p.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",function(){if(p.isEnabled()&&1==p.getSelectionCount()){var a=p.getSelectionCell(),a=p.getIncomingEdges(a);null!=a&&0<a.length&&p.setSelectionCell(p.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants",
-function(){if(p.isEnabled()&&1==p.getSelectionCount()){var a=p.getSelectionCell(),b=[];p.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});p.setSelectionCells(b)}},null,null,"Alt+Shift+T");var x=p.removeCells;p.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];v.isEdge(g)&&c(g)&&(e.push(g),g=v.getTerminal(g,!1));b(g)?(p.traverse(g,!0,
-function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=p.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return x.apply(this,arguments)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var u=p.duplicateCells;p.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=p.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=p.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
-a)}this.model.beginUpdate();try{var k=u.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var h=p.getIncomingEdges(k[e]),g=p.getIncomingEdges(a[e]);if(0==h.length&&0<g.length){var l=this.cloneCells([g[0]])[0];this.addEdge(l,p.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var A=p.moveCells;p.moveCells=function(a,c,d,e,f,g,k){var h=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
-if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||p.model.isEdge(a[q])&&null==p.model.getTerminal(a[q],!0)){f=p.model.getParent(a[q]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var t=p.getIncomingEdges(a[0]);if(0<t.length){var u=p.view.getState(p.model.getTerminal(t[0],!0));if(null!=u){var v=p.view.getState(l);null!=v&&(c=(v.getCenterX()-u.getCenterX())/p.view.scale,d=(v.getCenterY()-u.getCenterY())/p.view.scale)}}}}h=A.apply(this,arguments);
-if(null!=h&&null!=a&&h.length==a.length)for(q=0;q<h.length;q++)if(this.model.isEdge(h[q]))b(l)&&0>mxUtils.indexOf(h,this.model.getTerminal(h[q],!0))&&this.model.setTerminal(h[q],l,!0);else if(b(a[q])&&(t=p.getIncomingEdges(a[q]),0<t.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],l,!0);else if(0==p.getIncomingEdges(h[q]).length){m=l;if(null==m||m==p.model.getParent(a[q]))m=p.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e,
-p.getDefaultParent(),m,h[q])}}finally{this.model.endUpdate()}return h};if(null!=t.sidebar){var z=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=p.model,g=null;f.beginUpdate();try{if(g=z.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var h=p.getCellGeometry(g[k]);h.points=null;null!=h.getTerminalPoint(!0)&&h.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var w={88:t.actions.get("selectChildren"),
-84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},B=t.onKeyDown;t.onKeyDown=function(a){try{if(p.isEnabled()&&!p.isEditing()&&b(p.getSelectionCell())&&1==p.getSelectionCount()){var c=null;0<p.getIncomingEdges(p.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?g(p.getSelectionCell()):h(p.getSelectionCell()):13==a.which&&(c=m(p.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&p.model.isEdge(c[0])?p.setSelectionCell(p.model.getTerminal(c[0],
-!1)):p.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(p.view.getState(p.getSelectionCell())),p.startEditingAtCell(p.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=w[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(q(p.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(q(p.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(q(p.getSelectionCell(),
-mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(q(p.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(J){console.log("error",J)}mxEvent.isConsumed(a)||B.apply(this,arguments)};var G=p.connectVertex;p.connectVertex=function(a,c,d,e,f,k){var n=p.getIncomingEdges(a);return b(a)&&0<n.length?(d=l(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,f=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?h(a):e==f?g(a):m(a,c!=mxConstants.DIRECTION_NORTH&&
-c!=mxConstants.DIRECTION_WEST)):G.call(this,a,c,d,e,f,k)};p.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&p.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var C=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){C.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
+function(){if(p.isEnabled()&&1==p.getSelectionCount()){var a=p.getSelectionCell(),b=[];p.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});p.setSelectionCells(b)}},null,null,"Alt+Shift+T");var z=p.removeCells;p.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];w.isEdge(g)&&c(g)&&(e.push(g),g=w.getTerminal(g,!1));b(g)?(p.traverse(g,!0,
+function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=p.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return z.apply(this,arguments)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var u=p.duplicateCells;p.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=p.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=p.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
+a)}this.model.beginUpdate();try{var h=u.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=p.getIncomingEdges(h[e]),g=p.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var l=this.cloneCells([g[0]])[0];this.addEdge(l,p.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var x=p.moveCells;p.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
+if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||p.model.isEdge(a[q])&&null==p.model.getTerminal(a[q],!0)){f=p.model.getParent(a[q]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var t=p.getIncomingEdges(a[0]);if(0<t.length){var u=p.view.getState(p.model.getTerminal(t[0],!0));if(null!=u){var v=p.view.getState(l);null!=v&&(c=(v.getCenterX()-u.getCenterX())/p.view.scale,d=(v.getCenterY()-u.getCenterY())/p.view.scale)}}}}k=x.apply(this,arguments);
+if(null!=k&&null!=a&&k.length==a.length)for(q=0;q<k.length;q++)if(this.model.isEdge(k[q]))b(l)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[q],!0))&&this.model.setTerminal(k[q],l,!0);else if(b(a[q])&&(t=p.getIncomingEdges(a[q]),0<t.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],l,!0);else if(0==p.getIncomingEdges(k[q]).length){m=l;if(null==m||m==p.model.getParent(a[q]))m=p.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e,
+p.getDefaultParent(),m,k[q])}}finally{this.model.endUpdate()}return k};if(null!=t.sidebar){var y=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=p.model,g=null;f.beginUpdate();try{if(g=y.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=p.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var v={88:t.actions.get("selectChildren"),
+84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},B=t.onKeyDown;t.onKeyDown=function(a){try{if(p.isEnabled()&&!p.isEditing()&&b(p.getSelectionCell())&&1==p.getSelectionCount()){var c=null;0<p.getIncomingEdges(p.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?g(p.getSelectionCell()):k(p.getSelectionCell()):13==a.which&&(c=m(p.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&p.model.isEdge(c[0])?p.setSelectionCell(p.model.getTerminal(c[0],
+!1)):p.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(p.view.getState(p.getSelectionCell())),p.startEditingAtCell(p.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=v[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(q(p.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(q(p.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(q(p.getSelectionCell(),
+mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(q(p.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(K){console.log("error",K)}mxEvent.isConsumed(a)||B.apply(this,arguments)};var H=p.connectVertex;p.connectVertex=function(a,c,d,e,f,h){var n=p.getIncomingEdges(a);return b(a)&&0<n.length?(d=l(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,f=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?k(a):e==f?g(a):m(a,c!=mxConstants.DIRECTION_NORTH&&
+c!=mxConstants.DIRECTION_WEST)):H.call(this,a,c,d,e,f,h)};p.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&p.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var D=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){D.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);
this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var E=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){E.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
-this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var c=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=c.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
+this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var c=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=c.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");
b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
e.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");f.geometry.relative=!0;f.edge=!0;b.insertEdge(f,!0);e.insertEdge(f,!1);var q=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");q.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);q.insertEdge(t,!1);var p=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");p.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-v.geometry.relative=!0;v.edge=!0;b.insertEdge(v,!0);p.insertEdge(v,!1);a.insert(d);a.insert(f);a.insert(t);a.insert(v);a.insert(b);a.insert(c);a.insert(e);a.insert(q);a.insert(p);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
+t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);q.insertEdge(t,!1);var p=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");p.vertex=!0;var w=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+w.geometry.relative=!0;w.edge=!0;b.insertEdge(w,!0);p.insertEdge(w,!1);a.insert(d);a.insert(f);a.insert(t);a.insert(w);a.insert(b);a.insert(c);a.insert(e);a.insert(q);a.insert(p);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var c=new mxCell("Organization",
diff --git a/src/main/webapp/js/atlas-viewer.min.js b/src/main/webapp/js/atlas-viewer.min.js
index 21d13f11..da2d81af 100644
--- a/src/main/webapp/js/atlas-viewer.min.js
+++ b/src/main/webapp/js/atlas-viewer.min.js
@@ -1976,14 +1976,14 @@ this.updateGraphComponents();this.fireEvent(new mxEventObject("resetGraphView"))
Editor.prototype.getGraphXml=function(a){a=(null!=a?a:1)?(new mxCodec(mxUtils.createXmlDocument())).encode(this.graph.getModel()):this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)a.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),a.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);a.setAttribute("grid",this.graph.isGridEnabled()?"1":"0");a.setAttribute("gridSize",
this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",this.graph.foldingEnabled?"1":"0");a.setAttribute("page",this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width);
a.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&a.setAttribute("background",this.graph.background);return a};Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":"hidden",this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(a){this.modified=a};Editor.prototype.setFilename=function(a){this.filename=a};
-Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(d,b){for(var e=a.getSelectionCellsForChanges(b.getProperty("edit").changes),k=a.getModel(),q=[],t=0;t<e.length;t++)(k.isVertex(e[t])||k.isEdge(e[t]))&&null!=a.view.getState(e[t])&&
-q.push(e[t]);a.setSelectionCells(q)};b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};
+Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(d,b){for(var e=a.getSelectionCellsForChanges(b.getProperty("edit").changes),k=a.getModel(),q=[],r=0;r<e.length;r++)(k.isVertex(e[r])||k.isEdge(e[r]))&&null!=a.view.getState(e[r])&&
+q.push(e[r]);a.setSelectionCells(q)};b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};
OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)};
-function Dialog(a,b,e,d,k,m,l,q){var t=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(t=80);e+=t;d+=t;var c=e,f=d,g=Math.max(document.body.clientHeight,document.documentElement.clientHeight),p=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),n=Math.max(1,Math.round((g-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);d=Math.min(d,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&
-(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var h=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=h.x+"px";this.bg.style.top=h.y+"px";p+=h.x;n+=h.y;k&&document.body.appendChild(this.bg);var x=a.createDiv("geDialog");k=this.getPosition(p,n,
-e,d);p=k.x;n=k.y;x.style.width=e+"px";x.style.height=d+"px";x.style.left=p+"px";x.style.top=n+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=n+14+"px",m.style.left=p+e+38-t+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",
-mxUtils.bind(this,function(){a.hideDialog(!0)})),document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){g=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.bg.style.height=g+"px";p=Math.max(1,Math.round((document.body.clientWidth-e-64)/2));n=Math.max(1,Math.round((g-d-a.footerHeight)/3));e=Math.min(c,document.body.scrollWidth-64);d=
-Math.min(f,g-64);var h=this.getPosition(p,n,e,d);p=h.x;n=h.y;x.style.left=p+"px";x.style.top=n+"px";x.style.width=e+"px";x.style.height=d+"px";!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=n+14+"px",this.dialogImg.style.left=p+e+38-t+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=l;this.container=x;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";
+function Dialog(a,b,e,d,k,l,p,q){var r=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(r=80);e+=r;d+=r;var c=e,f=d,h=Math.max(document.body.clientHeight,document.documentElement.clientHeight),m=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),n=Math.max(1,Math.round((h-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);d=Math.min(d,h-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&
+(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=h+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var g=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=g.x+"px";this.bg.style.top=g.y+"px";m+=g.x;n+=g.y;k&&document.body.appendChild(this.bg);var x=a.createDiv("geDialog");k=this.getPosition(m,n,
+e,d);m=k.x;n=k.y;x.style.width=e+"px";x.style.height=d+"px";x.style.left=m+"px";x.style.top=n+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");l&&(l=document.createElement("img"),l.setAttribute("src",Dialog.prototype.closeImage),l.setAttribute("title",mxResources.get("close")),l.className="geDialogClose",l.style.top=n+14+"px",l.style.left=m+e+38-r+"px",l.style.zIndex=this.zIndex,mxEvent.addListener(l,"click",
+mxUtils.bind(this,function(){a.hideDialog(!0)})),document.body.appendChild(l),this.dialogImg=l,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){h=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.bg.style.height=h+"px";m=Math.max(1,Math.round((document.body.clientWidth-e-64)/2));n=Math.max(1,Math.round((h-d-a.footerHeight)/3));e=Math.min(c,document.body.scrollWidth-64);d=
+Math.min(f,h-64);var g=this.getPosition(m,n,e,d);m=g.x;n=g.y;x.style.left=m+"px";x.style.top=n+"px";x.style.width=e+"px";x.style.height=d+"px";!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=n+14+"px",this.dialogImg.style.left=m+e+38-r+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=x;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";
Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1;
Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+
"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png";
@@ -1994,66 +1994,66 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA
Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+
"/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a){null!=this.onDialogClose&&(this.onDialogClose(a),this.onDialogClose=null);null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
var PrintDialog=function(a,b){this.create(a,b)};
-PrintDialog.prototype.create=function(a){function b(a){var d=q.checked||c.checked,b=parseInt(g.value)/100;isNaN(b)&&(b=1,g.value="100%");var b=.75*b,p=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=1/e.pageScale;if(d){var r=q.checked?1:parseInt(f.value);isNaN(r)||(n=mxUtils.getScaleForPageCount(r,e,p))}e.getGraphBounds();var k=r=0,p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*b);p.height=Math.ceil(p.height*b);n*=b;!d&&e.pageVisible?(b=e.getPageLayout(),r-=b.x*p.width,k-=b.y*p.height):
-d=!0;d=PrintDialog.createPrintPreview(e,n,p,0,r,k,d);d.open();a&&PrintDialog.printPreview(d)}var e=a.editor.graph,d,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var l=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var t=document.createElement("span");mxUtils.write(t," "+mxResources.get("fitPage"));
-k.appendChild(t);mxEvent.addListener(t,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});d.appendChild(k);l.appendChild(d);d=d.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);t=document.createElement("span");mxUtils.write(t," "+mxResources.get("posterPrint")+":");k.appendChild(t);mxEvent.addListener(t,
-"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});d.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);l.appendChild(d);mxEvent.addListener(c,"change",
-function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";k.appendChild(g);d.appendChild(k);l.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
-k.style.paddingTop="20px";k.setAttribute("align","right");t=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});t.className="geBtn";a.editor.cancelFirst&&k.appendChild(t);if(PrintDialog.previewEnabled){var p=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});p.className="geBtn";k.appendChild(p)}p=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});p.className="geBtn gePrimaryBtn";k.appendChild(p);a.editor.cancelFirst||
-k.appendChild(t);d.appendChild(k);l.appendChild(d);m.appendChild(l);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}};
-PrintDialog.createPrintPreview=function(a,b,e,d,k,m,l){b=new mxPrintPreview(a,b,e,d,k,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=l;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var q=b.writeHead;b.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
+PrintDialog.prototype.create=function(a){function b(a){var d=q.checked||c.checked,b=parseInt(h.value)/100;isNaN(b)&&(b=1,h.value="100%");var b=.75*b,m=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=1/e.pageScale;if(d){var t=q.checked?1:parseInt(f.value);isNaN(t)||(n=mxUtils.getScaleForPageCount(t,e,m))}e.getGraphBounds();var k=t=0,m=mxRectangle.fromRectangle(m);m.width=Math.ceil(m.width*b);m.height=Math.ceil(m.height*b);n*=b;!d&&e.pageVisible?(b=e.getPageLayout(),t-=b.x*m.width,k-=b.y*m.height):
+d=!0;d=PrintDialog.createPrintPreview(e,n,m,0,t,k,d);d.open();a&&PrintDialog.printPreview(d)}var e=a.editor.graph,d,k,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var r=document.createElement("span");mxUtils.write(r," "+mxResources.get("fitPage"));
+k.appendChild(r);mxEvent.addListener(r,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});d.appendChild(k);p.appendChild(d);d=d.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);r=document.createElement("span");mxUtils.write(r," "+mxResources.get("posterPrint")+":");k.appendChild(r);mxEvent.addListener(r,
+"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});d.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);p.appendChild(d);mxEvent.addListener(c,"change",
+function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var h=document.createElement("input");h.setAttribute("value","100 %");h.setAttribute("size","5");h.style.width="50px";k.appendChild(h);d.appendChild(k);p.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
+k.style.paddingTop="20px";k.setAttribute("align","right");r=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});r.className="geBtn";a.editor.cancelFirst&&k.appendChild(r);if(PrintDialog.previewEnabled){var m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});m.className="geBtn";k.appendChild(m)}m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});m.className="geBtn gePrimaryBtn";k.appendChild(m);a.editor.cancelFirst||
+k.appendChild(r);d.appendChild(k);p.appendChild(d);l.appendChild(p);this.container=l};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}};
+PrintDialog.createPrintPreview=function(a,b,e,d,k,l,p){b=new mxPrintPreview(a,b,e,d,k,l);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var q=b.writeHead;b.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
PrintDialog.previewEnabled=!0;
-var PageSetupDialog=function(a){function b(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==n?(p.removeAttribute("title"),p.style.fontSize="",p.innerHTML=mxResources.get("change")+"..."):(p.setAttribute("title",n.src),p.style.fontSize="11px",p.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,m,l=document.createElement("table");l.style.width=
-"100%";l.style.height="100%";var q=document.createElement("tbody");k=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");k.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var t=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",d.pageFormat);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");
-mxUtils.write(m,mxResources.get("background")+":");k.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=d.background;b();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;b()});mxEvent.consume(c)});
-m.appendChild(c);mxUtils.write(m,mxResources.get("gridSize")+":");var g=document.createElement("input");g.setAttribute("type","number");g.setAttribute("min","0");g.style.width="40px";g.style.marginLeft="6px";g.value=d.getGridSize();m.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?d.getGridSize():a)});k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+
-":");k.appendChild(m);m=document.createElement("td");var p=document.createElement("a");p.style.textDecoration="underline";p.style.cursor="pointer";p.style.color="#a0a0a0";var n=d.backgroundImage;mxEvent.addListener(p,"click",function(c){a.showBackgroundImageDialog(function(a){n=a;e()});mxEvent.consume(c)});e();m.appendChild(p);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var h=
-mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&m.appendChild(h);var x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==g.value&&d.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,n,t.get());c.ignoreColor=d.background==f;c.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=n?n.src:null);d.pageFormat.width==c.previousFormat.width&&d.pageFormat.height==c.previousFormat.height&&
-c.ignoreColor&&c.ignoreImage||d.model.execute(c)});x.className="geBtn gePrimaryBtn";m.appendChild(x);a.editor.cancelFirst||m.appendChild(h);k.appendChild(m);q.appendChild(k);l.appendChild(q);this.container=l};
-PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,b){if(b||g!=document.activeElement&&p!=document.activeElement){a=!1;for(c=0;c<h.length;c++)b=h[c],r?"custom"==b.key&&(q.value=b.key,r=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&&
-e.height==b.format.height?(q.value=b.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,l.setAttribute("checked","checked"),l.defaultChecked=!0,a=l.checked=!0));a?(t.style.display="",f.style.display="none"):(g.value=e.width/100,p.value=e.height/100,v.setAttribute("selected","selected"),
-m.setAttribute("checked","checked"),m.defaultChecked=!0,t.style.display="none",f.style.display="")}}b="format-"+b;var m=document.createElement("input");m.setAttribute("name",b);m.setAttribute("type","radio");m.setAttribute("value","portrait");var l=document.createElement("input");l.setAttribute("name",b);l.setAttribute("type","radio");l.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var t=document.createElement("div");t.style.marginLeft=
-"4px";t.style.width="210px";t.style.height="24px";m.style.marginRight="6px";t.appendChild(m);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));t.appendChild(b);l.style.marginLeft="10px";l.style.marginRight="6px";t.appendChild(l);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));t.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height=
-"24px";var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var p=document.createElement("input");p.setAttribute("size","7");p.style.textAlign="right";f.appendChild(p);mxUtils.write(f," in");t.style.display="none";f.style.display="none";for(var n={},h=PageSetupDialog.getFormats(),x=0;x<h.length;x++){var u=h[x];n[u.key]=u;var v=document.createElement("option");v.setAttribute("value",u.key);mxUtils.write(v,u.title);q.appendChild(v)}var r=
-!1;k();a.appendChild(q);mxUtils.br(a);a.appendChild(t);a.appendChild(f);var y=e,w=function(){var a=n[q.value];null!=a.format?(g.value=a.format.width/100,p.value=a.format.height/100,f.style.display="none",t.style.display=""):(t.style.display="none",f.style.display="");isNaN(parseFloat(g.value))&&(g.value=e.width/100);isNaN(parseFloat(p.value))&&(p.value=e.height/100);a=new mxRectangle(0,0,Math.floor(100*parseFloat(g.value)),Math.floor(100*parseFloat(p.value)));"custom"!=q.value&&l.checked&&(a=new mxRectangle(0,
-0,a.height,a.width));if(a.width!=y.width||a.height!=y.height)y=a,null!=d&&d(y)};mxEvent.addListener(b,"click",function(a){m.checked=!0;w();mxEvent.consume(a)});mxEvent.addListener(c,"click",function(a){l.checked=!0;w();mxEvent.consume(a)});mxEvent.addListener(g,"blur",w);mxEvent.addListener(g,"click",w);mxEvent.addListener(p,"blur",w);mxEvent.addListener(p,"click",w);mxEvent.addListener(l,"change",w);mxEvent.addListener(m,"change",w);mxEvent.addListener(q,"change",function(){r="custom"==q.value;w()});
-w();return{set:function(a){e=a;k(null,null,!0)},get:function(){return y},widthInput:g,heightInput:p}};
+var PageSetupDialog=function(a){function b(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==n?(m.removeAttribute("title"),m.style.fontSize="",m.innerHTML=mxResources.get("change")+"..."):(m.setAttribute("title",n.src),m.style.fontSize="11px",m.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,l,p=document.createElement("table");p.style.width=
+"100%";p.style.height="100%";var q=document.createElement("tbody");k=document.createElement("tr");l=document.createElement("td");l.style.verticalAlign="top";l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("paperSize")+":");k.appendChild(l);l=document.createElement("td");l.style.verticalAlign="top";l.style.fontSize="10pt";var r=PageSetupDialog.addPageFormatPanel(l,"pagesetupdialog",d.pageFormat);k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");
+mxUtils.write(l,mxResources.get("background")+":");k.appendChild(l);l=document.createElement("td");l.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=d.background;b();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;b()});mxEvent.consume(c)});
+l.appendChild(c);mxUtils.write(l,mxResources.get("gridSize")+":");var h=document.createElement("input");h.setAttribute("type","number");h.setAttribute("min","0");h.style.width="40px";h.style.marginLeft="6px";h.value=d.getGridSize();l.appendChild(h);mxEvent.addListener(h,"change",function(){var a=parseInt(h.value);h.value=Math.max(1,isNaN(a)?d.getGridSize():a)});k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");mxUtils.write(l,mxResources.get("image")+
+":");k.appendChild(l);l=document.createElement("td");var m=document.createElement("a");m.style.textDecoration="underline";m.style.cursor="pointer";m.style.color="#a0a0a0";var n=d.backgroundImage;mxEvent.addListener(m,"click",function(c){a.showBackgroundImageDialog(function(a){n=a;e()});mxEvent.consume(c)});e();l.appendChild(m);k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");l.colSpan=2;l.style.paddingTop="16px";l.setAttribute("align","right");var g=
+mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);var x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==h.value&&d.setGridSize(parseInt(h.value));var c=new ChangePageSetup(a,f,n,r.get());c.ignoreColor=d.background==f;c.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=n?n.src:null);d.pageFormat.width==c.previousFormat.width&&d.pageFormat.height==c.previousFormat.height&&
+c.ignoreColor&&c.ignoreImage||d.model.execute(c)});x.className="geBtn gePrimaryBtn";l.appendChild(x);a.editor.cancelFirst||l.appendChild(g);k.appendChild(l);q.appendChild(k);p.appendChild(q);this.container=p};
+PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,b){if(b||h!=document.activeElement&&m!=document.activeElement){a=!1;for(c=0;c<g.length;c++)b=g[c],t?"custom"==b.key&&(q.value=b.key,t=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&&
+e.height==b.format.height?(q.value=b.key,l.setAttribute("checked","checked"),l.defaultChecked=!0,l.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(r.style.display="",f.style.display="none"):(h.value=e.width/100,m.value=e.height/100,v.setAttribute("selected","selected"),
+l.setAttribute("checked","checked"),l.defaultChecked=!0,r.style.display="none",f.style.display="")}}b="format-"+b;var l=document.createElement("input");l.setAttribute("name",b);l.setAttribute("type","radio");l.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",b);p.setAttribute("type","radio");p.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var r=document.createElement("div");r.style.marginLeft=
+"4px";r.style.width="210px";r.style.height="24px";l.style.marginRight="6px";r.appendChild(l);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));r.appendChild(b);p.style.marginLeft="10px";p.style.marginRight="6px";r.appendChild(p);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));r.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height=
+"24px";var h=document.createElement("input");h.setAttribute("size","7");h.style.textAlign="right";f.appendChild(h);mxUtils.write(f," in x ");var m=document.createElement("input");m.setAttribute("size","7");m.style.textAlign="right";f.appendChild(m);mxUtils.write(f," in");r.style.display="none";f.style.display="none";for(var n={},g=PageSetupDialog.getFormats(),x=0;x<g.length;x++){var u=g[x];n[u.key]=u;var v=document.createElement("option");v.setAttribute("value",u.key);mxUtils.write(v,u.title);q.appendChild(v)}var t=
+!1;k();a.appendChild(q);mxUtils.br(a);a.appendChild(r);a.appendChild(f);var A=e,y=function(){var a=n[q.value];null!=a.format?(h.value=a.format.width/100,m.value=a.format.height/100,f.style.display="none",r.style.display=""):(r.style.display="none",f.style.display="");isNaN(parseFloat(h.value))&&(h.value=e.width/100);isNaN(parseFloat(m.value))&&(m.value=e.height/100);a=new mxRectangle(0,0,Math.floor(100*parseFloat(h.value)),Math.floor(100*parseFloat(m.value)));"custom"!=q.value&&p.checked&&(a=new mxRectangle(0,
+0,a.height,a.width));if(a.width!=A.width||a.height!=A.height)A=a,null!=d&&d(A)};mxEvent.addListener(b,"click",function(a){l.checked=!0;y();mxEvent.consume(a)});mxEvent.addListener(c,"click",function(a){p.checked=!0;y();mxEvent.consume(a)});mxEvent.addListener(h,"blur",y);mxEvent.addListener(h,"click",y);mxEvent.addListener(m,"blur",y);mxEvent.addListener(m,"click",y);mxEvent.addListener(p,"change",y);mxEvent.addListener(l,"change",y);mxEvent.addListener(q,"change",function(){t="custom"==q.value;y()});
+y();return{set:function(a){e=a;k(null,null,!0)},get:function(){return A},widthInput:h,heightInput:m}};
PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:"US-Tabloid (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",
format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]};
(function(){mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph;if(null!=a.container&&!a.transparentBackground){if(a.pageVisible){var b=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var c=a.container.firstChild;null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.nextSibling;null!=c&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=
mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),c.style.position="absolute",a.container.insertBefore(this.backgroundPageShape.node,c),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(c){a.dblClick(c)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),
mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
-null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",g="";if(a.isGridEnabled()){g=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",g=a.gridSize*this.scale*this.gridSteps):
-d="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);g=-Math.round(g-mxUtils.mod(this.translate.x*this.scale-c,g))+"px "+-Math.round(g-mxUtils.mod(this.translate.y*this.scale-e,g))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=g,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
-b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=g,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],g=1;g<this.gridSteps;g++){var e=g*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
+null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",h="";if(a.isGridEnabled()){h=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",h=a.gridSize*this.scale*this.gridSteps):
+d="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);h=-Math.round(h-mxUtils.mod(this.translate.x*this.scale-c,h))+"px "+-Math.round(h-mxUtils.mod(this.translate.y*this.scale-e,h))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=h,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
+b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=h,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],h=1;h<this.gridSteps;h++){var e=h*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var c=
-this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,n=d*this.pageScale,h=this.view.getBackgroundPageBounds();b=h.width;c=h.height;var k=
-new mxRectangle(d*g.x,d*g.y,e.width*n,e.height*n),u=(a=a&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.ceil(c/k.height)-1:0,v=a?Math.ceil(b/k.width)-1:0,r=h.x+b,q=h.y+c;null==this.horizontalPageBreaks&&0<u&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?u:v,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(b+1)*k.height)),
-new mxPoint(Math.round(r),Math.round(h.y+(b+1)*k.height))]:[new mxPoint(Math.round(h.x+(b+1)*k.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(b+1)*k.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
-var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var g=this.graph.getCellGeometry(d[f]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
-!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,g=this.graph.pageScale,e=d.width*g,d=d.height*g,g=Math.floor(Math.min(0,b)/e),n=Math.floor(Math.min(0,
-c)/d);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+n*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-n)*d)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
-a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),g=b.getParent(d);
-if(null==c||c!=d&&c!=g)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)d=g,g=this.graph.getModel().getParent(d);return d};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=l.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),g=d.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&d.isVertex(g)){c=!0;break}g=d.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed=
+this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,h=this.view.translate,e=this.pageFormat,n=d*this.pageScale,g=this.view.getBackgroundPageBounds();b=g.width;c=g.height;var k=
+new mxRectangle(d*h.x,d*h.y,e.width*n,e.height*n),u=(a=a&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.ceil(c/k.height)-1:0,v=a?Math.ceil(b/k.width)-1:0,t=g.x+b,q=g.y+c;null==this.horizontalPageBreaks&&0<u&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?u:v,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(g.x),Math.round(g.y+(b+1)*k.height)),
+new mxPoint(Math.round(t),Math.round(g.y+(b+1)*k.height))]:[new mxPoint(Math.round(g.x+(b+1)*k.width),Math.round(g.y)),new mxPoint(Math.round(g.x+(b+1)*k.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
+var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var h=this.graph.getCellGeometry(d[f]);if(null!=h&&h.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
+!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,h=this.graph.pageScale,e=d.width*h,d=d.height*h,h=Math.floor(Math.min(0,b)/e),n=Math.floor(Math.min(0,
+c)/d);return new mxRectangle(this.scale*(this.translate.x+h*e),this.scale*(this.translate.y+n*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-h)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-n)*d)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
+a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,h,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var l=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=l.apply(this,arguments),h=b.getParent(d);
+if(null==c||c!=d&&c!=h)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(h)&&b.isVertex(h)&&!this.graph.isContainer(h);)d=h,h=this.graph.getModel().getParent(d);return d};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=p.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),h=d.getParent(a);null!=h;){if(this.graph.isCellSelected(h)&&d.isVertex(h)){c=!0;break}h=d.getParent(h)}return c};mxGraphHandler.prototype.selectDelayed=
function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&&
(a=c),c=b.getParent(c);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=e;mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||d.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=
k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(b=function(a){var c=mxEvent.getSource(a);
if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}return k(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b):d.panningHandler.usePopupTrigger=!1;d.init(this.diagramContainer);this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var c=mxUtils.getOffset(this.diagramContainer);
-0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,l=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return m||l.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(m=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||
-mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog()});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var q=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return q.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&
-(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var t=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return t.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))};var c=!1,f=null,g=null,p=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=d.cellEditor.isContentEditing()){for(var a=
-this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==p)this.toolbar.createTextToolbar();else{for(var h=0;h<p.length;h++)this.toolbar.container.appendChild(p[h]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu=g}c=d.cellEditor.isContentEditing();f=a;g=e;p=b}}),h=this,x=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){x.apply(this,
-arguments);n();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=h.toolbar)){var b=c.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));h.toolbar.setFontName(b);h.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,
-"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var u=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){u.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(F){}var v=d.fireMouseEvent;d.fireMouseEvent=function(a,c,
-b){a==mxEvent.MOUSE_DOWN&&this.container.focus();v.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),
-y="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=d.view.getState(a);if(null!=c){a=a.clone();a.style="";a=d.getCellStyle(a);var b=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(b.push(c.style[g]),f.push(g));g=d.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],h=0;h<e.length;h++){var p=e[h],n=p.indexOf("=");0<=n&&(g=p.substring(0,n),p=p.substring(n+1),null!=a[g]&&"none"==p&&(b.push(p),f.push(g)))}d.getModel().isEdge(c.cell)?
-d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[c.cell]))}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var w=["fontFamily","fontSize","fontColor"],A="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),
-E=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],w,["align"],["html"]];for(a=0;a<E.length;a++)for(b=0;b<E[a].length;b++)r.push(E[a][b]);for(a=0;a<y.length;a++)0>mxUtils.indexOf(r,y[a])&&r.push(y[a]);var B=function(a,c){var b=d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(p),g=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var h=
-g[f[e]];null!=h&&d.setCellStyles(f[e],h,a)}else for(h=0;h<a.length;h++){for(var p=a[h],n=b.getStyle(p),u=null!=n?n.split(";"):[],L=r.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var x=v.substring(0,k),q=mxUtils.indexOf(L,x);0<=q&&L.splice(q,1);for(var A=0;A<E.length;A++){var w=E[A];if(0<=mxUtils.indexOf(w,x))for(var m=0;m<w.length;m++){var l=mxUtils.indexOf(L,w[m]);0<=l&&L.splice(l,1)}}}}for(var g=(f=b.isEdge(p))?d.currentEdgeStyle:d.currentVertexStyle,t=b.getStyle(p),e=0;e<L.length;e++){var x=
-L[e],F=g[x];null==F||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(y,x))||(t=mxUtils.setStyle(t,x,F))}b.setStyle(p,t)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){B(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){B(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,
-c){var b=c.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(g=d.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=c.getProperty("keys"),h=c.getProperty("values"),e=0;e<b.length;e++){var p=0<=mxUtils.indexOf(w,b[e]);if("strokeColor"!=b[e]||null!=h[e]&&"none"!=h[e])if(0<=mxUtils.indexOf(y,b[e]))g||0<=mxUtils.indexOf(A,b[e])?null==h[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=h[e]:f&&0<=mxUtils.indexOf(r,b[e])&&(null==
-h[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=h[e]);else if(0<=mxUtils.indexOf(r,b[e])){if(f||p)null==h[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=h[e];if(g||p||0<=mxUtils.indexOf(A,b[e]))null==h[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=h[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=
+0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var l=!1,p=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return l||p.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(l=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||
+mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog()});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";l=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var q=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return q.apply(this,arguments)||l||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&
+(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var r=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return r.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))};var c=!1,f=null,h=null,m=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=d.cellEditor.isContentEditing()){for(var a=
+this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==m)this.toolbar.createTextToolbar();else{for(var g=0;g<m.length;g++)this.toolbar.container.appendChild(m[g]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu=h}c=d.cellEditor.isContentEditing();f=a;h=e;m=b}}),g=this,x=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){x.apply(this,
+arguments);n();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=g.toolbar)){var b=c.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));g.toolbar.setFontName(b);g.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,
+"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var u=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){u.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(G){}var v=d.fireMouseEvent;d.fireMouseEvent=function(a,c,
+b){a==mxEvent.MOUSE_DOWN&&this.container.focus();v.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var t="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),
+A="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=d.view.getState(a);if(null!=c){a=a.clone();a.style="";a=d.getCellStyle(a);var b=[],f=[],h;for(h in c.style)a[h]!=c.style[h]&&(b.push(c.style[h]),f.push(h));h=d.getModel().getStyle(c.cell);for(var e=null!=h?h.split(";"):[],g=0;g<e.length;g++){var m=e[g],n=m.indexOf("=");0<=n&&(h=m.substring(0,n),m=m.substring(n+1),null!=a[h]&&"none"==m&&(b.push(m),f.push(h)))}d.getModel().isEdge(c.cell)?
+d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[c.cell]))}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var y=["fontFamily","fontSize","fontColor"],w="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),
+F=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],y,["align"],["html"]];for(a=0;a<F.length;a++)for(b=0;b<F[a].length;b++)t.push(F[a][b]);for(a=0;a<A.length;a++)0>mxUtils.indexOf(t,A[a])&&t.push(A[a]);var B=function(a,c){var b=d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(m),h=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var g=
+h[f[e]];null!=g&&d.setCellStyles(f[e],g,a)}else for(g=0;g<a.length;g++){for(var m=a[g],n=b.getStyle(m),u=null!=n?n.split(";"):[],K=t.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var x=v.substring(0,k),q=mxUtils.indexOf(K,x);0<=q&&K.splice(q,1);for(var w=0;w<F.length;w++){var l=F[w];if(0<=mxUtils.indexOf(l,x))for(var p=0;p<l.length;p++){var y=mxUtils.indexOf(K,l[p]);0<=y&&K.splice(y,1)}}}}for(var h=(f=b.isEdge(m))?d.currentEdgeStyle:d.currentVertexStyle,r=b.getStyle(m),e=0;e<K.length;e++){var x=
+K[e],G=h[x];null==G||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(A,x))||(r=mxUtils.setStyle(r,x,G))}b.setStyle(m,r)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){B(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){B(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,
+c){var b=c.getProperty("cells"),f=!1,h=!1;if(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(h=d.getModel().isEdge(b[e])||h)||!f);e++);else h=f=!0;for(var b=c.getProperty("keys"),g=c.getProperty("values"),e=0;e<b.length;e++){var m=0<=mxUtils.indexOf(y,b[e]);if("strokeColor"!=b[e]||null!=g[e]&&"none"!=g[e])if(0<=mxUtils.indexOf(A,b[e]))h||0<=mxUtils.indexOf(w,b[e])?null==g[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=g[e]:f&&0<=mxUtils.indexOf(t,b[e])&&(null==
+g[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=g[e]);else if(0<=mxUtils.indexOf(t,b[e])){if(f||m)null==g[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=g[e];if(h||m||0<=mxUtils.indexOf(w,b[e]))null==g[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=g[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=
this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||null==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+
("vertical"==d.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==d.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==d.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==d.currentEdgeStyle.shape?
"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(d.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("end",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_ENDARROW],
@@ -2072,31 +2072,31 @@ a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==d?"geSprite geSprite-"+a+"block":"g
a+"ermany":"ERoneToMany"==e?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==e?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==e?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null};
EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),e=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(b.isEnabled())};
EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var d=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste",
-!1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};
+!1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var l=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){l.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};
EditorUi.prototype.initCanvas=function(){var a=this.editor.graph,a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*
-a.width*c.width,this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,b){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(c,b,d,f){if(null!=a.container){d=null!=d?d:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),h=a.view.translate,p=a.view.scale,n=mxRectangle.fromRectangle(g);
-n.x=n.x/p-h.x;n.y=n.y/p-h.y;n.width/=p;n.height/=p;var h=a.container.scrollTop,u=a.container.scrollLeft,v=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)v+=3;var r=a.container.offsetWidth-v,v=a.container.offsetHeight-v;c=c?Math.max(.3,Math.min(b||1,r/n.width)):p;b=(r-c*n.width)/2/c;var k=0==this.lightboxVerticalDivider?0:(v-c*n.height)/this.lightboxVerticalDivider/c;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||g.width<r||g.height<v)a.view.scaleAndTranslate(c,
-Math.floor(b-n.x),Math.floor(k-n.y)),a.container.scrollTop=h*c/p,a.container.scrollLeft=u*c/p;else if(0!=d||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+d/p),Math.floor(g.y+f/p))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
+a.width*c.width,this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,b){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(c,b,d,f){if(null!=a.container){d=null!=d?d:0;f=null!=f?f:0;var h=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),g=a.view.translate,m=a.view.scale,n=mxRectangle.fromRectangle(h);
+n.x=n.x/m-g.x;n.y=n.y/m-g.y;n.width/=m;n.height/=m;var g=a.container.scrollTop,u=a.container.scrollLeft,v=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)v+=3;var t=a.container.offsetWidth-v,v=a.container.offsetHeight-v;c=c?Math.max(.3,Math.min(b||1,t/n.width)):m;b=(t-c*n.width)/2/c;var k=0==this.lightboxVerticalDivider?0:(v-c*n.height)/this.lightboxVerticalDivider/c;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||h.width<t||h.height<v)a.view.scaleAndTranslate(c,
+Math.floor(b-n.x),Math.floor(k-n.y)),a.container.scrollTop=g*c/m,a.container.scrollLeft=u*c/m;else if(0!=d||0!=f)h=a.view.translate,a.view.setTranslate(Math.floor(h.x+d/m),Math.floor(h.y+f/m))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace=
"nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var k=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]||
-0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var m=0,k=mxUtils.bind(this,function(a,c,b){m++;var d=document.createElement("span");d.style.paddingLeft="8px";d.style.paddingRight="8px";d.style.cursor="pointer";mxEvent.addListener(d,"click",a);null!=b&&d.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);d.appendChild(a);this.chromelessToolbar.appendChild(d);
-return d}),l=k(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var t=k(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),
-c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(q.innerHTML="",mxUtils.write(q,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});l.style.paddingLeft="0px";l.style.paddingRight="4px";t.style.paddingLeft="4px";t.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(t.style.display="",l.style.display="",q.style.display="inline-block"):(t.style.display="none",l.style.display=
+0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var l=0,k=mxUtils.bind(this,function(a,c,b){l++;var d=document.createElement("span");d.style.paddingLeft="8px";d.style.paddingRight="8px";d.style.cursor="pointer";mxEvent.addListener(d,"click",a);null!=b&&d.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);d.appendChild(a);this.chromelessToolbar.appendChild(d);
+return d}),p=k(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var r=k(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),
+c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(q.innerHTML="",mxUtils.write(q,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});p.style.paddingLeft="0px";p.style.paddingRight="4px";r.style.paddingLeft="4px";r.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(r.style.display="",p.style.display="",q.style.display="inline-block"):(r.style.display="none",p.style.display=
"none",q.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);k(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(c){a.lightbox?(1==a.view.scale?
-this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,p=null,n=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=p&&(window.clearTimeout(p),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;p=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";p=
-null}),600)}),a||200)}),h=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=p&&(window.clearTimeout(p),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var x=k(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,
+this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var h=null,m=null,n=mxUtils.bind(this,function(a){null!=h&&(window.clearTimeout(h),fadeThead=null);null!=m&&(window.clearTimeout(m),fadeThead2=null);h=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);h=null;m=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";m=
+null}),600)}),a||200)}),g=mxUtils.bind(this,function(a){null!=h&&(window.clearTimeout(h),fadeThead=null);null!=m&&(window.clearTimeout(m),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var x=k(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,
"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var b=x.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff";
mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=b.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=b.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),u=a.getModel();u.addListener(mxEvent.CHANGE,function(){x.style.display=1<u.getChildCount(u.root)?
"":"none"})}this.addChromelessToolbarItems(k);null!=this.editor.editButtonLink&&k(mxUtils.bind(this,function(a){"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):window.open(this.editor.editButtonLink,"editWindow");mxEvent.consume(a)}),Editor.editLargeImage,mxResources.get("openInNewWindow"));!a.lightbox||"1"!=urlParams.close&&this.container==document.body||k(mxUtils.bind(this,function(a){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,
-mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||h(30),n())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});
-mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():h(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():h(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||h(30)}));var v=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,b){this.startX=
-b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<v&&Math.abs(this.scrollTop-a.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?n():h(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var r=
-a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}r.apply(this,arguments)};var y=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),d=this.getPageSize(),f=Math.ceil(2*b.x+c.width*
-d.width),g=Math.ceil(2*b.y+c.height*d.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,f,g);f=b.x-c.x*d.width;b=b.y-c.y*d.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==b?y.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,d=a.view.translate.y,a.view.setTranslate(f,b),a.container.scrollLeft+=Math.round((f-c)*a.view.scale),a.container.scrollTop+=Math.round((b-d)*a.view.scale),
-this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var w=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=
-(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),d=0,f=0;null!=w&&(d=a.container.offsetWidth/2-w.x+c.x,f=a.container.offsetHeight/2-w.y+c.y);c=this.view.scale;
+mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||g(30),n())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});
+mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():g(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():g(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||g(30)}));var v=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,b){this.startX=
+b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<v&&Math.abs(this.scrollTop-a.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?n():g(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var t=
+a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}t.apply(this,arguments)};var A=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),d=this.getPageSize(),f=Math.ceil(2*b.x+c.width*
+d.width),h=Math.ceil(2*b.y+c.height*d.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=h)a.minimumGraphSize=new mxRectangle(0,0,f,h);f=b.x-c.x*d.width;b=b.y-c.y*d.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==b?A.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,d=a.view.translate.y,a.view.setTranslate(f,b),a.container.scrollLeft+=Math.round((f-c)*a.view.scale),a.container.scrollTop+=Math.round((b-d)*a.view.scale),
+this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var y=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=
+(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),d=0,f=0;null!=y&&(d=a.container.offsetWidth/2-y.x+c.x,f=a.container.offsetHeight/2-y.y+c.y);c=this.view.scale;
this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&e.chromelessResize(!1,null,d*(this.cumulativeZoomFactor-1),f*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==d&&0==f||(a.container.scrollLeft-=d*(this.cumulativeZoomFactor-1),a.container.scrollTop-=f*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),20)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(c,b){if((mxEvent.isAltDown(c)||mxEvent.isControlDown(c)&&!mxClient.IS_MAC||
-a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var d=mxEvent.getSource(c);null!=d;){if(d==a.container){w=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));a.lazyZoom(b);mxEvent.consume(c);break}d=d.parentNode}}))};EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};
+a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var d=mxEvent.getSource(c);null!=d;){if(d==a.container){y=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));a.lazyZoom(b);mxEvent.consume(c);break}d=d.parentNode}}))};EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};
EditorUi.prototype.createTemporaryGraph=function(a){a=new Graph(document.createElement("div"),null,null,a);a.resetViewOnRootChange=!1;a.setConnectable(!1);a.gridEnabled=!1;a.autoScroll=!1;a.setTooltips(!1);a.setEnabled(!1);a.container.style.visibility="hidden";a.container.style.position="absolute";a.container.style.overflow="hidden";a.container.style.height="1px";a.container.style.width="1px";return a};
EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};EditorUi.prototype.toggleFormatPanel=function(a){this.formatWidth=a||0<this.formatWidth?0:240;this.formatContainer.style.display=a||0<this.formatWidth?"":"none";this.refresh();this.format.refresh();this.fireEvent(new mxEventObject("formatWidthChanged"))};
EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,e=60;null!=b&&(e=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(e,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
@@ -2119,20 +2119,20 @@ this.previousFormat=b);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.e
EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};
EditorUi.prototype.setPageFormat=function(a){this.editor.graph.pageFormat=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(a){this.editor.graph.pageScale=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};
EditorUi.prototype.setGridColor=function(a){this.editor.graph.view.gridColor=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};
-EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,d);e.addListener(mxEvent.UNDO,d);e.addListener(mxEvent.REDO,d);e.addListener(mxEvent.CLEAR,d);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);d()};var m=this.editor.graph.cellEditor.stopEditing;
-this.editor.graph.cellEditor.stopEditing=function(a,b){m.apply(this,arguments);d()};d()};
-EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,d=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var l=k[m];a.getModel().isEdge(l)&&(d=!0);a.getModel().isVertex(l)&&(e=!0);if(d&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m=
-0;m<k.length;m++)this.actions.get(k[m]).setEnabled(b);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(d);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);d=e&&1==a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||
+EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,d);e.addListener(mxEvent.UNDO,d);e.addListener(mxEvent.REDO,d);e.addListener(mxEvent.CLEAR,d);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);d()};var l=this.editor.graph.cellEditor.stopEditing;
+this.editor.graph.cellEditor.stopEditing=function(a,b){l.apply(this,arguments);d()};d()};
+EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,d=!1,k=a.getSelectionCells();if(null!=k)for(var l=0;l<k.length;l++){var p=k[l];a.getModel().isEdge(p)&&(d=!0);a.getModel().isVertex(p)&&(e=!0);if(d&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(l=
+0;l<k.length;l++)this.actions.get(k[l]).setEnabled(b);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(d);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);d=e&&1==a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||
d&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||d&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(d&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(b||null!=a.view.currentRoot);this.actions.get("collapsible").setEnabled(e&&(a.isContainer(a.getSelectionCell())||
0<a.model.getChildCount(a.getSelectionCell())));this.actions.get("home").setEnabled(null!=a.view.currentRoot);this.actions.get("exitGroup").setEnabled(null!=a.view.currentRoot);this.actions.get("enterGroup").setEnabled(1==a.getSelectionCount()&&a.isValidRoot(a.getSelectionCell()));b=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(b);this.actions.get("collapse").setEnabled(b);this.actions.get("editLink").setEnabled(1==a.getSelectionCount());this.actions.get("openLink").setEnabled(1==
a.getSelectionCount()&&null!=a.getLinkForCell(a.getSelectionCell()));this.actions.get("guides").setEnabled(a.isEnabled());this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);b=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(b);this.menus.get("insert").setEnabled(b);this.menus.get("direction").setEnabled(b&&e);this.menus.get("align").setEnabled(b&&e&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(b&&e&&1<a.getSelectionCount());
this.actions.get("selectVertices").setEnabled(b);this.actions.get("selectEdges").setEnabled(b);this.actions.get("selectAll").setEnabled(b);this.actions.get("selectNone").setEnabled(b);this.updatePasteActionStates()};
EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var b=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,d=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,d=b?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var k=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&
-(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),l=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",l+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",l+=this.toolbarHeight);0<l&&!mxClient.IS_QUIRKS&&(l+=1);var q=0;if(null!=this.sidebarFooterContainer){var t=
-this.footerHeight+k,q=Math.max(0,Math.min(d-l-t,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=t+"px"}t=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=l+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=l+"px";this.formatContainer.style.width=t+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left=
-null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=m+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);b?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,
-b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-q+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-t)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,q=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom=
-this.footerHeight+k+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=t+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+k+"px",this.formatContainer.style.bottom=
+(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var l=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),p=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",p+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",p+=this.toolbarHeight);0<p&&!mxClient.IS_QUIRKS&&(p+=1);var q=0;if(null!=this.sidebarFooterContainer){var r=
+this.footerHeight+k,q=Math.max(0,Math.min(d-p-r,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=l+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=r+"px"}r=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=p+"px";this.sidebarContainer.style.width=l+"px";this.formatContainer.style.top=p+"px";this.formatContainer.style.width=r+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left=
+null!=this.hsplit.parentNode?l+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=l+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);b?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,
+b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-q+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-l-this.splitSize-r)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,q=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom=
+this.footerHeight+k+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=r+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+k+"px",this.formatContainer.style.bottom=
this.footerHeight+k+"px",this.diagramContainer.style.bottom=this.footerHeight+k+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null};
EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.footerContainer=this.createDiv("geFooterContainer");this.hsplit=this.createDiv("geHsplit");this.hsplit.setAttribute("title",mxResources.get("collapseExpand"));
this.menubarContainer.style.top="0px";this.menubarContainer.style.left="0px";this.menubarContainer.style.right="0px";this.toolbarContainer.style.left="0px";this.toolbarContainer.style.right="0px";this.sidebarContainer.style.left="0px";this.formatContainer.style.right="0px";this.formatContainer.style.zIndex="1";this.diagramContainer.style.right=(null!=this.format?this.formatWidth:0)+"px";this.footerContainer.style.left="0px";this.footerContainer.style.right="0px";this.footerContainer.style.bottom=
@@ -2142,8 +2142,8 @@ this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContaine
this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,
!0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)};
EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var b=document.createElement("div");b.className=a;return b};
-EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=l){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,q+(b?g.x-l.x:l.y-g.y)-e));mxEvent.consume(a);q!=f()&&(t=!0,c=null)}}function m(a){k(a);l=q=null}var l=null,q=null,t=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){l=new mxPoint(mxEvent.getClientX(a),
-mxEvent.getClientY(a));q=f();t=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!t){var b=null!=c?c-e:0;c=f();d(b);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})};EditorUi.prototype.showDialog=function(a,b,e,d,k,m,l){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,m,l);this.dialogs.push(this.dialog)};
+EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=p){var h=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,q+(b?h.x-p.x:p.y-h.y)-e));mxEvent.consume(a);q!=f()&&(r=!0,c=null)}}function l(a){k(a);p=q=null}var p=null,q=null,r=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a),
+mxEvent.getClientY(a));q=f();r=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!r){var b=null!=c?c-e:0;c=f();d(b);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,k,l);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,l)})};EditorUi.prototype.showDialog=function(a,b,e,d,k,l,p){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,l,p);this.dialogs.push(this.dialog)};
EditorUi.prototype.hideDialog=function(a){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(a),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),this.editor.fireEvent(new mxEventObject("hideDialog")))};
EditorUi.prototype.pickColor=function(a,b){var e=this.editor.graph,d=e.cellEditor.saveSelection(),k=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(d);b(a)},function(){e.cellEditor.restoreSelection(d)});this.showDialog(k.container,230,430,!0,!1);k.init()};
EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};
@@ -2153,17 +2153,17 @@ EditorUi.prototype.extractGraphModelFromEvent=function(a){var b=null,e=null;null
EditorUi.prototype.save=function(a){if(null!=a){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,b);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(b.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(b))).simulate(document,
"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(b);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(e){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}};
EditorUi.prototype.executeLayout=function(a,b,e){var d=this.editor.graph;if(d.isEnabled()){d.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&b&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(d),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){d.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(d.getModel().endUpdate(),null!=e&&e())}}};
-EditorUi.prototype.showImageDialog=function(a,b,e,d){d=this.editor.graph.cellEditor;var k=d.saveSelection(),m=mxUtils.prompt(a,b);d.restoreSelection(k);if(null!=m&&0<m.length){var l=new Image;l.onload=function(){e(m,l.width,l.height)};l.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};l.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,b,e){a=new LinkDialog(this,a,b,e);this.showDialog(a.container,420,90,!0,!0);a.init()};
+EditorUi.prototype.showImageDialog=function(a,b,e,d){d=this.editor.graph.cellEditor;var k=d.saveSelection(),l=mxUtils.prompt(a,b);d.restoreSelection(k);if(null!=l&&0<l.length){var p=new Image;p.onload=function(){e(l,p.width,p.height)};p.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};p.src=l}else e(null)};EditorUi.prototype.showLinkDialog=function(a,b,e){a=new LinkDialog(this,a,b,e);this.showDialog(a.container,420,90,!0,!0);a.init()};
EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=b&&0<b.length){var e=new Image;e.onload=function(){a(new mxImage(b,e.width,e.height))};e.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};e.src=b}else a(null)};
EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,b,e){mxUtils.confirm(a)?null!=b&&b():null!=e&&e()};
EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);b.border=20;mxEvent.addListener(window,"resize",function(){b.update()});this.addListener("pageFormatChanged",function(){b.update()});return b};
-EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){l.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var f=d.getSelectionCells(),g=0;g<f.length;g++)if(d.getModel().isVertex(f[g])&&d.isCellResizable(f[g])){var e=d.getCellGeometry(f[g]);null!=e&&(e=e.clone(),37==a?e.width=Math.max(0,e.width-c):38==a?e.height=Math.max(0,e.height-c):39==a?e.width+=c:40==a&&(e.height+=c),d.getModel().setGeometry(f[g],e))}}finally{d.getModel().endUpdate()}}else f=
-d.getSelectionCell(),g=d.model.getParent(f),e=null,1==d.getSelectionCount()&&d.model.isVertex(f)&&null!=d.layoutManager&&!d.isCellLocked(f)&&(e=d.layoutManager.getLayout(g)),null!=e&&e.constructor==mxStackLayout?(e=g.getIndex(f),37==a||38==a?d.model.add(g,f,Math.max(0,e-1)):39!=a&&40!=a||d.model.add(g,f,Math.min(d.model.getChildCount(g),e+1))):(g=f=0,37==a?f=-c:38==a?g=-c:39==a?f=c:40==a&&(g=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),f,g))});null!=q&&window.clearTimeout(q);q=window.setTimeout(function(){if(0<
-l.length){d.getModel().beginUpdate();try{for(var a=0;a<l.length;a++)l[a]();l=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var e=this,d=this.editor.graph,k=new mxKeyHandler(d),m=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&
-!mxClient.IS_SF)&&m.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var l=[],q=null,t={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=k.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"),80:this.actions.get("connectionPoints")};
-mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){var g=f[a.keyCode];if(null!=g)return g.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=t[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),t[a.keyCode],
+EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){p.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var f=d.getSelectionCells(),h=0;h<f.length;h++)if(d.getModel().isVertex(f[h])&&d.isCellResizable(f[h])){var e=d.getCellGeometry(f[h]);null!=e&&(e=e.clone(),37==a?e.width=Math.max(0,e.width-c):38==a?e.height=Math.max(0,e.height-c):39==a?e.width+=c:40==a&&(e.height+=c),d.getModel().setGeometry(f[h],e))}}finally{d.getModel().endUpdate()}}else f=
+d.getSelectionCell(),h=d.model.getParent(f),e=null,1==d.getSelectionCount()&&d.model.isVertex(f)&&null!=d.layoutManager&&!d.isCellLocked(f)&&(e=d.layoutManager.getLayout(h)),null!=e&&e.constructor==mxStackLayout?(e=h.getIndex(f),37==a||38==a?d.model.add(h,f,Math.max(0,e-1)):39!=a&&40!=a||d.model.add(h,f,Math.min(d.model.getChildCount(h),e+1))):(h=f=0,37==a?f=-c:38==a?h=-c:39==a?f=c:40==a&&(h=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),f,h))});null!=q&&window.clearTimeout(q);q=window.setTimeout(function(){if(0<
+p.length){d.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var e=this,d=this.editor.graph,k=new mxKeyHandler(d),l=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&
+!mxClient.IS_SF)&&l.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var p=[],q=null,r={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=k.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"),80:this.actions.get("connectionPoints")};
+mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){var h=f[a.keyCode];if(null!=h)return h.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=r[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),r[a.keyCode],
d.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&d.model.isEdge(c[0])?d.setSelectionCell(d.model.getTerminal(c[0],!1)):d.setSelectionCell(c[c.length-1]),d.scrollCellToVisible(d.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(d.view.getState(d.getSelectionCell())))}}else return this.isControlDown(a)?function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null,!0)}:function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null)}}return c.apply(this,arguments)};k.bindAction=mxUtils.bind(this,
-function(a,c,b,d){var f=this.actions.get(b);null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):d?k.bindShiftKey(a,b):k.bindKey(a,b))});var g=k.escape;k.escape=function(a){g.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){d.exitGroup()});k.bindControlShiftKey(35,function(){d.enterGroup()});k.bindKey(36,function(){d.home()});k.bindKey(35,function(){d.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");
+function(a,c,b,d){var f=this.actions.get(b);null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):d?k.bindShiftKey(a,b):k.bindKey(a,b))});var h=k.escape;k.escape=function(a){h.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){d.exitGroup()});k.bindControlShiftKey(35,function(){d.enterGroup()});k.bindKey(36,function(){d.home()});k.bindKey(35,function(){d.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");
k.bindAction(80,!0,"print");k.bindAction(79,!0,"outline",!0);k.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)k.bindControlKey(36,function(){d.isEnabled()&&d.foldCells(!0)}),k.bindControlKey(35,function(){d.isEnabled()&&d.foldCells(!1)}),k.bindControlKey(13,function(){d.isEnabled()&&d.setSelectionCells(d.duplicateCells(d.getSelectionCells(),!1))}),k.bindAction(8,!1,"delete"),k.bindAction(8,!0,"deleteAll"),k.bindAction(46,!1,"delete"),k.bindAction(46,!0,"deleteAll"),k.bindAction(72,
!0,"resetView"),k.bindAction(72,!0,"fitWindow",!0),k.bindAction(74,!0,"fitPage"),k.bindAction(74,!0,"fitTwoPages",!0),k.bindAction(48,!0,"customZoom"),k.bindAction(82,!0,"turn"),k.bindAction(82,!0,"clearDefaultStyle",!0),k.bindAction(83,!0,"save"),k.bindAction(83,!0,"saveAs",!0),k.bindAction(65,!0,"selectAll"),k.bindAction(65,!0,"selectNone",!0),k.bindAction(73,!0,"selectVertices",!0),k.bindAction(69,!0,"selectEdges",!0),k.bindAction(69,!0,"editStyle"),k.bindAction(66,!0,"bold"),k.bindAction(66,!0,
"toBack",!0),k.bindAction(70,!0,"toFront",!0),k.bindAction(68,!0,"duplicate"),k.bindAction(68,!0,"setAsDefaultStyle",!0),k.bindAction(90,!0,"undo"),k.bindAction(89,!0,"autosize",!0),k.bindAction(88,!0,"cut"),k.bindAction(67,!0,"copy"),k.bindAction(86,!0,"paste"),k.bindAction(71,!0,"group"),k.bindAction(77,!0,"editData"),k.bindAction(71,!0,"grid",!0),k.bindAction(73,!0,"italic"),k.bindAction(76,!0,"lockUnlock"),k.bindAction(76,!0,"layers",!0),k.bindAction(80,!0,"formatPanel",!0),k.bindAction(85,!0,
@@ -2174,67 +2174,67 @@ EditorUi.prototype.destroy=function(){null!=this.editor&&(this.editor.destroy(),
(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;
mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";
Graph=function(a,b,e,d,k){mxGraph.call(this,a,b,e,d);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a);
-return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var m=null,l=null,q=null,t=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")&&this.isEnabled()){var d=b.getProperty("event");if(!mxEvent.isControlDown(d.getEvent())&&!mxEvent.isShiftDown(d.getEvent())){var f=d.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(d.getGraphX(),d.getGraphY()),c=this.isCellSelected(f.cell),q=f,l=d,null!=
-f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,d.getGraphX(),d.getGraphY())?t=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(t=f.getHandleForEvent(d))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,b){var d=this.selectionCellsHandler.handlers.map,f;for(f in d)if(null!=d[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(b.getEvent())&&
-!mxEvent.isShiftDown(b.getEvent())&&!mxEvent.isAltDown(b.getEvent()))if(f=this.tolerance,null!=m&&null!=q&&null!=l){if(d=q,Math.abs(m.x-b.getGraphX())>f||Math.abs(m.y-b.getGraphY())>f){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var g=this.selectionCellsHandler.getHandler(d.cell);if(null!=g&&null!=g.bends&&0<g.bends.length){var e=g.getHandleForEvent(l),h=this.view.getEdgeStyle(d);f=h==mxEdgeStyle.EntityRelation;c||t!=mxEvent.LABEL_HANDLE||(e=t);if(f&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f||
-null==d.visibleSourceState&&null==d.visibleTargetState||(this.graphHandler.reset(),b.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=d.visibleSourceState||e==g.bends.length-1||null!=d.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=d.absolutePoints,null!=f&&(null==h&&null==e||h==mxEdgeStyle.OrthConnector)&&(e=t,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)?
-e=g.bends.length-1:null!=h&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(d,m.x,m.y),e=null==h?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(b.getGraphX(),b.getGraphX(),e),t=m=l=q=null,c=!1,b.consume(),this.graphHandler.reset()}}}else if(d=b.getState(),null!=d&&this.model.isEdge(d.cell)){g=null;f=d.absolutePoints;if(null!=f)if(e=new mxRectangle(b.getGraphX(),
-b.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,b.getGraphX(),b.getGraphY()))g="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))g="pointer";else if(null!=d.visibleSourceState||null!=d.visibleTargetState)h=this.view.getEdgeStyle(d),g="crosshair",h!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(d)&&(h=mxUtils.findNearestSegment(d,b.getGraphX(),b.getGraphY()),
-h<f.length-1&&0<=h&&(g=0==Math.round(f[h].x-f[h+1].x)?"col-resize":"row-resize"));null!=g&&d.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){t=m=l=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);
+return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var l=null,p=null,q=null,r=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")&&this.isEnabled()){var d=b.getProperty("event");if(!mxEvent.isControlDown(d.getEvent())&&!mxEvent.isShiftDown(d.getEvent())){var f=d.getState();null!=f&&this.model.isEdge(f.cell)&&(l=new mxPoint(d.getGraphX(),d.getGraphY()),c=this.isCellSelected(f.cell),q=f,p=d,null!=
+f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,d.getGraphX(),d.getGraphY())?r=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(r=f.getHandleForEvent(d))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,b){var d=this.selectionCellsHandler.handlers.map,f;for(f in d)if(null!=d[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(b.getEvent())&&
+!mxEvent.isShiftDown(b.getEvent())&&!mxEvent.isAltDown(b.getEvent()))if(f=this.tolerance,null!=l&&null!=q&&null!=p){if(d=q,Math.abs(l.x-b.getGraphX())>f||Math.abs(l.y-b.getGraphY())>f){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var h=this.selectionCellsHandler.getHandler(d.cell);if(null!=h&&null!=h.bends&&0<h.bends.length){var e=h.getHandleForEvent(p),g=this.view.getEdgeStyle(d);f=g==mxEdgeStyle.EntityRelation;c||r!=mxEvent.LABEL_HANDLE||(e=r);if(f&&0!=e&&e!=h.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f||
+null==d.visibleSourceState&&null==d.visibleTargetState||(this.graphHandler.reset(),b.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=d.visibleSourceState||e==h.bends.length-1||null!=d.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=d.absolutePoints,null!=f&&(null==g&&null==e||g==mxEdgeStyle.OrthConnector)&&(e=r,null==e&&(e=new mxRectangle(l.x,l.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)?
+e=h.bends.length-1:null!=g&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(d,l.x,l.y),e=null==g?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),h.start(b.getGraphX(),b.getGraphX(),e),r=l=p=q=null,c=!1,b.consume(),this.graphHandler.reset()}}}else if(d=b.getState(),null!=d&&this.model.isEdge(d.cell)){h=null;f=d.absolutePoints;if(null!=f)if(e=new mxRectangle(b.getGraphX(),
+b.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,b.getGraphX(),b.getGraphY()))h="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))h="pointer";else if(null!=d.visibleSourceState||null!=d.visibleTargetState)g=this.view.getEdgeStyle(d),h="crosshair",g!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(d)&&(g=mxUtils.findNearestSegment(d,b.getGraphX(),b.getGraphY()),
+g<f.length-1&&0<=g&&(h=0==Math.round(f[g].x-f[g+1].x)?"col-resize":"row-resize"));null!=h&&d.setCursor(h)}}),mouseUp:mxUtils.bind(this,function(a,c){r=l=p=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);
this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,c){return!1};this.alternateEdgeStyle="vertical";null==d&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=
-function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,g=b.width*d,b=b.height*d,d=this.graph.view.translate,e=this.graph.view.scale,h=this.graph.getPageLayout(),p=0;p<h.width;p++)c.push(new mxRectangle(((h.x+p)*g+d.x)*e,(h.y*b+d.y)*e,g*e,b*e));for(p=0;p<h.height;p++)c.push(new mxRectangle((h.x*g+d.x)*e,((h.y+p)*b+d.y)*e,g*e,b*e));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=
+function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,h=b.width*d,b=b.height*d,d=this.graph.view.translate,e=this.graph.view.scale,g=this.graph.getPageLayout(),m=0;m<g.width;m++)c.push(new mxRectangle(((g.x+m)*h+d.x)*e,(g.y*b+d.y)*e,h*e,b*e));for(m=0;m<g.height;m++)c.push(new mxRectangle((g.x*h+d.x)*e,((g.y+m)*b+d.y)*e,h*e,b*e));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=
function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),b=[],d=0;d<c.length;d++){var f=this.graph.view.getState(c[d]),f=null!=f?f.style:this.graph.getCellStyle(c[d]);
-"1"==mxUtils.getValue(f,"part","0")?(f=this.graph.model.getParent(c[d]),this.graph.model.isVertex(f)&&0>mxUtils.indexOf(c,f)&&b.push(f)):b.push(c[d])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var g=new mxRubberband(this);
-this.getRubberband=function(){return g};var p=(new Date).getTime(),n=0,h=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;h.apply(this,arguments);a!=this.currentState?(p=(new Date).getTime(),n=0):n=(new Date).getTime()-p};var x=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,
-"outlineConnect","1"))&&x.apply(this,arguments)};var u=this.isToggleEvent;this.isToggleEvent=function(a){return u.apply(this,arguments)||mxEvent.isShiftDown(a)};var v=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return v.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var r=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
-(r=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=r)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return y.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
-var w=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return w.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,g){g=null!=g?g:[];if(0<b||0<d){var e=this.getModel(),h=a+b,p=c+d;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var n=e.getChildCount(f),L=0;L<n;L++){var u=
-e.getChildAt(f,L),r=this.view.getState(u);if(null!=r&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(r.style,"locked","0")){var v=mxUtils.getValue(r.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(r=mxUtils.getBoundingBox(r,v));(e.isEdge(u)||e.isVertex(u))&&r.x>=a&&r.y+r.height<=p&&r.y>=c&&r.x+r.width<=h&&g.push(u);this.getAllCells(a,c,b,d,u,g)}}}return g};var A=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
-!1:A.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var E=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();E=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
-mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=E?this.addSelectionCells(E):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);E=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=
+"1"==mxUtils.getValue(f,"part","0")?(f=this.graph.model.getParent(c[d]),this.graph.model.isVertex(f)&&0>mxUtils.indexOf(c,f)&&b.push(f)):b.push(c[d])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var h=new mxRubberband(this);
+this.getRubberband=function(){return h};var m=(new Date).getTime(),n=0,g=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;g.apply(this,arguments);a!=this.currentState?(m=(new Date).getTime(),n=0):n=(new Date).getTime()-m};var x=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,
+"outlineConnect","1"))&&x.apply(this,arguments)};var u=this.isToggleEvent;this.isToggleEvent=function(a){return u.apply(this,arguments)||mxEvent.isShiftDown(a)};var v=h.isForceRubberbandEvent;h.isForceRubberbandEvent=function(a){return v.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var t=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
+(t=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=t)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var A=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return A.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
+var y=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return y.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,h){h=null!=h?h:[];if(0<b||0<d){var e=this.getModel(),g=a+b,m=c+d;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var n=e.getChildCount(f),K=0;K<n;K++){var u=
+e.getChildAt(f,K),t=this.view.getState(u);if(null!=t&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(t.style,"locked","0")){var v=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(t=mxUtils.getBoundingBox(t,v));(e.isEdge(u)||e.isVertex(u))&&t.x>=a&&t.y+t.height<=m&&t.y>=c&&t.x+t.width<=g&&h.push(u);this.getAllCells(a,c,b,d,u,h)}}}return h};var w=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
+!1:w.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();F=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
+mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),h.start(b.x,b.y)):null!=F?this.addSelectionCells(F):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);F=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=
function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var B=this.updateMouseEvent;this.updateMouseEvent=function(a){a=B.apply(this,arguments);this.isCellLocked(a.getCell())&&(a.state=null);return a}}};
Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;
Graph.createSvgImage=function(a,b,e){e=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+b+'px" version="1.1">'+e+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0)),a,b)};mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;
Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.defaultGraphBackground="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);
Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.absoluteUrlPattern=/^(?:[a-z]+:)?\/\//i;Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=(window!=window.top?document.referrer:document.location.toString()).split("#")[0];
-Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,k=!0,m=null,l=mxUtils.bind(this,function(a){k=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<b&&Math.abs(m.y-mxEvent.getClientY(a))<b}),t=mxUtils.bind(this,function(c){if(k)for(var b=mxEvent.getSource(c);null!=
-b&&b!=e.node;){if("a"==b.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,b,c);break}b=b.parentNode}});mxEvent.addGestureListeners(e.node,l,q,t);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};Graph.prototype.isPageLink=function(a){return!1};
+Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,k=!0,l=null,p=mxUtils.bind(this,function(a){k=!0;l=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){k=k&&null!=l&&Math.abs(l.x-mxEvent.getClientX(a))<b&&Math.abs(l.y-mxEvent.getClientY(a))<b}),r=mxUtils.bind(this,function(c){if(k)for(var b=mxEvent.getSource(c);null!=
+b&&b!=e.node;){if("a"==b.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,b,c);break}b=b.parentNode}});mxEvent.addGestureListeners(e.node,p,q,r);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};Graph.prototype.isPageLink=function(a){return!1};
Graph.prototype.labelLinkClicked=function(a,b,e){b=b.getAttribute("href");if(null!=b&&!this.isPageLink(b)){if(!this.isEnabled()){var d=a.view.graph.isBlankLink(b)?a.view.graph.linkTarget:"_top";b=a.view.graph.getAbsoluteUrl(b);"_self"==d&&window!=window.top?window.location.href=b:b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==d&&window==window.top?window.location.hash=b.split("#")[1]:(mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e))&&
window.open(b,d)}mxEvent.consume(e)}};Graph.prototype.isExternalProtocol=function(a){return"mailto:"===a.substring(0,7)};Graph.prototype.isBlankLink=function(a){return!this.isExternalProtocol(a)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(a)&&a.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(a){return null!=a&&!this.absoluteUrlPattern.test(a)&&"data:"!==a.substring(0,5)&&!this.isExternalProtocol(a)};
Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.getLayout=function(a){var b=this.graph.view.getState(a);a=null!=b?b.style:this.graph.getCellStyle(a);return"stackLayout"==a.childLayout?(b=new mxStackLayout(this.graph,!0),b.resizeParentMax="1"==mxUtils.getValue(a,"resizeParentMax","1"),b.horizontal="1"==mxUtils.getValue(a,"horizontalStack","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.resizeLast="1"==mxUtils.getValue(a,
"resizeLast","0"),b.spacing=a.stackSpacing||b.spacing,b.border=a.stackBorder||b.border,b.marginLeft=a.marginLeft||0,b.marginRight=a.marginRight||0,b.marginTop=a.marginTop||0,b.marginBottom=a.marginBottom||0,b.fill=!0,b):"treeLayout"==a.childLayout?(b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(a,"horizontalTree","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.groupPadding=mxUtils.getValue(a,"parentPadding",20),b.levelDistance=mxUtils.getValue(a,"treeLevelDistance",
30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b):"flowLayout"==a.childLayout?(b=new mxHierarchicalLayout(this.graph,mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.parentBorder=mxUtils.getValue(a,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(a,"interRankCellSpacing",
mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b):null}};Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};
-Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(d/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-m)};
+Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),l=Math.floor(d/a.height);return new mxRectangle(k,l,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-l)};
Graph.prototype.sanitizeHtml=function(a,b){return html_sanitize(a,function(a){return null!=a&&"javascript:"!==a.toString().toLowerCase().substring(0,11)?a:null},function(a){return a})};Graph.prototype.updatePlaceholders=function(){var a=!1,b;for(b in this.model.cells){var e=this.model.cells[b];this.isReplacePlaceholders(e)&&(this.view.invalidate(e,!1,!1),a=!0)}a&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")};
Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};Graph.prototype.isSplitTarget=function(a,b,e){return!this.model.isEdge(b[0])&&!mxEvent.isAltDown(e)&&!mxEvent.isShiftDown(e)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};
Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(b=this.replacePlaceholders(a,b));return b};Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(b,"labelMovable","0")))};
Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};
Graph.prototype.formatDate=function(a,b,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",
-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,l=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
-/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var q=e?"getUTC":"get",t=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),g=a[q+"FullYear"](),p=a[q+"Hours"](),n=a[q+"Minutes"](),h=a[q+"Seconds"](),q=a[q+"Milliseconds"](),x=e?0:a.getTimezoneOffset(),u={d:t,dd:l(t),ddd:d.i18n.dayNames[c],dddd:d.i18n.dayNames[c+7],m:f+1,mm:l(f+1),mmm:d.i18n.monthNames[f],mmmm:d.i18n.monthNames[f+
-12],yy:String(g).slice(2),yyyy:g,h:p%12||12,hh:l(p%12||12),H:p,HH:l(p),M:n,MM:l(n),s:h,ss:l(h),l:l(q,3),L:l(99<q?Math.round(q/10):q),t:12>p?"a":"p",tt:12>p?"am":"pm",T:12>p?"A":"P",TT:12>p?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<x?"-":"+")+l(100*Math.floor(Math.abs(x)/60)+Math.abs(x)%60,4),S:["th","st","nd","rd"][3<t%10?0:(10!=t%100-t%10)*t%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in u?u[a]:a.slice(1,
+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,l=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
+/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var q=e?"getUTC":"get",r=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),h=a[q+"FullYear"](),m=a[q+"Hours"](),n=a[q+"Minutes"](),g=a[q+"Seconds"](),q=a[q+"Milliseconds"](),x=e?0:a.getTimezoneOffset(),u={d:r,dd:p(r),ddd:d.i18n.dayNames[c],dddd:d.i18n.dayNames[c+7],m:f+1,mm:p(f+1),mmm:d.i18n.monthNames[f],mmmm:d.i18n.monthNames[f+
+12],yy:String(h).slice(2),yyyy:h,h:m%12||12,hh:p(m%12||12),H:m,HH:p(m),M:n,MM:p(n),s:g,ss:p(g),l:p(q,3),L:p(99<q?Math.round(q/10):q),t:12>m?"a":"p",tt:12>m?"am":"pm",T:12>m?"A":"P",TT:12>m?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(l,""),o:(0<x?"-":"+")+p(100*Math.floor(Math.abs(x)/60)+Math.abs(x)%60,4),S:["th","st","nd","rd"][3<r%10?0:(10!=r%100-r%10)*r%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in u?u[a]:a.slice(1,
a.length-1)})};
Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),e=b.getChildCount(b.root),d=0;d<e;d++)(function(d){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");b.isVisible(d)&&(k.setAttribute("checked","checked"),k.defaultChecked=
!0);e.appendChild(k);var q=d.value||mxResources.get("background")||"Background";e.setAttribute("title",q);mxUtils.write(e,q);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");b.setVisible(d,k.checked)})})(b.getChildAt(b.root,d));return a};
-Graph.prototype.replacePlaceholders=function(a,b){for(var e=[],d=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>d&&"%"==b.charAt(match.index-1))m=k.substring(1);else{var l=k.substring(1,k.length-1);if(0>l.indexOf("{"))for(var q=a;null==m&&null!=q;)null!=q.value&&"object"==typeof q.value&&(m=q.hasAttribute(l)?null!=q.getAttribute(l)?q.getAttribute(l):"":null),q=this.model.getParent(q);null==m&&(m=this.getGlobalVariable(l))}e.push(b.substring(d,
-match.index)+(null!=m?m:k));d=match.index+k.length}}e.push(b.substring(d));return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(b)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
-Graph.prototype.connectVertex=function(a,b,e,d,k,m){m=m?m:!1;var l=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(l.x+=a.geometry.width/2,l.y-=e):b==mxConstants.DIRECTION_SOUTH?(l.x+=a.geometry.width/2,l.y+=a.geometry.height+e):(l.x=b==mxConstants.DIRECTION_WEST?l.x-e:l.x+(a.geometry.width+e),l.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a));
-var q=this.view.scale,t=this.view.translate,c=t.x*q,t=t.y*q;this.model.isVertex(e.cell)&&(c=e.x,t=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(l.x+=a.parent.geometry.x,l.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(d)&&!k?null:this.getCellAt(c+l.x*q,t+l.y*q);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),q=this.view.getState(m),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(m=
-null));if(k=!mxEvent.isShiftDown(d)||k)b==mxConstants.DIRECTION_NORTH?l.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?l.y+=a.geometry.height/2:l.x=b==mxConstants.DIRECTION_WEST?l.x-a.geometry.width/2:l.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{q=m;if(null==q&&k){for(var c=a,f=this.getCellGeometry(a);null!=
-f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var g=this.view.getState(c),p=null!=g?g.style:this.getCellStyle(c);if(mxUtils.getValue(p,"part",!1)){var n=this.model.getParent(c);this.model.isVertex(n)&&(c=n)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=l.x-f.width/2,f.y=l.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var h=mxEvent.isControlDown(d)&&k||null==m&&null!=f&&f.constructor==mxStackLayout?
-null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=h&&this.connectionHandler.insertBeforeSource){var x=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=h.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==h.parent&&(x=d.parent.getIndex(d),this.model.add(d.parent,h,x))}null==m&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(x=a.parent.getIndex(a),this.model.add(a.parent,
-q,x));null!=h&&e.push(h);null==m&&null!=q&&e.push(q);null==q&&null!=h&&h.geometry.setTerminalPoint(l,!1);null!=h&&this.fireEvent(new mxEventObject("cellsInserted","cells",[h]))}finally{this.model.endUpdate()}return e};
+Graph.prototype.replacePlaceholders=function(a,b){for(var e=[],d=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var l=null;if(match.index>d&&"%"==b.charAt(match.index-1))l=k.substring(1);else{var p=k.substring(1,k.length-1);if(0>p.indexOf("{"))for(var q=a;null==l&&null!=q;)null!=q.value&&"object"==typeof q.value&&(l=q.hasAttribute(p)?null!=q.getAttribute(p)?q.getAttribute(p):"":null),q=this.model.getParent(q);null==l&&(l=this.getGlobalVariable(p))}e.push(b.substring(d,
+match.index)+(null!=l?l:k));d=match.index+k.length}}e.push(b.substring(d));return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(b)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
+Graph.prototype.connectVertex=function(a,b,e,d,k,l){l=l?l:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):b==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=b==mxConstants.DIRECTION_WEST?p.x-e:p.x+(a.geometry.width+e),p.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a));
+var q=this.view.scale,r=this.view.translate,c=r.x*q,r=r.y*q;this.model.isVertex(e.cell)&&(c=e.x,r=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);l=l||mxEvent.isControlDown(d)&&!k?null:this.getCellAt(c+p.x*q,r+p.y*q);this.model.isAncestor(l,a)&&(l=null);for(e=l;null!=e;){if(this.isCellLocked(e)){l=null;break}e=this.model.getParent(e)}null!=l&&(e=this.view.getState(a),q=this.view.getState(l),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(l=
+null));if(k=!mxEvent.isShiftDown(d)||k)b==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=b==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==l||this.isCellConnectable(l)||(e=this.getModel().getParent(l),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(l=e));if(l==a||this.model.isEdge(l)||!this.isCellConnectable(l))l=null;e=[];this.model.beginUpdate();try{q=l;if(null==q&&k){for(var c=a,f=this.getCellGeometry(a);null!=
+f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var h=this.view.getState(c),m=null!=h?h.style:this.getCellStyle(c);if(mxUtils.getValue(m,"part",!1)){var n=this.model.getParent(c);this.model.isVertex(n)&&(c=n)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=p.x-f.width/2,f.y=p.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var g=mxEvent.isControlDown(d)&&k||null==l&&null!=f&&f.constructor==mxStackLayout?
+null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=g&&this.connectionHandler.insertBeforeSource){var x=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=g.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==g.parent&&(x=d.parent.getIndex(d),this.model.add(d.parent,g,x))}null==l&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(x=a.parent.getIndex(a),this.model.add(a.parent,
+q,x));null!=g&&e.push(g);null==l&&null!=q&&e.push(q);null==q&&null!=g&&g.geometry.setTerminalPoint(p,!1);null!=g&&this.fireEvent(new mxEventObject("cellsInserted","cells",[g]))}finally{this.model.endUpdate()}return e};
Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],e,d;for(d in this.model.cells)if(e=this.model.cells[d],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(a.innerHTML=this.getLabel(e),e=mxUtils.extractTextWithWhitespace([a])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&b.push(e);return b.join(" ")};
Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),e=a,d=null;null==d&&null!=e;)null!=e.value&&"object"==typeof e.value&&(d=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e);return d||""}return a.value.getAttribute("label")}return mxGraph.prototype.convertValueToString.apply(this,arguments)};
Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null};
Graph.prototype.getCellStyle=function(a){var b=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var e=this.model.getParent(a);this.model.isVertex(e)&&this.isCellCollapsed(a)&&(e=this.layoutManager.getLayout(e),null!=e&&e.constructor==mxStackLayout&&(b[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))}return b};
Graph.prototype.updateAlternateBounds=function(a,b,e){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var d=this.layoutManager.getLayout(this.model.getParent(a));null!=d&&d.constructor==mxStackLayout&&(d.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
-Graph.prototype.foldCells=function(a,b,e,d,k){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var l=this.view.getState(e[m]),q=this.getCellGeometry(e[m]);if(null!=l&&null!=q){var t=Math.round(q.width-l.width/this.view.scale),c=Math.round(q.height-l.height/this.view.scale);if(0!=c||0!=t){var f=this.model.getParent(e[m]),g=this.layoutManager.getLayout(f);
-null==g?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(l,f,t,c):null!=k&&mxEvent.isAltDown(k)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(f,g,t,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
-Graph.prototype.moveSiblings=function(a,b,e,d){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var m=this.view.getState(k[b]),l=this.getCellGeometry(k[b]);null!=m&&null!=l&&(l=l.clone(),l.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[b],l))}}finally{this.model.endUpdate()}};
-Graph.prototype.resizeParentStacks=function(a,b,e,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var m=this.getCellGeometry(a),l=this.view.getState(a);null!=l&&null!=m&&(m=m.clone(),b.horizontal?m.width+=e+Math.min(0,l.width/this.view.scale-m.width):m.height+=d+Math.min(0,l.height/this.view.scale-m.height),this.model.setGeometry(a,
-m));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
+Graph.prototype.foldCells=function(a,b,e,d,k){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var l=0;l<e.length;l++){var p=this.view.getState(e[l]),q=this.getCellGeometry(e[l]);if(null!=p&&null!=q){var r=Math.round(q.width-p.width/this.view.scale),c=Math.round(q.height-p.height/this.view.scale);if(0!=c||0!=r){var f=this.model.getParent(e[l]),h=this.layoutManager.getLayout(f);
+null==h?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(p,f,r,c):null!=k&&mxEvent.isAltDown(k)||h.constructor!=mxStackLayout||h.resizeLast||this.resizeParentStacks(f,h,r,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
+Graph.prototype.moveSiblings=function(a,b,e,d){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var l=this.view.getState(k[b]),p=this.getCellGeometry(k[b]);null!=l&&null!=p&&(p=p.clone(),p.translate(Math.round(e*Math.max(0,Math.min(1,(l.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(l.y-a.y)/a.height)))),this.model.setGeometry(k[b],p))}}finally{this.model.endUpdate()}};
+Graph.prototype.resizeParentStacks=function(a,b,e,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var l=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=l&&(l=l.clone(),b.horizontal?l.width+=e+Math.min(0,p.width/this.view.scale-l.width):l.height+=d+Math.min(0,p.height/this.view.scale-l.height),this.model.setGeometry(a,
+l));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,b,e){e=e||this.getDefaultParent();this.isCellLocked(e)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,e){e=e||this.getDefaultParent();return this.isCellLocked(e)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)};
Graph.prototype.isCellFoldable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.foldingEnabled&&!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=b.collapsible||!this.isContainer(a)&&"1"==b.collapsible)};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};
Graph.prototype.zoom=function(a,b){a=Math.max(.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};
@@ -2250,7 +2250,7 @@ HoverIcons.prototype.refreshTarget=new mxImage(mxClient.IS_SVG?"data:image/png;b
HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"));this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"));this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"));this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"));this.elts=[this.arrowUp,this.arrowRight,this.arrowDown,this.arrowLeft];this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});
-var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var m=this.getState(d.getState());null==m&&mxEvent.isTouchEvent(e)||this.update(m)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&
+var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var l=this.getState(d.getState());null==l&&mxEvent.isTouchEvent(e)||this.update(l)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&
null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(d.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(d.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?b||this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),
d.getGraphY())))):mxEvent.isTouchEvent(e)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(e)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
HoverIcons.prototype.createArrow=function(a,b){var e=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",a.src),e.style.borderStyle="none"):(e=document.createElement("div"),e.style.backgroundImage="url("+a.src+")",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat"),e.style.width=a.width+4+"px",e.style.height=a.height+4+"px",e.style.display=mxClient.IS_QUIRKS?"inline":
@@ -2259,14 +2259,14 @@ this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redire
this.resetActiveArrow()}));return e};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var a=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?a=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?a=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(a=mxConstants.DIRECTION_WEST);return a};
HoverIcons.prototype.visitNodes=function(a){for(var b=0;b<this.elts.length;b++)null!=this.elts[b]&&a(this.elts[b])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(b){b.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
HoverIcons.prototype.drag=function(a,b,e){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,e),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,a=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=a&&a.setHandlesVisible(!1))};HoverIcons.prototype.getStateAt=function(a,b,e){return this.graph.view.getState(this.graph.getCellAt(b,e))};
-HoverIcons.prototype.click=function(a,b,e){var d=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(d)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):
+HoverIcons.prototype.click=function(a,b,e){var d=e.getEvent(),k=e.getGraphX(),l=e.getGraphY(),k=this.getStateAt(a,k,l);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(d)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):
this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(k.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null};
HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing);
var b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=b&&(a.x-=b.horizontalOffset/2,a.y-=b.verticalOffset/2,a.width+=b.horizontalOffset,a.height+=b.verticalOffset,null!=b.rotationShape&&null!=b.rotationShape.node&&"hidden"!=b.rotationShape.node.style.visibility&&"none"!=b.rotationShape.node.style.display&&null!=b.rotationShape.boundingBox&&a.add(b.rotationShape.boundingBox));this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance)+
"px";this.arrowUp.style.top=Math.round(a.y-this.triangleUp.height-this.tolerance)+"px";mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity);this.arrowRight.style.left=Math.round(a.x+a.width-this.tolerance)+"px";this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)+"px";mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity);this.arrowDown.style.left=this.arrowUp.style.left;this.arrowDown.style.top=Math.round(a.y+a.height-this.tolerance)+
"px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=Math.round(a.x-this.triangleLeft.width-this.tolerance)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),d=this.graph.getCellAt(this.currentState.getCenterX(),
-a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==d&&d==a&&(a=d=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==k||d.height<6*k.height&&d.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
-m(b,this.arrowRight);m(e,this.arrowLeft);m(d,this.arrowUp);m(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
+a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==d&&d==a&&(a=d=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),l=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==k||d.height<6*k.height&&d.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
+l(b,this.arrowRight);l(e,this.arrowLeft);l(d,this.arrowUp);l(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
@@ -2275,23 +2275,23 @@ this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activa
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,c){var d=this.getState(a);null!=d&&this.graph.model.isEdge(d.cell)&&null!=d.style&&1!=d.style[mxConstants.STYLE_CURVED]&&!d.invalid&&this.updateLineJumps(d)&&this.graph.cellRenderer.redraw(d,!1,this.isRendering());d=b.apply(this,arguments);null!=
d&&this.graph.model.isEdge(d.cell)&&1!=d.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(d);return d};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,c){return e.apply(this,arguments)||null!=a.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&&1!=a.style[mxConstants.STYLE_CURVED]&&
-this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var b=null!=a.routedPoints,d=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,b,f){var g=new mxPoint(b,f);g.type=c;d.push(g);g=null!=a.routedPoints?a.routedPoints[d.length-1]:null;return null==g||g.type!=c||g.x!=b||g.y!=f},n=.5*this.scale,b=!1,d=[],h=0;h<c.length-1;h++){for(var k=c[h+1],u=c[h],v=[],r=c[h+2];h<
-c.length-2&&mxUtils.ptSegDistSq(u.x,u.y,r.x,r.y,k.x,k.y)<1*this.scale*this.scale;)k=r,h++,r=c[h+2];for(var b=e(0,u.x,u.y)||b,q=0;q<this.validEdges.length;q++){var w=this.validEdges[q],m=w.absolutePoints;if(null!=m&&mxUtils.intersects(a,w))for(w=0;w<m.length-1;w++){for(var l=m[w+1],t=m[w],r=m[w+2];w<m.length-2&&mxUtils.ptSegDistSq(t.x,t.y,r.x,r.y,l.x,l.y)<1*this.scale*this.scale;)l=r,w++,r=m[w+2];r=mxUtils.intersection(u.x,u.y,k.x,k.y,t.x,t.y,l.x,l.y);if(null!=r&&(Math.abs(r.x-t.x)>n||Math.abs(r.y-
-t.y)>n)&&(Math.abs(r.x-l.x)>n||Math.abs(r.y-l.y)>n)){l=r.x-u.x;t=r.y-u.y;r={distSq:l*l+t*t,x:r.x,y:r.y};for(l=0;l<v.length;l++)if(v[l].distSq>r.distSq){v.splice(l,0,r);r=null;break}null==r||0!=v.length&&v[v.length-1].x===r.x&&v[v.length-1].y===r.y||v.push(r)}}}for(w=0;w<v.length;w++)b=e(1,v[w].x,v[w].y)||b}r=c[c.length-1];b=e(0,r.x,r.y)||b}a.routedPoints=d;return b}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,b){this.routedPoints=null!=this.state?this.state.routedPoints:
-null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),h,q=!0,u=null,v=null;h=[];var r=null;a.begin();for(var m=0;m<this.state.routedPoints.length;m++){var w=this.state.routedPoints[m],
-l=new mxPoint(w.x/this.scale,w.y/this.scale);0==m?l=c[0]:m==this.state.routedPoints.length-1&&(l=c[c.length-1]);var t=!1;if(null!=u&&1==w.type){var B=this.state.routedPoints[m+1],w=B.x/this.scale-l.x,B=B.y/this.scale-l.y,w=w*w+B*B;null==r&&(r=new mxPoint(l.x-u.x,l.y-u.y),v=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/v,r.y=r.y*f/v);w>f*f&&0<v&&(w=u.x-l.x,B=u.y-l.y,w=w*w+B*B,w>f*f&&(t=new mxPoint(l.x-r.x,l.y-r.y),w=new mxPoint(l.x+r.x,l.y+r.y),h.push(t),this.addPoints(a,h,b,d,!1,null,q),h=0>Math.round(r.x)||
-0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(t.x-r.y*h,t.y+r.x*h),a.lineTo(w.x-r.y*h,w.y+r.x*h),a.lineTo(w.x,w.y)):"arc"==e?(h*=1.3,a.curveTo(t.x-r.y*h,t.y+r.x*h,w.x-r.y*h,w.y+r.x*h,w.x,w.y)):(a.moveTo(w.x,w.y),q=!0),h=[w],t=!0))}else r=null;t||(h.push(l),u=l)}this.addPoints(a,h,b,d,!1,null,q);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,b,d){if(null==c||null==a||"1"!=c.style.snapToPoint&&
-"1"!=a.style.snapToPoint)m.apply(this,arguments);else{c=this.getTerminalPort(a,c,d);var f=this.getNextPoint(a,b,d),g=this.graph.isOrthogonal(a),e=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),k=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=e)var u=Math.cos(-e),v=Math.sin(-e),f=mxUtils.getRotatedPoint(f,u,v,k);u=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
-0);f=this.getPerimeterPoint(c,f,0==e&&g,u);0!=e&&(u=Math.cos(e),v=Math.sin(e),f=mxUtils.getRotatedPoint(f,u,v,k));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,b,d,f),d)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,b,d,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);d=b=null;for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(c,a[f]);if(null!=g){var p=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==d||p<d)b=g,d=p}}null!=b&&(e=b)}return e};var l=mxStencil.prototype.evaluateTextAttribute;
-mxStencil.prototype.evaluateTextAttribute=function(a,c,b){var d=l.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=b.state&&(d=b.state.view.graph.replacePlaceholders(b.state.cell,d));return d};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"stencil("==c.substring(0,8))try{var b=c.substring(8,c.length-1),d=mxUtils.parseXml(a.view.graph.decompress(b));
-return new mxShape(new mxStencil(d.documentElement))}catch(p){null!=window.console&&console.log("Error in shape: "+p)}}return q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
-mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var d=0;d<b.length;d++){var k=b[d];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var m=
-mxUtils.load(k);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(l){null!=window.console&&console.log("error in getStencil:",k,l)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};
+this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var b=null!=a.routedPoints,d=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,b,f){var h=new mxPoint(b,f);h.type=c;d.push(h);h=null!=a.routedPoints?a.routedPoints[d.length-1]:null;return null==h||h.type!=c||h.x!=b||h.y!=f},n=.5*this.scale,b=!1,d=[],g=0;g<c.length-1;g++){for(var k=c[g+1],u=c[g],v=[],t=c[g+2];g<
+c.length-2&&mxUtils.ptSegDistSq(u.x,u.y,t.x,t.y,k.x,k.y)<1*this.scale*this.scale;)k=t,g++,t=c[g+2];for(var b=e(0,u.x,u.y)||b,q=0;q<this.validEdges.length;q++){var l=this.validEdges[q],p=l.absolutePoints;if(null!=p&&mxUtils.intersects(a,l))for(l=0;l<p.length-1;l++){for(var r=p[l+1],B=p[l],t=p[l+2];l<p.length-2&&mxUtils.ptSegDistSq(B.x,B.y,t.x,t.y,r.x,r.y)<1*this.scale*this.scale;)r=t,l++,t=p[l+2];t=mxUtils.intersection(u.x,u.y,k.x,k.y,B.x,B.y,r.x,r.y);if(null!=t&&(Math.abs(t.x-B.x)>n||Math.abs(t.y-
+B.y)>n)&&(Math.abs(t.x-r.x)>n||Math.abs(t.y-r.y)>n)){r=t.x-u.x;B=t.y-u.y;t={distSq:r*r+B*B,x:t.x,y:t.y};for(r=0;r<v.length;r++)if(v[r].distSq>t.distSq){v.splice(r,0,t);t=null;break}null==t||0!=v.length&&v[v.length-1].x===t.x&&v[v.length-1].y===t.y||v.push(t)}}}for(l=0;l<v.length;l++)b=e(1,v[l].x,v[l].y)||b}t=c[c.length-1];b=e(0,t.x,t.y)||b}a.routedPoints=d;return b}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,b){this.routedPoints=null!=this.state?this.state.routedPoints:
+null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),g,q=!0,u=null,v=null;g=[];var t=null;a.begin();for(var l=0;l<this.state.routedPoints.length;l++){var p=this.state.routedPoints[l],
+w=new mxPoint(p.x/this.scale,p.y/this.scale);0==l?w=c[0]:l==this.state.routedPoints.length-1&&(w=c[c.length-1]);var r=!1;if(null!=u&&1==p.type){var B=this.state.routedPoints[l+1],p=B.x/this.scale-w.x,B=B.y/this.scale-w.y,p=p*p+B*B;null==t&&(t=new mxPoint(w.x-u.x,w.y-u.y),v=Math.sqrt(t.x*t.x+t.y*t.y),t.x=t.x*f/v,t.y=t.y*f/v);p>f*f&&0<v&&(p=u.x-w.x,B=u.y-w.y,p=p*p+B*B,p>f*f&&(r=new mxPoint(w.x-t.x,w.y-t.y),p=new mxPoint(w.x+t.x,w.y+t.y),g.push(r),this.addPoints(a,g,b,d,!1,null,q),g=0>Math.round(t.x)||
+0==Math.round(t.x)&&0>=Math.round(t.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(r.x-t.y*g,r.y+t.x*g),a.lineTo(p.x-t.y*g,p.y+t.x*g),a.lineTo(p.x,p.y)):"arc"==e?(g*=1.3,a.curveTo(r.x-t.y*g,r.y+t.x*g,p.x-t.y*g,p.y+t.x*g,p.x,p.y)):(a.moveTo(p.x,p.y),q=!0),g=[p],r=!0))}else t=null;r||(g.push(w),u=w)}this.addPoints(a,g,b,d,!1,null,q);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,b,d){if(null==c||null==a||"1"!=c.style.snapToPoint&&
+"1"!=a.style.snapToPoint)l.apply(this,arguments);else{c=this.getTerminalPort(a,c,d);var f=this.getNextPoint(a,b,d),h=this.graph.isOrthogonal(a),e=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),k=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=e)var u=Math.cos(-e),v=Math.sin(-e),f=mxUtils.getRotatedPoint(f,u,v,k);u=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
+0);f=this.getPerimeterPoint(c,f,0==e&&h,u);0!=e&&(u=Math.cos(e),v=Math.sin(e),f=mxUtils.getRotatedPoint(f,u,v,k));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,b,d,f),d)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,b,d,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);d=b=null;for(var f=0;f<a.length;f++){var h=this.graph.getConnectionPoint(c,a[f]);if(null!=h){var m=(h.x-e.x)*(h.x-e.x)+(h.y-e.y)*(h.y-e.y);if(null==d||m<d)b=h,d=m}}null!=b&&(e=b)}return e};var p=mxStencil.prototype.evaluateTextAttribute;
+mxStencil.prototype.evaluateTextAttribute=function(a,c,b){var d=p.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=b.state&&(d=b.state.view.graph.replacePlaceholders(b.state.cell,d));return d};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"stencil("==c.substring(0,8))try{var b=c.substring(8,c.length-1),d=mxUtils.parseXml(a.view.graph.decompress(b));
+return new mxShape(new mxStencil(d.documentElement))}catch(m){null!=window.console&&console.log("Error in shape: "+m)}}return q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
+mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var d=0;d<b.length;d++){var k=b[d];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var l=
+mxUtils.load(k);null!=l&&200<=l.getStatus()&&299>=l.getStatus()&&eval.call(window,l.getText())}}catch(p){null!=window.console&&console.log("error in getStencil:",k,p)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};
mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var b=a[1],e=2;e<a.length-1;e++)b+="/"+a[e];return b};
-mxStencilRegistry.loadStencilSet=function(a,b,e,d){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,m=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,m))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;m=!0}catch(l){null!=window.console&&console.log("error in loadStencilSet:",a,l)}null!=k&&null!=
-k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,b,m)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
-mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,e),d=d.nextSibling;else{e=null!=e?e:!0;var d=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(d));if(null!=b){var l=d.getAttribute("w"),
-q=d.getAttribute("h"),l=null==l?80:parseInt(l,10),q=null==q?80:parseInt(q,10);b(k,m,a,l,q)}}d=d.nextSibling}}};
+mxStencilRegistry.loadStencilSet=function(a,b,e,d){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var l=!1;if(null==k)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,l=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,l))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;l=!0}catch(p){null!=window.console&&console.log("error in loadStencilSet:",a,p)}null!=k&&null!=
+k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,b,l)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
+mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,e),d=d.nextSibling;else{e=null!=e?e:!0;var d=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var k=k.toLowerCase(),l=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+l.toLowerCase(),new mxStencil(d));if(null!=b){var p=d.getAttribute("w"),
+q=d.getAttribute("h"),p=null==p?80:parseInt(p,10),q=null==q?80:parseInt(q,10);b(k,l,a,p,q)}}d=d.nextSibling}}};
"undefined"!=typeof mxVertexHandler&&function(){function a(){var a=document.createElement("div");a.className="geHint";a.style.whiteSpace="nowrap";a.style.position="absolute";return a}mxConstants.HANDLE_FILLCOLOR="#99ccff";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR=
"#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=8;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var b=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)||
b.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxEllipse(null,this.highlightColor,this.highlightColor,0);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(a){a=this.graph.createCurrentEdgeStyle();a=this.graph.createEdge(null,null,null,null,null,a);a=new mxCellState(this.graph.view,a,this.graph.getCellStyle(a));
@@ -2299,71 +2299,71 @@ for(var c in this.graph.currentEdgeStyle)a.style[c]=this.graph.currentEdgeStyle[
a.getCell=mxUtils.bind(this,function(a){var b=c.apply(this,arguments);this.error=null;return b});return a};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&&(a+="shape="+this.currentEdgeStyle.shape+";");null!=this.currentEdgeStyle.curved&&(a+="curved="+
this.currentEdgeStyle.curved+";");null!=this.currentEdgeStyle.rounded&&(a+="rounded="+this.currentEdgeStyle.rounded+";");null!=this.currentEdgeStyle.comic&&(a+="comic="+this.currentEdgeStyle.comic+";");null!=this.currentEdgeStyle.jumpStyle&&(a+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";");null!=this.currentEdgeStyle.jumpSize&&(a+="jumpSize="+this.currentEdgeStyle.jumpSize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(a+="elbow="+this.currentEdgeStyle.elbow+
";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())};Graph.prototype.importGraphModel=function(a,c,b,d){c=null!=c?
-c:0;b=null!=b?b:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var g={},h=0;h<a;h++){var p=e.getChildAt(e.getRoot(),h);if(1!=a||this.isCellLocked(this.getDefaultParent()))p=this.importCells([p],0,0,this.model.getRoot(),null,g)[0],n=this.model.getChildren(p),this.moveCells(n,c,b),f=f.concat(n);else var n=e.getChildren(p),f=f.concat(this.importCells(n,c,b,this.getDefaultParent(),
-null,g))}if(d){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var u=this.getBoundingBoxFromGeometry(f,!0);null!=u&&this.moveCells(f,c-u.x,b-u.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var d=[];try{for(var f=JSON.parse(b),b=0;b<f.length;b++){var e=f[b];d.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0))}}catch(Q){}return d}if(null!=
+c:0;b=null!=b?b:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var h={},g=0;g<a;g++){var m=e.getChildAt(e.getRoot(),g);if(1!=a||this.isCellLocked(this.getDefaultParent()))m=this.importCells([m],0,0,this.model.getRoot(),null,h)[0],n=this.model.getChildren(m),this.moveCells(n,c,b),f=f.concat(n);else var n=e.getChildren(m),f=f.concat(this.importCells(n,c,b,this.getDefaultParent(),
+null,h))}if(d){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var u=this.getBoundingBoxFromGeometry(f,!0);null!=u&&this.moveCells(f,c-u.x,b-u.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var d=[];try{for(var f=JSON.parse(b),b=0;b<f.length;b++){var e=f[b];d.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0))}}catch(Q){}return d}if(null!=
a.shape)if(null!=a.shape.stencil){if(null!=a.shape.stencil)return a.shape.stencil.constraints}else if(null!=a.shape.constraints)return a.shape.constraints}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);null!=c&&(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};
Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,d=0;d<c;d++){var f=this.model.getChildAt(a,d);this.model.isVertex(f)&&(f=this.getCellGeometry(f),null==f||f.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c,"dropTarget",
"1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,
-arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var d=0;d<a.length;d++){var f=a[d];if(c.isEdge(f)){var e=c.getTerminal(f,!0),g=c.getTerminal(f,!1);c.setTerminal(f,g,!0);c.setTerminal(f,e,!1);var h=c.getGeometry(f);if(null!=h){h=h.clone();null!=h.points&&h.points.reverse();var p=h.getTerminalPoint(!0),n=h.getTerminalPoint(!1);
-h.setTerminalPoint(p,!1);h.setTerminalPoint(n,!0);c.setGeometry(f,h);var u=this.view.getState(f),r=this.view.getState(e),v=this.view.getState(g);if(null!=u){var k=null!=r?this.getConnectionConstraint(u,r,!0):null,L=null!=v?this.getConnectionConstraint(u,v,!1):null;this.setConnectionConstraint(f,e,!0,L);this.setConnectionConstraint(f,g,!1,k)}b.push(f)}}else if(c.isVertex(f)&&(h=this.getCellGeometry(f),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var q=h.width;h.width=h.height;
-h.height=q;c.setGeometry(f,h);var z=this.view.getState(f);if(null!=z){var x=z.style[mxConstants.STYLE_DIRECTION]||"east";"east"==x?x="south":"south"==x?x="west":"west"==x?x="north":"north"==x&&(x="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,x,[f])}b.push(f)}}}finally{c.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);
+arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var d=0;d<a.length;d++){var f=a[d];if(c.isEdge(f)){var e=c.getTerminal(f,!0),h=c.getTerminal(f,!1);c.setTerminal(f,h,!0);c.setTerminal(f,e,!1);var g=c.getGeometry(f);if(null!=g){g=g.clone();null!=g.points&&g.points.reverse();var m=g.getTerminalPoint(!0),n=g.getTerminalPoint(!1);
+g.setTerminalPoint(m,!1);g.setTerminalPoint(n,!0);c.setGeometry(f,g);var u=this.view.getState(f),t=this.view.getState(e),v=this.view.getState(h);if(null!=u){var k=null!=t?this.getConnectionConstraint(u,t,!0):null,K=null!=v?this.getConnectionConstraint(u,v,!1):null;this.setConnectionConstraint(f,e,!0,K);this.setConnectionConstraint(f,h,!1,k)}b.push(f)}}else if(c.isVertex(f)&&(g=this.getCellGeometry(f),null!=g)){g=g.clone();g.x+=g.width/2-g.height/2;g.y+=g.height/2-g.width/2;var q=g.width;g.width=g.height;
+g.height=q;c.setGeometry(f,g);var x=this.view.getState(f);if(null!=x){var z=x.style[mxConstants.STYLE_DIRECTION]||"east";"east"==z?z="south":"south"==z?z="west":"west"==z?z="north":"north"==z&&(z="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,z,[f])}b.push(f)}}}finally{c.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);
if(0<c.length)for(var b=0;b<c.length;b++)this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,c,b){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(d)){this.setAttributeForCell(f,d,c);break}f=
-this.model.getParent(f)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,b=0;b<a.length;b++)c.put(a[b],!0);for(var d=[],b=0;b<a.length;b++){var f=this.model.getParent(a[b]);null==f||c.get(f)||(c.put(f,!0),d.push(f))}for(b=0;b<d.length;b++)if(f=this.view.getState(d[b]),null!=f&&this.isCellDeletable(f.cell)){var e=mxUtils.getValue(f.style,
-mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=!0;for(g=0;g<this.model.getChildCount(f.cell)&&e;g++)c.get(this.model.getChildAt(f.cell,g))||(e=!1);e&&a.push(f.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var d=this.view.getState(a[b]);if(null!=d){var f=
-mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&d==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.setAttributeForCell=function(a,c,b){var d;
-null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=b&&0<b.length?d.setAttribute(c,b):d.removeAttribute(c);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,c,b,d){this.getModel();if(mxEvent.isAltDown(c))return null;for(var f=0;f<a.length;f++)if(this.model.isEdge(this.model.getParent(a[f])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=
-function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var d=this.model.isEdge(c)?this.view.getState(c):null,f=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=f||null!=d&&null!=d.text&&null!=d.text.node&&(mxUtils.contains(d.text.boundingBox,
-b.x,b.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&f==this.view.getCanvas()||mxClient.IS_SVG&&f==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,d))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,b=this.container.scrollTop/
-this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),f=this.getPageSize(),c=Math.max(c,d.x*f.width),b=Math.max(b,d.y*f.height);return new mxPoint(this.snap(c+a),this.snap(b+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),d=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+(0==c.height?1:
-2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=b){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var f=this.view.getRelativePoint(b,a,c);d.geometry.x=Math.round(1E4*f.x)/1E4;d.geometry.y=Math.round(f.y);d.geometry.offset=
-new mxPoint(0,0);var f=this.view.getPoint(b,d.geometry),e=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((c-f.y)/e))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-f.x,d.geometry.y=Math.round(c/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([d],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",
-[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,c,b){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var b=0;b<a.length;b++){var d=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=d&&(a[b].setAttribute("href",
-d),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,d);d();var f=this.container.style.cursor,e=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
-mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(g.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-c.getGraphX()),d=Math.abs(this.startY-c.getGraphY());(b>e||d>e)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=
-b.parentNode;null!=b?this.clear():(null==this.currentState||c.getState()!=this.currentState&&null!=c.getState()||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c)}},mouseUp:function(a,d){for(var f=d.getSource(),h=d.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(h)&&
-!mxEvent.isPopupTrigger(h)||mxEvent.isTouchEvent(h))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(h,this.currentLink),mxEvent.isConsumed(h)||(h=f?g.linkTarget:"_top","_self"==h&&window!=window.top?window.location.href=this.currentLink:this.currentLink.substring(0,g.baseUrl.length)==g.baseUrl&&"#"==this.currentLink.charAt(g.baseUrl.length)&&"_top"==h&&window==window.top?window.location.hash=this.currentLink.split("#")[1]:window.open(this.currentLink,
-h),d.consume())):null!=b&&!d.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&Math.abs(this.startX-d.getGraphX())<e&&Math.abs(this.startY-d.getGraphY())<e&&b(d.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=
-f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}};g.click=function(a){};g.addMouseListener(h);mxEvent.addListener(document,"mouseleave",function(a){h.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),d=this.gridSize,f=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1),g=0;g<a.length;g++){var h=b.getParent(a[g]),p=this.moveCells([e[g]],d,d,!1,h)[0];
-f.push(p);if(c)b.add(h,e[g]);else{var n=h.getIndex(a[g]);b.add(h,e[g],n+1)}}}finally{b.endUpdate()}return f};Graph.prototype.insertImage=function(a,c,b){if(null!=a){for(var d=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<d.length;e++)f.push(d[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",b);break}}};
+this.model.getParent(f)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,b=0;b<a.length;b++)c.put(a[b],!0);for(var d=[],b=0;b<a.length;b++){var f=this.model.getParent(a[b]);null==f||c.get(f)||(c.put(f,!0),d.push(f))}for(b=0;b<d.length;b++)if(f=this.view.getState(d[b]),null!=f&&(this.model.isEdge(f.cell)||this.model.isVertex(f.cell))&&
+this.isCellDeletable(f.cell)){var e=mxUtils.getValue(f.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),h=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&h==mxConstants.NONE){e=!0;for(h=0;h<this.model.getChildCount(f.cell)&&e;h++)c.get(this.model.getChildAt(f.cell,h))||(e=!1);e&&a.push(f.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var d=
+this.view.getState(a[b]);if(null!=d){var f=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&d==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.setAttributeForCell=
+function(a,c,b){var d;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=b&&0<b.length?d.setAttribute(c,b):d.removeAttribute(c);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,c,b,d){this.getModel();if(mxEvent.isAltDown(c))return null;for(var f=0;f<a.length;f++)if(this.model.isEdge(this.model.getParent(a[f])))return null;return mxGraph.prototype.getDropTarget.apply(this,
+arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var d=this.model.isEdge(c)?this.view.getState(c):null,f=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=f||null!=d&&null!=d.text&&null!=d.text.node&&
+(mxUtils.contains(d.text.boundingBox,b.x,b.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&f==this.view.getCanvas()||mxClient.IS_SVG&&f==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,d))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,
+b=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),f=this.getPageSize(),c=Math.max(c,d.x*f.width),b=Math.max(b,d.y*f.height);return new mxPoint(this.snap(c+a),this.snap(b+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),d=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+
+(0==c.height?1:2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=b){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var f=this.view.getRelativePoint(b,a,c);d.geometry.x=Math.round(1E4*f.x)/1E4;d.geometry.y=Math.round(f.y);
+d.geometry.offset=new mxPoint(0,0);var f=this.view.getPoint(b,d.geometry),e=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((c-f.y)/e))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-f.x,d.geometry.y=Math.round(c/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([d],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted",
+"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,c,b){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var b=0;b<a.length;b++){var d=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=d&&(a[b].setAttribute("href",
+d),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,d);d();var f=this.container.style.cursor,e=this.getTolerance(),h=this,g={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(h,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=h.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
+mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=h.container.scrollLeft;this.scrollTop=h.container.scrollTop;null==this.currentLink&&"auto"==h.container.style.overflow&&(h.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(h.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-c.getGraphX()),d=Math.abs(this.startY-c.getGraphY());(b>e||d>e)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=
+b.parentNode;null!=b?this.clear():(null==this.currentState||c.getState()!=this.currentState&&null!=c.getState()||!h.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c)}},mouseUp:function(a,d){for(var f=d.getSource(),g=d.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-h.container.scrollLeft)<e&&Math.abs(this.scrollTop-h.container.scrollTop)<e&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(g)&&
+!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))&&(null!=this.currentLink?(f=h.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(g,this.currentLink),mxEvent.isConsumed(g)||(g=f?h.linkTarget:"_top","_self"==g&&window!=window.top?window.location.href=this.currentLink:this.currentLink.substring(0,h.baseUrl.length)==h.baseUrl&&"#"==this.currentLink.charAt(h.baseUrl.length)&&"_top"==g&&window==window.top?window.location.hash=this.currentLink.split("#")[1]:window.open(this.currentLink,
+g),d.consume())):null!=b&&!d.isConsumed()&&Math.abs(this.scrollLeft-h.container.scrollLeft)<e&&Math.abs(this.scrollTop-h.container.scrollTop)<e&&Math.abs(this.startX-d.getGraphX())<e&&Math.abs(this.startY-d.getGraphY())<e&&b(d.getEvent()));this.clear()},activate:function(a){this.currentLink=h.getAbsoluteUrl(h.getLinkForCell(a.cell));null!=this.currentLink&&(h.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=h.container&&(h.container.style.cursor=
+f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}};h.click=function(a){};h.addMouseListener(g);mxEvent.addListener(document,"mouseleave",function(a){g.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),d=this.gridSize,f=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1),h=0;h<a.length;h++){var g=b.getParent(a[h]),m=this.moveCells([e[h]],d,d,!1,g)[0];
+f.push(m);if(c)b.add(g,e[h]);else{var n=g.getIndex(a[h]);b.add(g,e[h],n+1)}}}finally{b.endUpdate()}return f};Graph.prototype.insertImage=function(a,c,b){if(null!=a){for(var d=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<d.length;e++)f.push(d[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",b);break}}};
Graph.prototype.insertLink=function(a){0==a.length?document.execCommand("unlink",!1):document.execCommand("createlink",!1,mxUtils.trim(a))};Graph.prototype.isCellResizable=function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());
-if(null!=c&&1<c.length){for(var b=[],d=null,f=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var g=this.view.getState(c[e]);if(null!=g){var h=a?g.getCenterX():g.getCenterY(),d=null!=d?Math.max(d,h):h,f=null!=f?Math.min(f,h):h;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;h=this.view.scale;f=f/h-(a?g.x:g.y);d=d/h-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var p=(d-f)/(b.length-1),d=f,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),
-u=this.getCellGeometry(b[e].cell),d=d+p;null!=u&&null!=n&&(u=u.clone(),a?u.x=Math.round(d-u.width/2)-n.origin.x:u.y=Math.round(d-u.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,u))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),b=new mxDictionary,d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<c.length;d++){var f=
+if(null!=c&&1<c.length){for(var b=[],d=null,f=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var h=this.view.getState(c[e]);if(null!=h){var g=a?h.getCenterX():h.getCenterY(),d=null!=d?Math.max(d,g):g,f=null!=f?Math.min(f,g):g;b.push(h)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});h=this.view.translate;g=this.view.scale;f=f/g-(a?h.x:h.y);d=d/g-(a?h.x:h.y);this.getModel().beginUpdate();try{for(var m=(d-f)/(b.length-1),d=f,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),
+u=this.getCellGeometry(b[e].cell),d=d+m;null!=u&&null!=n&&(u=u.clone(),a?u.x=Math.round(d-u.width/2)-n.origin.x:u.y=Math.round(d-u.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,u))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),b=new mxDictionary,d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<c.length;d++){var f=
this.view.getState(a[d]);if(null!=f){var e=this.getCellGeometry(c[d]);null==e||!e.relative||this.model.isEdge(a[d])||b.get(this.model.getParent(a[d]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(d=0;d<a.length;d++)f.add(e,c[d]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});
-return a};Graph.prototype.getSvg=function(a,c,b,d,f,e,g){c=null!=c?c:1;b=null!=b?b:0;f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;var h=e||d?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==h)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,n=mxUtils.createXmlDocument();d=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=d.style?d.style.backgroundColor=a:d.setAttribute("style","background-color:"+
-a));null==n.createElementNS?(d.setAttribute("xmlns",mxConstants.NS_SVG),d.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/p;d.setAttribute("width",Math.max(1,Math.ceil(h.width*a)+2*b)+"px");d.setAttribute("height",Math.max(1,Math.ceil(h.height*a)+2*b)+"px");d.setAttribute("version","1.1");var u=d;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform",
-"translate(0.5,0.5)"),d.appendChild(u));n.appendChild(d);n=this.createSvgCanvas(u);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-h.x)/p),Math.floor((b/c-h.y)/p));var r=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,e,g,h,n,p,u,v,k){var q=this.state;if(null!=this.foAltText&&(0==d||0!=q.fontSize&&e.length<5*d/q.fontSize)){var x=this.createElement("text");x.setAttribute("x",Math.round(d/2));x.setAttribute("y",Math.round((f+q.fontSize)/
-2));x.setAttribute("fill",q.fontColor||"black");x.setAttribute("text-anchor","middle");x.setAttribute("font-size",Math.round(q.fontSize)+"px");x.setAttribute("font-family",q.fontFamily);(q.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&x.setAttribute("font-weight","bold");(q.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&x.setAttribute("font-style","italic");(q.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&x.setAttribute("text-decoration","underline");
-mxUtils.write(x,e);return x}return r.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(h,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=g;g=this.createSvgImageExport();var v=g.drawCellState;g.drawCellState=function(a,c){(e||a.view.graph.isCellSelected(a.cell))&&v.apply(this,arguments)};g.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
+return a};Graph.prototype.getSvg=function(a,c,b,d,f,e,h){c=null!=c?c:1;b=null!=b?b:0;f=null!=f?f:!0;e=null!=e?e:!0;h=null!=h?h:!0;var g=e||d?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==g)throw Error(mxResources.get("drawingEmpty"));var m=this.view.scale,n=mxUtils.createXmlDocument();d=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=d.style?d.style.backgroundColor=a:d.setAttribute("style","background-color:"+
+a));null==n.createElementNS?(d.setAttribute("xmlns",mxConstants.NS_SVG),d.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/m;d.setAttribute("width",Math.max(1,Math.ceil(g.width*a)+2*b)+"px");d.setAttribute("height",Math.max(1,Math.ceil(g.height*a)+2*b)+"px");d.setAttribute("version","1.1");var u=d;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform",
+"translate(0.5,0.5)"),d.appendChild(u));n.appendChild(d);n=this.createSvgCanvas(u);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-g.x)/m),Math.floor((b/c-g.y)/m));var t=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,e,h,g,n,m,u,v,k){var q=this.state;if(null!=this.foAltText&&(0==d||0!=q.fontSize&&e.length<5*d/q.fontSize)){var z=this.createElement("text");z.setAttribute("x",Math.round(d/2));z.setAttribute("y",Math.round((f+q.fontSize)/
+2));z.setAttribute("fill",q.fontColor||"black");z.setAttribute("text-anchor","middle");z.setAttribute("font-size",Math.round(q.fontSize)+"px");z.setAttribute("font-family",q.fontFamily);(q.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&z.setAttribute("font-weight","bold");(q.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&z.setAttribute("font-style","italic");(q.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&z.setAttribute("text-decoration","underline");
+mxUtils.write(z,e);return z}return t.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=m/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(g,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=h;h=this.createSvgImageExport();var v=h.drawCellState;h.drawCellState=function(a,c){(e||a.view.graph.isCellSelected(a.cell))&&v.apply(this,arguments)};h.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=
window.getSelection(),c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],d=0<b.rows.length?b.rows[0].cells.length:1,b=b.insertRow(c),f=0;f<d;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};
Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var d=0;d<b.rows.length;d++){var f=document.createElement("th");b.rows[d].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(d=0;d<b.rows.length;d++)f=b.rows[d].insertCell(c),mxUtils.br(f);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,d=0;d<b.length;d++)b[d].cells.length>c&&b[d].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;
if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){c=c.getRangeAt(0);c.deleteContents();var b=document.createElement("div");b.innerHTML=a;a=document.createDocumentFragment();for(var d;d=b.firstChild;)lastNode=a.appendChild(d);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint=function(a,c){c=null!=c?c:a;var b=document.createElement("a");b.setAttribute("href",this.getAbsoluteUrl(a));b.setAttribute("title",
a);null!=this.linkTarget&&b.setAttribute("target",this.linkTarget);40<c.length&&(c=c.substring(0,26)+"..."+c.substring(c.length-10));mxUtils.write(b,c);return b};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,c){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(c){c=a.apply(this,arguments);if(mxEvent.isTouchEvent(c.getEvent())&&
-null==c.getState()){var b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,c.graphY)||(c.state=this.view.getState(b),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return c};var c=!1,b=!1,d=!1,f=this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),
+null==c.getState()){var b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,c.graphY)||(c.state=this.view.getState(b),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return c};var c=!1,b=!1,d=!1,f=this.fireMouseEvent;this.fireMouseEvent=function(a,e,h){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),
b=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());f.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,f){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==f.getState()||!f.isSource(f.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(f.getEvent())&&(b&&null==f.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(f.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,
arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],b=0,d=a.rangeCount;b<d;++b)c.push(a.getRangeAt(b));return c}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=
-function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(S){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));k.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||
-!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var l=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){l.apply(this,arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";
+function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(S){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));k.apply(this,arguments)};var l=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||
+!mxEvent.isAltDown(a.getEvent())?l.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var p=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){p.apply(this,arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";
this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var b=this.graph.getModel().getParent(a),d=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(b)&&null!=d&&d.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border=
"")};var q=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,b){b.originalNode=a;a=a.firstChild;for(var d=b.firstChild;null!=a&&null!=d;)c(a,d),a=a.nextSibling,d=d.nextSibling;return b}function b(a,c){if(null!=a)if(c.originalNode!=a)d(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var f=a.nextSibling;null==c?d(a):(b(a,c),c=c.nextSibling);a=f}}function d(a){for(var c=a.firstChild;null!=c;){var b=c.nextSibling;d(c);c=b}1==a.nodeType&&("BR"===
a.nodeName||null!=a.firstChild)||3==a.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(a)).length?(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"),a.removeAttribute("border"))):a.parentNode.removeChild(a)}q.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||
-mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var d=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){b(this.textarea,d)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){h=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<h.length&&"\n"==h.charAt(h.length-1)&&(h=h.substring(0,
-h.length-1));h=this.graph.sanitizeHtml(c?h.replace(/\n/g,"<br/>"):h,!0);this.textarea.className="mxCellEditor geContentEditable";var d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,
+mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var d=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){b(this.textarea,d)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){g=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<g.length&&"\n"==g.charAt(g.length-1)&&(g=g.substring(0,
+g.length-1));g=this.graph.sanitizeHtml(c?g.replace(/\n/g,"<br/>"):g,!0);this.textarea.className="mxCellEditor geContentEditable";var d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,h=(mxUtils.getValue(a.style,
mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=
-g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=h&&(this.textarea.innerHTML=h,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var h=mxUtils.htmlEntities(this.textarea.innerHTML);
-mxClient.IS_QUIRKS||8==document.documentMode||(h=mxUtils.replaceTrailingNewlines(h,"<div><br></div>"));h=this.graph.sanitizeHtml(c?h.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):h,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var d=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration="";
-this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=h&&(this.textarea.innerHTML=h);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=b;this.resize()};var t=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,
+h?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=g&&(this.textarea.innerHTML=g,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var g=mxUtils.htmlEntities(this.textarea.innerHTML);
+mxClient.IS_QUIRKS||8==document.documentMode||(g=mxUtils.replaceTrailingNewlines(g,"<div><br></div>"));g=this.graph.sanitizeHtml(c?g.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):g,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var d=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration="";
+this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=g&&(this.textarea.innerHTML=g);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=b;this.resize()};var r=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,
c){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=a){var b=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*b;this.bounds.height=60*b;var d=null!=a.text?a.text.margin:null;null==d&&(d=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));
this.bounds.x+=d.x*this.bounds.width;this.bounds.y+=d.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/b)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/b)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/b)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*b);this.textarea.clientWidth<
this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/b)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*b);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxClient.IS_VML?this.textarea.style.zoom=b:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+b+","+b+")")}else this.textarea.style.height="",this.textarea.style.overflow="",
-t.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(a,c){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,c);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=
+r.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(a,c){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,c);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=
function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var c=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return c="1"==mxUtils.getValue(a.style,"nl2Br","1")?c.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var c=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();c.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=
-function(){try{this.graph.container.focus()}catch(L){}};var f=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,c){this.graph.getModel().beginUpdate();try{if(f.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],
-!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var g=mxGraphHandler.prototype.moveCells;
-mxGraphHandler.prototype.moveCells=function(a,c,b,d,f,e){mxEvent.isAltDown(e)&&(f=null);g.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var b=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-b.x);b=this.roundLength((this.bounds.y+this.currentDy)/d-b.y);this.hint.innerHTML=c+", "+b;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-
+function(){try{this.graph.container.focus()}catch(K){}};var f=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,c){this.graph.getModel().beginUpdate();try{if(f.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],
+!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var h=mxGraphHandler.prototype.moveCells;
+mxGraphHandler.prototype.moveCells=function(a,c,b,d,f,e){mxEvent.isAltDown(e)&&(f=null);h.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var b=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-b.x);b=this.roundLength((this.bounds.y+this.currentDy)/d-b.y);this.hint.innerHTML=c+", "+b;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-
this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,c){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!mxEvent.isControlDown(c.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==
-mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())};var p=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=
-new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=p.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+
+mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())};var m=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=
+new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=m.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+
"&deg;":(c=this.state.view.scale,this.hint.innerHTML=this.roundLength(this.bounds.width/c)+" x "+this.roundLength(this.bounds.height/c)),c=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),null==c&&(c=this.bounds),this.hint.style.left=c.x+Math.round((c.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=c.y+c.height+12+"px",null!=this.linkHint&&(this.linkHint.style.display="none"))};mxVertexHandler.prototype.removeHint=
function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(c,b){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var d=this.graph.view.translate,f=this.graph.view.scale,e=this.roundLength(b.x/f-d.x),d=this.roundLength(b.y/f-d.y);this.hint.innerHTML=e+", "+d;this.hint.style.visibility="visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&
null!=this.constraintHandler.currentFocus?(e=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*e.x)+"%, "+Math.round(100*e.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(c.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(c.getGraphY(),b.y)+this.state.view.graph.gridSize+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;
@@ -2376,105 +2376,105 @@ Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxClient.IS_SVG||((n
-20;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};
if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-24,mxConstraintHandler.prototype.getTolerance=function(a){return mxEvent.isMouseEvent(a.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return null==
a.getState()&&!mxEvent.isMouseEvent(c)||mxEvent.isPopupTrigger(c)&&(null==a.getState()||mxEvent.isControlDown(c)||mxEvent.isShiftDown(c))};var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){n.apply(this,arguments);mxEvent.isTouchEvent(c.getEvent())&&this.graph.isCellSelected(c.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return mxEvent.isLeftMouseButton(c)&&
-(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var b=null!=this.div&&"none"!=this.div.style.display,d=null,f=null,e=null,g=null;null!=this.first&&
-null!=this.currentX&&null!=this.currentY&&(d=this.first.x,f=this.first.y,e=(this.currentX-d)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),h=
-this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(h)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(h=this.graph.getCellsBeyond(d,f,this.graph.getDefaultParent(),!0,!0),b=0;b<h.length;b++)if(this.graph.isCellMovable(h[b])){var n=this.graph.view.getState(h[b]),p=this.graph.getCellGeometry(h[b]);null!=n&&null!=p&&(p=p.clone(),p.translate(e,g),this.graph.model.setGeometry(h[b],p))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y,
-this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),d=mxUtils.getOffset(this.graph.container);b.x-=d.x;b.y-=d.y;var d=c.getX()+b.x,b=c.getY()+b.y,f=this.first.x-d,e=this.first.y-b,g=this.graph.tolerance;if(null!=this.div||Math.abs(f)>g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,b),
+(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var b=null!=this.div&&"none"!=this.div.style.display,d=null,f=null,e=null,h=null;null!=this.first&&
+null!=this.currentX&&null!=this.currentY&&(d=this.first.x,f=this.first.y,e=(this.currentX-d)/this.graph.view.scale,h=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),h=this.graph.snap(h),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(h)<this.graph.tolerance&&(h=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),g=
+this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(g)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(g=this.graph.getCellsBeyond(d,f,this.graph.getDefaultParent(),!0,!0),b=0;b<g.length;b++)if(this.graph.isCellMovable(g[b])){var n=this.graph.view.getState(g[b]),m=this.graph.getCellGeometry(g[b]);null!=n&&null!=m&&(m=m.clone(),m.translate(e,h),this.graph.model.setGeometry(g[b],m))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y,
+this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),d=mxUtils.getOffset(this.graph.container);b.x-=d.x;b.y-=d.y;var d=c.getX()+b.x,b=c.getY()+b.y,f=this.first.x-d,e=this.first.y-b,h=this.graph.tolerance;if(null!=this.div||Math.abs(f)>h||Math.abs(e)>h)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,b),
this.isSpaceEvent(c)?(d=this.x+this.width,b=this.y+this.height,f=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/f)*f,this.height=this.graph.snap(this.height/f)*f,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=d-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=
this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=
-Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var h=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);h.apply(this,
-arguments)};var x=(new Date).getTime(),u=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,d){v.apply(this,arguments);b!=this.currentTerminalState?(x=(new Date).getTime(),u=0):u=(new Date).getTime()-x;this.currentTerminalState=b};var r=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<u||(null==this.currentTerminalState||
-"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&r.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,d=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),
-f):null)?this.fixedHandleImage:null!=f&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var y=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?
-HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return y.apply(this,arguments)};var w=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return w.apply(this,
-arguments)};var A=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):A.apply(this,arguments)};var E=mxVertexHandler.prototype.mouseDown;
-mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),d=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(d)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&E.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||
-this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var B=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){B.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var F=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=
-function(a,c){F.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var C=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){C.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=
+Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var g=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);g.apply(this,
+arguments)};var x=(new Date).getTime(),u=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,d){v.apply(this,arguments);b!=this.currentTerminalState?(x=(new Date).getTime(),u=0):u=(new Date).getTime()-x;this.currentTerminalState=b};var t=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<u||(null==this.currentTerminalState||
+"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&t.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,d=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),
+f):null)?this.fixedHandleImage:null!=f&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var A=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?
+HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return A.apply(this,arguments)};var y=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return y.apply(this,
+arguments)};var w=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):w.apply(this,arguments)};var F=mxVertexHandler.prototype.mouseDown;
+mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),d=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(d)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&F.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||
+this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var B=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){B.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var G=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=
+function(a,c){G.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var C=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){C.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=
1==this.graph.getSelectionCount()?"":"none");null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.selectionHandler=mxUtils.bind(this,function(a,b){c()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(a,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));
c()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(a,c){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var b=this.graph.getLinkForCell(this.state.cell),d=this.graph.getLinksForState(this.state);this.updateLinkHint(b,d);if(null!=b||null!=d&&0<d.length)a=!0;a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(c,b){if(null==c&&(null==b||0==b.length)||1<this.graph.getSelectionCount())null!=
this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=c||null!=b&&0<b.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.fontSize="90%",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint));this.linkHint.innerHTML="";if(null!=c&&(this.linkHint.appendChild(this.graph.createLinkForHint(c)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var d=
document.createElement("img");d.setAttribute("src",IMAGE_PATH+"/edit.gif");d.setAttribute("title",mxResources.get("editLink"));d.setAttribute("width","11");d.setAttribute("height","11");d.style.marginLeft="10px";d.style.marginBottom="-1px";d.style.cursor="pointer";this.linkHint.appendChild(d);mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)}));d=document.createElement("img");d.setAttribute("src",Dialog.prototype.clearImage);
d.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));d.setAttribute("width","13");d.setAttribute("height","10");d.style.marginLeft="4px";d.style.marginBottom="-1px";d.style.cursor="pointer";this.linkHint.appendChild(d);mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(a)}))}if(null!=b)for(d=0;d<b.length;d++){var f=document.createElement("div");f.style.marginTop=null!=c||0<d?"6px":"0px";f.appendChild(this.graph.createLinkForHint(b[d].getAttribute("href"),
-mxUtils.getTextContent(b[d])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var G=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){G.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=
+mxUtils.getTextContent(b[d])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var H=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){H.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=
this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(c,b){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(c,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE,
-this.changeHandler);var c=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=c||null!=b&&0<b.length)this.updateLinkHint(c,b),this.redrawHandles()};var z=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){z.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var H=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){H.apply(this);
+this.changeHandler);var c=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=c||null!=b&&0<b.length)this.updateLinkHint(c,b),this.redrawHandles()};var z=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){z.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var L=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){L.apply(this);
if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(c,this.state.style[mxConstants.STYLE_ROTATION]||"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,c=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;null!=c&&(b=Math.max(b,
-c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var J=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){J.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var K=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=
-function(){K.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Y=mxEdgeHandler.prototype.redrawHandles;
+c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var E=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){E.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var I=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=
+function(){I.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Y=mxEdgeHandler.prototype.redrawHandles;
mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Y.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),a.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var R=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=
function(){R.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var P=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){P.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),
-this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function l(){mxCylinder.call(this)}function q(){mxActor.call(this)}function t(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function p(){mxActor.call(this)}function n(){mxActor.call(this)}function h(a,c){this.canvas=
-a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,h.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,h.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,h.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,h.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
-this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function x(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function r(){mxActor.call(this)}function y(){mxActor.call(this)}function w(){mxRectangleShape.call(this)}function A(){mxRectangleShape.call(this)}function E(){mxCylinder.call(this)}function B(){mxShape.call(this)}function F(){mxShape.call(this)}
-function C(){mxEllipse.call(this)}function G(){mxShape.call(this)}function z(){mxShape.call(this)}function H(){mxRectangleShape.call(this)}function J(){mxShape.call(this)}function K(){mxShape.call(this)}function Y(){mxShape.call(this)}function R(){mxCylinder.call(this)}function P(){mxDoubleEllipse.call(this)}function L(){mxDoubleEllipse.call(this)}function I(){mxArrowConnector.call(this);this.spacing=0}function M(){mxArrowConnector.call(this);this.spacing=0}function S(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}
+this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function l(){mxActor.call(this)}function p(){mxCylinder.call(this)}function q(){mxActor.call(this)}function r(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function h(){mxActor.call(this)}function m(){mxActor.call(this)}function n(){mxActor.call(this)}function g(a,c){this.canvas=
+a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,g.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,g.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,g.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,g.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
+this.canvas.curveTo=mxUtils.bind(this,g.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,g.prototype.arcTo)}function x(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function t(){mxActor.call(this)}function A(){mxActor.call(this)}function y(){mxRectangleShape.call(this)}function w(){mxRectangleShape.call(this)}function F(){mxCylinder.call(this)}function B(){mxShape.call(this)}function G(){mxShape.call(this)}
+function C(){mxEllipse.call(this)}function H(){mxShape.call(this)}function z(){mxShape.call(this)}function L(){mxRectangleShape.call(this)}function E(){mxShape.call(this)}function I(){mxShape.call(this)}function Y(){mxShape.call(this)}function R(){mxCylinder.call(this)}function P(){mxDoubleEllipse.call(this)}function K(){mxDoubleEllipse.call(this)}function J(){mxArrowConnector.call(this);this.spacing=0}function M(){mxArrowConnector.call(this);this.spacing=0}function S(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}
function W(){mxActor.call(this)}function Q(){mxActor.call(this)}function X(){mxActor.call(this)}function U(){mxActor.call(this)}function T(){mxActor.call(this)}function O(){mxActor.call(this)}function ca(){mxActor.call(this)}function V(){mxActor.call(this)}function Z(){mxActor.call(this)}function aa(){mxActor.call(this)}function ia(){mxEllipse.call(this)}function da(){mxEllipse.call(this)}function ma(){mxEllipse.call(this)}function fa(){mxRhombus.call(this)}function ja(){mxEllipse.call(this)}function ba(){mxEllipse.call(this)}
-function qa(){mxEllipse.call(this)}function na(){mxEllipse.call(this)}function ta(){mxActor.call(this)}function oa(){mxActor.call(this)}function pa(){mxActor.call(this)}function ka(){mxConnector.call(this)}function Aa(a,c,b,d,f,e,g,h,p,n){g+=p;var ga=d.clone();d.x-=f*(2*g+p);d.y-=e*(2*g+p);f*=g+p;e*=g+p;return function(){a.ellipse(ga.x-f-g,ga.y-e-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,
+function qa(){mxEllipse.call(this)}function na(){mxEllipse.call(this)}function ta(){mxActor.call(this)}function oa(){mxActor.call(this)}function pa(){mxActor.call(this)}function ka(){mxConnector.call(this)}function Aa(a,c,b,d,f,e,h,g,m,n){h+=m;var ga=d.clone();d.x-=f*(2*h+m);d.y-=e*(2*h+m);f*=h+m;e*=h+m;return function(){a.ellipse(ga.x-f-h,ga.y-e-h,2*h,2*h);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,
Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(c,f),a.lineTo(c,c),a.lineTo(0,0),a.moveTo(c,c),a.lineTo(d,c)):(a.moveTo(0,0),a.lineTo(d-c,0),a.lineTo(d,c),a.lineTo(d,f),a.lineTo(c,f),a.lineTo(0,f-c),a.lineTo(0,0),a.close());a.end()};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube",
a);var xa=Math.tan(mxUtils.toRadians(30)),la=(.5-xa)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d,f/xa);a.translate((d-c)/2,(f-c)/2+c/4);a.moveTo(0,.25*c);a.lineTo(.5*c,c*la);a.lineTo(c,.25*c);a.lineTo(.5*c,(.5-la)*c);a.lineTo(0,.25*c);a.close();a.end()};mxCellRenderer.registerShape("isoRectangle",b);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.min(d,f/(.5+xa));e?(a.moveTo(0,.25*c),a.lineTo(.5*
c,(.5-la)*c),a.lineTo(c,.25*c),a.moveTo(.5*c,(.5-la)*c),a.lineTo(.5*c,(1-la)*c)):(a.translate((d-c)/2,(f-c)/2),a.moveTo(0,.25*c),a.lineTo(.5*c,c*la),a.lineTo(c,.25*c),a.lineTo(c,.75*c),a.lineTo(.5*c,(1-la)*c),a.lineTo(0,.75*c),a.close());a.end()};mxCellRenderer.registerShape("isoCube",e);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.min(f/2,Math.round(f/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||
(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||(a.stroke(),a.begin()),a.translate(0,-c);e||(a.moveTo(0,c),a.curveTo(0,-c/3,d,-c/3,d,c),a.lineTo(d,f-c),a.curveTo(d,f+c/3,0,f+c/3,0,f-c),a.close())};d.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1)*this.scale,0,0)};mxCellRenderer.registerShape("datastore",
-d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(d-c,0),a.lineTo(d-c,c),a.lineTo(d,c)):(a.moveTo(0,0),a.lineTo(d-c,0),a.lineTo(d,c),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d/2,.5*f,d,0);a.quadTo(.5*
-d,f/2,d,f);a.quadTo(d/2,.5*f,0,f);a.quadTo(.5*d,f/2,0,0);a.end()};mxCellRenderer.registerShape("switch",m);mxUtils.extend(l,mxCylinder);l.prototype.tabWidth=60;l.prototype.tabHeight=20;l.prototype.tabPosition="right";l.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var g=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);
-e?"left"==g?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(d-c,b),a.lineTo(d,b)):("left"==g?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(d,b)):(a.moveTo(0,b),a.lineTo(d-c,b),a.lineTo(d-c,0),a.lineTo(d,0)),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",l);mxUtils.extend(q,mxActor);q.prototype.size=30;q.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));b=mxUtils.getValue(this.style,
-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",q);mxUtils.extend(t,mxActor);t.prototype.size=.4;t.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(d/4,1.4*c,d/2,c/2);a.quadTo(3*d/4,c*(1-1.4),d,c/2);a.lineTo(d,f-c/2);a.quadTo(3*
-d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();a.end()};t.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,d=a.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=d,new mxRectangle(a.x,a.y+c,b,d-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,d)}return a};mxCellRenderer.registerShape("tape",
-t);mxUtils.extend(c,mxActor);c.prototype.size=.3;c.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};c.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(d,0);a.lineTo(d,f-c/2);a.quadTo(3*d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();
+d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(d-c,0),a.lineTo(d-c,c),a.lineTo(d,c)):(a.moveTo(0,0),a.lineTo(d-c,0),a.lineTo(d,c),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",k);mxUtils.extend(l,mxActor);l.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d/2,.5*f,d,0);a.quadTo(.5*
+d,f/2,d,f);a.quadTo(d/2,.5*f,0,f);a.quadTo(.5*d,f/2,0,0);a.end()};mxCellRenderer.registerShape("switch",l);mxUtils.extend(p,mxCylinder);p.prototype.tabWidth=60;p.prototype.tabHeight=20;p.prototype.tabPosition="right";p.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var h=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);
+e?"left"==h?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(d-c,b),a.lineTo(d,b)):("left"==h?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(d,b)):(a.moveTo(0,b),a.lineTo(d-c,b),a.lineTo(d-c,0),a.lineTo(d,0)),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",p);mxUtils.extend(q,mxActor);q.prototype.size=30;q.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));b=mxUtils.getValue(this.style,
+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",q);mxUtils.extend(r,mxActor);r.prototype.size=.4;r.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(d/4,1.4*c,d/2,c/2);a.quadTo(3*d/4,c*(1-1.4),d,c/2);a.lineTo(d,f-c/2);a.quadTo(3*
+d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();a.end()};r.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,d=a.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=d,new mxRectangle(a.x,a.y+c,b,d-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,d)}return a};mxCellRenderer.registerShape("tape",
+r);mxUtils.extend(c,mxActor);c.prototype.size=.3;c.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};c.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(d,0);a.lineTo(d,f-c/2);a.quadTo(3*d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();
a.end()};mxCellRenderer.registerShape("document",c);mxCylinder.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,Math.min(this.maxHeight*this.scale,.3*a.height),0,0):null};mxUtils.extend(f,mxActor);f.prototype.size=.2;f.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,
-[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d-c,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",f);mxUtils.extend(g,mxActor);g.prototype.size=.2;g.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,f)],this.isRounded,
-b,!0)};mxCellRenderer.registerShape("trapezoid",g);mxUtils.extend(p,mxActor);p.prototype.size=.5;p.prototype.redrawPath=function(a,c,b,d,f){a.setFillColor(null);c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,0),new mxPoint(c,0),new mxPoint(c,f/2),new mxPoint(0,f/2),new mxPoint(c,f/2),new mxPoint(c,f),new mxPoint(d,f)],this.isRounded,b,!1);a.end()};
-mxCellRenderer.registerShape("curlyBracket",p);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,c,b,d,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=d/5;a.rect(0,0,c,f);a.fillAndStroke();a.rect(2*c,0,c,f);a.fillAndStroke();a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",n);h.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};h.prototype.close=function(){null!=this.firstX&&
-null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};h.prototype.quadTo=function(a,c,b,d){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=d};h.prototype.curveTo=function(a,c,b,d,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};h.prototype.arcTo=function(a,c,b,d,f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=
-g};h.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},d=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(d*d+f*f);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),ga=this.defaultVariation;5>g&&(g=5,ga/=3);for(var h=b(a-this.lastX)*d/g,b=b(c-this.lastY)*f/g,d=d/e,f=f/e,e=0;e<g;e++){var p=(Math.random()-.5)*ga;this.originalLineTo.call(this.canvas,
-h*e+this.lastX-p*f,b*e+this.lastY-p*d)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};h.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Ea=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=
-function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new h(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ea.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Fa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Fa.apply(this,arguments)};
+[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d-c,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",f);mxUtils.extend(h,mxActor);h.prototype.size=.2;h.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,f)],this.isRounded,
+b,!0)};mxCellRenderer.registerShape("trapezoid",h);mxUtils.extend(m,mxActor);m.prototype.size=.5;m.prototype.redrawPath=function(a,c,b,d,f){a.setFillColor(null);c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,0),new mxPoint(c,0),new mxPoint(c,f/2),new mxPoint(0,f/2),new mxPoint(c,f/2),new mxPoint(c,f),new mxPoint(d,f)],this.isRounded,b,!1);a.end()};
+mxCellRenderer.registerShape("curlyBracket",m);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,c,b,d,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=d/5;a.rect(0,0,c,f);a.fillAndStroke();a.rect(2*c,0,c,f);a.fillAndStroke();a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",n);g.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};g.prototype.close=function(){null!=this.firstX&&
+null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};g.prototype.quadTo=function(a,c,b,d){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=d};g.prototype.curveTo=function(a,c,b,d,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};g.prototype.arcTo=function(a,c,b,d,f,e,h){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=
+h};g.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},d=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(d*d+f*f);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var h=Math.round(e/10),ga=this.defaultVariation;5>h&&(h=5,ga/=3);for(var g=b(a-this.lastX)*d/h,b=b(c-this.lastY)*f/h,d=d/e,f=f/e,e=0;e<h;e++){var m=(Math.random()-.5)*ga;this.originalLineTo.call(this.canvas,
+g*e+this.lastX-m*f,b*e+this.lastY-m*d)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};g.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Ea=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=
+function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new g(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ea.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Fa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Fa.apply(this,arguments)};
var Ga=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,b,d,f){if(null==a.handJiggle)Ga.apply(this,arguments);else{var e=!0;null!=this.style&&(e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(e||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)e||null!=this.fill&&this.fill!=mxConstants.NONE||(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,
0)?e=Math.min(d/2,Math.min(f/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(d*e,f*e)),a.moveTo(c+e,b),a.lineTo(c+d-e,b),a.quadTo(c+d,b,c+d,b+e),a.lineTo(c+d,b+f-e),a.quadTo(c+d,b+f,c+d-e,b+f),a.lineTo(c+e,b+f),a.quadTo(c,b+f,c,b+f-e),a.lineTo(c,b+e),a.quadTo(c,b,c+e,b)):(a.moveTo(c,b),a.lineTo(c+d,b),a.lineTo(c+d,b+f),a.lineTo(c,b+f),a.lineTo(c,
b)),a.close(),a.end(),a.fillAndStroke()}};var Ha=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,b,d,f){null==a.handJiggle&&Ha.apply(this,arguments)};mxUtils.extend(x,mxRectangleShape);x.prototype.size=.1;x.prototype.isHtmlAllowed=function(){return!1};x.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var c=
-a.width,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,d=Math.max(d,Math.min(c*f,b*f));a.x+=Math.round(d);a.width-=Math.round(2*d)}return a};x.prototype.paintForeground=function(a,c,b,d,f){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=
-mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*g,f*g));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+f);a.moveTo(c+d-e,b);a.lineTo(c+d-e,b+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",x);mxUtils.extend(u,mxRectangleShape);u.prototype.paintBackground=function(a,c,b,d,f){a.setFillColor(mxConstants.NONE);a.rect(c,b,d,f);a.fill()};u.prototype.paintForeground=
+a.width,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,d=Math.max(d,Math.min(c*f,b*f));a.x+=Math.round(d);a.width-=Math.round(2*d)}return a};x.prototype.paintForeground=function(a,c,b,d,f){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var h=
+mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*h,f*h));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+f);a.moveTo(c+d-e,b);a.lineTo(c+d-e,b+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",x);mxUtils.extend(u,mxRectangleShape);u.prototype.paintBackground=function(a,c,b,d,f){a.setFillColor(mxConstants.NONE);a.rect(c,b,d,f);a.fill()};u.prototype.paintForeground=
function(a,c,b,d,f){};mxCellRenderer.registerShape("transparent",u);mxUtils.extend(v,mxHexagon);v.prototype.size=30;v.prototype.position=.5;v.prototype.position2=.5;v.prototype.base=20;v.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};v.prototype.redrawPath=function(a,c,b,d,f){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,
-"size",this.size))));var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),h=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-b),new mxPoint(Math.min(d,e+h),f-b),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-b),new mxPoint(0,f-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",
-v);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-
-c,f),new mxPoint(0,f),new mxPoint(c,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",r);mxUtils.extend(y,mxHexagon);y.prototype.size=.25;y.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],
-this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",y);mxUtils.extend(w,mxRectangleShape);w.prototype.isHtmlAllowed=function(){return!1};w.prototype.paintForeground=function(a,c,b,d,f){var e=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+e);a.lineTo(c+d/2,b+f-e);a.moveTo(c+e,b+f/2);a.lineTo(c+d-e,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",w);var Ba=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=
+"size",this.size))));var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),h=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),g=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-b),new mxPoint(Math.min(d,e+g),f-b),new mxPoint(h,f),new mxPoint(Math.max(0,e),f-b),new mxPoint(0,f-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",
+v);mxUtils.extend(t,mxActor);t.prototype.size=.2;t.prototype.fixedSize=20;t.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-
+c,f),new mxPoint(0,f),new mxPoint(c,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",t);mxUtils.extend(A,mxHexagon);A.prototype.size=.25;A.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],
+this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",A);mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.paintForeground=function(a,c,b,d,f){var e=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+e);a.lineTo(c+d/2,b+f-e);a.moveTo(c+e,b+f/2);a.lineTo(c+d-e,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",y);var Ba=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=
function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,d,f){Ba.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;b+=e;d-=2*e;f-=2*e;0<d&&0<f&&(a.setShadow(!1),Ba.apply(this,[a,c,
-b,d,f]))}};mxUtils.extend(A,mxRectangleShape);A.prototype.isHtmlAllowed=function(){return!1};A.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};A.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
-0);c+=e;b+=e;d-=2*e;f-=2*e;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+e]];if(null!=g){var h=this.style["symbol"+e+"Align"],ga=this.style["symbol"+e+"VerticalAlign"],p=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],u=this.style["symbol"+e+"Spacing"]||0,r=this.style["symbol"+e+"VSpacing"]||u,v=this.style["symbol"+e+"ArcSpacing"];null!=v&&(v*=this.getArcSize(d+this.strokewidth,
-f+this.strokewidth),u+=v,r+=v);var v=c,k=b,v=h==mxConstants.ALIGN_CENTER?v+(d-p)/2:h==mxConstants.ALIGN_RIGHT?v+(d-p-u):v+u,k=ga==mxConstants.ALIGN_MIDDLE?k+(f-n)/2:ga==mxConstants.ALIGN_BOTTOM?k+(f-n-r):k+r;a.save();h=new g;h.style=this.style;g.prototype.paintVertexShape.call(h,a,v,k,p,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",A);mxUtils.extend(E,mxCylinder);E.prototype.redrawPath=function(a,c,b,d,f,e){e?
-(a.moveTo(0,0),a.lineTo(d/2,f/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",E);mxUtils.extend(B,mxShape);B.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.ellipse(d/4,0,d/2,f/4);a.fillAndStroke();a.begin();a.moveTo(d/2,f/4);a.lineTo(d/2,2*f/3);a.moveTo(d/2,f/3);a.lineTo(0,f/3);a.moveTo(d/2,f/3);a.lineTo(d,f/3);a.moveTo(d/2,2*f/3);a.lineTo(0,f);a.moveTo(d/2,2*f/3);a.lineTo(d,f);a.end();a.stroke()};
-mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(F,mxShape);F.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};F.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(d/6,f/2);a.end();a.stroke();a.ellipse(d/6,0,5*d/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",F);mxUtils.extend(C,mxEllipse);C.prototype.paintVertexShape=function(a,c,
-b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/8,b+f);a.lineTo(c+7*d/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",C);mxUtils.extend(G,mxShape);G.prototype.paintVertexShape=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(d,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",G);mxUtils.extend(z,mxShape);z.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+
-a.height/8,a.width,7*a.height/8)};z.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,0);a.end();a.stroke();a.ellipse(0,f/8,d,7*f/8);a.fillAndStroke()};z.prototype.paintForeground=function(a,c,b,d,f){a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",z);mxUtils.extend(H,mxRectangleShape);H.prototype.size=40;H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=
-function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};H.prototype.paintBackground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,d,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=H&&(g=new g,
-g.apply(this.state),a.save(),g.paintVertexShape(a,c,b,d,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(c+d/2,b+e),a.lineTo(c+d/2,b+f),a.end(),a.stroke())};H.prototype.paintForeground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,d,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",H);mxUtils.extend(J,mxShape);J.prototype.width=60;J.prototype.height=30;J.prototype.corner=
-10;J.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};J.prototype.paintBackground=function(a,c,b,d,f){var e=this.corner,g=Math.min(d,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),h=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),p=mxUtils.getValue(this.style,
-mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);p!=mxConstants.NONE&&(a.setFillColor(p),a.rect(c,b,d,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(a,c,b,d,f),a.setGradient(this.fill,this.gradient,c,b,d,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+g,b);a.lineTo(c+g,b+Math.max(0,h-1.5*e));a.lineTo(c+Math.max(0,g-e),b+h);a.lineTo(c,b+h);a.close();a.fillAndStroke();a.begin();
-a.moveTo(c+g,b);a.lineTo(c+d,b);a.lineTo(c+d,b+f);a.lineTo(c,b+f);a.lineTo(c,b+h);a.stroke()};mxCellRenderer.registerShape("umlFrame",J);mxPerimeter.LifelinePerimeter=function(a,c,b,d){d=H.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+d,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);
+b,d,f]))}};mxUtils.extend(w,mxRectangleShape);w.prototype.isHtmlAllowed=function(){return!1};w.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};w.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
+0);c+=e;b+=e;d-=2*e;f-=2*e;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,h;do{h=mxCellRenderer.defaultShapes[this.style["symbol"+e]];if(null!=h){var g=this.style["symbol"+e+"Align"],ga=this.style["symbol"+e+"VerticalAlign"],m=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],u=this.style["symbol"+e+"Spacing"]||0,t=this.style["symbol"+e+"VSpacing"]||u,v=this.style["symbol"+e+"ArcSpacing"];null!=v&&(v*=this.getArcSize(d+this.strokewidth,
+f+this.strokewidth),u+=v,t+=v);var v=c,k=b,v=g==mxConstants.ALIGN_CENTER?v+(d-m)/2:g==mxConstants.ALIGN_RIGHT?v+(d-m-u):v+u,k=ga==mxConstants.ALIGN_MIDDLE?k+(f-n)/2:ga==mxConstants.ALIGN_BOTTOM?k+(f-n-t):k+t;a.save();g=new h;g.style=this.style;h.prototype.paintVertexShape.call(g,a,v,k,m,n);a.restore()}e++}while(null!=h)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",w);mxUtils.extend(F,mxCylinder);F.prototype.redrawPath=function(a,c,b,d,f,e){e?
+(a.moveTo(0,0),a.lineTo(d/2,f/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",F);mxUtils.extend(B,mxShape);B.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.ellipse(d/4,0,d/2,f/4);a.fillAndStroke();a.begin();a.moveTo(d/2,f/4);a.lineTo(d/2,2*f/3);a.moveTo(d/2,f/3);a.lineTo(0,f/3);a.moveTo(d/2,f/3);a.lineTo(d,f/3);a.moveTo(d/2,2*f/3);a.lineTo(0,f);a.moveTo(d/2,2*f/3);a.lineTo(d,f);a.end();a.stroke()};
+mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(G,mxShape);G.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};G.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(d/6,f/2);a.end();a.stroke();a.ellipse(d/6,0,5*d/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",G);mxUtils.extend(C,mxEllipse);C.prototype.paintVertexShape=function(a,c,
+b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/8,b+f);a.lineTo(c+7*d/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",C);mxUtils.extend(H,mxShape);H.prototype.paintVertexShape=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(d,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",H);mxUtils.extend(z,mxShape);z.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+
+a.height/8,a.width,7*a.height/8)};z.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,0);a.end();a.stroke();a.ellipse(0,f/8,d,7*f/8);a.fillAndStroke()};z.prototype.paintForeground=function(a,c,b,d,f){a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",z);mxUtils.extend(L,mxRectangleShape);L.prototype.size=40;L.prototype.isHtmlAllowed=function(){return!1};L.prototype.getLabelBounds=
+function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};L.prototype.paintBackground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),h=mxUtils.getValue(this.style,"participant");null==h||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,d,e):(h=this.state.view.graph.cellRenderer.getShape(h),null!=h&&h!=L&&(h=new h,
+h.apply(this.state),a.save(),h.paintVertexShape(a,c,b,d,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(c+d/2,b+e),a.lineTo(c+d/2,b+f),a.end(),a.stroke())};L.prototype.paintForeground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,d,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",L);mxUtils.extend(E,mxShape);E.prototype.width=60;E.prototype.height=30;E.prototype.corner=
+10;E.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};E.prototype.paintBackground=function(a,c,b,d,f){var e=this.corner,h=Math.min(d,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),g=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),m=mxUtils.getValue(this.style,
+mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);m!=mxConstants.NONE&&(a.setFillColor(m),a.rect(c,b,d,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(a,c,b,d,f),a.setGradient(this.fill,this.gradient,c,b,d,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+h,b);a.lineTo(c+h,b+Math.max(0,g-1.5*e));a.lineTo(c+Math.max(0,h-e),b+g);a.lineTo(c,b+g);a.close();a.fillAndStroke();a.begin();
+a.moveTo(c+h,b);a.lineTo(c+d,b);a.lineTo(c+d,b+f);a.lineTo(c,b+f);a.lineTo(c,b+g);a.stroke()};mxCellRenderer.registerShape("umlFrame",E);mxPerimeter.LifelinePerimeter=function(a,c,b,d){d=L.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+d,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);
mxPerimeter.OrthogonalPerimeter=function(a,c,b,d){d=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(a,c,b,d){d=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(d+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return b.x<
a.getCenterX()&&(d=-1*(d+1)),new mxPoint(a.getCenterX()+d,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(d=-1*(d+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)),a.getCenterY()+d)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,b,d){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",v.prototype.size))*
-c.view.scale))),c.style),c,b,d)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,h=a.y,p=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h),new mxPoint(g+
-p,h+e),new mxPoint(g+p,h+n),new mxPoint(g,h+n-e),new mxPoint(g,h)]):(e=p*Math.max(0,Math.min(1,e)),h=[new mxPoint(g+e,h),new mxPoint(g+p,h),new mxPoint(g+p-e,h+n),new mxPoint(g,h+n),new mxPoint(g+e,h)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<g||b.x>g+p?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(h,a,b)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var f=g.prototype.size;null!=c&&(f=
-mxUtils.getValue(c.style,"size",f));var e=a.x,h=a.y,p=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=p*Math.max(0,Math.min(1,f)),h=[new mxPoint(e+f,h),new mxPoint(e+p-f,h),new mxPoint(e+p,h+n),new mxPoint(e,h+n),new mxPoint(e+f,h)]):c==mxConstants.DIRECTION_WEST?(f=p*Math.max(0,Math.min(1,f)),h=[new mxPoint(e,h),new mxPoint(e+p,h),new mxPoint(e+p-f,h+n),new mxPoint(e+f,h+n),new mxPoint(e,
-h)]):c==mxConstants.DIRECTION_NORTH?(f=n*Math.max(0,Math.min(1,f)),h=[new mxPoint(e,h+f),new mxPoint(e+p,h),new mxPoint(e+p,h+n),new mxPoint(e,h+n-f),new mxPoint(e,h+f)]):(f=n*Math.max(0,Math.min(1,f)),h=[new mxPoint(e,h),new mxPoint(e+p,h+f),new mxPoint(e+p,h+n-f),new mxPoint(e,h+n),new mxPoint(e,h)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<e||b.x>e+p?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(h,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);
-mxPerimeter.StepPerimeter=function(a,c,b,d){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?r.prototype.fixedSize:r.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,h=a.y,p=a.width,n=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(p,e)):p*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h),new mxPoint(g+p-
-f,h),new mxPoint(g+p,a),new mxPoint(g+p-f,h+n),new mxPoint(g,h+n),new mxPoint(g+f,a),new mxPoint(g,h)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(p,e)):p*Math.max(0,Math.min(1,e)),h=[new mxPoint(g+f,h),new mxPoint(g+p,h),new mxPoint(g+p-f,a),new mxPoint(g+p,h+n),new mxPoint(g+f,h+n),new mxPoint(g,a),new mxPoint(g+f,h)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h+f),new mxPoint(u,h),new mxPoint(g+p,h+f),new mxPoint(g+p,
-h+n),new mxPoint(u,h+n-f),new mxPoint(g,h+n),new mxPoint(g,h+f)]):(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h),new mxPoint(u,h+f),new mxPoint(g+p,h),new mxPoint(g+p,h+n-f),new mxPoint(u,h+n),new mxPoint(g,h+n-f),new mxPoint(g,h)]);u=new mxPoint(u,a);d&&(b.x<g||b.x>g+p?u.y=b.y:u.x=b.x);return mxUtils.getPerimeterPoint(h,u,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,d){var f=y.prototype.size;null!=
-c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,h=a.width,p=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=p*Math.max(0,Math.min(1,f)),g=[new mxPoint(n,g),new mxPoint(e+h,g+f),new mxPoint(e+h,g+p-f),new mxPoint(n,g+p),new mxPoint(e,g+p-f),new mxPoint(e,g+f),new mxPoint(n,g)]):(f=h*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+
-f,g),new mxPoint(e+h-f,g),new mxPoint(e+h,a),new mxPoint(e+h-f,g+p),new mxPoint(e+f,g+p),new mxPoint(e,a),new mxPoint(e+f,g)]);n=new mxPoint(n,a);d&&(b.x<e||b.x>e+h?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(g,n,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(K,mxShape);K.prototype.size=10;K.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((d-e)/2,0,e,e);a.fillAndStroke();
-a.begin();a.moveTo(d/2,e);a.lineTo(d/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",K);mxUtils.extend(Y,mxShape);Y.prototype.size=10;Y.prototype.inset=2;Y.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(d/2,e+g);a.lineTo(d/2,f);a.end();a.stroke();a.begin();a.moveTo((d-e)/2-g,e/2);a.quadTo((d-e)/2-g,e+g,d/
-2,e+g);a.quadTo((d+e)/2+g,e+g,(d+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",Y);mxUtils.extend(R,mxCylinder);R.prototype.jettyWidth=32;R.prototype.jettyHeight=12;R.prototype.redrawPath=function(a,c,b,d,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=g/2;var g=b+g/2,h=.3*f-c/2,p=.7*f-c/2;e?(a.moveTo(b,h),a.lineTo(g,h),a.lineTo(g,h+c),a.lineTo(b,h+c),a.moveTo(b,p),
-a.lineTo(g,p),a.lineTo(g,p+c),a.lineTo(b,p+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,p+c),a.lineTo(0,p+c),a.lineTo(0,p),a.lineTo(b,p),a.lineTo(b,h+c),a.lineTo(0,h+c),a.lineTo(0,h),a.lineTo(b,h),a.close());a.end()};mxCellRenderer.registerShape("component",R);mxUtils.extend(P,mxDoubleEllipse);P.prototype.outerStroke=!0;P.prototype.paintVertexShape=function(a,c,b,d,f){var e=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+e,b+e,d-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);
-this.outerStroke&&(a.ellipse(c,b,d,f),a.stroke())};mxCellRenderer.registerShape("endState",P);mxUtils.extend(L,P);L.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",L);mxUtils.extend(I,mxArrowConnector);I.prototype.defaultWidth=4;I.prototype.isOpenEnded=function(){return!0};I.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};I.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",
-I);mxUtils.extend(M,mxArrowConnector);M.prototype.defaultWidth=10;M.prototype.defaultArrowWidth=20;M.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};M.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};M.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",
+c.view.scale))),c.style),c,b,d)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var h=a.x,g=a.y,m=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g),new mxPoint(h+
+m,g+e),new mxPoint(h+m,g+n),new mxPoint(h,g+n-e),new mxPoint(h,g)]):(e=m*Math.max(0,Math.min(1,e)),g=[new mxPoint(h+e,g),new mxPoint(h+m,g),new mxPoint(h+m-e,g+n),new mxPoint(h,g+n),new mxPoint(h+e,g)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<h||b.x>h+m?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(g,a,b)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var f=h.prototype.size;null!=c&&(f=
+mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,m=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=m*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+m-f,g),new mxPoint(e+m,g+n),new mxPoint(e,g+n),new mxPoint(e+f,g)]):c==mxConstants.DIRECTION_WEST?(f=m*Math.max(0,Math.min(1,f)),g=[new mxPoint(e,g),new mxPoint(e+m,g),new mxPoint(e+m-f,g+n),new mxPoint(e+f,g+n),new mxPoint(e,
+g)]):c==mxConstants.DIRECTION_NORTH?(f=n*Math.max(0,Math.min(1,f)),g=[new mxPoint(e,g+f),new mxPoint(e+m,g),new mxPoint(e+m,g+n),new mxPoint(e,g+n-f),new mxPoint(e,g+f)]):(f=n*Math.max(0,Math.min(1,f)),g=[new mxPoint(e,g),new mxPoint(e+m,g+f),new mxPoint(e+m,g+n-f),new mxPoint(e,g+n),new mxPoint(e,g)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<e||b.x>e+m?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(g,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);
+mxPerimeter.StepPerimeter=function(a,c,b,d){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?t.prototype.fixedSize:t.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var h=a.x,g=a.y,m=a.width,n=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(m,e)):m*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g),new mxPoint(h+m-
+f,g),new mxPoint(h+m,a),new mxPoint(h+m-f,g+n),new mxPoint(h,g+n),new mxPoint(h+f,a),new mxPoint(h,g)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(m,e)):m*Math.max(0,Math.min(1,e)),g=[new mxPoint(h+f,g),new mxPoint(h+m,g),new mxPoint(h+m-f,a),new mxPoint(h+m,g+n),new mxPoint(h+f,g+n),new mxPoint(h,a),new mxPoint(h+f,g)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g+f),new mxPoint(u,g),new mxPoint(h+m,g+f),new mxPoint(h+m,
+g+n),new mxPoint(u,g+n-f),new mxPoint(h,g+n),new mxPoint(h,g+f)]):(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g),new mxPoint(u,g+f),new mxPoint(h+m,g),new mxPoint(h+m,g+n-f),new mxPoint(u,g+n),new mxPoint(h,g+n-f),new mxPoint(h,g)]);u=new mxPoint(u,a);d&&(b.x<h||b.x>h+m?u.y=b.y:u.x=b.x);return mxUtils.getPerimeterPoint(g,u,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,d){var f=A.prototype.size;null!=
+c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,h=a.y,g=a.width,m=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=m*Math.max(0,Math.min(1,f)),h=[new mxPoint(n,h),new mxPoint(e+g,h+f),new mxPoint(e+g,h+m-f),new mxPoint(n,h+m),new mxPoint(e,h+m-f),new mxPoint(e,h+f),new mxPoint(n,h)]):(f=g*Math.max(0,Math.min(1,f)),h=[new mxPoint(e+
+f,h),new mxPoint(e+g-f,h),new mxPoint(e+g,a),new mxPoint(e+g-f,h+m),new mxPoint(e+f,h+m),new mxPoint(e,a),new mxPoint(e+f,h)]);n=new mxPoint(n,a);d&&(b.x<e||b.x>e+g?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(h,n,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(I,mxShape);I.prototype.size=10;I.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((d-e)/2,0,e,e);a.fillAndStroke();
+a.begin();a.moveTo(d/2,e);a.lineTo(d/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",I);mxUtils.extend(Y,mxShape);Y.prototype.size=10;Y.prototype.inset=2;Y.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),h=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(d/2,e+h);a.lineTo(d/2,f);a.end();a.stroke();a.begin();a.moveTo((d-e)/2-h,e/2);a.quadTo((d-e)/2-h,e+h,d/
+2,e+h);a.quadTo((d+e)/2+h,e+h,(d+e)/2+h,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",Y);mxUtils.extend(R,mxCylinder);R.prototype.jettyWidth=32;R.prototype.jettyHeight=12;R.prototype.redrawPath=function(a,c,b,d,f,e){var h=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=h/2;var h=b+h/2,g=.3*f-c/2,m=.7*f-c/2;e?(a.moveTo(b,g),a.lineTo(h,g),a.lineTo(h,g+c),a.lineTo(b,g+c),a.moveTo(b,m),
+a.lineTo(h,m),a.lineTo(h,m+c),a.lineTo(b,m+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,m+c),a.lineTo(0,m+c),a.lineTo(0,m),a.lineTo(b,m),a.lineTo(b,g+c),a.lineTo(0,g+c),a.lineTo(0,g),a.lineTo(b,g),a.close());a.end()};mxCellRenderer.registerShape("component",R);mxUtils.extend(P,mxDoubleEllipse);P.prototype.outerStroke=!0;P.prototype.paintVertexShape=function(a,c,b,d,f){var e=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+e,b+e,d-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);
+this.outerStroke&&(a.ellipse(c,b,d,f),a.stroke())};mxCellRenderer.registerShape("endState",P);mxUtils.extend(K,P);K.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",K);mxUtils.extend(J,mxArrowConnector);J.prototype.defaultWidth=4;J.prototype.isOpenEnded=function(){return!0};J.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};J.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",
+J);mxUtils.extend(M,mxArrowConnector);M.prototype.defaultWidth=10;M.prototype.defaultArrowWidth=20;M.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};M.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};M.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",
M);mxUtils.extend(S,mxActor);S.prototype.size=30;S.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(0,c),new mxPoint(d,0),new mxPoint(d,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",S);mxUtils.extend(D,mxRectangleShape);D.prototype.dx=20;D.prototype.dy=20;D.prototype.isHtmlAllowed=
-function(){return!1};D.prototype.paintForeground=function(a,c,b,d,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*g,f*g));g=Math.max(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,b+e);a.lineTo(c+d,b+e);
-a.end();a.stroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+g,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",D);mxUtils.extend(W,mxActor);W.prototype.dx=20;W.prototype.dy=20;W.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
+function(){return!1};D.prototype.paintForeground=function(a,c,b,d,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*h,f*h));h=Math.max(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,b+e);a.lineTo(c+d,b+e);
+a.end();a.stroke();a.begin();a.moveTo(c+h,b);a.lineTo(c+h,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",D);mxUtils.extend(W,mxActor);W.prototype.dx=20;W.prototype.dy=20;W.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,b),new mxPoint(c,b),new mxPoint(c,f),new mxPoint(0,f)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("corner",W);mxUtils.extend(Q,mxActor);Q.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.lineTo(0,f);a.end();a.moveTo(d,0);a.lineTo(d,f);a.end();a.moveTo(0,f/2);a.lineTo(d,f/2);a.end()};mxCellRenderer.registerShape("crossbar",Q);mxUtils.extend(X,mxActor);X.prototype.dx=20;X.prototype.dy=
20;X.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,b),new mxPoint((d+c)/2,b),new mxPoint((d+c)/2,f),new mxPoint((d-c)/2,f),new mxPoint((d-
-c)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",X);mxUtils.extend(U,mxActor);U.prototype.arrowWidth=.3;U.prototype.arrowSize=.2;U.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
-2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(0,e)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("singleArrow",U);mxUtils.extend(T,mxActor);T.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",U.prototype.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",U.prototype.arrowSize))));
-b=(f-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(c,e),new mxPoint(c,f)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",T);mxUtils.extend(O,mxActor);O.prototype.size=.1;O.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
+c)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",X);mxUtils.extend(U,mxActor);U.prototype.arrowWidth=.3;U.prototype.arrowSize=.2;U.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-e)/2;var e=b+e,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
+2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(0,e)],this.isRounded,h,!0);a.end()};mxCellRenderer.registerShape("singleArrow",U);mxUtils.extend(T,mxActor);T.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",U.prototype.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",U.prototype.arrowSize))));
+b=(f-e)/2;var e=b+e,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(c,e),new mxPoint(c,f)],this.isRounded,h,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",T);mxUtils.extend(O,mxActor);O.prototype.size=.1;O.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));a.moveTo(c,0);a.lineTo(d,0);a.quadTo(d-2*c,f/2,d,f);a.lineTo(c,f);a.quadTo(c-2*c,f/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",O);mxUtils.extend(ca,mxActor);ca.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",ca);mxUtils.extend(V,mxActor);V.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.quadTo(d/2,f/2,0,0);a.close();
a.end()};mxCellRenderer.registerShape("xor",V);mxUtils.extend(Z,mxActor);Z.prototype.size=20;Z.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d/2,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.8*c),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",
Z);mxUtils.extend(aa,mxActor);aa.prototype.size=.375;aa.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-c),new mxPoint(d/2,f),new mxPoint(0,f-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",aa);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=
@@ -2484,33 +2484,33 @@ arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+f/2);a.lineTo(c+d,b+f/2);a.end
function(a,c,b,d,f){var e=b+f-5;a.begin();a.moveTo(c,b);a.lineTo(c,b+f);a.moveTo(c,e);a.lineTo(c+10,e-5);a.moveTo(c,e);a.lineTo(c+10,e+5);a.moveTo(c,e);a.lineTo(c+d,e);a.moveTo(c+d,b);a.lineTo(c+d,b+f);a.moveTo(c+d,e);a.lineTo(c+d-10,e-5);a.moveTo(c+d,e);a.lineTo(c+d-10,e+5);a.end();a.stroke()};mxCellRenderer.registerShape("dimension",ba);mxUtils.extend(qa,mxEllipse);qa.prototype.paintVertexShape=function(a,c,b,d,f){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,
arguments);null!=this.style&&(a.setStrokeColor(this.stroke),a.rect(c,b,d,f),a.fill(),a.begin(),a.moveTo(c,b),"1"==mxUtils.getValue(this.style,"top","1")?a.lineTo(c+d,b):a.moveTo(c+d,b),"1"==mxUtils.getValue(this.style,"right","1")?a.lineTo(c+d,b+f):a.moveTo(c+d,b+f),"1"==mxUtils.getValue(this.style,"bottom","1")?a.lineTo(c,b+f):a.moveTo(c,b+f),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(c,b-this.strokewidth/2),a.end(),a.stroke())};mxCellRenderer.registerShape("partialRectangle",qa);mxUtils.extend(na,
mxEllipse);na.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+d/2,b),a.lineTo(c+d/2,b+f)):(a.moveTo(c,b+f/2),a.lineTo(c+d,b+f/2));a.end();a.stroke()};mxCellRenderer.registerShape("lineEllipse",na);mxUtils.extend(ta,mxActor);ta.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d,f/2);a.moveTo(0,0);a.lineTo(d-c,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,d-c,f);a.lineTo(0,
-f);a.close();a.end()};mxCellRenderer.registerShape("delay",ta);mxUtils.extend(oa,mxActor);oa.prototype.size=.2;oa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,d);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(f-e)/2;b=c+e;var g=(d-e)/2,e=g+e;a.moveTo(0,c);a.lineTo(g,c);a.lineTo(g,0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(d,c);a.lineTo(d,b);a.lineTo(e,b);a.lineTo(e,f);a.lineTo(g,f);a.lineTo(g,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",
+f);a.close();a.end()};mxCellRenderer.registerShape("delay",ta);mxUtils.extend(oa,mxActor);oa.prototype.size=.2;oa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,d);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(f-e)/2;b=c+e;var h=(d-e)/2,e=h+e;a.moveTo(0,c);a.lineTo(h,c);a.lineTo(h,0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(d,c);a.lineTo(d,b);a.lineTo(e,b);a.lineTo(e,f);a.lineTo(h,f);a.lineTo(h,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",
oa);mxUtils.extend(pa,mxActor);pa.prototype.size=.25;pa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d,f/2);b=Math.min(d-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*d);a.moveTo(0,f/2);a.lineTo(b,0);a.lineTo(d-c,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,d-c,f);a.lineTo(b,f);a.close();a.end()};mxCellRenderer.registerShape("display",pa);mxUtils.extend(ka,mxConnector);ka.prototype.origPaintEdgeShape=ka.prototype.paintEdgeShape;ka.prototype.paintEdgeShape=function(a,c,b){for(var d=
[],f=0;f<c.length;f++)d.push(mxUtils.clone(c[f]));var f=a.state.dashed,e=a.state.fixDash;ka.prototype.origPaintEdgeShape.apply(this,[a,d,b]);3<=a.state.strokeWidth&&(d=mxUtils.getValue(this.style,"fillColor",null),null!=d&&(a.setStrokeColor(d),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(f,e),ka.prototype.origPaintEdgeShape.apply(this,[a,c,b])))};mxCellRenderer.registerShape("filledEdge",ka);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;
-StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,d,f,e,g,h,p,n){var u=f*(g+p+1),r=e*(g+p+1);return function(){a.begin();a.moveTo(d.x-u/2-r/2,d.y-r/2+u/2);a.lineTo(d.x+r/2-3*u/2,d.y-3*r/2-u/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,d,f,e,g,h,p,
-n){var u=f*(g+p+1),r=e*(g+p+1);return function(){a.begin();a.moveTo(d.x-u/2-r/2,d.y-r/2+u/2);a.lineTo(d.x+r/2-3*u/2,d.y-3*r/2-u/2);a.moveTo(d.x-u/2+r/2,d.y-r/2-u/2);a.lineTo(d.x-r/2-3*u/2,d.y-3*r/2+u/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,g,h,p,n){var u=d.clone(),r=Aa.apply(this,arguments),v=f*(g+2*p),k=e*(g+2*p);return function(){r.apply(this,arguments);a.begin();a.moveTo(u.x-f*p,u.y-e*p);a.lineTo(u.x-2*v+f*p,u.y-2*k+e*p);a.moveTo(u.x-
-v-k+e*p,u.y-k+v-f*p);a.lineTo(u.x+k-v-e*p,u.y-k-v+f*p);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,g,h,p,n){c=f*p*1.118;b=e*p*1.118;f*=g+p;e*=g+p;var u=d.clone();u.x-=c;u.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(u.x,u.y);h?a.lineTo(u.x-f-e/2,u.y-e+f/2):a.lineTo(u.x+e/2-f,u.y-e-f/2);a.lineTo(u.x-f,u.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,d,f,e,g,h,p,n,u){e*=h+n;g*=h+n;var r=
-f.clone();return function(){c.begin();c.moveTo(r.x,r.y);p?c.lineTo(r.x-e-g/a,r.y-g+e/a):c.lineTo(r.x+g/a-e,r.y-g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ca=function(a,c,b){return ra(a,["width"],c,function(c,d,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+d*c/4+f*g/2,e.y+f*c/4-d*g/2)},function(c,d,f,e,g,h){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ra=function(a,c,b,d,f){return N(a,c,
-function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var g=a.view.scale,h=b?f[0]:f[e],f=b?f[1]:f[e-1],e=f.x-h.x,p=f.y-h.y,n=Math.sqrt(e*e+p*p),h=d.call(this,n,e/n,p/n,h,f);return new mxPoint(h.x/g-c.x,h.y/g-c.y)},function(c,d,e){var g=a.absolutePoints,h=g.length-1;c=a.view.translate;var p=a.view.scale,n=b?g[0]:g[h],g=b?g[1]:g[h-1],h=g.x-n.x,u=g.y-n.y,r=Math.sqrt(h*h+u*u);d.x=(d.x+c.x)*p;d.y=(d.y+c.y)*p;f.call(this,r,h/r,u/r,n,g,d,e)})},ha=function(a){return function(c){return[N(c,["arrowWidth",
+StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,d,f,e,h,g,m,n){var u=f*(h+m+1),t=e*(h+m+1);return function(){a.begin();a.moveTo(d.x-u/2-t/2,d.y-t/2+u/2);a.lineTo(d.x+t/2-3*u/2,d.y-3*t/2-u/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,d,f,e,h,g,m,
+n){var u=f*(h+m+1),t=e*(h+m+1);return function(){a.begin();a.moveTo(d.x-u/2-t/2,d.y-t/2+u/2);a.lineTo(d.x+t/2-3*u/2,d.y-3*t/2-u/2);a.moveTo(d.x-u/2+t/2,d.y-t/2-u/2);a.lineTo(d.x-t/2-3*u/2,d.y-3*t/2+u/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,h,g,m,n){var u=d.clone(),t=Aa.apply(this,arguments),v=f*(h+2*m),k=e*(h+2*m);return function(){t.apply(this,arguments);a.begin();a.moveTo(u.x-f*m,u.y-e*m);a.lineTo(u.x-2*v+f*m,u.y-2*k+e*m);a.moveTo(u.x-
+v-k+e*m,u.y-k+v-f*m);a.lineTo(u.x+k-v-e*m,u.y-k-v+f*m);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,h,g,m,n){c=f*m*1.118;b=e*m*1.118;f*=h+m;e*=h+m;var u=d.clone();u.x-=c;u.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(u.x,u.y);g?a.lineTo(u.x-f-e/2,u.y-e+f/2):a.lineTo(u.x+e/2-f,u.y-e-f/2);a.lineTo(u.x-f,u.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,d,f,e,h,g,m,n,u){e*=g+n;h*=g+n;var t=
+f.clone();return function(){c.begin();c.moveTo(t.x,t.y);m?c.lineTo(t.x-e-h/a,t.y-h+e/a):c.lineTo(t.x+h/a-e,t.y-h-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ca=function(a,c,b){return ra(a,["width"],c,function(c,d,f,e,h){h=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+d*c/4+f*h/2,e.y+f*c/4-d*h/2)},function(c,d,f,e,h,g){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ra=function(a,c,b,d,f){return N(a,c,
+function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var h=a.view.scale,g=b?f[0]:f[e],f=b?f[1]:f[e-1],e=f.x-g.x,m=f.y-g.y,n=Math.sqrt(e*e+m*m),g=d.call(this,n,e/n,m/n,g,f);return new mxPoint(g.x/h-c.x,g.y/h-c.y)},function(c,d,e){var h=a.absolutePoints,g=h.length-1;c=a.view.translate;var m=a.view.scale,n=b?h[0]:h[g],h=b?h[1]:h[g-1],g=h.x-n.x,u=h.y-n.y,t=Math.sqrt(g*g+u*u);d.x=(d.x+c.x)*m;d.y=(d.y+c.y)*m;f.call(this,t,g/t,u/t,n,h,d,e)})},ha=function(a){return function(c){return[N(c,["arrowWidth",
"arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",U.prototype.arrowWidth))),d=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",U.prototype.arrowSize)));return new mxPoint(c.x+(1-d)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(c.y+c.height/2-b.y)/c.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(c.x+c.width-b.x)/c.width))})]}},ya=function(a,c,b){return function(d){var f=
-[N(d,["size"],function(b){var d=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a;return new mxPoint(b.x+d,b.y+d)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&f.push(ea(d));return f}},ua=function(a,c,b,d,f){b=null!=b?b:1;return function(e){var g=[N(e,["size"],function(c){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,
-"fixedSize","0"):null,d=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(c.x+Math.max(0,Math.min(c.width,d*(b?1:c.width))),c.getCenterY())},function(a,c,d){var g=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));g&&!mxEvent.isAltDown(d.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,d)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(ea(e));return g}},Da=function(a){return function(c){var b=
-[N(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",g.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ea(c));return b}},sa=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c}},ea=function(a,c){return N(a,
+[N(d,["size"],function(b){var d=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a;return new mxPoint(b.x+d,b.y+d)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&f.push(ea(d));return f}},ua=function(a,c,b,d,f){b=null!=b?b:1;return function(e){var h=[N(e,["size"],function(c){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,
+"fixedSize","0"):null,d=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(c.x+Math.max(0,Math.min(c.width,d*(b?1:c.width))),c.getCenterY())},function(a,c,d){var h=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=h?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));h&&!mxEvent.isAltDown(d.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,d)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&h.push(ea(e));return h}},Da=function(a){return function(c){var b=
+[N(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",h.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ea(c));return b}},sa=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c}},ea=function(a,c){return N(a,
[mxConstants.STYLE_ARCSIZE],function(b){var d=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,f),b.y+d)}f=Math.max(0,parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*
-f),b.y+d)},function(c,b,d){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},N=function(a,c,b,d,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};
-g.getPosition=b;g.setPosition=d;g.ignoreGrid=null!=f?f:!0;if(e){var h=g.positionChanged;g.positionChanged=function(){h.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},za={link:function(a){return[Ca(a,!0,10),Ca(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ra(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,
-b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,h,p){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;
-a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(p.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-
-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,h,p){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,
-Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(p.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=
+f),b.y+d)},function(c,b,d){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},N=function(a,c,b,d,f,e){var h=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);h.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};
+h.getPosition=b;h.setPosition=d;h.ignoreGrid=null!=f?f:!0;if(e){var g=h.positionChanged;h.positionChanged=function(){g.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return h},za={link:function(a){return[Ca(a,!0,10),Ca(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ra(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,
+b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,h,g,m){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;
+a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(m.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-
+a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,h,g,m){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,
+Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(m.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=
a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ra(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,
-e,g,h,p){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(p.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<
-c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,h,p){b=
-Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(p.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-
+e,h,g,m){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(m.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<
+c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,h,g,m){b=
+Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(m.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-
parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)-parseFloat(a.style.startWidth))<c&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var c=[N(a,[mxConstants.STYLE_STARTSIZE],function(c){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(c.getCenterX(),
c.y+Math.max(0,Math.min(c.height,b))):new mxPoint(c.x+Math.max(0,Math.min(c.width,b)),c.getCenterY())},function(c,b){a.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(c.height,b.y-c.y))):Math.round(Math.max(0,Math.min(c.width,b.x-c.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));c.push(ea(a,b/2))}return c},
-label:sa(),ext:sa(),rectangle:sa(),triangle:sa(),rhombus:sa(),umlLifeline:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",H.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[N(a,["width","height"],function(a){var c=Math.max(J.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,
-"width",J.prototype.width))),b=Math.max(1.5*J.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",J.prototype.height)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(J.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*J.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[N(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,
+label:sa(),ext:sa(),rectangle:sa(),triangle:sa(),rhombus:sa(),umlLifeline:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[N(a,["width","height"],function(a){var c=Math.max(E.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,
+"width",E.prototype.width))),b=Math.max(1.5*E.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",E.prototype.height)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(E.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*E.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[N(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,
"size",x.prototype.size))));return new mxPoint(a.x+a.width*c,a.y+a.height/4)},function(a,c){this.state.style.size=Math.max(0,Math.min(.5,(c.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},cross:function(a){return[N(a,["size"],function(a){var c=Math.min(a.width,a.height),c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",oa.prototype.size)))*c/2;return new mxPoint(a.getCenterX()-c,a.getCenterY()-c)},function(a,c){var b=Math.min(a.width,
a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,a.getCenterY()-c.y)/b*2,Math.max(0,a.getCenterX()-c.x)/b*2)))})]},note:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=
[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",S.prototype.size)));return new mxPoint(a.x+a.width/4,a.y+3*c/4)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(c.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},dataStorage:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",O.prototype.size))));return new mxPoint(a.x+
@@ -2520,40 +2520,40 @@ Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",v.prototyp
c.x-a.x-b*a.width)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},internalStorage:function(a){var c=[N(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",D.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",D.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,
Math.min(a.height,c.y-a.y)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},corner:function(a){return[N(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",W.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",W.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,
Math.min(a.height,c.y-a.y)))})]},tee:function(a){return[N(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",X.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",X.prototype.dy)));return new mxPoint(a.x+(a.width+c)/2,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,2*Math.min(a.width/2,c.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},singleArrow:ha(1),doubleArrow:ha(.5),
-folder:function(a){return[N(a,["tabWidth","tabHeight"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",l.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",l.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",l.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,
-"tabPosition",l.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[N(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",c.prototype.size))));return new mxPoint(a.x+3*a.width/4,a.y+(1-b)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},
-tape:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",t.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",aa.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},
-function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},step:ua(r.prototype.size,!0,null,!0,r.prototype.fixedSize),hexagon:ua(y.prototype.size,!0,.5,!0),curlyBracket:ua(p.prototype.size,!1),display:ua(pa.prototype.size,!1),cube:ya(1,a.prototype.size,!1),card:ya(.5,q.prototype.size,!0),loopLimit:ya(.5,Z.prototype.size,!0),trapezoid:Da(.5),parallelogram:Da(1)};Graph.createHandle=N;Graph.handleFactory=za;mxVertexHandler.prototype.createCustomHandles=function(){if(1==
+folder:function(a){return[N(a,["tabWidth","tabHeight"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",p.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",p.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",p.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,
+"tabPosition",p.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[N(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",c.prototype.size))));return new mxPoint(a.x+3*a.width/4,a.y+(1-b)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},
+tape:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",r.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",aa.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},
+function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},step:ua(t.prototype.size,!0,null,!0,t.prototype.fixedSize),hexagon:ua(A.prototype.size,!0,.5,!0),curlyBracket:ua(m.prototype.size,!1),display:ua(pa.prototype.size,!1),cube:ya(1,a.prototype.size,!1),card:ya(.5,q.prototype.size,!0),loopLimit:ya(.5,Z.prototype.size,!0),trapezoid:Da(.5),parallelogram:Da(1)};Graph.createHandle=N;Graph.handleFactory=za;mxVertexHandler.prototype.createCustomHandles=function(){if(1==
this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=za[a];if(null!=a)return a(this.state)}return null};mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_CONNECTOR);
-a=za[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),ha=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(ha),Math.sin(ha)),ha=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(ha),Math.sin(ha));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,h=g[0],g=g[g.length-1];null!=d&&(d=e.transformControlPoint(a,
-d));null==h&&null!=c&&(h=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var p=va.x,n=va.y,u=wa.x,r=wa.y,v="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=h){a=function(a,c,b){a-=k.x;var d=c-k.y;c=(r*a-u*d)/(p*r-n*u);a=(n*a-p*d)/(n*u-p*r);v?(b&&(k=new mxPoint(k.x+p*c,k.y+n*c),f.push(k)),k=new mxPoint(k.x+u*a,k.y+r*a)):(b&&(k=new mxPoint(k.x+u*a,k.y+r*a),f.push(k)),k=new mxPoint(k.x+p*c,k.y+n*c));f.push(k)};
-var k=h;null==d&&(d=new mxPoint(h.x+(g.x-h.x)/2,h.y+(g.y-h.y)/2));a(d.x,d.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ia=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Ia.apply(this,arguments)};b.prototype.constraints=[];e.prototype.constraints=[];v.prototype.constraints=[];mxRectangleShape.prototype.constraints=
+a=za[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),ha=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(ha),Math.sin(ha)),ha=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(ha),Math.sin(ha));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var h=a.absolutePoints,g=h[0],h=h[h.length-1];null!=d&&(d=e.transformControlPoint(a,
+d));null==g&&null!=c&&(g=new mxPoint(c.getCenterX(),c.getCenterY()));null==h&&null!=b&&(h=new mxPoint(b.getCenterX(),b.getCenterY()));var m=va.x,n=va.y,u=wa.x,t=wa.y,v="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=h&&null!=g){a=function(a,c,b){a-=k.x;var d=c-k.y;c=(t*a-u*d)/(m*t-n*u);a=(n*a-m*d)/(n*u-m*t);v?(b&&(k=new mxPoint(k.x+m*c,k.y+n*c),f.push(k)),k=new mxPoint(k.x+u*a,k.y+t*a)):(b&&(k=new mxPoint(k.x+u*a,k.y+t*a),f.push(k)),k=new mxPoint(k.x+m*c,k.y+n*c));f.push(k)};
+var k=g;null==d&&(d=new mxPoint(g.x+(h.x-g.x)/2,g.y+(h.y-g.y)/2));a(d.x,d.y,!0);a(h.x,h.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ia=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Ia.apply(this,arguments)};b.prototype.constraints=[];e.prototype.constraints=[];v.prototype.constraints=[];mxRectangleShape.prototype.constraints=
[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,
1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];mxLabel.prototype.constraints=
-mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;w.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;l.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=
+mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;y.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;p.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=
mxRectangleShape.prototype.constraints;O.prototype.constraints=mxRectangleShape.prototype.constraints;ia.prototype.constraints=mxEllipse.prototype.constraints;da.prototype.constraints=mxEllipse.prototype.constraints;ma.prototype.constraints=mxEllipse.prototype.constraints;na.prototype.constraints=mxEllipse.prototype.constraints;S.prototype.constraints=mxRectangleShape.prototype.constraints;ta.prototype.constraints=mxRectangleShape.prototype.constraints;pa.prototype.constraints=mxRectangleShape.prototype.constraints;
Z.prototype.constraints=mxRectangleShape.prototype.constraints;aa.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,
.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,
1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,
.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,
-.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];m.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,
-1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];t.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,
-0),!1)];r.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,
-.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];K.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=
+.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];l.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,
+1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];r.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,
+0),!1)];t.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,
+.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=
mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,
0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(.125,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(.125,.75),!0),new mxConnectionConstraint(new mxPoint(.875,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(.875,.75),!0),new mxConnectionConstraint(new mxPoint(.375,
1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,
-.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];f.prototype.constraints=mxRectangleShape.prototype.constraints;g.prototype.constraints=mxRectangleShape.prototype.constraints;c.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,
+.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];f.prototype.constraints=mxRectangleShape.prototype.constraints;h.prototype.constraints=mxRectangleShape.prototype.constraints;c.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,
0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;X.prototype.constraints=null;W.prototype.constraints=null;Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,
.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];U.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];T.prototype.constraints=
-[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];H.prototype.constraints=null;ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
+[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];L.prototype.constraints=null;ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];V.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}
Actions.prototype.init=function(){function a(a){d.escape();var b=d.getDeletableCells(d.getSelectionCells());if(null!=b&&0<b.length){var c=d.model.getParents(b);d.removeCells(b,a);if(null!=c){a=[];for(b=0;b<c.length;b++)d.model.contains(c[b])&&(d.model.isVertex(c[b])||d.model.isEdge(c[b]))&&a.push(c[b]);d.setSelectionCells(a)}}}var b=this.editorUi,e=b.editor,d=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){window.open(b.getUrl())});
this.addAction("open...",function(){window.openNew=!0;window.openKey="open";b.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){b.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var c=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));b.showDialog((new OpenDialog(this)).container,
320,220,!0,!0,function(){window.openFile=null})}).isEnabled=k;this.addAction("save",function(){b.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=k;this.addAction("saveAs...",function(){b.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=k;this.addAction("export...",function(){b.showDialog((new ExportDialog(b)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(b);b.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...",
function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(d,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",
function(){mxClipboard.cut(d)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&mxClipboard.paste(d)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){d.getModel().beginUpdate();try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var c=0;c<b.length&&
-a;c++)a=a&&d.model.isEdge(b[c]);var f=d.view.translate,e=d.view.scale,p=f.x,n=f.y,f=null;if(1==b.length&&a){var h=d.getCellGeometry(b[0]);null!=h&&(f=h.getTerminalPoint(!0))}f=null!=f?f:d.getBoundingBoxFromGeometry(b,a);if(null!=f){var k=Math.round(d.snap(d.popupMenuHandler.triggerX/e-p)),u=Math.round(d.snap(d.popupMenuHandler.triggerY/e-n));d.cellsMoved(b,k-f.x,u-f.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");
+a;c++)a=a&&d.model.isEdge(b[c]);var f=d.view.translate,e=d.view.scale,m=f.x,n=f.y,f=null;if(1==b.length&&a){var g=d.getCellGeometry(b[0]);null!=g&&(f=g.getTerminalPoint(!0))}f=null!=f?f:d.getBoundingBoxFromGeometry(b,a);if(null!=f){var k=Math.round(d.snap(d.popupMenuHandler.triggerX/e-m)),u=Math.round(d.snap(d.popupMenuHandler.triggerY/e-n));d.cellsMoved(b,k-f.x,u-f.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");
this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){d.setSelectionCells(d.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){d.turnShapes(d.getSelectionCells())},null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices",function(){d.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){d.selectEdges()},
null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){d.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){d.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{var a=d.isCellMovable(d.getSelectionCell())?1:0;d.toggleCellStyles(mxConstants.STYLE_MOVABLE,a);d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);d.toggleCellStyles(mxConstants.STYLE_ROTATABLE,
a);d.toggleCellStyles(mxConstants.STYLE_DELETABLE,a);d.toggleCellStyles(mxConstants.STYLE_EDITABLE,a);d.toggleCellStyles("connectable",a)}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("home",function(){d.home()},null,null,"Home");this.addAction("exitGroup",function(){d.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){d.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){d.foldCells(!0)},
@@ -2561,7 +2561,7 @@ null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){d.foldCells
d.getSelectionCount()&&0==d.getModel().getChildCount(d.getSelectionCell())?d.setCellStyles("container","0"):d.setSelectionCells(d.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){d.removeCellsFromParent()});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();null!=a&&(a=new EditDataDialog(b,a),b.showDialog(a.container,
320,320,!0,!1,null,!1),a.init())},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c="";if(mxUtils.isNode(d.value)){var f=d.value.getAttribute("tooltip");null!=f&&(c=f)}c=new TextareaDialog(b,mxResources.get("editTooltip")+":",c,function(c){a.setTooltipForCell(d,c)});b.showDialog(c.container,320,200,!0,!0);c.init()}});this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());
null!=a&&window.open(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c=a.getLinkForCell(d)||"";b.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}});this.addAction("insertLink...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,e){a=mxUtils.trim(a);if(0<a.length){var c=null,f=a.substring(a.lastIndexOf("/")+
-1);if(d.isPageLink(a)){var g=a.indexOf(",");0<g&&(f=b.getPageById(a.substring(g+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}null!=e&&0<e.length&&(c=e[0].iconUrl,f=e[0].name||e[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));g=d.getFreeInsertPoint();c=new mxCell(f,new mxGeometry(g.x,g.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:
+1);if(d.isPageLink(a)){var h=a.indexOf(",");0<h&&(f=b.getPageById(a.substring(h+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}null!=e&&0<e.length&&(c=e[0].iconUrl,f=e[0].name||e[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));h=d.getFreeInsertPoint();c=new mxCell(f,new mxGeometry(h.x,h.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:
"spacing=10;"));c.vertex=!0;d.setLinkForCell(c,a);d.cellSizeUpdated(c,!0);d.getModel().beginUpdate();try{c=d.addCell(c),d.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{d.getModel().endUpdate()}d.setSelectionCell(c);d.scrollCellToVisible(d.getSelectionCell())}})}).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getParentByName(a.getSelectedElement(),"A",a.cellEditor.textarea),c="";
null!=d&&(c=d.getAttribute("href")||"");var f=a.cellEditor.saveSelection();b.showLinkDialog(c,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(f);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().getChildCount(c))d.updateGroupBounds([c],
20);else{var f=d.view.getState(c),e=d.getCellGeometry(c);d.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&d.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(c,e)):d.updateCellSize(c)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var e=
@@ -2572,13 +2572,13 @@ a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxCo
(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=
Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+
"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,
-function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.isGridEnabled()});m.setEnabled(!1);m=this.addAction("guides",function(){d.graphHandler.guidesEnabled=
-!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});m.setEnabled(!1);m=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=
-!d.foldingEnabled;d.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return d.pageVisible});m=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=
-!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionArrowsEnabled});m=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});m=this.addAction("copyConnect",
-function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});m.isEnabled=k;m=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&
-(a="_"+mxClient.language);window.open(RESOURCES_PATH+"/help"+a+".html")});var l=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){l||(b.showDialog((new AboutDialog(b)).container,320,280,!0,!0,function(){l=!1}),l=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){null!=c&&d.cellEditor.isContentEditing()?c():(d.stopEditing(!1),d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b))},null,null,f)});m("bold",mxConstants.FONT_BOLD,
-function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");m("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");m("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",
+function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var l=null,l=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.isGridEnabled()});l.setEnabled(!1);l=this.addAction("guides",function(){d.graphHandler.guidesEnabled=
+!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});l.setEnabled(!1);l=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});l=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=
+!d.foldingEnabled;d.model.execute(a)});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.foldingEnabled});l.isEnabled=k;l=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.scrollbars});l=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return d.pageVisible});l=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=
+!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionArrowsEnabled});l=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});l=this.addAction("copyConnect",
+function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});l.isEnabled=k;l=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.autosave});l.isEnabled=k;l.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&
+(a="_"+mxClient.language);window.open(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));l=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){null!=c&&d.cellEditor.isContentEditing()?c():(d.stopEditing(!1),d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b))},null,null,f)});l("bold",mxConstants.FONT_BOLD,
+function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",
function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});
this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,
null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],
@@ -2587,21 +2587,21 @@ null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DAS
"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,f);d.setCellStyles(mxConstants.STYLE_CURVED,null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",
[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();
if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&
-b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,g=c.x,c=c.y,a=d.getModel().getParent(a),p=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=p;)g+=p.x,c+=p.y,a=d.getModel().getParent(a),p=d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g));
-f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,
-f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=
-mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;d.getModel().beginUpdate();try{if(0==e.length){var p=d.getFreeInsertPoint(),g=e=[d.insertVertex(d.getDefaultParent(),
-null,"",p.x,p.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var n=d.view.getState(e[0]),r=null!=n?n.style:d.getCellStyle(e[0]);"image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&
-null!=c&&null!=b){var k=e[0],m=d.getModel().getGeometry(k);null!=m&&(m=m.clone(),m.width=c,m.height=b,d.getModel().setGeometry(k,m))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())}).isEnabled=k;m=this.addAction("layers",
+b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,h=c.x,c=c.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=m;)h+=m.x,c+=m.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);h=Math.round(d.snap(d.popupMenuHandler.triggerX/f-h));
+f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,h,f)}}});this.addAction("removeWaypoint",function(){var a=b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,
+f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=
+mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var h=null;d.getModel().beginUpdate();try{if(0==e.length){var m=d.getFreeInsertPoint(),h=e=[d.insertVertex(d.getDefaultParent(),
+null,"",m.x,m.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",h))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var n=d.view.getState(e[0]),t=null!=n?n.style:d.getCellStyle(e[0]);"image"!=t[mxConstants.STYLE_SHAPE]&&"label"!=t[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&
+null!=c&&null!=b){var k=e[0],l=d.getModel().getGeometry(k);null!=l&&(l=l.clone(),l.width=c,l.height=b,d.getModel().setGeometry(k,l))}}finally{d.getModel().endUpdate()}null!=h&&(d.setSelectionCells(h),d.scrollCellToVisible(h[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())}).isEnabled=k;l=this.addAction("layers",
mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+
-"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));m=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-
-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=
-this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
+"+Shift+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));l=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-
+260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=
+this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};
Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.data=b||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};
-DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,b,e,d){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData())};DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};
-DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};
-DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
+DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,b,e,d){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};
+DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};
+DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
DrawioFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,b){var e=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||(this.setModified(!0),this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||
this.isModified()||this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))}),mxUtils.bind(this,function(a){this.ui.getCurrentFile()==this&&this.addUnsavedStatus(a)}))):this.addUnsavedStatus())});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener);this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener);this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener);this.ui.addListener("pageFormatChanged",this.changeListener);
this.ui.addListener("pageScaleChanged",this.changeListener);this.ui.addListener("backgroundColorChanged",this.changeListener);this.ui.addListener("backgroundImageChanged",this.changeListener);this.ui.addListener("foldingEnabledChanged",this.changeListener);this.ui.addListener("mathEnabledChanged",this.changeListener);this.ui.addListener("gridEnabledChanged",this.changeListener);this.ui.addListener("guidesEnabledChanged",this.changeListener);this.ui.addListener("pageViewChanged",this.changeListener)};
@@ -2611,8 +2611,8 @@ DrawioFile.prototype.autosave=function(a,b,e,d){null==this.lastAutosave&&(this.l
mxUtils.bind(this,function(a){null!=d&&d(a)}))}else null!=e&&e(null)}),a)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};
DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,b){if(null!=a&&null!=b){var e=a.lastIndexOf("."),d=0<e?a.substring(e):"",e=b.lastIndexOf(".");return d===(0<e?b.substring(e):"")}return a==b};
DrawioFile.prototype.destroy=function(){this.clearAutosave();null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};LocalFile=function(a,b,e,d){DrawioFile.call(this,a,b);this.title=e;this.mode=d?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,b,e){this.saveAs(this.title,b,e)};LocalFile.prototype.saveAs=function(a,b,e){this.saveFile(a,!1,b,e)};
-LocalFile.prototype.saveFile=function(a,b,e,d){this.title=a;this.updateFileData();b=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
-(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):m(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
+LocalFile.prototype.saveFile=function(a,b,e,d){this.title=a;this.updateFileData();b=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),l=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
+(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){l(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):l(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,b){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
@@ -2627,7 +2627,7 @@ b.parentNode.insertBefore(c,b),Editor.prototype.fontCss=a.fontCss);if(null!=a.pl
null!=d&&0<d.length&&(b=d[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==c.nodeName){b=c.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(d=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=d&&(f=new mxCodec(d.ownerDocument),f.decode(d,this.graph.getStylesheet())));else if(d=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),
null!=d){var f=new mxCodec(d.ownerDocument);f.decode(d,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==c.getAttribute("math");b=c.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;this.graph.setShadowVisible("1"==c.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||
"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=b.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?
-"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(y){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==
+"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(A){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==
typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),d=[];if(null!=b&&0<b.length)for(var f=0;f<b.length;f++)if("mxgraph"==b[f].getAttribute("class")){d.push(b[f]);break}0<d.length&&(b=d[0].getAttribute("data-mxgraph"),null!=b?(d=JSON.parse(b),null!=d&&null!=d.xml&&(d=mxUtils.parseXml(d.xml),a=d.documentElement)):(d=d[0].getElementsByTagName("div"),0<d.length&&(b=mxUtils.getTextContent(d[0]),b=this.graph.decompress(b),0<b.length&&(d=mxUtils.parseXml(b),a=d.documentElement))))}if(null!=a&&
"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||c||(d=null,"diagram"==a.nodeName?d=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(d=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=d&&
(b=this.graph.decompress(mxUtils.getTextContent(d)),null!=b&&0<b.length&&(a=mxUtils.parseXml(b).documentElement)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);return a};var e=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;e.apply(this,arguments)};Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
@@ -2635,24 +2635,24 @@ var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphCompone
messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(c||{jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};
Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,c){this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var d=document.getElementsByTagName("script");if(null!=d&&0<d.length){var f=
document.createElement("script");f.type="text/javascript";f.src=a;d[0].parentNode.appendChild(f)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;var c=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,
-function(a,b,d,f){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
-mxSettings.save()}}if(null!=window.StyleFormatPanel){var l=Format.prototype.init;Format.prototype.init=function(){l.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?q.apply(this,arguments):this.clear()};var t=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=t.apply(this,
+function(a,b,d,f){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var l=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){l.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
+mxSettings.save()}}if(null!=window.StyleFormatPanel){var p=Format.prototype.init;Format.prototype.init=function(){p.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?q.apply(this,arguments):this.clear()};var r=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=r.apply(this,
arguments);if(mxClient.IS_SVG){var c=this.editorUi,b=c.editor.graph;a.appendChild(this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var d=new ChangePageSetup(c);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;b.model.execute(d)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}}))}return a};var c=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=c.apply(this,arguments);var b=this.editorUi;if(b.editor.graph.isEnabled()){var d=b.getCurrentFile();null!=d&&d.isAutosaveOptional()&&(d=this.createOption(mxResources.get("autosave"),function(){return b.editor.autosave},function(a){b.editor.setAutosave(a)},{install:function(a){this.listener=function(){a(b.editor.autosave)};b.editor.addListener("autosaveChanged",this.listener)},destroy:function(){b.editor.removeListener(this.listener)}}),a.appendChild(d))}return a};
StyleFormatPanel.prototype.defaultColorSchemes=[[null,{fill:"#f5f5f5",stroke:"#666666"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[null,{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},
{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){"image"!=this.format.createSelectionState().style.shape&&
-this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments)};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);
-c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return g.apply(this,arguments)};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){d.getModel().beginUpdate();try{var b=
-d.getSelectionCells();for(c=0;c<b.length;c++){for(var f=d.getModel().getStyle(b[c]),g=0;g<e.length;g++)f=mxUtils.removeStylename(f,e[g]);null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,"#ffffff"),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,"#000000"),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,
+this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments)};var h=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);
+c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return h.apply(this,arguments)};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){d.getModel().beginUpdate();try{var b=
+d.getSelectionCells();for(c=0;c<b.length;c++){for(var f=d.getModel().getStyle(b[c]),h=0;h<e.length;h++)f=mxUtils.removeStylename(f,e[h]);null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,"#ffffff"),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,"#000000"),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,
null));d.getModel().setStyle(b[c],f)}}finally{d.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";null!=a?(null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?c.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":c.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":c.style.backgroundColor=
a.fill,c.style.border="1px solid "+a.stroke):(c.style.backgroundColor="#ffffff",c.style.border="1px solid #000000");f.appendChild(c)}f.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(f),c(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var d=this.editorUi.editor.graph,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.paddingLeft="24px";f.style.paddingRight=
-"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var g=document.createElement("div");g.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
-mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var h=document.createElement("div");h.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
-1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(h));mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(h);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
+"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var h=document.createElement("div");h.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
+mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var g=document.createElement("div");g.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
+1<this.defaultColorSchemes.length&&(a.appendChild(h),a.appendChild(g));mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(h);b(g);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
(b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var d=this.editorUi.editor.graph,f=d.view.getState(d.getSelectionCell());1==d.getSelectionCount()&&null!=f&&null!=f.shape&&null!=f.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px":
(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize=
-"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var p=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}p.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
+"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var m=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}m.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,
c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}return d.apply(this,arguments)}};var n=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){n.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.highlightCell=function(a,
c,b){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),f=new mxCellHighlight(this,c,d,!1);f.highlight(a);window.setTimeout(function(){null!=f.shape&&(mxUtils.setPrefixedStyle(f.shape.node.style,"transition","all 1200ms ease-in-out"),f.shape.node.style.opacity=0);window.setTimeout(function(){f.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;
@@ -2667,86 +2667,86 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist
[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=
[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",
STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
-[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var h=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,g,p,n,k){if(null!=b&&null==mxMarker.markers[b]){var u=this.getPackageForType(b);null!=u&&mxStencilRegistry.getStencil(u)}return h.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){m.value=Math.max(1,
-Math.min(h,Math.max(parseInt(m.value),parseInt(x.value))));x.value=Math.max(1,Math.min(h,Math.min(parseInt(m.value),parseInt(x.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),g=0,h=0,p=ca.get(),n=1/c.pageScale,k=t.checked;if(k)var n=parseInt(T.value),r=parseInt(O.value),n=Math.min(p.height*r/(e.height/c.view.scale),p.width*n/(e.width/c.view.scale));else n=parseInt(q.value)/(100*c.pageScale),isNaN(n)&&(d=1/c.pageScale,q.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*
-d);p.height=Math.ceil(p.height*d);n*=d;!k&&c.pageVisible?(e=c.getPageLayout(),g-=e.x*p.width,h-=e.y*p.height):k=!0;if(null==b){b=PrintDialog.createPrintPreview(c,n,p,0,g,h,k);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var u=b.writeHead;b.writeHead=function(c){u.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var x=b.renderPage;b.renderPage=
-function(a,c,b,d,f,e){var g=x.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:g.className="geDisableMathJax";return g}}b.open(null,null,f,!0)}else{p=c.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";b.backgroundColor=p;b.autoOrigin=k;b.appendGraph(c,n,g,h,f,!0)}return b}var d=parseInt(V.value)/100;isNaN(d)&&(d=1,V.value="100 %");var d=.75*d,e=x.value,g=m.value,h=!k.checked,n=null;h&&(h=e==p&&g==p);if(!h&&null!=a.pages&&a.pages.length){var r=0,h=a.pages.length-1;k.checked||
-(r=parseInt(e)-1,h=parseInt(g)-1);for(var u=r;u<=h;u++){var v=a.pages[u],e=v==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),g=!0,r=!1,z=null,l=null;null==v.viewState&&null==v.mapping&&null==v.root&&a.updatePageRoot(v);null!=v.viewState?(g=v.viewState.pageVisible,r=v.viewState.mathEnabled,z=v.viewState.background,l=v.viewState.backgroundImage):null!=v.mapping&&null!=v.mapping.diagramMap&&(r="0"!=v.mapping.diagramMap.get("mathEnabled"),z=v.mapping.diagramMap.get("background"),
-l=v.mapping.diagramMap.get("backgroundImage"),l=null!=l&&0<l.length?JSON.parse(l):null);e.background=z;e.backgroundImage=null!=l?new mxImage(l.src,l.width,l.height):null;e.pageVisible=g;e.mathEnabled=r;var w=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?v.getName():"pagenumber"==a?u+1:w.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(v);e.model.setRoot(v.root)}n=b(e,n,u!=h);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);n.mathEnabled&&
-(h=n.wnd.document,h.writeln('<script type="text/x-mathjax-config">'),h.writeln("MathJax.Hub.Config({"),h.writeln('messageStyle: "none",'),h.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),h.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),h.writeln("TeX: {"),h.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),h.writeln("},"),h.writeln("tex2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("},"),
-h.writeln("asciimath2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("}"),h.writeln("});"),c&&(h.writeln("MathJax.Hub.Queue(function () {"),h.writeln("window.print();"),h.writeln("});")),h.writeln("\x3c/script>"),h.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));n.closeDocument();!n.mathEnabled&&c&&PrintDialog.printPreview(n)}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");
-g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var h=1,p=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio");k.setAttribute("name","pages-printdialog");n.appendChild(k);g=document.createElement("span");
-mxUtils.write(g,mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var u=k.cloneNode(!0);k.setAttribute("checked","checked");u.setAttribute("value","range");n.appendChild(u);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");n.appendChild(g);var x=document.createElement("input");x.style.cssText="margin:0 8px 0 8px;";x.setAttribute("value","1");x.setAttribute("type","number");x.setAttribute("min","1");x.style.width="50px";n.appendChild(x);g=document.createElement("span");
-mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var m=x.cloneNode(!0);n.appendChild(m);mxEvent.addListener(x,"focus",function(){u.checked=!0});mxEvent.addListener(m,"focus",function(){u.checked=!0});mxEvent.addListener(x,"change",b);mxEvent.addListener(m,"change",b);if(null!=a.pages&&(h=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){p=g+1;x.value=p;m.value=p;break}x.setAttribute("max",h);m.setAttribute("max",h);1<h&&e.appendChild(n);var v=document.createElement("div");
-v.style.marginBottom="10px";var l=document.createElement("input");l.style.marginRight="8px";l.setAttribute("value","adjust");l.setAttribute("type","radio");l.setAttribute("name","printZoom");v.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));v.appendChild(g);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";v.appendChild(q);mxEvent.addListener(q,"focus",function(){l.checked=!0});
-e.appendChild(v);var n=n.cloneNode(!1),t=l.cloneNode(!0);t.setAttribute("value","fit");l.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(t);n.appendChild(g);v=document.createElement("table");v.style.display="inline-block";var L=document.createElement("tbody"),I=document.createElement("tr"),M=I.cloneNode(!0),S=document.createElement("td"),D=S.cloneNode(!0),W=S.cloneNode(!0),Q=S.cloneNode(!0),
-X=S.cloneNode(!0),U=S.cloneNode(!0);S.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(S,mxResources.get("fitTo"));var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","1");T.setAttribute("min","1");T.setAttribute("type","number");T.style.width="40px";D.appendChild(T);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));W.appendChild(g);mxUtils.write(Q,mxResources.get("fitToBy"));var O=T.cloneNode(!0);X.appendChild(O);
-mxEvent.addListener(T,"focus",function(){t.checked=!0});mxEvent.addListener(O,"focus",function(){t.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));U.appendChild(g);I.appendChild(S);I.appendChild(D);I.appendChild(W);M.appendChild(Q);M.appendChild(X);M.appendChild(U);L.appendChild(I);L.appendChild(M);v.appendChild(L);n.appendChild(v);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom=
-"12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ca=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var V=document.createElement("input");V.style.cssText="margin:0 8px 0 8px;";V.setAttribute("value","100 %");V.style.width="60px";n.appendChild(V);
-e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&g.appendChild(n);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",g.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
-d(!1)}),v.className="geBtn",g.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});v.className="geBtn gePrimaryBtn";g.appendChild(v);a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var x=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
+[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var g=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,h,m,n,k){if(null!=b&&null==mxMarker.markers[b]){var u=this.getPackageForType(b);null!=u&&mxStencilRegistry.getStencil(u)}return g.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){x.value=Math.max(1,
+Math.min(g,Math.max(parseInt(x.value),parseInt(l.value))));l.value=Math.max(1,Math.min(g,Math.min(parseInt(x.value),parseInt(l.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),h=0,g=0,m=ca.get(),n=1/c.pageScale,k=r.checked;if(k)var n=parseInt(T.value),t=parseInt(O.value),n=Math.min(m.height*t/(e.height/c.view.scale),m.width*n/(e.width/c.view.scale));else n=parseInt(q.value)/(100*c.pageScale),isNaN(n)&&(d=1/c.pageScale,q.value="100 %");m=mxRectangle.fromRectangle(m);m.width=Math.ceil(m.width*
+d);m.height=Math.ceil(m.height*d);n*=d;!k&&c.pageVisible?(e=c.getPageLayout(),h-=e.x*m.width,g-=e.y*m.height):k=!0;if(null==b){b=PrintDialog.createPrintPreview(c,n,m,0,h,g,k);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var u=b.writeHead;b.writeHead=function(c){u.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var v=b.renderPage;b.renderPage=
+function(a,c,b,d,f,e){var h=v.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:h.className="geDisableMathJax";return h}}b.open(null,null,f,!0)}else{m=c.background;if(null==m||""==m||m==mxConstants.NONE)m="#ffffff";b.backgroundColor=m;b.autoOrigin=k;b.appendGraph(c,n,h,g,f,!0)}return b}var d=parseInt(V.value)/100;isNaN(d)&&(d=1,V.value="100 %");var d=.75*d,e=l.value,h=x.value,g=!k.checked,n=null;g&&(g=e==m&&h==m);if(!g&&null!=a.pages&&a.pages.length){var t=0,g=a.pages.length-1;k.checked||
+(t=parseInt(e)-1,g=parseInt(h)-1);for(var u=t;u<=g;u++){var v=a.pages[u],e=v==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),h=!0,t=!1,z=null,p=null;null==v.viewState&&null==v.mapping&&null==v.root&&a.updatePageRoot(v);null!=v.viewState?(h=v.viewState.pageVisible,t=v.viewState.mathEnabled,z=v.viewState.background,p=v.viewState.backgroundImage):null!=v.mapping&&null!=v.mapping.diagramMap&&(t="0"!=v.mapping.diagramMap.get("mathEnabled"),z=v.mapping.diagramMap.get("background"),
+p=v.mapping.diagramMap.get("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null);e.background=z;e.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height):null;e.pageVisible=h;e.mathEnabled=t;var A=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?v.getName():"pagenumber"==a?u+1:A.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(v);e.model.setRoot(v.root)}n=b(e,n,u!=g);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);n.mathEnabled&&
+(g=n.wnd.document,g.writeln('<script type="text/x-mathjax-config">'),g.writeln("MathJax.Hub.Config({"),g.writeln('messageStyle: "none",'),g.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),g.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),g.writeln("TeX: {"),g.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),g.writeln("},"),g.writeln("tex2jax: {"),g.writeln('\tignoreClass: "geDisableMathJax"'),g.writeln("},"),
+g.writeln("asciimath2jax: {"),g.writeln('\tignoreClass: "geDisableMathJax"'),g.writeln("}"),g.writeln("});"),c&&(g.writeln("MathJax.Hub.Queue(function () {"),g.writeln("window.print();"),g.writeln("});")),g.writeln("\x3c/script>"),g.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));n.closeDocument();!n.mathEnabled&&c&&PrintDialog.printPreview(n)}var f=a.editor.graph,e=document.createElement("div"),h=document.createElement("h3");
+h.style.width="100%";h.style.textAlign="center";h.style.marginTop="0px";mxUtils.write(h,c||mxResources.get("print"));e.appendChild(h);var g=1,m=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio");k.setAttribute("name","pages-printdialog");n.appendChild(k);h=document.createElement("span");
+mxUtils.write(h,mxResources.get("printAllPages"));n.appendChild(h);mxUtils.br(n);var u=k.cloneNode(!0);k.setAttribute("checked","checked");u.setAttribute("value","range");n.appendChild(u);h=document.createElement("span");mxUtils.write(h,mxResources.get("pages")+":");n.appendChild(h);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;";l.setAttribute("value","1");l.setAttribute("type","number");l.setAttribute("min","1");l.style.width="50px";n.appendChild(l);h=document.createElement("span");
+mxUtils.write(h,mxResources.get("to"));n.appendChild(h);var x=l.cloneNode(!0);n.appendChild(x);mxEvent.addListener(l,"focus",function(){u.checked=!0});mxEvent.addListener(x,"focus",function(){u.checked=!0});mxEvent.addListener(l,"change",b);mxEvent.addListener(x,"change",b);if(null!=a.pages&&(g=a.pages.length,null!=a.currentPage))for(h=0;h<a.pages.length;h++)if(a.currentPage==a.pages[h]){m=h+1;l.value=m;x.value=m;break}l.setAttribute("max",g);x.setAttribute("max",g);1<g&&e.appendChild(n);var v=document.createElement("div");
+v.style.marginBottom="10px";var p=document.createElement("input");p.style.marginRight="8px";p.setAttribute("value","adjust");p.setAttribute("type","radio");p.setAttribute("name","printZoom");v.appendChild(p);h=document.createElement("span");mxUtils.write(h,mxResources.get("adjustTo"));v.appendChild(h);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";v.appendChild(q);mxEvent.addListener(q,"focus",function(){p.checked=!0});
+e.appendChild(v);var n=n.cloneNode(!1),r=p.cloneNode(!0);r.setAttribute("value","fit");p.setAttribute("checked","checked");h=document.createElement("div");h.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";h.appendChild(r);n.appendChild(h);v=document.createElement("table");v.style.display="inline-block";var K=document.createElement("tbody"),J=document.createElement("tr"),M=J.cloneNode(!0),S=document.createElement("td"),D=S.cloneNode(!0),W=S.cloneNode(!0),Q=S.cloneNode(!0),
+X=S.cloneNode(!0),U=S.cloneNode(!0);S.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(S,mxResources.get("fitTo"));var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","1");T.setAttribute("min","1");T.setAttribute("type","number");T.style.width="40px";D.appendChild(T);h=document.createElement("span");mxUtils.write(h,mxResources.get("fitToSheetsAcross"));W.appendChild(h);mxUtils.write(Q,mxResources.get("fitToBy"));var O=T.cloneNode(!0);X.appendChild(O);
+mxEvent.addListener(T,"focus",function(){r.checked=!0});mxEvent.addListener(O,"focus",function(){r.checked=!0});h=document.createElement("span");mxUtils.write(h,mxResources.get("fitToSheetsDown"));U.appendChild(h);J.appendChild(S);J.appendChild(D);J.appendChild(W);M.appendChild(Q);M.appendChild(X);M.appendChild(U);K.appendChild(J);K.appendChild(M);v.appendChild(K);n.appendChild(v);e.appendChild(n);n=document.createElement("div");h=document.createElement("div");h.style.fontWeight="bold";h.style.marginBottom=
+"12px";mxUtils.write(h,mxResources.get("paperSize"));n.appendChild(h);h=document.createElement("div");h.style.marginBottom="12px";var ca=PageSetupDialog.addPageFormatPanel(h,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(h);h=document.createElement("span");mxUtils.write(h,mxResources.get("pageScale"));n.appendChild(h);var V=document.createElement("input");V.style.cssText="margin:0 8px 0 8px;";V.setAttribute("value","100 %");V.style.width="60px";n.appendChild(V);
+e.appendChild(n);h=document.createElement("div");h.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&h.appendChild(n);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",h.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
+d(!1)}),v.className="geBtn",h.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});v.className="geBtn gePrimaryBtn";h.appendChild(v);a.editor.cancelFirst||h.appendChild(n);e.appendChild(h);this.container=e};var x=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(x.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=
this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=
-!(!a.getContext||!a.getContext("2d"))}catch(n){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}try{b=
+!(!a.getContext||!a.getContext("2d"))}catch(n){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(g){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}try{b=
document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(n){}})();EditorUi.prototype.openLink=function(a){return window.open(a)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};
EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||
-!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color=
-"white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight="10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),g.innerHTML=e+"...",d.appendChild(g),c.status=g,mxClient.IS_VML&&
-(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};
-return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=
-mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(p){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>d&&(b=c.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var n=
-mxUtils.parseXml(c),h=this.editor.extractGraphModel(n.documentElement,null!=this.pages),b=null!=h?mxUtils.getXml(h):""}catch(x){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,
-!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=
+!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var h=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(h=document.createElement("div"),h.style.position="absolute",h.style.whiteSpace="nowrap",h.style.background="#4B4243",h.style.color=
+"white",h.style.fontFamily="Helvetica, Arial",h.style.fontSize="9pt",h.style.padding="6px",h.style.paddingLeft="10px",h.style.paddingRight="10px",h.style.zIndex=2E9,h.style.left=Math.max(0,a)+"px",h.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(h.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(h.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(h.style,"boxShadow","2px 2px 3px 0px #ddd"),h.innerHTML=e+"...",d.appendChild(h),c.status=h,mxClient.IS_VML&&
+(null==document.documentMode||8>=document.documentMode)&&(h.style.left=Math.round(Math.max(0,a-h.offsetWidth/2))+"px",h.style.top=Math.round(Math.max(0,b+70-h.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),h=!0);return h};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};
+return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var h=c(a,4);if(null!=b&&b(e-8,h,d))break;value=c(a,d);c(a,4);if("IEND"==h)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=
+mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(m){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>d&&(b=c.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var n=
+mxUtils.parseXml(c),g=this.editor.extractGraphModel(n.documentElement,null!=this.pages),b=null!=g?mxUtils.getXml(g):""}catch(x){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,
+!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var g=this.updatePageRoot(new DiagramPage(d[e]));null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,g,0==e?g:null,0))}}else"0"!=
urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};
-EditorUi.prototype.createFileData=function(a,b,d,e,n,h,k,u,m,r){b=null!=b?b:this.editor.graph;n=null!=n?n:!1;m=null!=m?m:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var p=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(p);if(b.decompress(g)!=p)return p;p=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(p,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(p)}r?
-(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.setAttribute("userAgent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!h&&!n&&(k||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(h||!n&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==
-d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,u,m,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=
-0;f<this.pages.length;f++){var e=this.pages[f].mapping;this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,n,h,k,u){n=null!=n?n:!0;k=null!=k?k:this.getXmlFileData(n,null!=
-h?h:!1);h=this.editor.graph;var c=this.getCurrentFile();if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=c&&/(\.svg)$/i.test(c.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var f=h.getGlobalVariable,g=this.pages[0];h.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(g.root)}a=this.createFileData(k,h,c,window.location.href,a,b,d,e,n,u);h!=this.editor.graph&&h.container.parentNode.removeChild(h.container);
-return a};EditorUi.prototype.getHtml=function(a,b,d,e,n,h){h=null!=h?h:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=h?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;h=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==n&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",h);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom",
-"1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=n&&(n=n.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':
-">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+"</head>\n<body"+(null==n&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+"</div>\n</div>\n"+(null==n?'<script type="text/javascript" src="'+f+'">\x3c/script>':
-'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,n){null!=n&&(n=n.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,
-this.currentPage));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
+EditorUi.prototype.createFileData=function(a,b,d,e,n,g,k,u,l,t){b=null!=b?b:this.editor.graph;n=null!=n?n:!1;l=null!=l?l:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var h=a;if("mxfile"!=h.nodeName.toLowerCase()){var m=b.zapGremlins(mxUtils.getXml(a)),h=b.compress(m);if(b.decompress(h)!=m)return m;m=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(m,h);h=a.ownerDocument.createElement("mxfile");h.appendChild(m)}t?
+(h=h.cloneNode(!0),h.removeAttribute("userAgent"),h.removeAttribute("version"),h.removeAttribute("editor"),h.removeAttribute("type")):(h.setAttribute("userAgent",navigator.userAgent),h.setAttribute("version",EditorUi.VERSION),h.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&h.setAttribute("type",a));a=mxUtils.getXml(h);if(!g&&!n&&(k||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(h),b,null!=d?d.getTitle():null,c,f);else if(g||!n&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==
+d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,u,l,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=
+0;f<this.pages.length;f++){var e=this.pages[f].mapping;this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,n,g,k,u,l){n=null!=n?n:!0;k=null!=k?k:this.getXmlFileData(n,null!=
+g?g:!1);l=null!=l?l:this.getCurrentFile();g=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=l&&/(\.svg)$/i.test(l.getTitle()))){g=this.createTemporaryGraph(g.getStylesheet());var c=g.getGlobalVariable,f=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(f.root)}a=this.createFileData(k,g,l,window.location.href,a,b,d,e,n,u);g!=this.editor.graph&&
+g.container.parentNode.removeChild(g.container);return a};EditorUi.prototype.getHtml=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=g?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),h=b.view.scale;g=Math.floor(c.x/h-b.view.translate.x);h=Math.floor(c.y/h-b.view.translate.y);c=b.background;null==n&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",g);a.setAttribute("y0",
+h)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=n&&(n=n.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+"</head>\n<body"+(null==n&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+
+"</div>\n</div>\n"+(null==n?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,n){null!=n&&(n=n.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};
+null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==n?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;var c=null!=a&&0<a.length?
mxUtils.parseXml(a).documentElement:null;a=null!=c?this.editor.extractGraphModel(c,!0):null;null!=a&&(c=a);if(null!=c&&"mxfile"==c.nodeName&&(a=c.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<a.length||1==a.length&&a[0].hasAttribute("name"))){this.fileNode=c;this.pages=[];for(c=0;c<a.length;c++){var b=new DiagramPage(a[c]);null==b.getName()&&b.setName(mxResources.get("pageWithNumber",[c+1]));this.pages.push(b)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||
0))];c=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=c&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(c);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(){var a=this.getCurrentFile(),a=null!=a&&null!=
-a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,d,e,n,h){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(),f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,n));this.saveData(f,a,g,"text/xml")}else if("html"==
-a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,g,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var d=this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var f=this.createDownloadRequest(c,a,e,b);this.editor.graph.pageVisible=d;return f}catch(G){this.handleError(G)}}));else{var p=null,k=
-mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);var l=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(l);this.convertImages(l,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();k('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
-mxUtils.getXml(a))})))}else f=c+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();k(a)}),e)}}catch(E){this.handleError(E)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var g=
-0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){f="&from="+g;break}return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();
+a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,d,e,n,g){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(),f=c+"."+a;if("xml"==a){var h='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,n));this.saveData(f,a,h,"text/xml")}else if("html"==
+a)h=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,h,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var d=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var f=this.createDownloadRequest(c,a,e,b);this.editor.graph.pageVisible=d;return f}catch(H){this.handleError(H)}}));else{var m=null,k=
+mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(m)}))});if("svg"==a){var l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);var p=this.editor.graph.getSvg(l,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(p);this.convertImages(p,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();k('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
+mxUtils.getXml(a))})))}else f=c+".svg",m=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();k(a)}),e)}}catch(F){this.handleError(F)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var h=
+0;h<this.pages.length;h++)if(this.pages[h]==this.currentPage){f="&from="+h;break}return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);
a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>"));!this.editor.chromeless||this.editor.editable?
(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.lightbox&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));c=!0;this.isOffline()||null==a.getMode()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),
mode:a.getMode()})}catch(n){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(n){}}catch(n){null!=window.console&&console.log("error in fileLoaded:",a,n);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=n&&null!=n.message?":err:"+encodeURIComponent(n.message):"")+(null!=
-n&&null!=n.stack?"&stack="+encodeURIComponent(n.stack):"")}catch(h){}this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
-"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,n,h,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
+n&&null!=n.stack?"&stack="+encodeURIComponent(n.stack):"")}catch(g){}this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
+"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(h){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,n,g,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),
".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;
var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=
this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){if(0==c.length&&a.isEditable())null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding=
-"8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],g=e.data;if(null!=g){var g=this.convertDataUri(g),h="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(h+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(h+"image="+g,e.w,e.h,"",e.title||"",!1,!1,!0))}else null!=e.xml&&(g=this.stringToCells(this.editor.graph.decompress(e.xml)),0<g.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(g,
-e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
-mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var m=k.parentNode.previousSibling;d=m.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&m.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);
-var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");m.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("align","top");l.setAttribute("border","0");l.className="geButton";l.style.marginRight="1px";l.style.marginTop="-1px";r.appendChild(l);var w=
-null;mxEvent.addListener(l,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=w?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q=this.editor.graph,t=null,B=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),F=mxUtils.bind(this,function(c){a.setModified(!0);
-a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=l.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",r.insertBefore(t,r.firstChild),m.style.paddingRight=18*r.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),m.style.paddingRight=18*r.childNodes.length+
-"px")})):null==w&&(w=l.cloneNode(!1),w.setAttribute("src",IMAGE_PATH+"/download.png"),w.setAttribute("title",mxResources.get("save")),r.insertBefore(w,r.firstChild),mxEvent.addListener(w,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==w||a.isModified()||(m.style.paddingRight=18*r.childNodes.length+"px",w.parentNode.removeChild(w),w=null)});mxEvent.consume(c)})),m.style.paddingRight=18*r.childNodes.length+"px")}),C=
-mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);null!=h&&h.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);F(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),
-G=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x;b.y-=q.view.translate.y;C(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},
-mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&
-null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,G(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor=
-"",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
-mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,p,n,r,u,m){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,n),c)],c[0].vertex=
-!0,C(c,new mxRectangle(0,0,p,n),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var l=!1,x=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);F(a);this.spinner.stop();l=!0}catch(V){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=
-g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var h=mxUtils.getTextContent(p[g]),n=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(n);C(n,new mxRectangle(0,0,r.width,r.height),a)}l=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}l||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});!this.isOffline()&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=m?this.parseFile(m,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border=
-"3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",IMAGE_PATH+"/edit.gif");l.setAttribute("title",mxResources.get("edit"));r.insertBefore(l,r.firstChild);mxEvent.addListener(l,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});d=l.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));r.insertBefore(d,r.firstChild);mxEvent.addListener(d,"click",
-G);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:gray;text-decoration:none;",d.className="geButton",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(d,r.firstChild))}m.appendChild(r);m.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||
+"8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],h=e.data;if(null!=h){var h=this.convertDataUri(h),g="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(g+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(g+"image="+h,e.w,e.h,"",e.title||"",!1,!1,!0))}else null!=e.xml&&(h=this.stringToCells(this.editor.graph.decompress(e.xml)),0<h.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(h,
+e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var h=0;h<b.length;h++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
+mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[h]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var l=k.parentNode.previousSibling;d=l.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);
+var t=document.createElement("div");t.style.position="absolute";t.style.right="0px";t.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(t.style.backgroundColor="inherit");l.style.position="relative";var p=document.createElement("img");p.setAttribute("src",Dialog.prototype.closeImage);p.setAttribute("title",mxResources.get("close"));p.setAttribute("align","top");p.setAttribute("border","0");p.className="geButton";p.style.marginRight="1px";p.style.marginTop="-1px";t.appendChild(p);var q=
+null;mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var w=this.editor.graph,r=null,B=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),G=mxUtils.bind(this,function(c){a.setModified(!0);
+a.isAutosave()?(null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r),r=p.cloneNode(!1),r.setAttribute("src",Editor.spinImage),r.setAttribute("title",mxResources.get("saving")),r.style.cursor="default",r.style.marginRight="2px",r.style.marginTop="-2px",t.insertBefore(r,t.firstChild),l.style.paddingRight=18*t.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=r&&null!=r.parentNode&&(r.parentNode.removeChild(r),l.style.paddingRight=18*t.childNodes.length+
+"px")})):null==q&&(q=p.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title",mxResources.get("save")),t.insertBefore(q,t.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(l.style.paddingRight=18*t.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(c)})),l.style.paddingRight=18*t.childNodes.length+"px")}),C=
+mxUtils.bind(this,function(a,c,d,e){a=w.cloneCells(mxUtils.sortCells(w.model.getTopmostCells(a)));for(var h=0;h<a.length;h++){var g=w.getCellGeometry(a[h]);null!=g&&g.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);G(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),
+H=mxUtils.bind(this,function(a){if(w.isSelectionEmpty())w.getRubberband().isActive()?(w.getRubberband().execute(a),w.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=w.getSelectionCells(),b=w.view.getBounds(c),d=w.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=w.view.translate.x;b.y-=w.view.translate.y;C(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},
+mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.panningManager&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",w.panningManager.stop(),w.autoScroll=!1,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!1),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){w.isMouseDown&&
+null!=w.panningManager&&null!=w.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,w.panningManager.stop(),w.graphHandler.reset(),w.isMouseDown=!1,w.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor=
+"",w.autoScroll=!0,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!0),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
+mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,h,g,m,n,t,l,p){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=
+!0,C(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var u=!1,x=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var h=mxUtils.parseXml(c);if("mxlibrary"==h.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(h.documentElement));e(g,k);b=b.concat(g);G(a);this.spinner.stop();u=!0}catch(V){}else if("mxfile"==h.documentElement.nodeName)try{for(var m=
+h.documentElement.getElementsByTagName("diagram"),h=0;h<m.length;h++){var g=mxUtils.getTextContent(m[h]),n=this.stringToCells(this.editor.graph.decompress(g)),t=this.editor.graph.getBoundingBoxFromGeometry(n);C(n,new mxRectangle(0,0,t.width,t.height),a)}u=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});!this.isOffline()&&
+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,t)&&null!=p?this.parseFile(p,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border=
+"3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));p=p.cloneNode(!1);p.setAttribute("src",IMAGE_PATH+"/edit.gif");p.setAttribute("title",mxResources.get("edit"));t.insertBefore(p,t.firstChild);mxEvent.addListener(p,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});d=p.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));t.insertBefore(d,t.firstChild);mxEvent.addListener(d,"click",
+H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:gray;text-decoration:none;",d.className="geButton",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),t.insertBefore(d,t.firstChild))}l.appendChild(t);l.style.paddingRight=18*t.childNodes.length+"px"}};"1"==urlParams.offline||
EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));
a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet","styles/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",
Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet","styles/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",
@@ -2755,135 +2755,135 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM
"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,e,n){a=new ImageDialog(this,a,b,d,e,n);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
!0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,n){a=new LibraryDialog(this,a,b,d,e,n);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");
a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d){var c=null!=this.spinner&&null!=
-this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
+this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),h=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),h=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a=
-mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,g)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,n,h,k){a=new ErrorDialog(this,a,b,d,e,n,h,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
+mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,h)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,n,g,k){a=new ErrorDialog(this,a,b,d,e,n,g,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,n){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,n)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};
EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};
EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,n){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height=
"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof c.download;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(u){}}else this.createEchoRequest(a,
-b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var m=1024*k,l=Math.min(m+1024,d),r=Array(l-m),q=0;m<l;++q,++m)r[q]=
-c[m].charCodeAt(0);e[k]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,
-!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(w){this.handleError(w)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,h,k,null,null,4<n?3:4,a,d,e);this.showDialog(b.container,380,n==(mxClient.IS_IOS?0:1)?160:4<n?390:270,!0,!0);b.init()};
+b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var l=1024*k,p=Math.min(l+1024,d),t=Array(p-l),q=0;l<p;++q,++l)t[q]=
+c[l].charCodeAt(0);e[k]=new Uint8Array(t)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,g,k){g=null!=g?g:!1;k=null!=k?k:"vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,
+!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(y){this.handleError(y)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,null,4<n?3:4,a,d,e);this.showDialog(b.container,380,n==(mxClient.IS_IOS?0:1)?160:4<n?390:270,!0,!0);b.init()};
EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,
!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");
var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=
d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height=
"auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,
-n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,
-a,h,!0,c,d)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,c,d)}catch(A){this.handleError(A)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
-!1,!1,k,null,null,4<c?3:4,e,h,n);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,n,h){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,h,k,m,l){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;
-c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,m,null,d);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,l));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,
-this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==
-this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,h){h=null!=h?h:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");h&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,
+n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,g,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,
+a,g,!0,c,d)}catch(w){this.handleError(w)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,c,d)}catch(w){this.handleError(w)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
+!1,!1,k,null,null,4<c?3:4,e,g,n);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,n,g){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,g,k,l,p){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;
+c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,l,null,d);e&&this.editor.graph.addSvgShadow(f);var h=this.getBaseFilename()+".svg",m=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,p));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,
+this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==
+this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,m,this.thumbImageCache)):m(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,
b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));f.appendChild(d);d=document.createElement("option");
d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");f.appendChild(d);a.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"==f.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||
b.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+
Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");
f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=
-mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,n,h,k,m){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
-a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=n&&0<n.length&&f.push("edit="+encodeURIComponent(n)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),m||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?
+mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,n,g,k,l){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=n&&0<n.length&&f.push("edit="+encodeURIComponent(n)),g&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),l||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,
-b,d,e,n,h,k,m,l,r,q){this.getBasenames();var c={};""!=n&&n!=mxConstants.NONE&&(c.highlight=n);"auto"!==e&&(c.target=e);l||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];k&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);m&&d.push("layers");0<d.length&&(l&&d.push("lightbox"),c.toolbar=d.join(" "));null!=r&&0<r.length&&(c.edit=r);null!=
-a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
-'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
-p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","type-embedhtmldialog");f=p.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(p);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));g.appendChild(k);var r=this.getCurrentFile();null==d&&null!=r&&r.constructor==window.DriveFile&&(k=
-document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==d&&p.setAttribute("disabled","disabled");c.appendChild(g);var m=this.addLinkSection(c),l=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
-":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";c.appendChild(q);var t=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(c,mxResources.get("allPages"),g,!g),F=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),G=this.addEditButton(c,C),z=G.getEditInput();
-z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&C.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(p.checked?d:null,l.checked,q.value,m.getTarget(),m.getColor(),t.checked,B.checked,F.checked,C.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
-EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,k,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
-p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");
-n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
-this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,l=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",c.appendChild(m),mxUtils.write(c,mxResources.get("height")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.width="50px",
-l.style.marginLeft="6px",l.style.marginBottom="10px",l.value=e+"px",c.appendChild(l),mxUtils.br(c);var q=this.addLinkSection(c,h);d=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var F=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,F),G=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=G.style.marginLeft;z.style.marginBottom="16px";
-z.style.marginTop="8px";mxEvent.addListener(F,"change",function(){F.checked?(z.removeAttribute("disabled"),G.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"));G.checked&&F.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){k(q.getTarget(),q.getColor(),null==t?!0:t.checked,F.checked,C.getLink(),z.checked,null!=m?m.value:null,null!=
-l?l.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
-c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!g.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,k,h,m,l){m=null!=m?m:!0;var c=document.createElement("div");c.style.whiteSpace=
-"nowrap";var f=this.editor.graph,g="jpeg"==l?170:280,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(n);mxUtils.write(c,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value=this.lastExportZoom||"100%";c.appendChild(p);mxUtils.write(c,mxResources.get("borderWidth")+
-":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var q=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),x=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),t=document.createElement("input");t.style.marginTop="16px";t.style.marginRight=
-"8px";t.style.marginLeft="24px";t.setAttribute("disabled","disabled");t.setAttribute("type","checkbox");h&&(c.appendChild(t),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(x,"change",function(){x.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(t.setAttribute("checked","checked"),t.defaultChecked=!0);var G=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop=
-"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var H=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),m,null,null,"jpeg"!=l),J=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=l);K.style.marginLeft="24px";K.style.marginBottom="16px";J||(K.style.visibility=
-"hidden");mxEvent.addListener(H,"change",function(){H.checked&&J?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});m&&J||K.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=p.value;k(p.value,q.checked,!x.checked,G.checked,H.checked,z.checked,u.value,t.checked,!K.checked)}),null,d,e);this.showDialog(a.container,320,g,!0,!0);p.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var p=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,
-!e),m=this.addCheckbox(c,d),l=this.addCheckbox(c,mxResources.get("lightbox"),!0),q=this.addEditButton(c,l),t=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(c,mxResources.get("layers"),B,!B);F.style.marginLeft=t.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(l,"change",function(){l.checked?(B&&F.removeAttribute("disabled"),t.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));
-t.checked&&l.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(p.checked,n.checked,m.checked,l.checked,q.getLink(),F.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,k,h,m,l){function c(c){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var p="";d&&(p=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');m('<img src="'+c+'"'+p+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}),
-null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?c("data:image/png;base64,"+p.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,d,e,k,h,m){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",l="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");a&&(l+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=l?' style="'+l+'"':"")+n+"/>")}))}else l="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}}})(this);"),l+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),l+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=l&&c.setAttribute("style",l),m(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+
+b,d,e,n,g,k,l,p,t,q){this.getBasenames();var c={};""!=n&&n!=mxConstants.NONE&&(c.highlight=n);"auto"!==e&&(c.target=e);p||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];k&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);l&&d.push("layers");0<d.length&&(p&&d.push("lightbox"),c.toolbar=d.join(" "));null!=t&&0<t.length&&(c.edit=t);null!=
+a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
+m.setAttribute("value","url");m.setAttribute("type","radio");m.setAttribute("name","type-embedhtmldialog");f=m.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(k);mxUtils.br(h);h.appendChild(m);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));h.appendChild(k);var l=this.getCurrentFile();null==d&&null!=l&&l.constructor==window.DriveFile&&(k=
+document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),h.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));f.setAttribute("checked","checked");null==d&&m.setAttribute("disabled","disabled");c.appendChild(h);var p=this.addLinkSection(c),q=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
+":");var w=document.createElement("input");w.setAttribute("type","text");w.style.marginRight="16px";w.style.width="60px";w.style.marginLeft="4px";w.style.marginRight="12px";w.value="100%";c.appendChild(w);var r=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(c,mxResources.get("allPages"),h,!h),G=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,C),z=H.getEditInput();
+z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&C.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(m.checked?d:null,q.checked,w.value,p.getTarget(),p.getColor(),r.checked,B.checked,G.checked,C.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
+EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,k,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
+m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));m.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";m.appendChild(n);c.appendChild(m);n=document.createElement("a");
+n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));m.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
+this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,p=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",c.appendChild(l),mxUtils.write(c,mxResources.get("height")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.width="50px",
+p.style.marginLeft="6px",p.style.marginBottom="10px",p.value=e+"px",c.appendChild(p),mxUtils.br(c);var q=this.addLinkSection(c,g);d=null!=this.pages&&1<this.pages.length;var r=null;if(null==h||h.constructor!=window.DriveFile||b)r=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var G=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,G),H=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=H.style.marginLeft;z.style.marginBottom="16px";
+z.style.marginTop="8px";mxEvent.addListener(G,"change",function(){G.checked?(z.removeAttribute("disabled"),H.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&G.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){k(q.getTarget(),q.getColor(),null==r?!0:r.checked,G.checked,C.getLink(),z.checked,null!=l?l.value:null,null!=
+p?p.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=l?(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
+c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,k,g,l,p){l=null!=l?l:!0;var c=document.createElement("div");c.style.whiteSpace=
+"nowrap";var f=this.editor.graph,h="jpeg"==p?170:280,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(n);mxUtils.write(c,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";c.appendChild(m);mxUtils.write(c,mxResources.get("borderWidth")+
+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var q=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=p),x=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),r=document.createElement("input");r.style.marginTop="16px";r.style.marginRight=
+"8px";r.style.marginLeft="24px";r.setAttribute("disabled","disabled");r.setAttribute("type","checkbox");g&&(c.appendChild(r),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(x,"change",function(){x.checked?r.removeAttribute("disabled"):r.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(r.setAttribute("checked","checked"),r.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop=
+"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),h+=26);var L=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=p),E=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(c,E?mxResources.get("allPages"):"",E,!E,null,"jpeg"!=p);I.style.marginLeft="24px";I.style.marginBottom="16px";E||(I.style.visibility=
+"hidden");mxEvent.addListener(L,"change",function(){L.checked&&E?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});l&&E||I.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;k(m.value,q.checked,!x.checked,H.checked,L.checked,z.checked,u.value,r.checked,!I.checked)}),null,d,e);this.showDialog(a.container,320,h,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var m=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,
+!e),l=this.addCheckbox(c,d),p=this.addCheckbox(c,mxResources.get("lightbox"),!0),q=this.addEditButton(c,p),r=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),G=this.addCheckbox(c,mxResources.get("layers"),B,!B);G.style.marginLeft=r.style.marginLeft;G.style.marginBottom="12px";G.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(B&&G.removeAttribute("disabled"),r.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),r.setAttribute("disabled","disabled"));
+r.checked&&p.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(m.checked,n.checked,l.checked,p.checked,q.getLink(),G.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,k,g,l,p){function c(c){var b=" ",h="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(k?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",h+="cursor:pointer;");a&&(h+="max-width:100%;");var m="";d&&(m=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');l('<img src="'+c+'"'+m+(""!=h?' style="'+h+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){p({message:mxResources.get("unknownError")})}),
+null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var h="";d&&(h="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+h+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?c("data:image/png;base64,"+m.getText()):p({message:mxResources.get("unknownError")})}))}else p({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,d,e,k,g,l){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var h=0;h<f.length;h++){var m=f[h].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==f[h].getAttribute("target")&&f[h].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",p="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(k?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){l('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=p?' style="'+p+'"':"")+n+"/>")}))}else p="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(k?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),p+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),p+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=p&&c.setAttribute("style",p),l(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+
" "+mxResources.get("months");c=Math.floor(a/86400);if(1<c)return c+" "+mxResources.get("days");c=Math.floor(a/3600);if(1<c)return c+" "+mxResources.get("hours");c=Math.floor(a/60);return 1<c?c+" "+mxResources.get("minutes"):1==c?c+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0<
-d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(h){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph,
-e=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),e=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),f=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);
-c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==e&&(e=this.getFileData(!0));var f=d.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(r){null!=b&&b(r)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg=
-function(a,b,d,e,k,h,l){l=b.background;l==mxConstants.NONE&&(l=null);b=b.getSvg(l,null,null,null,null,h);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=k)this.convertImages(b,mxUtils.bind(this,function(a){k((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
-mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,k,h,l,m,q){q=null!=q?q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,k?this.getFileData(!0,null,null,null,d,m):null,q)}catch(w){"Invalid image"==w.message?this.downloadFile(q):this.handleError(w)}}),null,
-this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,h,l)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var h=
-b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,h))]);f.push('"'+b[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var l=b[k].indexOf(")"),m=null,r=b[k].indexOf("format(",l);0<r&&(m=c(b[k].substring(r+7,b[k].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))c=
-"application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;h()}),mxUtils.bind(this,
-function(a){d--;h()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[k].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,h,m,l,q,r,t,w,A,E){h=null!=h?h:!0;w=null!=w?w:this.editor.graph;A=null!=A?A:0;var c=q?null:w.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==q&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(w.getSvg(c,null,null,E,null,null!=m?m:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this,
-function(){try{var f=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=h?Math.min(1,Math.min(3*b/(4*n),b/g)):b/g);g=Math.ceil(l*g)+2*A;n=Math.ceil(l*n)+2*A;f.setAttribute("width",g);f.setAttribute("height",n);var p=f.getContext("2d");null!=c&&(p.beginPath(),p.rect(0,0,g,n),p.fillStyle=c,p.fill());p.scale(l,l);p.drawImage(e,A/l,A/l);a(f)}catch(Y){null!=k&&k(Y)}});e.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(d);
-var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(w,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(z){null!=k&&k(z)}}),d,t)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
-a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var h=a.getElementsByTagName(d),k=0;k<h.length;k++)mxUtils.bind(this,function(d){var h=
-e.convert(d.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var k=f[h];null==k?(c++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,k)}})(h[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,k,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
-a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}h=null!=h?h:"data:image/png;base64,";e=h+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,
+d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(g){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph,
+e=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),e=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),f=c.getGlobalVariable,h=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?h.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);
+c.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==e&&(e=this.getFileData(!0));var f=d.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(t){null!=b&&b(t)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg=
+function(a,b,d,e,k,g,l){l=b.background;l==mxConstants.NONE&&(l=null);b=b.getSvg(l,null,null,null,null,g);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=k)this.convertImages(b,mxUtils.bind(this,function(a){k((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
+mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,k,g,l,p,q){q=null!=q?q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,k?this.getFileData(!0,null,null,null,d,p):null,q)}catch(y){"Invalid image"==y.message?this.downloadFile(q):this.handleError(y)}}),null,
+this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,g,l)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},g=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],h=1;h<b.length;h++){var g=
+b[h].indexOf(")");f.push('url("');f.push(e[c(b[h].substring(0,g))]);f.push('"'+b[h].substring(g))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var l=b[k].indexOf(")"),p=null,t=b[k].indexOf("format(",l);0<t&&(p=c(b[k].substring(t+7,b[k].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==p||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))c=
+"application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;g()}),mxUtils.bind(this,
+function(a){d--;g()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[k].substring(0,l)),p)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,g,l,p,q,t,r,y,w,F){g=null!=g?g:!0;y=null!=y?y:this.editor.graph;w=null!=w?w:0;var c=q?null:y.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==q&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(y.getSvg(c,null,null,F,null,null!=l?l:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this,
+function(){try{var f=document.createElement("canvas"),h=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=g?Math.min(1,Math.min(3*b/(4*n),b/h)):b/h);h=Math.ceil(p*h)+2*w;n=Math.ceil(p*n)+2*w;f.setAttribute("width",h);f.setAttribute("height",n);var m=f.getContext("2d");null!=c&&(m.beginPath(),m.rect(0,0,h,n),m.fillStyle=c,m.fill());m.scale(p,p);m.drawImage(e,w/p,w/p);a(f)}catch(Y){null!=k&&k(Y)}});e.onerror=function(a){null!=k&&k(a)};try{t&&this.editor.graph.addSvgShadow(d);
+var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(y,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(z){null!=k&&k(z)}}),d,r)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
+a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,h){for(var g=a.getElementsByTagName(d),k=0;k<g.length;k++)mxUtils.bind(this,function(d){var g=
+e.convert(d.getAttribute(h));if(null!=g&&"data:"!=g.substring(0,5)){var k=f[g];null==k?(c++,this.convertImageToDataUri(g,function(e){null!=e&&(f[g]=e,d.setAttribute(h,e));c--;0==c&&b(a)})):d.setAttribute(h,k)}})(g[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,k,g){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
+a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}g=null!=g?g:"data:image/png;base64,";e=g+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,
function(){k&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(v){null!=d&&d(v)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=
-function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,k){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),n=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var p=n.getElementsByTagName("diagram");
-if(1==p.length)n=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=n&&"mxGraphModel"===n.nodeName&&(c=f.importGraphModel(n,b,d,e))}}catch(A){throw k||this.handleError(A,mxResources.get("invalidOrMissingFile")),
-A;}return c};EditorUi.prototype.importLucidChart=function(a,b,d,e,k){var c=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,k)}catch(x){this.handleError(x)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,k){k=JSON.parse(a);a=
+function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,k){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var h=mxUtils.parseXml(a),n=this.editor.extractGraphModel(h.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var m=n.getElementsByTagName("diagram");
+if(1==m.length)n=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(m[0]))).documentElement;else if(1<m.length){f.model.beginUpdate();try{for(a=0;a<m.length;a++){var l=this.updatePageRoot(new DiagramPage(m[a])),p=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[p+1]));f.model.execute(new ChangePage(this,l,l,p))}}finally{f.model.endUpdate()}}}null!=n&&"mxGraphModel"===n.nodeName&&(c=f.importGraphModel(n,b,d,e))}}catch(w){throw k||this.handleError(w,mxResources.get("invalidOrMissingFile")),
+w;}return c};EditorUi.prototype.importLucidChart=function(a,b,d,e,k){var c=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,k)}catch(x){this.handleError(x)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,k){k=JSON.parse(a);a=
[];if(null!=k.state){k=JSON.parse(k.state);for(var c in k.Pages)a.push(k.Pages[c]);a.sort(function(a,c){return a.Properties.Order<c.Properties.Order?-1:a.Properties.Order>c.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=
-function(a,b,d,e,k,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=
-this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,h,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,
-function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),g=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,
-null,"",c.snap(b),c.snap(d),g,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
-if(this.isCompatibleString(a))return this.importXml(a,b,d,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,h);else{c=this.editor.graph;k=null;c.getModel().beginUpdate();try{k=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,c.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(k.value)&&
+function(a,b,d,e,k,g,l){g=null!=g?g:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=
+this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),h=this.importXml(f,b,d,g,!0);if(0<h.length)return h}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),h=this.importXml(f,b,d,g,!0),0<h.length)return h}catch(A){}this.loadImage(a,mxUtils.bind(this,
+function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),h=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,
+null,"",c.snap(b),c.snap(d),h,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
+if(this.isCompatibleString(a))return this.importXml(a,b,d,g);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,g);else{c=this.editor.graph;k=null;c.getModel().beginUpdate();try{k=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,c.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(k.value)&&
c.setLinkForCell(k,k.value),k.geometry.width+=c.gridSize,k.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[k]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=
-function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,d,e,k,h,l,m,q,r,t){r=null!=r?r:!0;var c=!1,f=null;"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,r),q=!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
-1))),r&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,r);null!=m&&m(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(c=!0,this.parseFile(null!=
-q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,l))):b=this.importXml(a,d,e,r));null!=m&&m(b)}}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,r));c||null==m||m(f);return f};
-EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,h,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}h=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&
-240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};
-EditorUi.prototype.importFiles=function(a,b,d,e,k,h,l,m,q,r,t,w){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=t||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>p){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,e,f,g,h,k,p){return null!=a&&"<mxlibrary"==a.substring(0,
-10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,d,e,f,g,h,k,p,c,w)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,q=n,u=[],x=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(u);else{var c=[];g.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{g.getModel().endUpdate()}}h(c)}}),
-v=0;v<n;v++)mxUtils.bind(this,function(c){var h=a[c],n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var n=a.target.result,m=n.indexOf(","),q=decodeURIComponent(escape(atob(n.substring(m+1)))),z=mxUtils.parseXml(q),q=z.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=w?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));
-null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?x(c,mxUtils.bind(this,function(){try{if(n.substring(0,m+1),null!=z){var a=z.getElementsByTagName("svg");if(0<a.length){var f=a[0],l=parseFloat(f.getAttribute("width")),r=parseFloat(f.getAttribute("height")),q=f.getAttribute("viewBox");if(null==q||0==q.length)f.setAttribute("viewBox","0 0 "+l+" "+r);else if(isNaN(l)||isNaN(r)){var u=q.split(" ");3<u.length&&(l=parseFloat(u[2]),
-r=parseFloat(u[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var t=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,r)),x=k(n,h.type,b+c*p,d+c*p,Math.max(1,Math.round(l*t)),Math.max(1,Math.round(r*t)),h.name);if(isNaN(l)||isNaN(r)){var H=new Image;H.onload=mxUtils.bind(this,function(){l=Math.max(1,H.width);r=Math.max(1,H.height);x[0].geometry.width=l;x[0].geometry.height=r;f.setAttribute("viewBox","0 0 "+l+" "+r);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,
-a)+n.substring(n.indexOf(",",a+1)));g.setCellStyles("image",n,[x[0]])});H.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(ba){}return null})):x(c,mxUtils.bind(this,function(){return k(u,"text/xml",b+c*p,d+c*p,0,0,h.name)}))}}else{q=!1;if("image/png"==h.type){var H=w?null:this.extractGraphModelFromPng(a.target.result);if(null!=H&&0<H.length){var v=new Image;v.src=a.target.result;x(c,mxUtils.bind(this,function(){return k(H,"text/xml",b+c*p,d+c*p,v.width,v.height,h.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?
-(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,n,l){x(c,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var m=f&&this.isResampleImage(a.target.result,t)?Math.min(1,
-Math.min(e/n,e/l)):1;return k(g,h.type,b+c*p,d+c*p,Math.round(n*m),Math.round(l*m),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,t)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+c*p,d+c*p,240,160,h.name,function(a){x(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(h.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(h,
-mxUtils.bind(this,function(a){x(c,mxUtils.bind(this,function(){var b=h.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(h,mxUtils.bind(this,function(a){x(c,mxUtils.bind(this,function(){return this.importXml(a,b+c*p,d+c*p)}))})):k(null,h.type,b+c*p,d+c*p,240,160,h.name,function(a){x(c,function(){return a})},h):"image"==h.type.substring(0,5)?n.readAsDataURL(h):
-n.readAsText(h)})(v)});g?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},
+function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,d,e,k,g,l,p,q,t,r){t=null!=t?t:!0;var c=!1,f=null;"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=r?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,t),q=!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
+1))),t&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,k,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,t);null!=p&&p(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(c=!0,this.parseFile(null!=
+q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,l))):b=this.importXml(a,d,e,t));null!=p&&p(b)}}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,t));c||null==p||p(f);return f};
+EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&
+240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};
+EditorUi.prototype.importFiles=function(a,b,d,e,k,g,l,p,q,t,r,y){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,h=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var m=r||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>m){h=!0;break}var u=mxUtils.bind(this,function(){var h=this.editor.graph,m=h.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,e,f,h,g,k,m){return null!=a&&"<mxlibrary"==a.substring(0,
+10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,d,e,f,h,g,k,m,c,y)});g=null!=g?g:mxUtils.bind(this,function(a){h.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,q=n,u=[],v=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=p)p(u);else{var c=[];h.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{h.getModel().endUpdate()}}g(c)}}),
+x=0;x<n;x++)mxUtils.bind(this,function(c){var g=a[c],n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==l||l(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,p=n.indexOf(","),q=decodeURIComponent(escape(atob(n.substring(p+1)))),z=mxUtils.parseXml(q),q=z.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=y?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));
+null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?v(c,mxUtils.bind(this,function(){try{if(n.substring(0,p+1),null!=z){var a=z.getElementsByTagName("svg");if(0<a.length){var f=a[0],l=parseFloat(f.getAttribute("width")),t=parseFloat(f.getAttribute("height")),q=f.getAttribute("viewBox");if(null==q||0==q.length)f.setAttribute("viewBox","0 0 "+l+" "+t);else if(isNaN(l)||isNaN(t)){var u=q.split(" ");3<u.length&&(l=parseFloat(u[2]),
+t=parseFloat(u[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var r=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,t)),v=k(n,g.type,b+c*m,d+c*m,Math.max(1,Math.round(l*r)),Math.max(1,Math.round(t*r)),g.name);if(isNaN(l)||isNaN(t)){var E=new Image;E.onload=mxUtils.bind(this,function(){l=Math.max(1,E.width);t=Math.max(1,E.height);v[0].geometry.width=l;v[0].geometry.height=t;f.setAttribute("viewBox","0 0 "+l+" "+t);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,
+a)+n.substring(n.indexOf(",",a+1)));h.setCellStyles("image",n,[v[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(f))}return v}}}catch(ba){}return null})):v(c,mxUtils.bind(this,function(){return k(u,"text/xml",b+c*m,d+c*m,0,0,g.name)}))}}else{q=!1;if("image/png"==g.type){var E=y?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var x=new Image;x.src=a.target.result;v(c,mxUtils.bind(this,function(){return k(E,"text/xml",b+c*m,d+c*m,x.width,x.height,g.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?
+(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,n,l){v(c,mxUtils.bind(this,function(){if(null!=h&&h.length<t){var p=f&&this.isResampleImage(a.target.result,r)?Math.min(1,
+Math.min(e/n,e/l)):1;return k(h,g.type,b+c*m,d+c*m,Math.round(n*p),Math.round(l*p),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,r)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,g.type,b+c*m,d+c*m,240,160,g.name,function(a){v(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(g.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(g,
+mxUtils.bind(this,function(a){v(c,mxUtils.bind(this,function(){var b=g.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(g,mxUtils.bind(this,function(a){v(c,mxUtils.bind(this,function(){return this.importXml(a,b+c*m,d+c*m)}))})):k(null,g.type,b+c*m,d+c*m,240,160,g.name,function(a){v(c,function(){return a})},g):"image"==g.type.substring(0,5)?n.readAsDataURL(g):
+n.readAsText(g)})(x)});h?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},
function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=
-function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,h){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(c/k,f/k);if(1<g){var p=Math.round(c/g),n=Math.round(f/g),l=document.createElement("canvas");l.width=p;l.height=n;l.getContext("2d").drawImage(a,0,0,p,n);var m=l.toDataURL();if(m.length<b.length){var q=
-document.createElement("canvas");q.width=p;q.height=n;var t=q.toDataURL();m!==t&&(b=m,c=p,f=n)}}}catch(F){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var d=e,k=0;8>k;k++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[e]=d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,b){var c=p;p+=b;return a.substring(c,p)}
-function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,p);do{var n=f(a);if("IDAT"==c(a,4)){k=a.substring(0,p-8);d=d+String.fromCharCode(0)+
-("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);k+=g(d.length)+b+d+g(e^4294967295);k+=a.substring(p-8,a.length);break}k+=a.substring(p-8,p-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
+function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,g){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,g))try{var h=Math.max(c/k,f/k);if(1<h){var m=Math.round(c/h),n=Math.round(f/h),l=document.createElement("canvas");l.width=m;l.height=n;l.getContext("2d").drawImage(a,0,0,m,n);var p=l.toDataURL();if(p.length<b.length){var q=
+document.createElement("canvas");q.width=m;q.height=n;var r=q.toDataURL();p!==r&&(b=p,c=m,f=n)}}}catch(G){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var d=e,k=0;8>k;k++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[e]=d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,b){var c=m;m+=b;return a.substring(c,m)}
+function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function h(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var m=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,m);do{var n=f(a);if("IDAT"==c(a,4)){k=a.substring(0,m-8);d=d+String.fromCharCode(0)+
+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);k+=h(d.length)+b+d+h(e^4294967295);k+=a.substring(m-8,a.length);break}k+=a.substring(m-8,m-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(n){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=
-function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var m=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph,e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
-b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var k=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};k.call(this,b,c,e)};m.apply(this,arguments);
-mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,
-arguments)};var l=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var g=c.indexOf(",");0<g&&(g=b.getPageById(c.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=l.call(this,c,e);f&&mxEvent.addListener(g,"click",function(b){a(c);mxEvent.consume(b)});return g};var q=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");null==f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?q.apply(this,arguments):
-(d.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var r=function(){window.setTimeout(function(){y.innerHTML="&nbsp;";y.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
+function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph,e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
+b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var k=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};k.call(this,b,c,e)};l.apply(this,arguments);
+mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var g=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:g.apply(this,
+arguments)};var p=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var h=c.indexOf(",");0<h&&(h=b.getPageById(c.substring(h+1)),e=null!=h?h.getName():mxResources.get("pageNotFound"))}h=p.call(this,c,e);f&&mxEvent.addListener(h,"click",function(b){a(c);mxEvent.consume(b)});return h};var q=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");null==f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?q.apply(this,arguments):
+(d.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var r=this.actions.get("print");r.setEnabled(!mxClient.IS_IOS||!navigator.standalone);r.visible=r.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=function(){window.setTimeout(function(){A.innerHTML="&nbsp;";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||d.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,
-d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(L){}}),
-!1);var y=document.createElement("div");y.style.position="absolute";y.style.whiteSpace="nowrap";y.style.overflow="hidden";y.style.display="block";y.contentEditable=!0;mxUtils.setOpacity(y,0);y.style.width="1px";y.style.height="1px";y.innerHTML="&nbsp;";var w=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||
-d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||w||(y.style.left=d.container.scrollLeft+10+"px",y.style.top=d.container.scrollTop+10+"px",d.container.appendChild(y),w=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){y.focus();document.execCommand("selectAll",!1,null)},0):(y.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
-function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!w||224!=b&&17!=b&&91!=b||(w=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),y.parentNode.removeChild(y))}),0)}));mxEvent.addListener(y,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(y),r())}));mxEvent.addListener(y,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(y,!0),r())}));mxEvent.addListener(y,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&
-!d.isCellLocked(d.getDefaultParent())&&(y.innerHTML="&nbsp;",y.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,y);y.innerHTML="&nbsp;"}),0))}),!0);var A=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==y?!0:A.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
+d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var h=f[index];if("file"===h.kind){if(b.isEditing())this.importFiles([h.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var g=this.editor.graph.getInsertPoint();this.importFiles([h.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(K){}}),
+!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML="&nbsp;";var y=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||
+d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||y||(A.style.left=d.container.scrollLeft+10+"px",A.style.top=d.container.scrollTop+10+"px",d.container.appendChild(A),y=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll",!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
+function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!y||224!=b&&17!=b&&91!=b||(y=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(A),t())}));mxEvent.addListener(A,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(A,!0),t())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&
+!d.isCellLocked(d.getDefaultParent())&&(A.innerHTML="&nbsp;",A.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML="&nbsp;"}),0))}),!0);var w=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:w.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),
-d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=
+d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=
Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));
-a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var E=document.createElement("div");E.style.position="absolute";E.style.top="125px";E.style.left="220px";E.style.width="30px";E.style.height="1000px";E.style.background="whiteSmoke";document.body.appendChild(E);
-var B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,E,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.test){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
-this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
-this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(d.container,
+a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){r=document.createElement("div");r.style.position="absolute";r.style.top="95px";r.style.left="250px";r.style.width="2000px";r.style.height="30px";r.style.background="whiteSmoke";document.body.appendChild(r);var F=document.createElement("div");F.style.position="absolute";F.style.top="125px";F.style.left="220px";F.style.width="30px";F.style.height="1000px";F.style.background="whiteSmoke";document.body.appendChild(F);
+var B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,F,!0);this.hRuler=new mxRuler(this.editor.graph,r,!1)}if("1"==urlParams.test){r=document.getElementById("geFooter");null!=r&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
+this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),r.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
+this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var G=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:G.apply(this,arguments)}}r=document.getElementById("geInfo");null!=r&&r.parentNode.removeChild(r);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(d.container,
"dragleave",function(a){d.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(a){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(a){null!=C&&(C.parentNode.removeChild(C),C=null);if(d.isEnabled()){var b=
-mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,g=b.y/e-c.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
-if(null!=b)d.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var p=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(k=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(k,
-f,g,!0,p,null,n))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,g,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-h+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
+mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,h=b.y/e-c.y;mxEvent.isAltDown(a)&&(h=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,h,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var g=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
+if(null!=b)d.setSelectionCells(this.importXml(b,f,h,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var m=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(k=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(k,
+f,h,!0,m,null,n))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,h,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+g+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(g,f,h,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,h,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);
mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
@@ -2895,11 +2895,11 @@ EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b
mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:
a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==
c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":
-"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+
-2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
+"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var g=document.documentElement;d=(e.clientWidth||g.clientWidth)-3;e=Math.max(e.clientHeight||0,g.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+
+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=b+"px";g.style.left=c+"px";g.style.width=Math.max(0,d-3)+"px";g.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length)if(!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml"),Graph.fileSupport&&
!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml",this.parseFile(a,mxUtils.bind(this,function(a){if(4==a.readyState)if(this.spinner.stop(),200<=a.status&&299>=a.status)if(a=a.responseText,"<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);null!=e&&".vssx"==e.toLowerCase().substring(e.length-5)&&(e=e.substring(0,
-filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
+filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),
this.openLocalFile(d,e,b)});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),
this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),
@@ -2908,41 +2908,42 @@ b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.
function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
-this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
-h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(J){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
-JSON.parse(h)}catch(H){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
-value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
-function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(H){k.postMessage(JSON.stringify({event:"draft",
-error:H.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
-return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
-null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var m=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(m);k.postMessage(JSON.stringify(b),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
-h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),u=n.getGlobalVariable,x=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?x.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(n.container);n.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,
-function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");
-if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=h.format;else if("html"==h.format)m=this.editor.getGraphXml(),p.data=this.getHtml(m,this.editor.graph),p.xml=mxUtils.getXml(m),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";
-if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
-this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
-(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
-l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(H){this.handleError(H)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var z=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
-e=z();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=z();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
-b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=
-function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
-"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
-mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
-(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,q=40,t=0,w=this.editor.graph;w.getGraphBounds();for(var A=function(){w.setSelectionCells(T);
-w.scrollCellToVisible(w.getSelectionCell())},E=w.getFreeInsertPoint(),B=E.x,F=E.y,E=F,C=null,G="auto",z=[],H=null,J=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var R=mxUtils.trim(a.substring(1,Y)),P=mxUtils.trim(a.substring(Y+1));"label"==R?C=w.sanitizeHtml(P):"style"==R?e=P:"identity"==R&&0<P.length&&"-"!=P?h=
-P:"width"==R?k=P:"height"==R?l=P:"ignore"==R?J=P.split(","):"connect"==R?z.push(JSON.parse(P)):"link"==R?H=P:"padding"==R?t=parseFloat(P):"edgespacing"==R?m=parseFloat(P):"nodespacing"==R?q=parseFloat(P):"layout"==R&&(G=P)}}}var L=this.editor.csvToArray(b[K]);a=null;if(null!=h)for(var I=0;I<L.length;I++)if(h==L[I]){a=I;break}null==C&&(C="%"+L[0]+"%");if(null!=z)for(var M=0;M<z.length;M++)null==d[z[M].to]&&(d[z[M].to]={});w.model.beginUpdate();try{for(I=K+1;I<b.length;I++){var S=this.editor.csvToArray(b[I]);
-if(S.length==L.length){var D=null,W=null!=a?S[a]:null;null!=W&&(D=w.model.getCell(W));null==D&&(D=new mxCell(C,new mxGeometry(B,E,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var Q=0;Q<S.length;Q++)w.setAttributeForCell(D,L[Q],S[Q]);w.setAttributeForCell(D,"placeholders","1");D.style=w.replacePlaceholders(D,D.style);for(M=0;M<z.length;M++)d[z[M].to][D.getAttribute(z[M].to)]=D;null!=H&&"link"!=H&&(w.setLinkForCell(D,D.getAttribute(H)),w.setAttributeForCell(D,H,null));w.fireEvent(new mxEventObject("cellsInserted",
-"cells",[D]));var X=this.editor.graph.getPreferredSizeForCell(D);D.geometry.width="auto"==k?X.width+t:parseFloat(k);D.geometry.height="auto"==l?X.height+t:parseFloat(l);E+=D.geometry.height+q;c.push(w.addCell(D))}}for(var U=c.slice(),T=c.slice(),M=0;M<z.length;M++)for(var O=z[M],I=0;I<c.length;I++){var D=c[I],ca=D.getAttribute(O.from);if(null!=ca){w.setAttributeForCell(D,O.from,null);for(var V=ca.split(","),Q=0;Q<V.length;Q++){var Z=d[O.to][V[Q]];null!=Z&&(C=O.label,null!=O.fromlabel&&(C=(D.getAttribute(O.fromlabel)||
-"")+(C||"")),null!=O.tolabel&&(C=(C||"")+(Z.getAttribute(O.tolabel)||"")),T.push(w.insertEdge(null,null,C||"",O.invert?Z:D,O.invert?D:Z,O.style||w.createCurrentEdgeStyle())),mxUtils.remove(O.invert?D:Z,U))}}}if(null!=J)for(I=0;I<c.length;I++)for(D=c[I],Q=0;Q<J.length;Q++)w.setAttributeForCell(D,mxUtils.trim(J[Q]),null);var aa=new mxParallelEdgeLayout(w);aa.spacing=m;var ia=function(){aa.execute(w.getDefaultParent());for(var a=0;a<c.length;a++){var b=w.getCellGeometry(c[a]);b.x=Math.round(w.snap(b.x));
-b.y=Math.round(w.snap(b.y));"auto"==k&&(b.width=Math.round(w.snap(b.width)));"auto"==l&&(b.height=Math.round(w.snap(b.height)))}};if("circle"==G){var da=new mxCircleLayout(w);da.resetEdges=!1;var ma=da.isVertexIgnored;da.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(w.getDefaultParent());ia()},!0,A);A=null}else if("horizontaltree"==G||"verticaltree"==G||"auto"==G&&T.length==2*c.length-1&&1==U.length){w.view.validate();
-var fa=new mxCompactTreeLayout(w,"horizontaltree"==G);fa.levelDistance=q;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(w.getDefaultParent(),0<U.length?U[0]:null)},!0,A);A=null}else if("horizontalflow"==G||"verticalflow"==G||"auto"==G&&1==U.length){w.view.validate();var ja=new mxHierarchicalLayout(w,"horizontalflow"==G?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=q;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(w.getDefaultParent(),
-T);w.moveCells(T,B,F)},!0,A);A=null}else if("organic"==G||"auto"==G&&T.length>c.length){w.view.validate();var ba=new mxFastOrganicLayout(w);ba.forceConstant=3*q;ba.resetEdges=!1;var qa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(w);aa.spacing=m;this.executeLayout(function(){ba.execute(w.getDefaultParent());ia()},!0,A);A=null}this.hideDialog()}finally{w.model.endUpdate()}null!=A&&A()}}catch(na){this.handleError(na)}};
-EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
-d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
+this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,g=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
+g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var g=f.data;if("json"==urlParams.proto){try{g=
+JSON.parse(g)}catch(E){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();var l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
+value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){l=null;l="data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):h(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(E){k.postMessage(JSON.stringify({event:"draft",
+error:E.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var l=1==g.enableRecent,p=1==g.enableSearch,l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=
+a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,p?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==g.action)this.searchReadyCallback(g.list,g.errorMsg);else if("recentDocsList"==
+g.action)this.recentReadyCallback(g.list,g.errorMsg);else{if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var m=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==g.action){if("png"==
+g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,r=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(n);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==
+a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);r(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),x=q.getGlobalVariable,z=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(q.container);
+q.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?r("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=
+g.xml&&0<g.xml.length&&this.setFileData(g.xml);m=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
+l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),
+mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=
+g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
+this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}}g=h(g);c=!0;try{a(g,f)}catch(E){this.handleError(E)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var L=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
+1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=L();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=L();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
+b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):
+urlParams.ready||"ready";k.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
+"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
+a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
+function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,k="auto",l="auto",p=40,q=40,r=0,y=this.editor.graph;y.getGraphBounds();
+for(var w=function(){y.setSelectionCells(T);y.scrollCellToVisible(y.getSelectionCell())},F=y.getFreeInsertPoint(),B=F.x,G=F.y,F=G,C=null,H="auto",z=[],L=null,E=null,I=0;I<b.length&&"#"==b[I].charAt(0);){a=b[I];for(I++;I<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[I].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[I].substring(1)),I++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var R=mxUtils.trim(a.substring(1,Y)),P=mxUtils.trim(a.substring(Y+1));"label"==R?C=y.sanitizeHtml(P):"style"==
+R?e=P:"identity"==R&&0<P.length&&"-"!=P?g=P:"width"==R?k=P:"height"==R?l=P:"ignore"==R?E=P.split(","):"connect"==R?z.push(JSON.parse(P)):"link"==R?L=P:"padding"==R?r=parseFloat(P):"edgespacing"==R?p=parseFloat(P):"nodespacing"==R?q=parseFloat(P):"layout"==R&&(H=P)}}}var K=this.editor.csvToArray(b[I]);a=null;if(null!=g)for(var J=0;J<K.length;J++)if(g==K[J]){a=J;break}null==C&&(C="%"+K[0]+"%");if(null!=z)for(var M=0;M<z.length;M++)null==d[z[M].to]&&(d[z[M].to]={});y.model.beginUpdate();try{for(J=I+
+1;J<b.length;J++){var S=this.editor.csvToArray(b[J]);if(S.length==K.length){var D=null,W=null!=a?S[a]:null;null!=W&&(D=y.model.getCell(W));null==D&&(D=new mxCell(C,new mxGeometry(B,F,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var Q=0;Q<S.length;Q++)y.setAttributeForCell(D,K[Q],S[Q]);y.setAttributeForCell(D,"placeholders","1");D.style=y.replacePlaceholders(D,D.style);for(M=0;M<z.length;M++)d[z[M].to][D.getAttribute(z[M].to)]=D;null!=L&&"link"!=L&&(y.setLinkForCell(D,D.getAttribute(L)),
+y.setAttributeForCell(D,L,null));y.fireEvent(new mxEventObject("cellsInserted","cells",[D]));var X=this.editor.graph.getPreferredSizeForCell(D);D.geometry.width="auto"==k?X.width+r:parseFloat(k);D.geometry.height="auto"==l?X.height+r:parseFloat(l);F+=D.geometry.height+q;c.push(y.addCell(D))}}for(var U=c.slice(),T=c.slice(),M=0;M<z.length;M++)for(var O=z[M],J=0;J<c.length;J++){var D=c[J],ca=D.getAttribute(O.from);if(null!=ca){y.setAttributeForCell(D,O.from,null);for(var V=ca.split(","),Q=0;Q<V.length;Q++){var Z=
+d[O.to][V[Q]];null!=Z&&(C=O.label,null!=O.fromlabel&&(C=(D.getAttribute(O.fromlabel)||"")+(C||"")),null!=O.tolabel&&(C=(C||"")+(Z.getAttribute(O.tolabel)||"")),T.push(y.insertEdge(null,null,C||"",O.invert?Z:D,O.invert?D:Z,O.style||y.createCurrentEdgeStyle())),mxUtils.remove(O.invert?D:Z,U))}}}if(null!=E)for(J=0;J<c.length;J++)for(D=c[J],Q=0;Q<E.length;Q++)y.setAttributeForCell(D,mxUtils.trim(E[Q]),null);var aa=new mxParallelEdgeLayout(y);aa.spacing=p;var ia=function(){aa.execute(y.getDefaultParent());
+for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==k&&(b.width=Math.round(y.snap(b.width)));"auto"==l&&(b.height=Math.round(y.snap(b.height)))}};if("circle"==H){var da=new mxCircleLayout(y);da.resetEdges=!1;var ma=da.isVertexIgnored;da.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ia()},!0,w);w=null}else if("horizontaltree"==H||
+"verticaltree"==H||"auto"==H&&T.length==2*c.length-1&&1==U.length){y.view.validate();var fa=new mxCompactTreeLayout(y,"horizontaltree"==H);fa.levelDistance=q;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(y.getDefaultParent(),0<U.length?U[0]:null)},!0,w);w=null}else if("horizontalflow"==H||"verticalflow"==H||"auto"==H&&1==U.length){y.view.validate();var ja=new mxHierarchicalLayout(y,"horizontalflow"==H?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=
+q;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(y.getDefaultParent(),T);y.moveCells(T,B,G)},!0,w);w=null}else if("organic"==H||"auto"==H&&T.length>c.length){y.view.validate();var ba=new mxFastOrganicLayout(y);ba.forceConstant=3*q;ba.resetEdges=!1;var qa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(y);aa.spacing=p;this.executeLayout(function(){ba.execute(y.getDefaultParent());ia()},!0,w);w=null}this.hideDialog()}finally{y.model.endUpdate()}null!=
+w&&w()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
+d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var p=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=p.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
-e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||
+a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
+e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||
c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
@@ -2953,9 +2954,9 @@ IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.
EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("rename").setEnabled(null!=d&&d.isRenamable());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());
-a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,h){var c=a.editor.graph;if("xml"==
-d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),l=Math.floor(g.width*k/c.view.scale),m=Math.floor(g.height*k/c.view.scale);f.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+
-encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+m+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
+a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var r=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);r.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,g){var c=a.editor.graph;if("xml"==
+d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,k,g)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),h=c.getGraphBounds(),l=Math.floor(h.width*k/c.view.scale),p=Math.floor(h.height*k/c.view.scale);f.length<=MAX_REQUEST_SIZE&&l*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+
+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+p+"&border="+g+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
@@ -2967,8 +2968,8 @@ EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mx
null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";d!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var e=!1,d=null,k=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=d&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.lightbox&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=
a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),d=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?e||(1!=MathJax.Hub.queue.pending||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})),MathJax.Hub.Queue(mxUtils.bind(this,function(){e=!0}))):"undefined"===typeof Editor.MathJaxClear||
this.editor.graph.mathEnabled||(e=!0,Editor.MathJaxClear())});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var d=b.getProperty("edit").changes,e=0;e<d.length;e++)if(d[e]instanceof SelectPage||d[e]instanceof RenamePage||d[e]instanceof MovePage||d[e]instanceof mxRootChange){k();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
-Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=a.getAttribute("pageScale"),d=a.getAttribute("pageWidth"),k=a.getAttribute("pageHeight"),m=a.getAttribute("background"),l=a.getAttribute("backgroundImage"),l=null!=l&&0<l.length?JSON.parse(l):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
-a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=m&&0<m.length?m:this.defaultGraphBackground,backgroundImage:null!=l?new mxImage(l.src,l.width,l.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=d&&null!=k?new mxRectangle(0,0,parseFloat(d),parseFloat(k)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
+Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=a.getAttribute("pageScale"),d=a.getAttribute("pageWidth"),k=a.getAttribute("pageHeight"),l=a.getAttribute("background"),p=a.getAttribute("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
+a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=l&&0<l.length?l:this.defaultGraphBackground,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=d&&null!=k?new mxRectangle(0,0,parseFloat(d),parseFloat(k)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}};
Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),
arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled}};
@@ -2984,11 +2985,11 @@ EditorUi.prototype.duplicatePage=function(a,b){var e=this.editor.graph,d=null;e.
EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var b=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&this.editor.graph.model.execute(new RenamePage(this,a,b))}),mxResources.get("rename"));this.showDialog(b.container,300,80,!0,!0);b.init()}return a};EditorUi.prototype.movePage=function(a,b){this.editor.graph.model.execute(new MovePage(this,a,b))};
EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#dcdcdc";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a};
EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="12px";b.style.marginLeft="30px";for(var e=this.editor.chromeless?29:59,d=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-e)/this.pages.length)+1),k=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(c,d){this.pages[c]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",d.style.fontWeight="bold",d.style.borderTopStyle="none"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=c):mxEvent.consume(b)}));mxEvent.addListener(d,
-"dragend",mxUtils.bind(this,function(a){k=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=k&&c!=k&&this.movePage(k,c);a.stopPropagation();a.preventDefault()}));b.appendChild(d)})(m,this.createTabForPage(this.pages[m],d,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);
-d=this.createPageMenuTab();this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var l=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");l.style.position="absolute";l.style.right=this.editor.chromeless?"29px":"55px";l.style.fontSize="13pt";this.tabContainer.appendChild(l);var q=this.createControlTab(4,
-"&nbsp;&#10095;");q.style.position="absolute";q.style.right=this.editor.chromeless?"0px":"29px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var t=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=t+"px";mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,t-20);mxUtils.setOpacity(l,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(l,
-0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,t-20);mxUtils.setOpacity(l,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
+e)/this.pages.length)+1),k=null,l=0;l<this.pages.length;l++)mxUtils.bind(this,function(c,d){this.pages[c]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",d.style.fontWeight="bold",d.style.borderTopStyle="none"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=c):mxEvent.consume(b)}));mxEvent.addListener(d,
+"dragend",mxUtils.bind(this,function(a){k=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=k&&c!=k&&this.movePage(k,c);a.stopPropagation();a.preventDefault()}));b.appendChild(d)})(l,this.createTabForPage(this.pages[l],d,this.pages[l]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);
+d=this.createPageMenuTab();this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var p=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");p.style.position="absolute";p.style.right=this.editor.chromeless?"29px":"55px";p.style.fontSize="13pt";this.tabContainer.appendChild(p);var q=this.createControlTab(4,
+"&nbsp;&#10095;");q.style.position="absolute";q.style.right=this.editor.chromeless?"0px":"29px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var r=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=r+"px";mxEvent.addListener(p,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,r-20);mxUtils.setOpacity(p,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(p,
+0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,r-20);mxUtils.setOpacity(p,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(a){var b=document.createElement("div");b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.whiteSpace="nowrap";b.style.boxSizing="border-box";b.style.position="relative";b.style.overflow="hidden";b.style.marginLeft="-1px";b.style.height=this.tabContainer.clientHeight+"px";b.style.padding="8px 4px 8px 4px";b.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #c0c0c0";b.style.borderBottomStyle="solid";b.style.backgroundColor=this.tabContainer.style.backgroundColor;
b.style.cursor="default";b.style.color="gray";a&&(mxEvent.addListener(b,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(b.style.backgroundColor="dark"==uiTheme?"black":"#d3d3d3",mxEvent.consume(a))})),mxEvent.addListener(b,"mouseleave",mxUtils.bind(this,function(a){b.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return b};
EditorUi.prototype.createControlTab=function(a,b){var e=this.createTab(!0);e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.style.lineHeight="30px";e.innerHTML=b;null!=e.firstChild&&null!=e.firstChild.style&&mxUtils.setOpacity(e.firstChild,40);return e};
@@ -2997,51 +2998,51 @@ function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,funct
null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var d=mxEvent.getClientX(a),k=mxEvent.getClientY(a);b.popup(d,k,null,a);this.setCurrentMenu(b);
mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a};
EditorUi.prototype.createTabForPage=function(a,b,e){e=this.createTab(e);var d=a.getName();e.setAttribute("title",d);mxUtils.write(e,d);e.style.maxWidth=b+"px";e.style.width=b+"px";this.addTabListeners(a,e);42<b&&(e.style.textOverflow="ellipsis");return e};
-EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&k||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!d){var l=new mxPopupMenu(this.createPageMenu(a));l.div.className+=" geMenubarMenu";l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);this.resetCurrentMenu();l.destroy()});var q=mxEvent.getClientX(m),t=mxEvent.getClientY(m);l.popup(q,t,null,m);this.setCurrentMenu(l,b)}mxEvent.consume(m)}}))};
+EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(l){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(l)&&k||mxEvent.isPopupTrigger(l))){e.popupMenuHandler.hideMenu();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(l)||!d){var p=new mxPopupMenu(this.createPageMenu(a));p.div.className+=" geMenubarMenu";p.smartSeparators=!0;p.showDisabled=!0;p.autoExpand=!0;p.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(p,arguments);this.resetCurrentMenu();p.destroy()});var q=mxEvent.getClientX(l),r=mxEvent.getClientY(l);p.popup(q,r,null,l);this.setCurrentMenu(p,b)}mxEvent.consume(l)}}))};
EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(e,d){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),d);e.addSeparator(d);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,e,d){d.setAttribute("page",e.page.getId());return d};a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){d.page=a.ui.getPageById(e.getAttribute("page"));d.previous=d.name;return d};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","neverShown"]);a.afterEncode=function(a,e,d){d.setAttribute("relatedPage",e.relatedPage.getId());null==e.index&&(d.setAttribute("name",e.relatedPage.getName()),null!=e.relatedPage.root&&a.encodeCell(e.relatedPage.root,d));return d};a.beforeDecode=function(a,e,d){d.ui=a.ui;d.relatedPage=d.ui.getPageById(e.getAttribute("relatedPage"));if(null==d.relatedPage){var b=document.createElement("diagram");b.setAttribute("id",e.getAttribute("relatedPage"));
-b.setAttribute("name",e.getAttribute("name"));d.relatedPage=new DiagramPage(b);e=e.cloneNode(!0);b=e.firstChild;if(null!=b)for(d.relatedPage.root=a.decodeCell(b,!1),d=b.nextSibling,b.parentNode.removeChild(b),b=d;null!=b;){d=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var m=b.getAttribute("id");null==a.lookup(m)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=d}}return e};a.afterDecode=function(a,e,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",b=Graph.prototype.foldCells;
-Graph.prototype.foldCells=function(a,d,e,q,t){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var k=this.view.getState(e[g]),l=null!=k?k.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(l,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g],
-a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=b.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return x.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=x.getParent(a),b=h.view.getState(a),h.view.getState(a),b="tree"==(null!=b?b.style:h.getCellStyle(a)).containerType);
-return b}function e(a){var b=!1;null!=a&&(a=x.getParent(a),b=h.view.getState(a),h.view.getState(a),b=null!=(null!=b?b.style:h.getCellStyle(a)).childLayout);return b}function q(a){a=h.view.getState(a);if(null!=a){var b=h.getIncomingEdges(a.cell);if(0<b.length&&(b=h.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
-a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function t(a,b){b=null!=b?b:!0;h.model.beginUpdate();try{var d=h.model.getParent(a),c=h.getIncomingEdges(a),e=h.cloneCells([c[0],a]);h.model.setTerminal(e[0],h.model.getTerminal(c[0],!0),!0);var f=q(a),g=d.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
-10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);h.view.currentRoot!=d&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=h.view.getState(a),l=h.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var n=h.getOutgoingEdges(h.model.getTerminal(c[0],
-!0));if(null!=n){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=c=0;t<n.length;t++){var r=h.model.getTerminal(n[t],!1);if(f==q(r)){var u=h.view.getState(r);r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,u)&&(c=10+Math.max(c,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/l),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/l))}}p?g=0:c=0;for(t=0;t<n.length;t++)if(r=h.model.getTerminal(n[t],
-!1),f==q(r)&&(u=h.view.getState(r),r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY()))){var z=[];h.traverse(u.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});h.moveCells(z,(b?1:-1)*c,(b?1:-1)*g)}}}return h.addCells(e,d)}finally{h.model.endUpdate()}}function c(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1);
-var e=h.model.getParent(a),f=e.geometry,g=[];h.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);h.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-40):b==mxConstants.DIRECTION_WEST?(k=-40,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);h.moveCells(g,k,l);return h.addCells(d,e)}finally{h.model.endUpdate()}}function f(a){h.model.beginUpdate();try{var b=
-h.model.getParent(a),d=h.getIncomingEdges(a),c=h.cloneCells([d[0],a]);h.model.setTerminal(c[0],a,!0);var d=h.getOutgoingEdges(a),e=b.geometry,f=[];h.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<d.length;g++){var k=h.model.getTerminal(d[g],!1);null!=k&&f.push(k)}var l=h.view.getBounds(f),m=q(a),n=h.view.translate,p=h.view.scale;m==mxConstants.DIRECTION_SOUTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/p-n.x-e.x+10,c[1].geometry.y+=a.geometry.height-
-e.y+40):m==mxConstants.DIRECTION_NORTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/p-n.x+-e.x+10,c[1].geometry.y-=c[1].geometry.height-e.y+40):(c[1].geometry.x=m==mxConstants.DIRECTION_WEST?c[1].geometry.x-(c[1].geometry.width-e.x+40):c[1].geometry.x+(a.geometry.width-e.x+40),c[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-c[1].geometry.height)/2:(l.y+l.height)/p-n.y+-e.y+10);return h.addCells(c,b)}finally{h.model.endUpdate()}}function g(a,
-b,c){a=h.getOutgoingEdges(a);c=h.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=h.view.getState(h.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function p(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
-c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():c==b?(d=h.getOutgoingEdges(a),null!=d&&0<d.length&&h.setSelectionCell(h.model.getTerminal(d[0],!1))):(c=h.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(h.model.getTerminal(c[0],!0),d,a),c=h.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&h.setSelectionCell(d[c].cell)))))}var n=this,h=n.editor.graph,x=h.getModel();mxResources.parse("selectChildren=Select Children");
-mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var u=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){u.apply(this,arguments);if(1==h.getSelectionCount()){c=h.getSelectionCell();var e=h.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(h.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(h.getSelectionCell())&&
-(a.addSeparator(),0<h.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),
-a=h.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=h.getOutgoingEdges(h.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+S");n.actions.addAction("selectParent",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getIncomingEdges(a);null!=a&&0<a.length&&h.setSelectionCell(h.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",
-function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),b=[];h.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});h.setSelectionCells(b)}},null,null,"Alt+Shift+T");var v=h.removeCells;h.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];x.isEdge(g)&&d(g)&&(e.push(g),g=x.getTerminal(g,!1));b(g)?(h.traverse(g,!0,
-function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=h.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return v.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var r=h.duplicateCells;h.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=h.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=h.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
-a)}this.model.beginUpdate();try{var k=r.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=h.getIncomingEdges(k[e]),g=h.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var m=this.cloneCells([g[0]])[0];this.addEdge(m,h.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var y=h.moveCells;h.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);
-if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||h.model.isEdge(a[q])&&null==h.model.getTerminal(a[q],!0)){f=h.model.getParent(a[q]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var t=h.getIncomingEdges(a[0]);if(0<t.length){var r=h.view.getState(h.model.getTerminal(t[0],!0));if(null!=r){var u=h.view.getState(m);null!=u&&(c=(u.getCenterX()-r.getCenterX())/h.view.scale,d=(u.getCenterY()-r.getCenterY())/h.view.scale)}}}}l=y.apply(this,arguments);
-if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],m,!0);else if(b(a[q])&&(t=h.getIncomingEdges(a[q]),0<t.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],m,!0);else if(0==h.getIncomingEdges(l[q]).length){n=m;if(null==n||n==h.model.getParent(a[q]))n=h.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e,
-h.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=n.sidebar){var w=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=w.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=h.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:n.actions.get("selectChildren"),
-84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},E=n.onKeyDown;n.onKeyDown=function(a){try{if(h.isEnabled()&&!h.isEditing()&&b(h.getSelectionCell())&&1==h.getSelectionCount()){var d=null;0<h.getIncomingEdges(h.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(h.getSelectionCell()):f(h.getSelectionCell()):13==a.which&&(d=t(h.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&h.model.isEdge(d[0])?h.setSelectionCell(h.model.getTerminal(d[0],
-!1)):h.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=A[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(h.getSelectionCell(),
-mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(h.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(K){console.log("error",K)}mxEvent.isConsumed(a)||E.apply(this,arguments)};var B=h.connectVertex;h.connectVertex=function(a,d,e,g,k,l){var m=h.getIncomingEdges(a);return b(a)&&0<m.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==k?c(a):t(a,d!=mxConstants.DIRECTION_NORTH&&
-d!=mxConstants.DIRECTION_WEST)):B.call(this,a,d,e,g,k,l)};h.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&h.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
+b.setAttribute("name",e.getAttribute("name"));d.relatedPage=new DiagramPage(b);e=e.cloneNode(!0);b=e.firstChild;if(null!=b)for(d.relatedPage.root=a.decodeCell(b,!1),d=b.nextSibling,b.parentNode.removeChild(b),b=d;null!=b;){d=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var l=b.getAttribute("id");null==a.lookup(l)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=d}}return e};a.afterDecode=function(a,e,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",b=Graph.prototype.foldCells;
+Graph.prototype.foldCells=function(a,d,e,q,r){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],h=0;h<e.length;h++){var k=this.view.getState(e[h]),l=null!=k?k.style:this.getCellStyle(e[h]);"1"==mxUtils.getValue(l,"treeFolding","0")&&(this.traverse(e[h],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[h]&&f.push(a);return a==e[h]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[h],
+a))}for(h=0;h<f.length;h++)this.model.setVisible(f[h],!a);e=c;e=b.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return x.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=x.getParent(a),b=g.view.getState(a),g.view.getState(a),b="tree"==(null!=b?b.style:g.getCellStyle(a)).containerType);
+return b}function e(a){var b=!1;null!=a&&(a=x.getParent(a),b=g.view.getState(a),g.view.getState(a),b=null!=(null!=b?b.style:g.getCellStyle(a)).childLayout);return b}function q(a){a=g.view.getState(a);if(null!=a){var b=g.getIncomingEdges(a.cell);if(0<b.length&&(b=g.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
+a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function r(a,b){b=null!=b?b:!0;g.model.beginUpdate();try{var d=g.model.getParent(a),c=g.getIncomingEdges(a),e=g.cloneCells([c[0],a]);g.model.setTerminal(e[0],g.model.getTerminal(c[0],!0),!0);var f=q(a),h=d.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
+10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);g.view.currentRoot!=d&&(e[1].geometry.x-=h.x,e[1].geometry.y-=h.y);var k=g.view.getState(a),l=g.view.scale;if(null!=k){var p=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?p.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:p.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var m=g.getOutgoingEdges(g.model.getTerminal(c[0],
+!0));if(null!=m){for(var n=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,r=h=c=0;r<m.length;r++){var t=g.model.getTerminal(m[r],!1);if(f==q(t)){var u=g.view.getState(t);t!=a&&null!=u&&(n&&b!=u.getCenterX()<k.getCenterX()||!n&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(p,u)&&(c=10+Math.max(c,(Math.min(p.x+p.width,u.x+u.width)-Math.max(p.x,u.x))/l),h=10+Math.max(h,(Math.min(p.y+p.height,u.y+u.height)-Math.max(p.y,u.y))/l))}}n?h=0:c=0;for(r=0;r<m.length;r++)if(t=g.model.getTerminal(m[r],
+!1),f==q(t)&&(u=g.view.getState(t),t!=a&&null!=u&&(n&&b!=u.getCenterX()<k.getCenterX()||!n&&b!=u.getCenterY()<k.getCenterY()))){var z=[];g.traverse(u.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});g.moveCells(z,(b?1:-1)*c,(b?1:-1)*h)}}}return g.addCells(e,d)}finally{g.model.endUpdate()}}function c(a){g.model.beginUpdate();try{var b=q(a),c=g.getIncomingEdges(a),d=g.cloneCells([c[0],a]);g.model.setTerminal(c[0],d[1],!1);g.model.setTerminal(d[0],d[1],!0);g.model.setTerminal(d[0],a,!1);
+var e=g.model.getParent(a),f=e.geometry,h=[];g.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);g.traverse(a,!0,function(a,b){null!=b&&h.push(b);h.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-40):b==mxConstants.DIRECTION_WEST?(k=-40,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);g.moveCells(h,k,l);return g.addCells(d,e)}finally{g.model.endUpdate()}}function f(a){g.model.beginUpdate();try{var b=
+g.model.getParent(a),d=g.getIncomingEdges(a),c=g.cloneCells([d[0],a]);g.model.setTerminal(c[0],a,!0);var d=g.getOutgoingEdges(a),e=b.geometry,f=[];g.view.currentRoot==b&&(e=new mxRectangle);for(var h=0;h<d.length;h++){var k=g.model.getTerminal(d[h],!1);null!=k&&f.push(k)}var l=g.view.getBounds(f),p=q(a),m=g.view.translate,n=g.view.scale;p==mxConstants.DIRECTION_SOUTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/n-m.x-e.x+10,c[1].geometry.y+=a.geometry.height-
+e.y+40):p==mxConstants.DIRECTION_NORTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/n-m.x+-e.x+10,c[1].geometry.y-=c[1].geometry.height-e.y+40):(c[1].geometry.x=p==mxConstants.DIRECTION_WEST?c[1].geometry.x-(c[1].geometry.width-e.x+40):c[1].geometry.x+(a.geometry.width-e.x+40),c[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-c[1].geometry.height)/2:(l.y+l.height)/n-m.y+-e.y+10);return g.addCells(c,b)}finally{g.model.endUpdate()}}function h(a,
+b,c){a=g.getOutgoingEdges(a);c=g.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=g.view.getState(g.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function m(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
+c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():c==b?(d=g.getOutgoingEdges(a),null!=d&&0<d.length&&g.setSelectionCell(g.model.getTerminal(d[0],!1))):(c=g.getIncomingEdges(a),null!=c&&0<c.length&&(d=h(g.model.getTerminal(c[0],!0),d,a),c=g.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&g.setSelectionCell(d[c].cell)))))}var n=this,g=n.editor.graph,x=g.getModel();mxResources.parse("selectChildren=Select Children");
+mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var u=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){u.apply(this,arguments);if(1==g.getSelectionCount()){c=g.getSelectionCell();var e=g.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(g.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(g.getSelectionCell())&&
+(a.addSeparator(),0<g.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(g.model.getTerminal(a[c],!1));g.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),
+a=g.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=g.getOutgoingEdges(g.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(g.model.getTerminal(a[c],!1));g.setSelectionCells(b)}}},null,null,"Alt+Shift+S");n.actions.addAction("selectParent",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getIncomingEdges(a);null!=a&&0<a.length&&g.setSelectionCell(g.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",
+function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),b=[];g.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});g.setSelectionCells(b)}},null,null,"Alt+Shift+T");var v=g.removeCells;g.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var h=a[f];x.isEdge(h)&&d(h)&&(e.push(h),h=x.getTerminal(h,!1));b(h)?(g.traverse(h,!0,
+function(a,b){null!=b&&e.push(b);e.push(a);return!0}),h=g.getIncomingEdges(a[f]),a=a.concat(h)):e.push(a[f])}a=e;return v.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var t=g.duplicateCells;g.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=g.view.getState(d[e]);if(null!=f&&b(f.cell))for(var h=g.getIncomingEdges(f.cell),f=0;f<h.length;f++)mxUtils.remove(h[f],
+a)}this.model.beginUpdate();try{var k=t.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=g.getIncomingEdges(k[e]),h=g.getIncomingEdges(a[e]);if(0==l.length&&0<h.length){var p=this.cloneCells([h[0]])[0];this.addEdge(p,g.getDefaultParent(),this.model.getTerminal(h[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var A=g.moveCells;g.moveCells=function(a,c,d,e,f,h,k){var l=null;this.model.beginUpdate();try{var p=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
+if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||g.model.isEdge(a[q])&&null==g.model.getTerminal(a[q],!0)){f=g.model.getParent(a[q]);break}if(null!=p&&f!=p&&null!=this.view.getState(a[0])){var r=g.getIncomingEdges(a[0]);if(0<r.length){var t=g.view.getState(g.model.getTerminal(r[0],!0));if(null!=t){var u=g.view.getState(p);null!=u&&(c=(u.getCenterX()-t.getCenterX())/g.view.scale,d=(u.getCenterY()-t.getCenterY())/g.view.scale)}}}}l=A.apply(this,arguments);
+if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(p)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],p,!0);else if(b(a[q])&&(r=g.getIncomingEdges(a[q]),0<r.length))if(!e)b(p)&&0>mxUtils.indexOf(a,this.model.getTerminal(r[0],!0))&&this.model.setTerminal(r[0],p,!0);else if(0==g.getIncomingEdges(l[q]).length){m=p;if(null==m||m==g.model.getParent(a[q]))m=g.model.getTerminal(r[0],!0);e=this.cloneCells([r[0]])[0];this.addEdge(e,
+g.getDefaultParent(),m,l[q])}}finally{this.model.endUpdate()}return l};if(null!=n.sidebar){var y=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=g.model,h=null;f.beginUpdate();try{if(h=y.apply(this,arguments),b(a))for(var k=0;k<h.length;k++)if(f.isEdge(h[k])&&null==f.getTerminal(h[k],!0)){f.setTerminal(h[k],a,!0);var l=g.getCellGeometry(h[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return h}}var w={88:n.actions.get("selectChildren"),
+84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},F=n.onKeyDown;n.onKeyDown=function(a){try{if(g.isEnabled()&&!g.isEditing()&&b(g.getSelectionCell())&&1==g.getSelectionCount()){var d=null;0<g.getIncomingEdges(g.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(g.getSelectionCell()):f(g.getSelectionCell()):13==a.which&&(d=r(g.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&g.model.isEdge(d[0])?g.setSelectionCell(g.model.getTerminal(d[0],
+!1)):g.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(g.view.getState(g.getSelectionCell())),g.startEditingAtCell(g.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=w[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(m(g.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(m(g.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(m(g.getSelectionCell(),
+mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(m(g.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(I){console.log("error",I)}mxEvent.isConsumed(a)||F.apply(this,arguments)};var B=g.connectVertex;g.connectVertex=function(a,d,e,h,k,l){var p=g.getIncomingEdges(a);return b(a)&&0<p.length?(e=q(a),h=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):h==k?c(a):r(a,d!=mxConstants.DIRECTION_NORTH&&
+d!=mxConstants.DIRECTION_WEST)):B.call(this,a,d,e,h,k,l)};g.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&g.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var G=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){G.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);
this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var C=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){C.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
-this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
+this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");
b.vertex=!0;var d=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");c.geometry.relative=!0;c.edge=!0;b.insertEdge(c,!0);d.insertEdge(c,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
-e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var k=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");k.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);k.insertEdge(m,!1);var h=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");h.vertex=!0;var x=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-x.geometry.relative=!0;x.edge=!0;b.insertEdge(x,!0);h.insertEdge(x,!1);a.insert(c);a.insert(g);a.insert(m);a.insert(x);a.insert(b);a.insert(d);a.insert(e);a.insert(k);a.insert(h);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
+e.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");h.geometry.relative=!0;h.edge=!0;b.insertEdge(h,!0);e.insertEdge(h,!1);var k=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");k.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+l.geometry.relative=!0;l.edge=!0;b.insertEdge(l,!0);k.insertEdge(l,!1);var g=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");g.vertex=!0;var x=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+x.geometry.relative=!0;x.edge=!0;b.insertEdge(x,!0);g.insertEdge(x,!1);a.insert(c);a.insert(h);a.insert(l);a.insert(x);a.insert(b);a.insert(d);a.insert(e);a.insert(k);a.insert(g);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var d=new mxCell("Organization",
new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(d,"treeRoot","1");d.vertex=!0;var e=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");e.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");c.geometry.relative=!0;c.edge=!0;
-d.insertEdge(c,!0);e.insertEdge(c,!1);var f=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");f.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");g.geometry.relative=!0;g.edge=!0;d.insertEdge(g,!0);f.insertEdge(g,!1);a.insert(c);a.insert(g);a.insert(d);a.insert(e);a.insert(f);return sb.createVertexTemplateFromCells([a],
+d.insertEdge(c,!0);e.insertEdge(c,!1);var f=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");f.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");h.geometry.relative=!0;h.edge=!0;d.insertEdge(h,!0);f.insertEdge(h,!1);a.insert(c);a.insert(h);a.insert(d);a.insert(e);a.insert(f);return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree root",function(){var a=new mxCell("Organization",new mxGeometry(0,0,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(a,"treeRoot","1");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree division",function(){var a=new mxCell("Division",new mxGeometry(20,40,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");b.geometry.setTerminalPoint(new mxPoint(0,0),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree sub sections",function(){var a=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var d=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,
@@ -3055,33 +3056,33 @@ mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGE
this.updateGraphXml(mxUtils.parseXml(this.graph.decompress(mxUtils.getTextContent(this.diagrams[this.currentPage]))).documentElement)};this.selectPageById=function(a){for(var b=0;b<this.diagrams.length;b++)if(this.diagrams[b].getAttribute("id")==a){this.selectPage(b);break}};var f=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});this.addListener("xmlNodeChanged",
f);f();urlParams.page=d.currentPage;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8,this.graph.view.scale=this.graphConfig.zoom||1}finally{this.graph.getModel().endUpdate()}this.graph.panningHandler.useLeftButtonForPanning=!0;this.graph.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())&&"auto"==this.graph.container.style.overflow};
this.graph.panningHandler.usePopupTrigger=!1;this.graph.panningHandler.pinchEnabled=!1;this.graph.panningHandler.ignoreCell=!0;this.graph.setPanning(!1);this.addSizeHandler();this.showLayers(this.graph);this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",
-this.graphConfig.title)});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(b){0<a.offsetWidth&&(m.disconnect(),d())}));m.observe(k,{attributes:!0})}else d()}};
+this.graphConfig.title)});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),l=new e(mxUtils.bind(this,function(b){0<a.offsetWidth&&(l.disconnect(),d())}));l.observe(k,{attributes:!0})}else d()}};
GraphViewer.prototype.getObservableParent=function(a){for(a=a.parentNode;a!=document.body&&null!=a.parentNode&&"none"!==mxUtils.getCurrentStyle(a).display;)a=a.parentNode;return a};GraphViewer.prototype.getImageUrl=function(a){null!=a&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a=this.imageBaseUrl+a);return a};
GraphViewer.prototype.setXmlNode=function(a){this.xmlDocument=a.ownerDocument;this.xml=mxUtils.getXml(a);this.xmlNode=a;this.updateGraphXml(a);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(a){null==this.xmlNode&&(this.xmlDocument=a.ownerDocument,this.xml=mxUtils.getXml(a),this.xmlNode=a);this.setGraphXml(a)};GraphViewer.prototype.updateGraphXml=function(a){this.setGraphXml(a);this.fireEvent(new mxEventObject("graphChanged"))};
GraphViewer.prototype.setGraphXml=function(a){null!=this.graph&&(this.graph.view.translate=new mxPoint,this.graph.view.scale=1,this.graph.getModel().clear(),this.editor.setGraphXml(a),this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph(),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale})};
GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,b=this.graph.getGraphBounds(),e=!1;a.style.overflow="hidden";var d=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=a.offsetWidth<b.width+this.graph.border?"auto":"hidden";if(null!=this.toolbar){var b=a.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},b={left:b.left-
-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||m||(m=!0,this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||
-(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){m=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,
-d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,this.toolbarHeight),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,b.width+2*this.graph.border),this.updateContainerHeight(a,b.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var l=k=null,d=mxUtils.bind(this,function(){window.clearTimeout(l);m||(l=window.setTimeout(mxUtils.bind(this,this.fitGraph),
+c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,l=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||l||(l=!0,this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||
+(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){l=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,
+d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,this.toolbarHeight),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,b.width+2*this.graph.border),this.updateContainerHeight(a,b.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var p=k=null,d=mxUtils.bind(this,function(){window.clearTimeout(p);l||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),
100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",d):new ResizeSensor(this.graph.container,d))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",d);var q=mxUtils.bind(this,function(){var d=a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");if(0<a.offsetWidth&&(this.allowZoomIn||b.width+2*this.graph.border>a.offsetWidth||b.height+2*this.graph.border>this.graphConfig["max-height"])){var c=
null;null!=this.graphConfig["max-height"]&&(c=this.graphConfig["max-height"]/(b.height+2*this.graph.border));this.fitGraph(c)}else this.graph.view.setTranslate(Math.floor((this.graph.border-b.x)/this.graph.view.scale),Math.floor((this.graph.border-b.y)/this.graph.view.scale)),k=a.offsetWidth;a.style.minWidth=d});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(q,0):q();this.positionGraph=function(){b=this.graph.getGraphBounds();k=null;q()}};
GraphViewer.prototype.updateContainerWidth=function(a,b){a.style.width=b+"px"};GraphViewer.prototype.updateContainerHeight=function(a,b){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=b+"px"};
-GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers;if(null!=e||null!=b)if(e=null!=e?e.split(" "):null,null!=b||0<e.length){var d=null!=b?b.getModel():null,k=a.getModel();k.beginUpdate();try{for(var m=k.getChildCount(k.root),l=0;l<m;l++)k.setVisible(k.getChildAt(k.root,l),null!=b?d.isVisible(d.getChildAt(d.root,l)):!1);if(null==d)for(l=0;l<e.length;l++)k.setVisible(k.getChildAt(k.root,parseInt(e[l])),!0)}finally{k.endUpdate()}}};
-GraphViewer.prototype.addToolbar=function(){function a(a,b,c,d){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=c&&g.setAttribute("title",c);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==d||d?(mxEvent.addListener(g,"mouseenter",function(){g.style.backgroundColor="#ddd"}),mxEvent.addListener(g,"mouseleave",
-function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cursor="pointer"):mxUtils.setOpacity(g,30);g.appendChild(a);e.appendChild(g);f++;return g}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
-e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var d=null,k=null,m=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,
-0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),l=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(l(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":
-"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){l(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){l(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||l(30)}));var q=this.graph,t=q.getTolerance();q.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=
-q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<t&&Math.abs(this.scrollTop-q.container.scrollTop)<t&&Math.abs(this.startX-b.getGraphX())<t&&Math.abs(this.startY-b.getGraphY())<t&&(0<parseFloat(e.style.opacity||0)?m():l(30))}})}for(var c=this.toolbarItems,f=0,g=null,p=null,n=0;n<c.length;n++){var h=c[n];if("pages"==h){p=b.ownerDocument.createElement("div");
-p.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(p,70);var x=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");x.style.borderRightStyle="none";x.style.paddingLeft="0px";x.style.paddingRight="0px";e.appendChild(p);var u=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
-1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");u.style.paddingLeft="0px";u.style.paddingRight="0px";h=mxUtils.bind(this,function(){p.innerHTML="";mxUtils.write(p,this.currentPage+1+" / "+this.diagrams.length);p.style.display=1<this.diagrams.length?"inline-block":"none";x.style.display=p.style.display;u.style.display=p.style.display});this.addListener("graphChanged",h);h()}else if("zoom"==h)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
-mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==h){if(this.layersEnabled){var v=this.graph.getModel(),r=a(mxUtils.bind(this,function(a){if(null!=g)g.parentNode.removeChild(g),
-g=null;else{g=this.graph.createLayersDialog();mxEvent.addListener(g,"mouseleave",function(){g.parentNode.removeChild(g);g=null});a=r.getBoundingClientRect();g.style.width="140px";g.style.padding="2px 0px 2px 0px";g.style.border="1px solid #d0d0d0";g.style.backgroundColor="#eee";g.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";g.style.fontSize="11px";g.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(g,80);var b=mxUtils.getDocumentScrollOrigin(document);g.style.left=b.x+a.left+
-"px";g.style.top=b.y+a.bottom+"px";document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");v.addListener(mxEvent.CHANGE,function(){r.style.display=1<v.getChildCount(v.root)?"inline-block":"none"});r.style.display=1<v.getChildCount(v.root)?"inline-block":"none"}}else"lightbox"==h?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(h=this.graphConfig["toolbar-buttons"][h],
-null!=h&&a(null==h.enabled||h.enabled?h.handler:function(){},h.image,h.title,h.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=b.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c,
-70),e.appendChild(c));this.minToolbarWidth=34*f;var y=b.style.border,c=mxUtils.bind(this,function(){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-c.top,bottom:a.bottom-c.top,right:a.right-c.left};e.style.left=a.left+"px";e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";
-e.style.border="1px solid #d0d0d0";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==y&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var d=mxUtils.bind(this,function(){1!=this.graphConfig["toolbar-nohide"]&&(null!=e.parentNode&&e.parentNode.removeChild(e),null!=g&&(g.parentNode.removeChild(g),
-g=null),b.style.border=y)});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==e||a==g)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})});mxEvent.addListener(b,"mouseenter",c)};
+GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers;if(null!=e||null!=b)if(e=null!=e?e.split(" "):null,null!=b||0<e.length){var d=null!=b?b.getModel():null,k=a.getModel();k.beginUpdate();try{for(var l=k.getChildCount(k.root),p=0;p<l;p++)k.setVisible(k.getChildAt(k.root,p),null!=b?d.isVisible(d.getChildAt(d.root,p)):!1);if(null==d)for(p=0;p<e.length;p++)k.setVisible(k.getChildAt(k.root,parseInt(e[p])),!0)}finally{k.endUpdate()}}};
+GraphViewer.prototype.addToolbar=function(){function a(a,b,c,d){var h=document.createElement("div");h.style.borderRight="1px solid #d0d0d0";h.style.padding="3px 6px 3px 6px";mxEvent.addListener(h,"click",a);null!=c&&h.setAttribute("title",c);h.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==d||d?(mxEvent.addListener(h,"mouseenter",function(){h.style.backgroundColor="#ddd"}),mxEvent.addListener(h,"mouseleave",
+function(){h.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),h.style.cursor="pointer"):mxUtils.setOpacity(h,30);h.appendChild(a);e.appendChild(h);f++;return h}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
+e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var d=null,k=null,l=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,
+0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),l())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":
+"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){p(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){p(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var q=this.graph,r=q.getTolerance();q.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=
+q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<r&&Math.abs(this.scrollTop-q.container.scrollTop)<r&&Math.abs(this.startX-b.getGraphX())<r&&Math.abs(this.startY-b.getGraphY())<r&&(0<parseFloat(e.style.opacity||0)?l():p(30))}})}for(var c=this.toolbarItems,f=0,h=null,m=null,n=0;n<c.length;n++){var g=c[n];if("pages"==g){m=b.ownerDocument.createElement("div");
+m.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(m,70);var x=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");x.style.borderRightStyle="none";x.style.paddingLeft="0px";x.style.paddingRight="0px";e.appendChild(m);var u=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
+1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");u.style.paddingLeft="0px";u.style.paddingRight="0px";g=mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,this.currentPage+1+" / "+this.diagrams.length);m.style.display=1<this.diagrams.length?"inline-block":"none";x.style.display=m.style.display;u.style.display=m.style.display});this.addListener("graphChanged",g);g()}else if("zoom"==g)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
+mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==g){if(this.layersEnabled){var v=this.graph.getModel(),t=a(mxUtils.bind(this,function(a){if(null!=h)h.parentNode.removeChild(h),
+h=null;else{h=this.graph.createLayersDialog();mxEvent.addListener(h,"mouseleave",function(){h.parentNode.removeChild(h);h=null});a=t.getBoundingClientRect();h.style.width="140px";h.style.padding="2px 0px 2px 0px";h.style.border="1px solid #d0d0d0";h.style.backgroundColor="#eee";h.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";h.style.fontSize="11px";h.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(h,80);var b=mxUtils.getDocumentScrollOrigin(document);h.style.left=b.x+a.left+
+"px";h.style.top=b.y+a.bottom+"px";document.body.appendChild(h)}}),Editor.layersImage,mxResources.get("layers")||"Layers");v.addListener(mxEvent.CHANGE,function(){t.style.display=1<v.getChildCount(v.root)?"inline-block":"none"});t.style.display=1<v.getChildCount(v.root)?"inline-block":"none"}}else"lightbox"==g?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(g=this.graphConfig["toolbar-buttons"][g],
+null!=g&&a(null==g.enabled||g.enabled?g.handler:function(){},g.image,g.title,g.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=b.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c,
+70),e.appendChild(c));this.minToolbarWidth=34*f;var A=b.style.border,c=mxUtils.bind(this,function(){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-c.top,bottom:a.bottom-c.top,right:a.right-c.left};e.style.left=a.left+"px";e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";
+e.style.border="1px solid #d0d0d0";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==A&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var d=mxUtils.bind(this,function(){1!=this.graphConfig["toolbar-nohide"]&&(null!=e.parentNode&&e.parentNode.removeChild(e),null!=h&&(h.parentNode.removeChild(h),
+h=null),b.style.border=A)});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==e||a==h)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})});mxEvent.addListener(b,"mouseenter",c)};
GraphViewer.prototype.addClickHandler=function(a,b){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,d){if(null==d){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(d=k.getAttribute("href"))}null!=b?null==d||a.isExternalProtocol(d)||a.isBlankLink(d)||window.setTimeout(function(){b.destroy()},0):null==d||!a.isPageLink(d)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)||(k=d.indexOf(","),0<k&&(k=d.substring(k+
1),this.selectPageById(k),mxEvent.consume(e)))}),mxUtils.bind(this,function(a){null!=b||!this.lightboxClickEnabled||mxEvent.isTouchEvent(a)&&0!=this.toolbarItems.length||this.showLightbox()}))};
GraphViewer.prototype.showLightbox=function(a,b,e){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){a=null!=a?a:null!=this.graphConfig.editable?this.graphConfig.editable:!0;e={client:1,lightbox:1,target:null!=e?e:"blank"};a&&(e.edit=this.graphConfig.edit||"_blank");if(null!=b?b:1)e.close=1;this.layersEnabled&&(e.layers=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(e.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&
@@ -3090,17 +3091,17 @@ GraphViewer.prototype.showLightbox=function(a,b,e){if("open"==this.graphConfig.l
GraphViewer.prototype.showLocalLightbox=function(){var a=mxUtils.getDocumentScrollOrigin(document),b=document.createElement("div");mxClient.IS_QUIRKS?(b.style.position="absolute",b.style.left=a.x+"px",b.style.top=a.y+"px",b.style.width=document.body.offsetWidth+"px",b.style.height=document.body.offsetHeight+"px"):b.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";b.style.zIndex=this.lightboxZIndex;b.style.backgroundColor="#000000";mxUtils.setOpacity(b,70);document.body.appendChild(b);
var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(e.style.position="absolute",e.style.right="32px",e.style.top=a.y+32+"px"):e.style.cssText="position:fixed;top:32px;right:32px;";e.style.cursor="pointer";mxEvent.addListener(e,"click",function(){d.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";if(null==document.documentMode||
10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var d=new EditorUi(new Editor(!0),document.createElement("div"),!0);d.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";d.refresh=function(){};mxEvent.addListener(b,"click",function(){d.destroy()});
-var k=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),m=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var l=d.editor.graph,q=l.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",
-k)):(b.style.display="none",e.style.display="none");var t=this;l.getImageFromBundles=function(a){return t.getImageUrl(a)};var c=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=c.apply(this,arguments);a.getImageFromBundles=function(a){return t.getImageUrl(a)};return a};this.graphConfig.move&&(l.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(q.style,"border-radius","4px"),q.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
-"hidden";mxClient.IS_SF||(mxUtils.setPrefixedStyle(q.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(q.style,"transition","all .25s ease-in-out"));this.addClickHandler(l,d);window.setTimeout(mxUtils.bind(this,function(){q.style.outline="none";q.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(q);document.body.appendChild(e);d.setFileData(this.xml);mxUtils.setPrefixedStyle(q.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
+var k=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),l=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;l.apply(this,arguments)};var p=d.editor.graph,q=p.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",
+k)):(b.style.display="none",e.style.display="none");var r=this;p.getImageFromBundles=function(a){return r.getImageUrl(a)};var c=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=c.apply(this,arguments);a.getImageFromBundles=function(a){return r.getImageUrl(a)};return a};this.graphConfig.move&&(p.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(q.style,"border-radius","4px"),q.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
+"hidden";mxClient.IS_SF||(mxUtils.setPrefixedStyle(q.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(q.style,"transition","all .25s ease-in-out"));this.addClickHandler(p,d);window.setTimeout(mxUtils.bind(this,function(){q.style.outline="none";q.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(q);document.body.appendChild(e);d.setFileData(this.xml);mxUtils.setPrefixedStyle(q.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
"60px";d.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(d.chromelessToolbar);d.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(q.style.position="absolute",q.style.display="block",q.style.left=a.x+"px",q.style.top=a.y+"px",q.style.width=document.body.clientWidth-80+"px",q.style.height=document.body.clientHeight-80+"px",q.style.backgroundColor="white",d.chromelessToolbar.style.display="block",d.chromelessToolbar.style.position="absolute",
-d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(l,this.graph)}),0);return d};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})};
+d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(p,this.graph)}),0);return d};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})};
GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var b=document.getElementsByClassName(a);a=[];for(var e=0;e<b.length;e++)a.push(b[e]);return a}for(var d=document.getElementsByTagName("*"),b=[],e=0;e<d.length;e++){var k=d[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&b.push(d[e]))}return b};
GraphViewer.createViewerForElement=function(a,b){var e=a.getAttribute("data-mxgraph");if(null!=e){var d=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,d);null!=b&&b(e)};null!=d.url?GraphViewer.getUrl(d.url,function(a){k(a)}):k(d.xml)}};
GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type="text/css";a.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}\ntd.mxPopupMenuIcon div {\nwidth:16px;\nheight:16px;}\nhtml div.mxPopupMenu {\n-webkit-box-shadow:2px 2px 3px #d5d5d5;\n-moz-box-shadow:2px 2px 3px #d5d5d5;\nbox-shadow:2px 2px 3px #d5d5d5;\n_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d0d0d0',Positive='true');\nbackground:white;\nposition:absolute;\nborder:3px solid #e7e7e7;\npadding:3px;}\nhtml table.mxPopupMenu {\nborder-collapse:collapse;\nmargin:0px;}\nhtml td.mxPopupMenuItem {\npadding:7px 30px 7px 30px;\nfont-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;}\nhtml td.mxPopupMenuIcon {\nbackground-color:white;\npadding:0px;}\ntd.mxPopupMenuIcon .geIcon {\npadding:2px;\npadding-bottom:4px;\nmargin:2px;\nborder:1px solid transparent;\nopacity:0.5;\n_width:26px;\n_height:26px;}\ntd.mxPopupMenuIcon .geIcon:hover {\nborder:1px solid gray;\nborder-radius:2px;\nopacity:1;}\nhtml tr.mxPopupMenuItemHover {\nbackground-color: #eeeeee;\ncolor: black;}\ntable.mxPopupMenu hr {\ncolor:#cccccc;\nbackground-color:#cccccc;\nborder:none;\nheight:1px;}\ntable.mxPopupMenu tr {\tfont-size:4pt;}\n.geDialog { font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;\nborder:none;\nmargin:0px;}\n.geDialog {\tposition:absolute;\tbackground:white;\toverflow:hidden;\tpadding:30px;\tborder:1px solid #acacac;\t-webkit-box-shadow:0px 0px 2px 2px #d5d5d5;\t-moz-box-shadow:0px 0px 2px 2px #d5d5d5;\tbox-shadow:0px 0px 2px 2px #d5d5d5;\t_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d5d5d5', Positive='true');\tz-index: 2;}.geDialogClose {\tposition:absolute;\twidth:9px;\theight:9px;\topacity:0.5;\tcursor:pointer;\t_filter:alpha(opacity=50);}.geDialogClose:hover {\topacity:1;}.geDialogTitle {\tbox-sizing:border-box;\twhite-space:nowrap;\tbackground:rgb(229, 229, 229);\tborder-bottom:1px solid rgb(192, 192, 192);\tfont-size:15px;\tfont-weight:bold;\ttext-align:center;\tcolor:rgb(35, 86, 149);}.geDialogFooter {\tbackground:whiteSmoke;\twhite-space:nowrap;\ttext-align:right;\tbox-sizing:border-box;\tborder-top:1px solid #e5e5e5;\tcolor:darkGray;}\n.geBtn {\tbackground-color: #f5f5f5;\tborder-radius: 2px;\tborder: 1px solid #d8d8d8;\tcolor: #333;\tcursor: default;\tfont-size: 11px;\tfont-weight: bold;\theight: 29px;\tline-height: 27px;\tmargin: 0 0 0 8px;\tmin-width: 72px;\toutline: 0;\tpadding: 0 8px;\tcursor: pointer;}.geBtn:hover, .geBtn:focus {\t-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\t-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tbox-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tborder: 1px solid #c6c6c6;\tbackground-color: #f8f8f8;\tbackground-image: linear-gradient(#f8f8f8 0px,#f1f1f1 100%);\tcolor: #111;}.geBtn:disabled {\topacity: .5;}.gePrimaryBtn {\tbackground-color: #4d90fe;\tbackground-image: linear-gradient(#4d90fe 0px,#4787ed 100%);\tborder: 1px solid #3079ed;\tcolor: #fff;}.gePrimaryBtn:hover, .gePrimaryBtn:focus {\tbackground-color: #357ae8;\tbackground-image: linear-gradient(#4d90fe 0px,#357ae8 100%);\tborder: 1px solid #2f5bb7;\tcolor: #fff;}.gePrimaryBtn:disabled {\topacity: .5;}";document.getElementsByTagName("head")[0].appendChild(a)}catch(b){}};
GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=e;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
-(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function l(b,c){if(!b.resizedAttached)b.resizedAttached=
+(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function l(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached=
new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
-b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var l=!1,p=function(){b.resizedAttached&&(l&&(b.resizedAttached.call(),l=!1),a(p))};a(p);var q,t,A,E,B=function(){if((A=b.offsetWidth)!=q||(E=b.offsetHeight)!=t)l=!0,q=A,t=E;g()},F=function(a,b,c){a.attachEvent?
-a.attachEvent("on"+b,c):a.addEventListener(b,c)};F(d,"scroll",B);F(f,"scroll",B)}var q=function(){GraphViewer.resizeSensorEnabled&&d()},t=Object.prototype.toString.call(e),c="[object Array]"===t||"[object NodeList]"===t||"[object HTMLCollection]"===t||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(c)for(var t=0,f=e.length;t<f;t++)l(e[t],q);else l(e,q);this.detach=function(){if(c)for(var a=0,d=e.length;a<d;a++)b.detach(e[a]);else b.detach(e)}};
+b.appendChild(b.resizeSensor);"static"==l(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],h=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};h();var m=!1,p=function(){b.resizedAttached&&(m&&(b.resizedAttached.call(),m=!1),a(p))};a(p);var q,r,w,F,B=function(){if((w=b.offsetWidth)!=q||(F=b.offsetHeight)!=r)m=!0,q=w,r=F;h()},G=function(a,b,c){a.attachEvent?
+a.attachEvent("on"+b,c):a.addEventListener(b,c)};G(d,"scroll",B);G(f,"scroll",B)}var q=function(){GraphViewer.resizeSensorEnabled&&d()},r=Object.prototype.toString.call(e),c="[object Array]"===r||"[object NodeList]"===r||"[object HTMLCollection]"===r||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(c)for(var r=0,f=e.length;r<f;r++)p(e[r],q);else p(e,q);this.detach=function(){if(c)for(var a=0,d=e.length;a<d;a++)b.detach(e[a]);else b.detach(e)}};
b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})();
diff --git a/src/main/webapp/js/atlas.min.js b/src/main/webapp/js/atlas.min.js
index 5dc70e8b..12ef1136 100644
--- a/src/main/webapp/js/atlas.min.js
+++ b/src/main/webapp/js/atlas.min.js
@@ -2498,16 +2498,16 @@ arguments);null!=b&&(b.width+=10,b.height+=4,this.gridEnabled&&(b.width=this.sna
h.setTerminalPoint(k,!1);h.setTerminalPoint(l,!0);b.setGeometry(e,h);var m=this.view.getState(e),D=this.view.getState(f),n=this.view.getState(g);if(null!=m){var p=null!=D?this.getConnectionConstraint(m,D,!0):null,q=null!=n?this.getConnectionConstraint(m,n,!1):null;this.setConnectionConstraint(e,f,!0,q);this.setConnectionConstraint(e,g,!1,p)}c.push(e)}}else if(b.isVertex(e)&&(h=this.getCellGeometry(e),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var t=h.width;h.width=h.height;
h.height=t;b.setGeometry(e,h);var r=this.view.getState(e);if(null!=r){var x=r.style[mxConstants.STYLE_DIRECTION]||"east";"east"==x?x="south":"south"==x?x="west":"west"==x?x="north":"north"==x&&(x="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,x,[e])}c.push(e)}}}finally{b.endUpdate()}return c};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var b=this.model.getDescendants(a.cell);
if(0<b.length)for(var c=0;c<b.length;c++)this.isReplacePlaceholders(b[c])&&this.view.invalidate(b[c],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,b,c){b=this.zapGremlins(b);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),e=a;null!=e;){if(e==this.model.getRoot()||null!=e.value&&"object"==typeof e.value&&e.hasAttribute(d)){this.setAttributeForCell(e,d,b);break}e=
-this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,
-mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=this.view.getState(a[c]);if(null!=d){var e=
-mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=function(a,b,c){var d;
-null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=
-function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&(mxUtils.contains(d.text.boundingBox,
-c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,c=this.container.scrollTop/
-this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+(0==b.height?1:
-2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);d.geometry.offset=
-new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",
-[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
+this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&(this.model.isEdge(e.cell)||this.model.isVertex(e.cell))&&
+this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=
+this.view.getState(a[c]);if(null!=d){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=
+function(a,b,c){var d;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,
+arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&
+(mxUtils.contains(d.text.boundingBox,c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,
+c=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+
+(0==b.height?1:2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);
+d.geometry.offset=new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted",
+"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
d),null!=b&&mxEvent.addGestureListeners(a[c],null,null,b))}});this.model.addListener(mxEvent.CHANGE,d);d();var e=this.container.style.cursor,f=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(b)},mouseMove:function(a,b){if(g.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-b.getGraphX()),d=Math.abs(this.startY-b.getGraphY());(c>f||d>f)&&this.clear()}}else{for(c=b.getSource();null!=c&&"a"!=c.nodeName.toLowerCase();)c=
c.parentNode;null!=c?this.clear():(null==this.currentState||b.getState()!=this.currentState&&null!=b.getState()||!g.intersects(this.currentState,b.getGraphX(),b.getGraphY()))&&this.updateCurrentState(b)}},mouseUp:function(a,d){for(var e=d.getSource(),h=d.getEvent();null!=e&&"a"!=e.nodeName.toLowerCase();)e=e.parentNode;null==e&&Math.abs(this.scrollLeft-g.container.scrollLeft)<f&&Math.abs(this.scrollTop-g.container.scrollTop)<f&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(h)&&
@@ -6210,267 +6210,271 @@ this.createVertexTemplateEntry(a+"vimeo;fillColor=#1AB7EA;strokeColor=none",62.6
"yahoo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yammer;fillColor=#0093BE;strokeColor=none",.2*348,59.6,"","Yammer",null,null,this.getTagsForStencil("mxgraph.weblogos","yammer","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yandex",31.8,66.4,"","Yandex",null,null,this.getTagsForStencil("mxgraph.weblogos","yandex","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yelp;fillColor=#C41200;strokeColor=none",.2*317,83,"","Yelp",null,null,this.getTagsForStencil("mxgraph.weblogos",
"yelp","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yoolink",79.2,79.2,"","Yoolink",null,null,this.getTagsForStencil("mxgraph.weblogos","yoolink","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youmob",76,76.2,"","Youmob",null,null,this.getTagsForStencil("mxgraph.weblogos","youmob","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youtube;fillColor=#FF2626;gradientColor=#B5171F",.2*786,65.8,"","Youtube",null,null,this.getTagsForStencil("mxgraph.weblogos",
"youtube","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youtube_2;fillColor=#FF2626;gradientColor=#B5171F",.2*232,32.6,"","Youtube",null,null,this.getTagsForStencil("mxgraph.weblogos","youtube","web logos logo").join(" "))])}})();
-DrawioFile=function(a,e){mxEventSource.call(this);this.ui=a;this.data=e||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};
-DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,e,d,b){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData())};DrawioFile.prototype.saveAs=function(a,e,d){};DrawioFile.prototype.saveFile=function(a,e,d,b){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};
-DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,e,d){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,e,d){};DrawioFile.prototype.getHash=function(){return""};
-DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
-DrawioFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,e){var d=null!=e?e.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=d&&d.ignoreEdit||(this.setModified(!0),this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||
+DrawioFile=function(a,d){mxEventSource.call(this);this.ui=a;this.data=d||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};
+DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,d,e,b){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,d,e){};DrawioFile.prototype.saveFile=function(a,d,e,b){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};
+DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,d,e){};DrawioFile.prototype.isMovable=function(){return!1};
+DrawioFile.prototype.move=function(a,d,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
+DrawioFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,d){var e=null!=d?d.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||(this.setModified(!0),this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||
this.isModified()||this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))}),mxUtils.bind(this,function(a){this.ui.getCurrentFile()==this&&this.addUnsavedStatus(a)}))):this.addUnsavedStatus())});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener);this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener);this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener);this.ui.addListener("pageFormatChanged",this.changeListener);
this.ui.addListener("pageScaleChanged",this.changeListener);this.ui.addListener("backgroundColorChanged",this.changeListener);this.ui.addListener("backgroundImageChanged",this.changeListener);this.ui.addListener("foldingEnabledChanged",this.changeListener);this.ui.addListener("mathEnabledChanged",this.changeListener);this.ui.addListener("gridEnabledChanged",this.changeListener);this.ui.addListener("guidesEnabledChanged",this.changeListener);this.ui.addListener("pageViewChanged",this.changeListener)};
DrawioFile.prototype.addUnsavedStatus=function(a){a instanceof Error&&null!=a.message?this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+" ("+mxUtils.htmlEntities(a.message)+")</div>"):(this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+"</div>"),null!=this.ui.statusContainer&&(a=this.ui.statusContainer.getElementsByTagName("div"),
0<a.length&&mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null==this.ui.mode?"saveAs":"save").funct()}))))};
-DrawioFile.prototype.autosave=function(a,e,d,b){null==this.lastAutosave&&(this.lastAutosave=(new Date).getTime());a=(new Date).getTime()-this.lastAutosave<e?a:0;this.clearAutosave();this.autosaveThread=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=this.autosaveThread=null;if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=d&&d(a)}),
-mxUtils.bind(this,function(a){null!=b&&b(a)}))}else null!=d&&d(null)}),a)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};
-DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,e){if(null!=a&&null!=e){var d=a.lastIndexOf("."),b=0<d?a.substring(d):"",d=e.lastIndexOf(".");return b===(0<d?e.substring(d):"")}return a==e};
-DrawioFile.prototype.destroy=function(){this.clearAutosave();null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};LocalFile=function(a,e,d,b){DrawioFile.call(this,a,e);this.title=d;this.mode=b?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,e,d){this.saveAs(this.title,e,d)};LocalFile.prototype.saveAs=function(a,e,d){this.saveFile(a,!1,e,d)};
-LocalFile.prototype.saveFile=function(a,e,d,b){this.title=a;this.updateFileData();e=this.getData();var h=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),k=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,h?"image/png":"text/xml",h);else if(b.length<MAX_REQUEST_SIZE){var e=a.lastIndexOf("."),e=0<e?a.substring(e+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+e+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
-(h?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=d&&d()});h?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){k(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):k(e)};LocalFile.prototype.rename=function(a,e,d){this.title=a;this.descriptorChanged();null!=e&&e()};
-LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,e){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};LocalLibrary=function(a,e,d){LocalFile.call(this,a,e,d)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,e,d){this.saveFile(a,!1,e,d)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,e,d){DrawioFile.call(this,a,e);this.title=d};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.autosaveDelay=2E3;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};
-StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.save=function(a,e,d){this.saveAs(this.getTitle(),e,d)};StorageFile.prototype.saveAs=function(a,e,d){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,e,d)};
-StorageFile.prototype.saveFile=function(a,e,d,b){if(this.isEditable()){var h=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=d&&d()}))}catch(k){null!=b&&b(k)}});this.isRenamable()&&"."==a.charAt(0)&&null!=b?b({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(d){this.isRenamable()&&this.getTitle()!=a&&null!=d?this.ui.confirm(mxResources.get("replaceIt",
-[a]),h,b):h()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,e,d){var b=this.getTitle();b!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(h){this.ui.confirm(mxResources.get("replaceIt",[a]),mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(b,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(b,e)}),d)}),d)})):e()};StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};
-StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,e,d){StorageFile.call(this,a,e,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,e,d){this.saveFile(a,!1,e,d)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
-StorageLibrary.prototype.isRenamable=function(a,e,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,e,d){StorageFile.call(this,a,e,d);a=d;e=a.lastIndexOf("/");0<=e&&(a=a.substring(e+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,e,d){return!1};UrlLibrary.prototype.saveAs=function(a,e,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,e,d){function b(b,q,u,p,w,h){function v(){mxEvent.addListener(t,"click",null!=h?h:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,c.checked);e()})):(a.setMode(u,c.checked),e()):window.location.hostname=DriveClient.prototype.newAppHostname})}var t=document.createElement("a");t.style.overflow="hidden";t.style.display=
-mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.boxSizing="border-box";t.style.fontSize="11px";t.style.position="relative";t.style.margin="4px";t.style.padding="8px 10px 12px 10px";t.style.width="88px";t.style.height="100px";t.style.whiteSpace="nowrap";t.setAttribute("title",q);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");var y=document.createElement("div");y.style.textOverflow="ellipsis";y.style.overflow="hidden";if(null!=b){var k=document.createElement("img");
-k.setAttribute("src",b);k.setAttribute("border","0");k.setAttribute("align","absmiddle");k.style.width="60px";k.style.height="60px";k.style.paddingBottom="6px";t.appendChild(k)}else y.style.paddingTop="5px",y.style.whiteSpace="normal",mxClient.IS_IOS?(t.style.padding="0px 10px 20px 10px",t.style.top="6px"):mxClient.IS_FF&&(y.style.paddingTop="0px",y.style.marginTop="-2px");t.appendChild(y);mxUtils.write(y,q);if(null!=w)for(b=0;b<w.length;b++)mxUtils.br(y),mxUtils.write(y,w[b]);if(null!=p&&null==a[p]){k.style.visibility=
-"hidden";mxUtils.setOpacity(y,10);var l=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});l.spin(t);var z=window.setTimeout(function(){null==a[p]&&(l.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(z),mxUtils.setOpacity(y,100),k.style.visibility="",l.stop(),v(),"drive"==p&&null!=g.parentNode&&g.parentNode.removeChild(g))}))}else v();
-m.appendChild(t);++f>=d&&(mxUtils.br(m),f=0)}d=null!=d?d:2;var h=document.createElement("div");h.style.textAlign="center";h.style.whiteSpace="nowrap";h.style.paddingTop="0px";h.style.paddingBottom="20px";var k=a.addLanguageMenu(h,!0);null!=k&&(k.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){k=document.createElement("a");k.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");k.setAttribute("title",mxResources.get("help"));k.setAttribute("target",
-"_blank");k.style.position="absolute";k.style.textDecoration="none";k.style.cursor="pointer";k.style.fontSize="12px";k.style.bottom="28px";k.style.left="26px";k.style.color="gray";var l=document.createElement("img");l.setAttribute("border","0");l.setAttribute("valign","bottom");l.setAttribute("src",Editor.helpImage);l.style.marginRight="2px";k.appendChild(l);mxUtils.write(k,mxResources.get("help"));h.appendChild(k)}var n=document.createElement("div");n.style.position="absolute";n.style.cursor="pointer";
-n.style.fontSize="12px";n.style.bottom="28px";n.style.color="gray";mxUtils.write(n,mxResources.get("decideLater"));a.isOfflineApp()?n.style.right="20px":(mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)"),n.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)n.style.marginLeft=-Math.round(n.clientWidth/2)+"px"};h.appendChild(n);mxEvent.addListener(n,"click",function(){a.hideDialog();var c=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,
-null,null,null,null,null,!0);Editor.useLocalStorage=c});var m=document.createElement("div");mxClient.IS_QUIRKS&&(m.style.whiteSpace="nowrap",m.style.cssFloat="left");m.style.border="1px solid #d3d3d3";m.style.borderWidth="1px 0px 1px 0px";m.style.padding="12px 0px 12px 0px";var c=document.createElement("input");c.setAttribute("type","checkbox");c.setAttribute("checked","checked");c.defaultChecked=!0;var f=0,g=document.createElement("p"),k=document.createElement("p");k.style.fontSize="16pt";k.style.padding=
-"0px";k.style.paddingTop="4px";k.style.paddingBottom="16px";k.style.margin="0px";k.style.color="gray";mxUtils.write(k,mxResources.get("saveDiagramsTo")+":");h.appendChild(k);"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");mxClient.IS_IOS&&"device"!=urlParams.storage||b(IMAGE_PATH+
-"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);h.appendChild(m);k=document.createElement("p");k.style.marginTop="12px";k.style.marginBottom="6px";k.appendChild(c);l=document.createElement("span");l.style.color="gray";l.style.fontSize="12px";mxUtils.write(l," "+mxResources.get("rememberThisSetting"));k.appendChild(l);mxUtils.br(k);var t=
-a.getRecent();if(null!=t&&0<t.length){var q=document.createElement("select");q.style.marginTop="8px";q.style.width="140px";var u=document.createElement("option");u.setAttribute("value","");u.setAttribute("selected","selected");u.style.textAlign="center";mxUtils.write(u,mxResources.get("openRecent")+"...");q.appendChild(u);for(u=0;u<t.length;u++)(function(a){var c=a.mode;c==App.MODE_GOOGLE?c="googleDrive":c==App.MODE_ONEDRIVE&&(c="oneDrive");var f=document.createElement("option");f.setAttribute("value",
-a.id);mxUtils.write(f,a.title+" ("+mxResources.get(c)+")");q.appendChild(f)})(t[u]);k.appendChild(q);mxEvent.addListener(q,"change",function(c){""!=q.value&&a.loadFile(q.value)})}else k.style.marginTop="20px",m.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(t=document.createElement("div"),t.style.cursor="pointer",t.style.padding="18px 0px 6px 0px",t.style.fontSize="12px",t.style.color="gray",mxUtils.write(t,mxResources.get("import")+" "+mxResources.get("gliffy")+
-", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(t,"click",function(){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(){null!=c.files&&(a.hideDialog(),a.openFiles(c.files,!0))});c.click()}),k.appendChild(t),m.style.paddingBottom="4px");m.appendChild(k);mxEvent.addListener(l,"click",function(a){c.checked=!c.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&
+DrawioFile.prototype.autosave=function(a,d,e,b){null==this.lastAutosave&&(this.lastAutosave=(new Date).getTime());a=(new Date).getTime()-this.lastAutosave<d?a:0;this.clearAutosave();this.autosaveThread=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=this.autosaveThread=null;if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=e&&e(a)}),
+mxUtils.bind(this,function(a){null!=b&&b(a)}))}else null!=e&&e(null)}),a)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};
+DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,d){if(null!=a&&null!=d){var e=a.lastIndexOf("."),b=0<e?a.substring(e):"",e=d.lastIndexOf(".");return b===(0<e?d.substring(e):"")}return a==d};
+DrawioFile.prototype.destroy=function(){this.clearAutosave();null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};LocalFile=function(a,d,e,b){DrawioFile.call(this,a,d);this.title=e;this.mode=b?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,d,e){this.saveAs(this.title,d,e)};LocalFile.prototype.saveAs=function(a,d,e){this.saveFile(a,!1,d,e)};
+LocalFile.prototype.saveFile=function(a,d,e,b){this.title=a;this.updateFileData();d=this.getData();var h=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),l=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,h?"image/png":"text/xml",h);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
+(h?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});h?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){l(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):l(d)};LocalFile.prototype.rename=function(a,d,e){this.title=a;this.descriptorChanged();null!=d&&d()};
+LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,d){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};LocalLibrary=function(a,d,e){LocalFile.call(this,a,d,e)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,d,e){this.saveFile(a,!1,d,e)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,d,e){DrawioFile.call(this,a,d);this.title=e};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.autosaveDelay=2E3;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};
+StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.save=function(a,d,e){this.saveAs(this.getTitle(),d,e)};StorageFile.prototype.saveAs=function(a,d,e){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,d,e)};
+StorageFile.prototype.saveFile=function(a,d,e,b){if(this.isEditable()){var h=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=e&&e()}))}catch(l){null!=b&&b(l)}});this.isRenamable()&&"."==a.charAt(0)&&null!=b?b({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(e){this.isRenamable()&&this.getTitle()!=a&&null!=e?this.ui.confirm(mxResources.get("replaceIt",
+[a]),h,b):h()}))}else null!=e&&e()};StorageFile.prototype.rename=function(a,d,e){var b=this.getTitle();b!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(h){var l=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(b,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(b,d)}),e)});null!=h?this.ui.confirm(mxResources.get("replaceIt",[a]),l,e):l()})):d()};
+StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,d,e){StorageFile.call(this,a,d,e)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,d,e){this.saveFile(a,!1,d,e)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
+StorageLibrary.prototype.isRenamable=function(a,d,e){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,d,e){StorageFile.call(this,a,d,e);a=e;d=a.lastIndexOf("/");0<=d&&(a=a.substring(d+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,d,e){return!1};UrlLibrary.prototype.saveAs=function(a,d,e){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,d,e){function b(b,u,t,q,v,h){function B(){mxEvent.addListener(p,"click",null!=h?h:function(){t!=App.MODE_GOOGLE||a.isDriveDomain()?t==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,c.checked);d()})):(a.setMode(t,c.checked),d()):window.location.hostname=DriveClient.prototype.newAppHostname})}var p=document.createElement("a");p.style.overflow="hidden";p.style.display=
+mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.padding="8px 10px 12px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace="nowrap";p.setAttribute("title",u);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var y=document.createElement("div");y.style.textOverflow="ellipsis";y.style.overflow="hidden";if(null!=b){var l=document.createElement("img");
+l.setAttribute("src",b);l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.width="60px";l.style.height="60px";l.style.paddingBottom="6px";p.appendChild(l)}else y.style.paddingTop="5px",y.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(y.style.paddingTop="0px",y.style.marginTop="-2px");p.appendChild(y);mxUtils.write(y,u);if(null!=v)for(b=0;b<v.length;b++)mxUtils.br(y),mxUtils.write(y,v[b]);if(null!=q&&null==a[q]){l.style.visibility=
+"hidden";mxUtils.setOpacity(y,10);var k=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});k.spin(p);var x=window.setTimeout(function(){null==a[q]&&(k.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[q]&&(window.clearTimeout(x),mxUtils.setOpacity(y,100),l.style.visibility="",k.stop(),B(),"drive"==q&&null!=g.parentNode&&g.parentNode.removeChild(g))}))}else B();
+n.appendChild(p);++f>=e&&(mxUtils.br(n),f=0)}e=null!=e?e:2;var h=document.createElement("div");h.style.textAlign="center";h.style.whiteSpace="nowrap";h.style.paddingTop="0px";h.style.paddingBottom="20px";var l=a.addLanguageMenu(h,!0);null!=l&&(l.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){l=document.createElement("a");l.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");l.setAttribute("title",mxResources.get("help"));l.setAttribute("target",
+"_blank");l.style.position="absolute";l.style.textDecoration="none";l.style.cursor="pointer";l.style.fontSize="12px";l.style.bottom="28px";l.style.left="26px";l.style.color="gray";var k=document.createElement("img");k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";l.appendChild(k);mxUtils.write(l,mxResources.get("help"));h.appendChild(l)}var m=document.createElement("div");m.style.position="absolute";m.style.cursor="pointer";
+m.style.fontSize="12px";m.style.bottom="28px";m.style.color="gray";mxUtils.write(m,mxResources.get("decideLater"));a.isOfflineApp()?m.style.right="20px":(mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)"),m.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)m.style.marginLeft=-Math.round(m.clientWidth/2)+"px"};h.appendChild(m);mxEvent.addListener(m,"click",function(){a.hideDialog();var c=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,
+null,null,null,null,null,!0);Editor.useLocalStorage=c});var n=document.createElement("div");mxClient.IS_QUIRKS&&(n.style.whiteSpace="nowrap",n.style.cssFloat="left");n.style.border="1px solid #d3d3d3";n.style.borderWidth="1px 0px 1px 0px";n.style.padding="12px 0px 12px 0px";var c=document.createElement("input");c.setAttribute("type","checkbox");c.setAttribute("checked","checked");c.defaultChecked=!0;var f=0,g=document.createElement("p"),l=document.createElement("p");l.style.fontSize="16pt";l.style.padding=
+"0px";l.style.paddingTop="4px";l.style.paddingBottom="16px";l.style.margin="0px";l.style.color="gray";mxUtils.write(l,mxResources.get("saveDiagramsTo")+":");h.appendChild(l);"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");mxClient.IS_IOS&&"device"!=urlParams.storage||b(IMAGE_PATH+
+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);h.appendChild(n);l=document.createElement("p");l.style.marginTop="12px";l.style.marginBottom="6px";l.appendChild(c);k=document.createElement("span");k.style.color="gray";k.style.fontSize="12px";mxUtils.write(k," "+mxResources.get("rememberThisSetting"));l.appendChild(k);mxUtils.br(l);var p=
+a.getRecent();if(null!=p&&0<p.length){var u=document.createElement("select");u.style.marginTop="8px";u.style.width="140px";var t=document.createElement("option");t.setAttribute("value","");t.setAttribute("selected","selected");t.style.textAlign="center";mxUtils.write(t,mxResources.get("openRecent")+"...");u.appendChild(t);for(t=0;t<p.length;t++)(function(a){var c=a.mode;c==App.MODE_GOOGLE?c="googleDrive":c==App.MODE_ONEDRIVE&&(c="oneDrive");var f=document.createElement("option");f.setAttribute("value",
+a.id);mxUtils.write(f,a.title+" ("+mxResources.get(c)+")");u.appendChild(f)})(p[t]);l.appendChild(u);mxEvent.addListener(u,"change",function(c){""!=u.value&&a.loadFile(u.value)})}else l.style.marginTop="20px",n.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(p=document.createElement("div"),p.style.cursor="pointer",p.style.padding="18px 0px 6px 0px",p.style.fontSize="12px",p.style.color="gray",mxUtils.write(p,mxResources.get("import")+" "+mxResources.get("gliffy")+
+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(p,"click",function(){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(){null!=c.files&&(a.hideDialog(),a.openFiles(c.files,!0))});c.click()}),l.appendChild(p),n.style.paddingBottom="4px");n.appendChild(l);mxEvent.addListener(k,"click",function(a){c.checked=!c.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&
"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(g.style.padding="8px",g.style.fontSize="9pt",g.style.marginTop="-14px",g.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",h.appendChild(g))},
-5E3);this.container=h},SplashDialog=function(a){var e=document.createElement("div");e.style.textAlign="center";a.addLanguageMenu(e,!0);var d=null,b=a.getServiceCount();!a.isOffline()&&1<b&&(d=document.createElement("a"),d.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage"),d.setAttribute("title",mxResources.get("help")),d.setAttribute("target","_blank"),d.style.position="absolute",d.style.fontSize="12px",d.style.textDecoration="none",d.style.cursor="pointer",d.style.bottom=
-"22px",d.style.left="26px",d.style.color="gray",b=document.createElement("img"),b.setAttribute("border","0"),b.setAttribute("valign","bottom"),b.setAttribute("src",Editor.helpImage),b.style.marginRight="2px",d.appendChild(b),mxUtils.write(d,mxResources.get("help")),e.appendChild(d));b=document.createElement("p");b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";var h=document.createElement("img");h.setAttribute("border","0");h.setAttribute("align",
-"absmiddle");h.style.width="40px";h.style.height="40px";h.style.marginRight="12px";h.style.paddingBottom="4px";var k="";a.mode==App.MODE_GOOGLE?(h.src=IMAGE_PATH+"/google-drive-logo.svg",k=mxResources.get("googleDrive"),null!=d&&d.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+Google+Drive")):a.mode==App.MODE_DROPBOX?(h.src=IMAGE_PATH+"/dropbox-logo.svg",k=mxResources.get("dropbox"),null!=d&&d.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+Dropbox")):
-a.mode==App.MODE_ONEDRIVE?(h.src=IMAGE_PATH+"/onedrive-logo.svg",k=mxResources.get("oneDrive"),null!=d&&d.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+OneDrive")):a.mode==App.MODE_GITHUB?(h.src=IMAGE_PATH+"/github-logo.svg",k=mxResources.get("github")):a.mode==App.MODE_TRELLO?(h.src=IMAGE_PATH+"/trello-logo.svg",k=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(h.src=IMAGE_PATH+"/osa_database.png",k=mxResources.get("browser")):(h.src=IMAGE_PATH+"/osa_drive-harddisk.png",
-k=mxResources.get("device"));var l=document.createElement("div");l.style.margin="4px 0px 0px 0px";var n=document.createElement("button");n.className="geBigButton";n.style.overflow="hidden";n.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(l.style.padding="42px 0px 56px 0px",n.style.marginBottom="12px"):(b.appendChild(h),mxUtils.write(b,k),e.appendChild(b),l.style.border="1px solid #d3d3d3",l.style.borderWidth="1px 0px 1px 0px",l.style.padding="18px 0px 24px 0px",n.style.marginBottom=
-"8px");mxClient.IS_QUIRKS&&(l.style.whiteSpace="nowrap",l.style.cssFloat="left");mxClient.IS_QUIRKS&&(n.style.width="340px");mxUtils.write(n,mxResources.get("createNewDiagram"));mxEvent.addListener(n,"click",function(){a.hideDialog();a.actions.get("new").funct()});l.appendChild(n);mxUtils.br(l);n=document.createElement("button");n.className="geBigButton";n.style.marginBottom="22px";n.style.overflow="hidden";n.style.width="340px";mxClient.IS_QUIRKS&&(n.style.width="340px");mxUtils.write(n,mxResources.get("openExistingDiagram"));
-mxEvent.addListener(n,"click",function(){a.actions.get("open").funct()});l.appendChild(n);d="undefined";a.mode==App.MODE_GOOGLE?d=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?d=mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?d=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?d=mxResources.get("github"):a.mode==App.MODE_TRELLO?d=mxResources.get("trello"):a.mode==App.MODE_DEVICE?d=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(d=mxResources.get("browser"));mxClient.IS_CHROMEAPP||
-EditorUi.isElectronApp||(h=function(b){n.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));n.style.marginBottom="16px";l.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});l.appendChild(c)},b=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=b?(n.style.marginBottom=
-"24px",h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="block",h.style.marginTop="6px",mxUtils.write(h,mxResources.get("changeUser")+" ("+b.displayName+")"),n.style.marginBottom="16px",l.style.paddingBottom="18px",mxEvent.addListener(h,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();
-a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),l.appendChild(h)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?h(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?h(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&h(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&h(function(){a.dropbox.logout();
-a.openLink("https://www.dropbox.com/logout")}),h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="block",h.style.marginTop="8px",mxUtils.write(h,mxResources.get("notUsingService",[d])),mxEvent.addListener(h,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),l.appendChild(h));e.appendChild(l);this.container=e},ConfirmDialog=function(a,e,d,b,h,k,l,n,m){var c=document.createElement("div");c.style.textAlign="center";var f=document.createElement("div");
-f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight="44px";mxClient.IS_QUIRKS&&(f.style.height="60px");mxUtils.write(f,e);c.appendChild(f);f=document.createElement("div");f.style.textAlign="center";f.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");k=mxUtils.button(k||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(g.checked)});k.className="geBtn";null!=n&&(k.innerHTML=n+"<br>"+k.innerHTML,k.style.paddingBottom="8px",k.style.paddingTop=
-"8px",k.style.height="auto",k.style.width="40%");a.editor.cancelFirst&&f.appendChild(k);h=mxUtils.button(h||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d(g.checked)});f.appendChild(h);null!=l?(h.innerHTML=l+"<br>"+h.innerHTML+"<br>",h.style.paddingBottom="8px",h.style.paddingTop="8px",h.style.height="auto",h.className="geBtn",h.style.width="40%"):h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||f.appendChild(k);c.appendChild(f);m?(f.style.marginTop="10px",f=document.createElement("p"),
-f.style.marginTop="20px",f.appendChild(g),l=document.createElement("span"),mxUtils.write(l," "+mxResources.get("rememberThisSetting")),f.appendChild(l),c.appendChild(f),mxEvent.addListener(l,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)})):f.style.marginTop="16px";this.container=c},ErrorDialog=function(a,e,d,b,h,k,l,n,m){m=null!=m?m:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=e){var f=document.createElement("div");f.style.padding="0px";f.style.margin="0px";
-f.style.fontSize="18px";f.style.paddingBottom="16px";f.style.marginBottom="16px";f.style.borderBottom="1px solid #c0c0c0";f.style.color="gray";mxUtils.write(f,e);c.appendChild(f)}e=document.createElement("div");e.style.padding="6px";e.innerHTML=d;c.appendChild(e);d=document.createElement("div");d.style.marginTop="16px";d.style.textAlign="right";null!=k&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();k()}),e.className="geBtn",d.appendChild(e),d.style.textAlign="center");var g=
-mxUtils.button(b,function(){m&&a.hideDialog();null!=h&&h()});g.className="geBtn";d.appendChild(g);null!=l&&(b=mxUtils.button(l,function(){m&&a.hideDialog();null!=n&&n()}),b.className="geBtn gePrimaryBtn",d.appendChild(b));this.init=function(){g.focus()};c.appendChild(d);this.container=c},EmbedDialog=function(a,e,d,b,h){b=document.createElement("div");var k=/^https?:\/\//.test(e)||/^mailto:\/\//.test(e);mxUtils.write(b,mxResources.get(5E5>e.length?k?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(b);
-var l=document.createElement("div");l.style.position="absolute";l.style.top="30px";l.style.right="30px";l.style.color="gray";mxUtils.write(l,a.formatFileSize(e.length));b.appendChild(l);var n=document.createElement("textarea");n.setAttribute("autocomplete","off");n.setAttribute("autocorrect","off");n.setAttribute("autocapitalize","off");n.setAttribute("spellcheck","false");n.style.marginTop="10px";n.style.resize="none";n.style.height="150px";n.style.width="440px";n.style.border="1px solid gray";n.value=
-mxResources.get("updatingDocument");b.appendChild(n);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>e.length?(n.value=e,n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):(n.setAttribute("readonly","true"),n.value=e.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};l=document.createElement("div");l.style.position="absolute";l.style.bottom="36px";l.style.right="32px";var m=
-null;mxClient.IS_CHROMEAPP&&!k||navigator.standalone||!(k||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(mxResources.get(5E5>e.length?"preview":"openInNewWindow"),function(){var c=5E5>e.length?n.value:e;if(null!=h)h(c);else if(k)try{var f=a.openLink(c);null!=f&&(null==d||0<d)&&window.setTimeout(mxUtils.bind(this,function(){null!=f&&null!=f.location.href&&f.location.href.substring(0,8)!=c.substring(0,8)&&(f.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),
-d||500)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}else{var b=window.open().document;b.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+e+"</body></html>");b.close()}}),m.className="geBtn",l.appendChild(m));if(!k||7500<e.length){var c=mxUtils.button(mxResources.get("download"),function(){a.saveData("embed.txt","txt",e,"text/plain")});c.className="geBtn";l.appendChild(c)}if(k&&(!a.isOffline()||
-mxClient.IS_CHROMEAPP)){if(51200>e.length){var f=mxUtils.button("",function(){try{var c="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(n.value);a.openLink(c)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),c=document.createElement("img");c.setAttribute("src",Editor.facebookImage);c.setAttribute("width","18");c.setAttribute("height","18");c.setAttribute("border","0");f.appendChild(c);f.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+
-" max)");f.style.verticalAlign="bottom";f.style.paddingTop="4px";f.style.minWidth="46px";f.className="geBtn";l.appendChild(f)}7168>e.length&&(f=mxUtils.button("",function(){try{var c="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(n.value);a.openLink(c)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),c=document.createElement("img"),c.setAttribute("src",Editor.tweetImage),c.setAttribute("width",
-"18"),c.setAttribute("height","18"),c.setAttribute("border","0"),c.style.marginBottom="5px",f.appendChild(c),f.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",l.appendChild(f))}c=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.appendChild(c);f=mxUtils.button(mxResources.get("copy"),function(){n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>e.length?mxClient.IS_SF||null!=document.documentMode?c.className="geBtn gePrimaryBtn":(l.appendChild(f),f.className="geBtn gePrimaryBtn",c.className="geBtn"):(l.appendChild(m),c.className="geBtn",m.className="geBtn gePrimaryBtn");b.appendChild(l);this.container=b},GoogleSitesDialog=function(a,e){function d(){var a=null!=A.getTitle()?A.getTitle():
-this.defaultFilename;if(z.checked&&""!=t.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<D.length&&(b+="&s="+D);""!=q.value&&"0"!=q.value&&(b+="&border="+q.value);""!=g.value&&(b+="&height="+g.value);b+="&pan="+(u.checked?"1":"0");b+="&zoom="+(x.checked?"1":"0");b+="&fit="+(w.checked?"1":"0");b+="&resize="+(p.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+m;h.mathEnabled&&(b+="&math=1");
-v.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));c.value=b}else A.constructor==DriveFile||A.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?b+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(b+=A.getHash().substring(1),b=A.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=g.value&&(a=parseInt(g.value)+parseInt(f.value),b+="&height="+
-a),c.value=b):c.value=""}var b=document.createElement("div"),h=a.editor.graph,k=h.getGraphBounds(),l=h.view.scale,n=Math.floor(k.x/l-h.view.translate.x),m=Math.floor(k.y/l-h.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var c=document.createElement("input");c.setAttribute("type","text");c.style.marginBottom="8px";c.style.marginTop="2px";c.style.width="410px";b.appendChild(c);mxUtils.br(b);this.init=function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?c.select():document.execCommand("selectAll",!1,null)};mxUtils.write(b,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=n;b.appendChild(f);mxUtils.write(b,mxResources.get("height")+":");var g=document.createElement("input");g.setAttribute("type","text");g.setAttribute("size","4");g.style.marginLeft="4px";g.value=Math.ceil(k.height/l);b.appendChild(g);
-mxUtils.br(b);k=document.createElement("hr");k.setAttribute("size","1");k.style.marginBottom="16px";k.style.marginTop="16px";b.appendChild(k);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var t=document.createElement("input");t.setAttribute("type","text");t.setAttribute("size","28");t.style.marginBottom="8px";t.style.marginTop="2px";t.style.width="410px";t.value=e||"";b.appendChild(t);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var q=document.createElement("input");
-q.setAttribute("type","text");q.setAttribute("size","3");q.style.marginBottom="8px";q.style.marginLeft="4px";q.value="0";b.appendChild(q);mxUtils.br(b);var u=document.createElement("input");u.setAttribute("type","checkbox");u.setAttribute("checked","checked");u.defaultChecked=!0;u.style.marginLeft="16px";b.appendChild(u);mxUtils.write(b,mxResources.get("pan")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.setAttribute("checked","checked");x.defaultChecked=!0;x.style.marginLeft=
-"8px";b.appendChild(x);mxUtils.write(b,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);b.appendChild(y);mxUtils.write(b,mxResources.get("edit")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.style.marginLeft="8px";b.appendChild(v);mxUtils.write(b,mxResources.get("asNew")+" ");mxUtils.br(b);var p=document.createElement("input");p.setAttribute("type",
-"checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="16px";b.appendChild(p);mxUtils.write(b,mxResources.get("resize")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.style.marginLeft="8px";b.appendChild(w);mxUtils.write(b,mxResources.get("fit")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";b.appendChild(z);mxUtils.write(b,mxResources.get("embed")+" ");var D=a.getBasenames().join(";"),
-A=a.getCurrentFile();mxEvent.addListener(u,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(p,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(v,"change",d);mxEvent.addListener(z,"change",d);mxEvent.addListener(g,"change",d);mxEvent.addListener(f,"change",d);mxEvent.addListener(q,"change",d);mxEvent.addListener(t,"change",d);d();mxEvent.addListener(c,"click",function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?c.select():document.execCommand("selectAll",!1,null)});k=document.createElement("div");k.style.paddingTop="12px";k.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";k.appendChild(l);b.appendChild(k);this.container=b},CreateGraphDialog=function(a,e,d){var b=document.createElement("div");b.style.textAlign="right";this.init=function(){var e=document.createElement("div");e.style.position="relative";e.style.border=
-"1px solid gray";e.style.width="100%";e.style.height="360px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);b.appendChild(e);var k=new Graph(e);k.setCellsCloneable(!0);k.setPanning(!0);k.setAllowDanglingEdges(!1);k.connectionHandler.select=!1;k.view.setTranslate(20,20);k.border=20;k.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";k.cellRenderer.installCellOverlayListeners=function(a,c,f){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,
-arguments);mxEvent.addListener(f.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(f){c.fireEvent(new mxEventObject("pointerdown","event",f,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(f.node,"touchstart",function(f){c.fireEvent(new mxEventObject("pointerdown","event",f,"state",a))})};k.getAllConnectionConstraints=function(){return null};k.connectionHandler.marker.highlight.keepOnTop=!1;k.connectionHandler.createEdgeState=function(a){a=k.createEdge(null,null,
-null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var n=k.getDefaultParent(),m=mxUtils.bind(this,function(a){var c=new mxCellOverlay(this.connectImage,"Add outgoing");c.cursor="hand";c.addListener(mxEvent.CLICK,function(c,f){k.connectionHandler.reset();k.clearSelection();var b=k.getCellGeometry(a),p;g(function(){p=k.insertVertex(n,null,"Entry",b.x,b.y,80,30,"rounded=1;");m(p);k.view.refresh(p);k.insertEdge(n,null,"",a,p,l)},function(){k.scrollCellToVisible(p)})});
-c.addListener("pointerdown",function(a,c){var f=c.getProperty("event"),b=c.getProperty("state");k.popupMenuHandler.hideMenu();k.stopEditing(!1);var p=mxUtils.convertPoint(k.container,mxEvent.getClientX(f),mxEvent.getClientY(f));k.connectionHandler.start(b,p.x,p.y);k.isMouseDown=!0;k.isMouseTrigger=mxEvent.isMouseEvent(f);mxEvent.consume(f)});k.addCellOverlay(a,c)});k.getModel().beginUpdate();var c;try{c=k.insertVertex(n,null,"Start",0,0,80,30,"ellipse"),m(c)}finally{k.getModel().endUpdate()}var f;
-"horizontalTree"==d?(f=new mxCompactTreeLayout(k),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==d?(f=new mxCompactTreeLayout(k,!1),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==d?(f=new mxRadialTreeLayout(k,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==d?f=new mxHierarchicalLayout(k,mxConstants.DIRECTION_NORTH):"horizontalFlow"==d?f=new mxHierarchicalLayout(k,mxConstants.DIRECTION_WEST):
-"organic"==d?(f=new mxFastOrganicLayout(k,!1),f.forceConstant=80):"circle"==d&&(f=new mxCircleLayout(k));if(null!=f){var g=function(a,b){k.getModel().beginUpdate();try{null!=a&&a(),f.execute(k.getDefaultParent(),c)}catch(p){throw p;}finally{var g=new mxMorphing(k);g.addListener(mxEvent.DONE,mxUtils.bind(this,function(){k.getModel().endUpdate();null!=b&&b()}));g.startAnimation()}},t=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(a,c,f,b,q){t.apply(this,arguments);g()};k.resizeCell=
-function(){mxGraph.prototype.resizeCell.apply(this,arguments);g()};k.connectionHandler.addListener(mxEvent.CONNECT,function(){g()})}var q=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=e.parentNode&&(k.destroy(),e.parentNode.removeChild(e));a.hideDialog()})});q.className="geBtn";a.editor.cancelFirst&&b.appendChild(q);var u=mxUtils.button(mxResources.get("insert"),function(){k.clearCellOverlays();var c=a.editor.graph.getFreeInsertPoint(),
-c=a.editor.graph.importCells(k.getModel().getChildren(k.getDefaultParent()),c.x,c.y),f=a.editor.graph.view,b=f.getBounds(c);b.x-=f.translate.x;b.y-=f.translate.y;a.editor.graph.scrollRectToVisible(b);a.editor.graph.setSelectionCells(c);null!=e.parentNode&&(k.destroy(),e.parentNode.removeChild(e));a.hideDialog()});b.appendChild(u);u.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(q)};this.container=b};
+5E3);this.container=h},SplashDialog=function(a){var d=document.createElement("div");d.style.textAlign="center";a.addLanguageMenu(d,!0);var e=null,b=a.getServiceCount();!a.isOffline()&&1<b&&(e=document.createElement("a"),e.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage"),e.setAttribute("title",mxResources.get("help")),e.setAttribute("target","_blank"),e.style.position="absolute",e.style.fontSize="12px",e.style.textDecoration="none",e.style.cursor="pointer",e.style.bottom=
+"22px",e.style.left="26px",e.style.color="gray",b=document.createElement("img"),b.setAttribute("border","0"),b.setAttribute("valign","bottom"),b.setAttribute("src",Editor.helpImage),b.style.marginRight="2px",e.appendChild(b),mxUtils.write(e,mxResources.get("help")),d.appendChild(e));b=document.createElement("p");b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";var h=document.createElement("img");h.setAttribute("border","0");h.setAttribute("align",
+"absmiddle");h.style.width="40px";h.style.height="40px";h.style.marginRight="12px";h.style.paddingBottom="4px";var l="";a.mode==App.MODE_GOOGLE?(h.src=IMAGE_PATH+"/google-drive-logo.svg",l=mxResources.get("googleDrive"),null!=e&&e.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+Google+Drive")):a.mode==App.MODE_DROPBOX?(h.src=IMAGE_PATH+"/dropbox-logo.svg",l=mxResources.get("dropbox"),null!=e&&e.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+Dropbox")):
+a.mode==App.MODE_ONEDRIVE?(h.src=IMAGE_PATH+"/onedrive-logo.svg",l=mxResources.get("oneDrive"),null!=e&&e.setAttribute("href","https://support.draw.io/display/DO/Using+draw.io+with+OneDrive")):a.mode==App.MODE_GITHUB?(h.src=IMAGE_PATH+"/github-logo.svg",l=mxResources.get("github")):a.mode==App.MODE_TRELLO?(h.src=IMAGE_PATH+"/trello-logo.svg",l=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(h.src=IMAGE_PATH+"/osa_database.png",l=mxResources.get("browser")):(h.src=IMAGE_PATH+"/osa_drive-harddisk.png",
+l=mxResources.get("device"));var k=document.createElement("div");k.style.margin="4px 0px 0px 0px";var m=document.createElement("button");m.className="geBigButton";m.style.overflow="hidden";m.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(k.style.padding="42px 0px 56px 0px",m.style.marginBottom="12px"):(b.appendChild(h),mxUtils.write(b,l),d.appendChild(b),k.style.border="1px solid #d3d3d3",k.style.borderWidth="1px 0px 1px 0px",k.style.padding="18px 0px 24px 0px",m.style.marginBottom=
+"8px");mxClient.IS_QUIRKS&&(k.style.whiteSpace="nowrap",k.style.cssFloat="left");mxClient.IS_QUIRKS&&(m.style.width="340px");mxUtils.write(m,mxResources.get("createNewDiagram"));mxEvent.addListener(m,"click",function(){a.hideDialog();a.actions.get("new").funct()});k.appendChild(m);mxUtils.br(k);m=document.createElement("button");m.className="geBigButton";m.style.marginBottom="22px";m.style.overflow="hidden";m.style.width="340px";mxClient.IS_QUIRKS&&(m.style.width="340px");mxUtils.write(m,mxResources.get("openExistingDiagram"));
+mxEvent.addListener(m,"click",function(){a.actions.get("open").funct()});k.appendChild(m);e="undefined";a.mode==App.MODE_GOOGLE?e=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?e=mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?e=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?e=mxResources.get("github"):a.mode==App.MODE_TRELLO?e=mxResources.get("trello"):a.mode==App.MODE_DEVICE?e=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(e=mxResources.get("browser"));mxClient.IS_CHROMEAPP||
+EditorUi.isElectronApp||(h=function(b){m.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));m.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});k.appendChild(c)},b=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=b?(m.style.marginBottom=
+"24px",h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="block",h.style.marginTop="6px",mxUtils.write(h,mxResources.get("changeUser")+" ("+b.displayName+")"),m.style.marginBottom="16px",k.style.paddingBottom="18px",mxEvent.addListener(h,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();
+a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),k.appendChild(h)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?h(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?h(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&h(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&h(function(){a.dropbox.logout();
+a.openLink("https://www.dropbox.com/logout")}),h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="block",h.style.marginTop="8px",mxUtils.write(h,mxResources.get("notUsingService",[e])),mxEvent.addListener(h,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),k.appendChild(h));d.appendChild(k);this.container=d},ConfirmDialog=function(a,d,e,b,h,l,k,m,n){var c=document.createElement("div");c.style.textAlign="center";var f=document.createElement("div");
+f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight="44px";mxClient.IS_QUIRKS&&(f.style.height="60px");mxUtils.write(f,d);c.appendChild(f);f=document.createElement("div");f.style.textAlign="center";f.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");l=mxUtils.button(l||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(g.checked)});l.className="geBtn";null!=m&&(l.innerHTML=m+"<br>"+l.innerHTML,l.style.paddingBottom="8px",l.style.paddingTop=
+"8px",l.style.height="auto",l.style.width="40%");a.editor.cancelFirst&&f.appendChild(l);h=mxUtils.button(h||mxResources.get("ok"),function(){a.hideDialog();null!=e&&e(g.checked)});f.appendChild(h);null!=k?(h.innerHTML=k+"<br>"+h.innerHTML+"<br>",h.style.paddingBottom="8px",h.style.paddingTop="8px",h.style.height="auto",h.className="geBtn",h.style.width="40%"):h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||f.appendChild(l);c.appendChild(f);n?(f.style.marginTop="10px",f=document.createElement("p"),
+f.style.marginTop="20px",f.appendChild(g),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberThisSetting")),f.appendChild(k),c.appendChild(f),mxEvent.addListener(k,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)})):f.style.marginTop="16px";this.container=c},ErrorDialog=function(a,d,e,b,h,l,k,m,n){n=null!=n?n:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=d){var f=document.createElement("div");f.style.padding="0px";f.style.margin="0px";
+f.style.fontSize="18px";f.style.paddingBottom="16px";f.style.marginBottom="16px";f.style.borderBottom="1px solid #c0c0c0";f.style.color="gray";mxUtils.write(f,d);c.appendChild(f)}d=document.createElement("div");d.style.padding="6px";d.innerHTML=e;c.appendChild(d);e=document.createElement("div");e.style.marginTop="16px";e.style.textAlign="right";null!=l&&(d=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();l()}),d.className="geBtn",e.appendChild(d),e.style.textAlign="center");var g=
+mxUtils.button(b,function(){n&&a.hideDialog();null!=h&&h()});g.className="geBtn";e.appendChild(g);null!=k&&(b=mxUtils.button(k,function(){n&&a.hideDialog();null!=m&&m()}),b.className="geBtn gePrimaryBtn",e.appendChild(b));this.init=function(){g.focus()};c.appendChild(e);this.container=c},EmbedDialog=function(a,d,e,b,h){b=document.createElement("div");var l=/^https?:\/\//.test(d)||/^mailto:\/\//.test(d);mxUtils.write(b,mxResources.get(5E5>d.length?l?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(b);
+var k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.right="30px";k.style.color="gray";mxUtils.write(k,a.formatFileSize(d.length));b.appendChild(k);var m=document.createElement("textarea");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("autocapitalize","off");m.setAttribute("spellcheck","false");m.style.marginTop="10px";m.style.resize="none";m.style.height="150px";m.style.width="440px";m.style.border="1px solid gray";m.value=
+mxResources.get("updatingDocument");b.appendChild(m);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>d.length?(m.value=d,m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):(m.setAttribute("readonly","true"),m.value=d.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};k=document.createElement("div");k.style.position="absolute";k.style.bottom="36px";k.style.right="32px";var n=
+null;mxClient.IS_CHROMEAPP&&!l||navigator.standalone||!(l||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(n=mxUtils.button(mxResources.get(5E5>d.length?"preview":"openInNewWindow"),function(){var c=5E5>d.length?m.value:d;if(null!=h)h(c);else if(l)try{var f=a.openLink(c);null!=f&&(null==e||0<e)&&window.setTimeout(mxUtils.bind(this,function(){null!=f&&null!=f.location.href&&f.location.href.substring(0,8)!=c.substring(0,8)&&(f.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),
+e||500)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}else{var b=window.open().document;b.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+d+"</body></html>");b.close()}}),n.className="geBtn",k.appendChild(n));if(!l||7500<d.length){var c=mxUtils.button(mxResources.get("download"),function(){a.saveData("embed.txt","txt",d,"text/plain")});c.className="geBtn";k.appendChild(c)}if(l&&(!a.isOffline()||
+mxClient.IS_CHROMEAPP)){if(51200>d.length){var f=mxUtils.button("",function(){try{var c="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(m.value);a.openLink(c)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),c=document.createElement("img");c.setAttribute("src",Editor.facebookImage);c.setAttribute("width","18");c.setAttribute("height","18");c.setAttribute("border","0");f.appendChild(c);f.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+
+" max)");f.style.verticalAlign="bottom";f.style.paddingTop="4px";f.style.minWidth="46px";f.className="geBtn";k.appendChild(f)}7168>d.length&&(f=mxUtils.button("",function(){try{var c="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(c)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),c=document.createElement("img"),c.setAttribute("src",Editor.tweetImage),c.setAttribute("width",
+"18"),c.setAttribute("height","18"),c.setAttribute("border","0"),c.style.marginBottom="5px",f.appendChild(c),f.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",k.appendChild(f))}c=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.appendChild(c);f=mxUtils.button(mxResources.get("copy"),function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>d.length?mxClient.IS_SF||null!=document.documentMode?c.className="geBtn gePrimaryBtn":(k.appendChild(f),f.className="geBtn gePrimaryBtn",c.className="geBtn"):(k.appendChild(n),c.className="geBtn",n.className="geBtn gePrimaryBtn");b.appendChild(k);this.container=b},GoogleSitesDialog=function(a,d){function e(){var a=null!=A.getTitle()?A.getTitle():
+this.defaultFilename;if(x.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<z.length&&(b+="&s="+z);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=g.value&&(b+="&height="+g.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(w.checked?"1":"0");b+="&fit="+(v.checked?"1":"0");b+="&resize="+(q.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;h.mathEnabled&&(b+="&math=1");
+B.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));c.value=b}else A.constructor==DriveFile||A.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=A.getHash().substring(1),b=A.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=g.value&&(a=parseInt(g.value)+parseInt(f.value),b+="&height="+
+a),c.value=b):c.value=""}var b=document.createElement("div"),h=a.editor.graph,l=h.getGraphBounds(),k=h.view.scale,m=Math.floor(l.x/k-h.view.translate.x),n=Math.floor(l.y/k-h.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var c=document.createElement("input");c.setAttribute("type","text");c.style.marginBottom="8px";c.style.marginTop="2px";c.style.width="410px";b.appendChild(c);mxUtils.br(b);this.init=function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?c.select():document.execCommand("selectAll",!1,null)};mxUtils.write(b,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=m;b.appendChild(f);mxUtils.write(b,mxResources.get("height")+":");var g=document.createElement("input");g.setAttribute("type","text");g.setAttribute("size","4");g.style.marginLeft="4px";g.value=Math.ceil(l.height/k);b.appendChild(g);
+mxUtils.br(b);l=document.createElement("hr");l.setAttribute("size","1");l.style.marginBottom="16px";l.style.marginTop="16px";b.appendChild(l);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","28");p.style.marginBottom="8px";p.style.marginTop="2px";p.style.width="410px";p.value=d||"";b.appendChild(p);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var u=document.createElement("input");
+u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";b.appendChild(u);mxUtils.br(b);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";b.appendChild(t);mxUtils.write(b,mxResources.get("pan")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft=
+"8px";b.appendChild(w);mxUtils.write(b,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);b.appendChild(y);mxUtils.write(b,mxResources.get("edit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft="8px";b.appendChild(B);mxUtils.write(b,mxResources.get("asNew")+" ");mxUtils.br(b);var q=document.createElement("input");q.setAttribute("type",
+"checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";b.appendChild(q);mxUtils.write(b,mxResources.get("resize")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.style.marginLeft="8px";b.appendChild(v);mxUtils.write(b,mxResources.get("fit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";b.appendChild(x);mxUtils.write(b,mxResources.get("embed")+" ");var z=a.getBasenames().join(";"),
+A=a.getCurrentFile();mxEvent.addListener(t,"change",e);mxEvent.addListener(w,"change",e);mxEvent.addListener(q,"change",e);mxEvent.addListener(v,"change",e);mxEvent.addListener(y,"change",e);mxEvent.addListener(B,"change",e);mxEvent.addListener(x,"change",e);mxEvent.addListener(g,"change",e);mxEvent.addListener(f,"change",e);mxEvent.addListener(u,"change",e);mxEvent.addListener(p,"change",e);e();mxEvent.addListener(c,"click",function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?c.select():document.execCommand("selectAll",!1,null)});l=document.createElement("div");l.style.paddingTop="12px";l.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";l.appendChild(k);b.appendChild(l);this.container=b},CreateGraphDialog=function(a,d,e){var b=document.createElement("div");b.style.textAlign="right";this.init=function(){var d=document.createElement("div");d.style.position="relative";d.style.border=
+"1px solid gray";d.style.width="100%";d.style.height="360px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);b.appendChild(d);var l=new Graph(d);l.setCellsCloneable(!0);l.setPanning(!0);l.setAllowDanglingEdges(!1);l.connectionHandler.select=!1;l.view.setTranslate(20,20);l.border=20;l.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";l.cellRenderer.installCellOverlayListeners=function(a,c,f){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,
+arguments);mxEvent.addListener(f.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(f){c.fireEvent(new mxEventObject("pointerdown","event",f,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(f.node,"touchstart",function(f){c.fireEvent(new mxEventObject("pointerdown","event",f,"state",a))})};l.getAllConnectionConstraints=function(){return null};l.connectionHandler.marker.highlight.keepOnTop=!1;l.connectionHandler.createEdgeState=function(a){a=l.createEdge(null,null,
+null,null,null,k);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var m=l.getDefaultParent(),n=mxUtils.bind(this,function(a){var c=new mxCellOverlay(this.connectImage,"Add outgoing");c.cursor="hand";c.addListener(mxEvent.CLICK,function(c,f){l.connectionHandler.reset();l.clearSelection();var b=l.getCellGeometry(a),q;g(function(){q=l.insertVertex(m,null,"Entry",b.x,b.y,80,30,"rounded=1;");n(q);l.view.refresh(q);l.insertEdge(m,null,"",a,q,k)},function(){l.scrollCellToVisible(q)})});
+c.addListener("pointerdown",function(a,c){var f=c.getProperty("event"),b=c.getProperty("state");l.popupMenuHandler.hideMenu();l.stopEditing(!1);var q=mxUtils.convertPoint(l.container,mxEvent.getClientX(f),mxEvent.getClientY(f));l.connectionHandler.start(b,q.x,q.y);l.isMouseDown=!0;l.isMouseTrigger=mxEvent.isMouseEvent(f);mxEvent.consume(f)});l.addCellOverlay(a,c)});l.getModel().beginUpdate();var c;try{c=l.insertVertex(m,null,"Start",0,0,80,30,"ellipse"),n(c)}finally{l.getModel().endUpdate()}var f;
+"horizontalTree"==e?(f=new mxCompactTreeLayout(l),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==e?(f=new mxCompactTreeLayout(l,!1),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==e?(f=new mxRadialTreeLayout(l,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==e?f=new mxHierarchicalLayout(l,mxConstants.DIRECTION_NORTH):"horizontalFlow"==e?f=new mxHierarchicalLayout(l,mxConstants.DIRECTION_WEST):
+"organic"==e?(f=new mxFastOrganicLayout(l,!1),f.forceConstant=80):"circle"==e&&(f=new mxCircleLayout(l));if(null!=f){var g=function(a,b){l.getModel().beginUpdate();try{null!=a&&a(),f.execute(l.getDefaultParent(),c)}catch(q){throw q;}finally{var g=new mxMorphing(l);g.addListener(mxEvent.DONE,mxUtils.bind(this,function(){l.getModel().endUpdate();null!=b&&b()}));g.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(a,c,f,b,u){p.apply(this,arguments);g()};l.resizeCell=
+function(){mxGraph.prototype.resizeCell.apply(this,arguments);g()};l.connectionHandler.addListener(mxEvent.CONNECT,function(){g()})}var u=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=d.parentNode&&(l.destroy(),d.parentNode.removeChild(d));a.hideDialog()})});u.className="geBtn";a.editor.cancelFirst&&b.appendChild(u);var t=mxUtils.button(mxResources.get("insert"),function(){l.clearCellOverlays();var c=a.editor.graph.getFreeInsertPoint(),
+c=a.editor.graph.importCells(l.getModel().getChildren(l.getDefaultParent()),c.x,c.y),f=a.editor.graph.view,b=f.getBounds(c);b.x-=f.translate.x;b.y-=f.translate.y;a.editor.graph.scrollRectToVisible(b);a.editor.graph.setSelectionCells(c);null!=d.parentNode&&(l.destroy(),d.parentNode.removeChild(d));a.hideDialog()});b.appendChild(t);t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(u)};this.container=b};
CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":IMAGE_PATH+
"/handle-connect.png",26,26);
-var BackgroundImageDialog=function(a,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var b=document.createElement("h2");mxUtils.write(b,mxResources.get("backgroundImage"));b.style.marginTop="0px";d.appendChild(b);mxUtils.write(d,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(d);var b=a.editor.graph.backgroundImage,h=document.createElement("input");h.setAttribute("type","text");h.style.marginTop="4px";h.style.marginBottom="4px";h.style.width="350px";h.value=
-null!=b?b.src:"";var k=!1,l=function(){k||""==h.value||a.isOffline()?(n.value="",m.value=""):a.loadImage(mxUtils.trim(h.value),function(a){n.value=a.width;m.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));h.value="";n.value="";m.value=""})};this.init=function(){h.focus();if(Graph.fileSupport){h.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=d.parentNode,f=null;mxEvent.addListener(c,"dragleave",function(a){null!=
-f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(c));b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(c){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<c.dataTransfer.files.length)a.importFiles(c.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,c,f,b,g,q){h.value=a;l()},function(){},
-function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);else if(0<=mxUtils.indexOf(c.dataTransfer.types,"text/uri-list")){var b=c.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b)&&(h.value=decodeURIComponent(b),l())}c.stopPropagation();c.preventDefault()}),!1)}};d.appendChild(h);mxUtils.br(d);mxUtils.br(d);mxUtils.write(d,mxResources.get("width")+":");var n=document.createElement("input");
-n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=b?b.width:"";d.appendChild(n);mxUtils.write(d,mxResources.get("height")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=b?b.height:"";d.appendChild(m);b=mxUtils.button(mxResources.get("reset"),function(){h.value="";n.value="";m.value="";k=!1});mxEvent.addListener(b,"mousedown",
-function(){k=!0});mxEvent.addListener(b,"touchstart",function(){k=!0});b.className="geBtn";b.width="100";d.appendChild(b);mxUtils.br(d);mxEvent.addListener(h,"change",l);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(h.value=a.url,l()));h.focus()};b=document.createElement("div");b.style.marginTop="40px";b.style.textAlign="right";var c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
+var BackgroundImageDialog=function(a,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var b=document.createElement("h2");mxUtils.write(b,mxResources.get("backgroundImage"));b.style.marginTop="0px";e.appendChild(b);mxUtils.write(e,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(e);var b=a.editor.graph.backgroundImage,h=document.createElement("input");h.setAttribute("type","text");h.style.marginTop="4px";h.style.marginBottom="4px";h.style.width="350px";h.value=
+null!=b?b.src:"";var l=!1,k=function(){l||""==h.value||a.isOffline()?(m.value="",n.value=""):a.loadImage(mxUtils.trim(h.value),function(a){m.value=a.width;n.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));h.value="";m.value="";n.value=""})};this.init=function(){h.focus();if(Graph.fileSupport){h.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=e.parentNode,f=null;mxEvent.addListener(c,"dragleave",function(a){null!=
+f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(c));b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(c){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<c.dataTransfer.files.length)a.importFiles(c.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,c,f,b,g,u){h.value=a;k()},function(){},
+function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);else if(0<=mxUtils.indexOf(c.dataTransfer.types,"text/uri-list")){var b=c.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b)&&(h.value=decodeURIComponent(b),k())}c.stopPropagation();c.preventDefault()}),!1)}};e.appendChild(h);mxUtils.br(e);mxUtils.br(e);mxUtils.write(e,mxResources.get("width")+":");var m=document.createElement("input");
+m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=b?b.width:"";e.appendChild(m);mxUtils.write(e,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=b?b.height:"";e.appendChild(n);b=mxUtils.button(mxResources.get("reset"),function(){h.value="";m.value="";n.value="";l=!1});mxEvent.addListener(b,"mousedown",
+function(){l=!0});mxEvent.addListener(b,"touchstart",function(){l=!0});b.className="geBtn";b.width="100";e.appendChild(b);mxUtils.br(e);mxEvent.addListener(h,"change",k);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(h.value=a.url,k()));h.focus()};b=document.createElement("div");b.style.marginTop="40px";b.style.textAlign="right";var c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);if(!a.isOffline()&&"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top){var f=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var c=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)});
f.className="geBtn";b.appendChild(f);null!=a.drive&&"1"==urlParams.photos&&(f=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var c=gapi.auth.getToken().access_token,c=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(c).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
-a.photoPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),f.className="geBtn",b.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e(""!=h.value?new mxImage(mxUtils.trim(h.value),n.value,m.value):null)});f.className="geBtn gePrimaryBtn";b.appendChild(f);a.editor.cancelFirst||b.appendChild(c);d.appendChild(b);this.container=d},ParseDialog=function(a,e){function d(c,f){var b=c.split("\n");if("plantUmlPng"==f||"plantUmlSvg"==
-f){var b="plantUmlPng"==f?"https://exp.draw.io/plantuml2/png/":"https://exp.draw.io/plantuml2/svg/",g=a.editor.graph;if(a.spinner.spin(document.body,mxResources.get("inserting"))){var d=function(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"},e=function(a,c,b){c1=a>>2;c2=(a&3)<<4|c>>4;c3=(c&15)<<2|b>>6;c4=b&63;r="";r+=d(c1&63);r+=d(c2&63);r+=d(c3&63);return r+=d(c4&63)},v=
-new XMLHttpRequest;v.open("GET",b+function(a){r="";for(k=0;k<a.length;k+=3)r=k+2==a.length?r+e(a.charCodeAt(k),a.charCodeAt(k+1),0):k+1==a.length?r+e(a.charCodeAt(k),0,0):r+e(a.charCodeAt(k),a.charCodeAt(k+1),a.charCodeAt(k+2));return r}(g.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(c))))),!0);v.responseType="blob";v.onload=function(b){200<=this.status&&300>this.status?(b=new FileReader,b.readAsDataURL(this.response),b.onload=function(b){var f=new Image;f.onload=function(){a.spinner.stop();
-g.getModel().beginUpdate();try{cell=g.insertVertex(null,null,c,h.x,h.y,f.width,f.height,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(b.target.result)+";")}finally{g.getModel().endUpdate()}g.setSelectionCell(cell);g.scrollCellToVisible(g.getSelectionCell())};f.src=b.target.result},b.onerror=function(c){a.handleError(c)}):(a.spinner.stop(),a.handleError(b))};v.onerror=function(c){a.handleError(c)};v.send()}}else if("table"==f){for(var p=null,w=[],t=0,
-k=0;k<b.length;k++)if(v=mxUtils.trim(b[k]),"create table"==v.substring(0,12).toLowerCase())v=mxUtils.trim(v.substring(12)),"("==v.charAt(v.length-1)&&(v=v.substring(0,v.lastIndexOf(" "))),p=new mxCell(v,new mxGeometry(t,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),p.vertex=!0,w.push(p),v=a.editor.graph.getPreferredSizeForCell(l),
-null!=v&&(p.geometry.width=v.width+10);else if(null!=p&&")"==v.charAt(0))t+=p.geometry.width+40,p=null;else if("("!=v&&null!=p&&(v=v.substring(0,","==v.charAt(v.length-1)?v.length-1:v.length),"primary key"!=v.substring(0,11).toLowerCase())){var l=new mxCell(v,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
-l.vertex=!0;v=sb.cloneCell(l,"");v.connectable=!1;v.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";v.geometry.width=30;v.geometry.height=26;l.insert(v);v=a.editor.graph.getPreferredSizeForCell(l);null!=v&&p.geometry.width<v.width+10&&(p.geometry.width=v.width+10);p.insert(l);p.geometry.height+=26}0<w.length&&(g=a.editor.graph,b=g.view,v=g.getGraphBounds(),
-g.setSelectionCells(g.importCells(w,Math.ceil(Math.max(0,v.x/b.scale-b.translate.x)+4*g.gridSize),Math.ceil(Math.max(0,(v.y+v.height)/b.scale-b.translate.y)+4*g.gridSize))),g.scrollCellToVisible(g.getSelectionCell()))}else if("list"==f){if(0<b.length){g=a.editor.graph;l=new mxCell(b[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");l.vertex=!0;
-v=g.getPreferredSizeForCell(l);null!=v&&l.geometry.width<v.width+10&&(l.geometry.width=v.width+10);p=[l];if(1<b.length)for(k=1;k<b.length;k++)"--"==b[k]?(v=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),v.vertex=!0,l.geometry.height+=v.geometry.height,l.insert(v),p.push(v)):0<b[k].length&&";"!=b[k].charAt(0)&&(t=new mxCell(b[k],
-new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),t.vertex=!0,v=g.getPreferredSizeForCell(t),null!=v&&t.geometry.width<v.width&&(t.geometry.width=v.width),l.geometry.width=Math.max(l.geometry.width,t.geometry.width),l.geometry.height+=t.geometry.height,l.insert(t),p.push(t));g.getModel().beginUpdate();try{l=g.importCells([l],h.x,h.y)[0],g.fireEvent(new mxEventObject("cellsInserted",
-"cells",[l].concat(l.children)))}finally{g.getModel().endUpdate()}g.setSelectionCell(l);g.scrollCellToVisible(g.getSelectionCell())}}else{for(var l=function(a){var c=n[a];null==c&&(c=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),c.vertex=!0,n[a]=c,w.push(c));return c},n={},w=[],k=0;k<b.length;k++)if(";"!=b[k].charAt(0)){var m=b[k].split("->");if(2<=m.length){var t=l(m[0]),C=l(m[m.length-1]),m=new mxCell(2<m.length?m[1]:"",new mxGeometry);m.edge=!0;t.insertEdge(m,!0);C.insertEdge(m,
-!1);w.push(m)}}if(0<w.length){b=document.createElement("div");b.style.visibility="hidden";document.body.appendChild(b);g=new Graph(b);g.getModel().beginUpdate();try{w=g.importCells(w);for(k=0;k<w.length;k++)g.getModel().isVertex(w[k])&&(v=g.getPreferredSizeForCell(w[k]),w[k].geometry.width=Math.max(w[k].geometry.width,v.width),w[k].geometry.height=Math.max(w[k].geometry.height,v.height));p=new mxFastOrganicLayout(g);p.disableEdgeStyle=!1;p.forceConstant=120;p.execute(g.getDefaultParent())}finally{g.getModel().endUpdate()}g.clearCellOverlays();
-p=[];a.editor.graph.getModel().beginUpdate();try{p=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),h.x,h.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",p))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(p[0]);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());g.destroy();b.parentNode.removeChild(b)}}}function b(){return"list"==n.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":
-"table"==n.value?"CREATE TABLE Persons\n(\nPersonID int,\nLastName varchar(255),\nFirstName varchar(255),\nAddress varchar(255),\nCity varchar(255)\n);":"plantUmlPng"==n.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":"plantUmlSvg"==n.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
-";Example:\na->b\nb->edge label->c\nc->a\n"}var h=a.editor.graph.getFreeInsertPoint(),k=document.createElement("div");k.style.textAlign="right";var l=document.createElement("textarea");l.style.resize="none";l.style.width="100%";l.style.height="354px";l.style.marginBottom="16px";var n=document.createElement("select"),m=document.createElement("option");m.setAttribute("value","list");m.setAttribute("selected","selected");mxUtils.write(m,mxResources.get("list"));n.appendChild(m);m=document.createElement("option");
-m.setAttribute("value","table");mxUtils.write(m,mxResources.get("table"));n.appendChild(m);m=document.createElement("option");m.setAttribute("value","diagram");mxUtils.write(m,mxResources.get("diagram"));n.appendChild(m);m=document.createElement("option");m.setAttribute("value","plantUmlSvg");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");var c=document.createElement("option");c.setAttribute("value","plantUmlPng");mxUtils.write(c,mxResources.get("plantUml")+" ("+
-mxResources.get("formatPng")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&(n.appendChild(m),n.appendChild(c));var f=b();l.value=f;k.appendChild(l);this.init=function(){l.focus()};Graph.fileSupport&&(l.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),l.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var c=new FileReader;c.onload=function(a){l.value=a.target.result};
-c.readAsText(a)}},!1));k.appendChild(n);mxEvent.addListener(n,"change",function(){var a=b();if(0==l.value.length||l.value==f)f=a,l.value=f});m=mxUtils.button(mxResources.get("close"),function(){l.value==f?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});m.className="geBtn";a.editor.cancelFirst&&k.appendChild(m);c=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();d(l.value,n.value)});k.appendChild(c);c.className="geBtn gePrimaryBtn";a.editor.cancelFirst||
-k.appendChild(m);this.container=k},NewDialog=function(a,e,d,b,h,k,l,n,m,c,f){function g(){if(b)d||a.hideDialog(),b(z,p.value);else{var c=p.value;null!=c&&0<c.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null,function(b){a.createFile(c,z,null!=w&&0<w.length?w:null,null,function(){a.hideDialog()},null,b)})}}function t(a,c,b){null!=D&&(D.style.backgroundColor="transparent",D.style.border="1px solid transparent");
-z=c;w=b;D=a;D.style.backgroundColor=n;D.style.border=m}function q(a,c,b,f,p){var d=document.createElement("div");d.className="geTemplate";d.style.height="140px";d.style.width="140px";null!=f&&0<f.length&&d.setAttribute("title",f);if(null!=a&&0<a.length){a.substring(0,a.length-4);d.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";var e=!1;mxEvent.addListener(d,"click",function(b){A.setAttribute("disabled",
-"disabled");d.style.backgroundColor="transparent";d.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(A.removeAttribute("disabled"),t(d,a.getText(),c),e&&g())}))});mxEvent.addListener(d,"dblclick",function(a){e=!0})}else d.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(b)+"</td></tr></table>",p&&t(d),mxEvent.addListener(d,"click",function(a){t(d)}),mxEvent.addListener(d,
-"dblclick",function(a){g()});F.appendChild(d)}function u(){function a(){for(var a=!0;b<B.length&&(a||0!=mxUtils.mod(b,30));)a=B[b++],q(a.url,a.libs,a.title,a.tooltip,a.select),a=!1}var b=0;mxEvent.addListener(F,"scroll",function(c){F.scrollTop+F.clientHeight>=F.scrollHeight&&(a(),mxEvent.consume(c))});var f=null,p;for(p in C){var g=document.createElement("div"),d=mxResources.get(p),e=C[p];null==d&&(d=p.substring(0,1).toUpperCase()+p.substring(1));18<d.length&&(d=d.substring(0,18)+"&hellip;");g.style.cssText=
-"display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";g.setAttribute("title",d+" ("+e.length+")");mxUtils.write(g,g.getAttribute("title"));null!=c&&(g.style.padding=c);E.appendChild(g);null==f&&(f=g,f.style.backgroundColor=l);(function(c,p){mxEvent.addListener(g,"click",function(){f!=p&&(f.style.backgroundColor="",f=p,f.style.backgroundColor=l,F.scrollTop=0,F.innerHTML="",b=0,B=C[c],a())})})(p,g)}a()}d=null!=d?d:!0;h=null!=h?h:!1;
-l=null!=l?l:"#ebf2f9";n=null!=n?n:"#e6eff8";m=null!=m?m:"1px solid #ccd9ea";f=null!=f?f:TEMPLATE_PATH+"/index.xml";var x=document.createElement("div");x.style.height="100%";var y=document.createElement("div");y.style.whiteSpace="nowrap";y.style.height="46px";x.appendChild(y);var v=document.createElement("img");v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.width="40px";v.style.height="40px";v.style.marginRight="10px";v.style.paddingBottom="4px";v.src=a.mode==App.MODE_GOOGLE?
-IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!e&&d&&y.appendChild(v);d&&mxUtils.write(y,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+
-":");v=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?v=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?v=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?v=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?v=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(v=a.trello.extension);var p=document.createElement("input");p.setAttribute("value",a.defaultFilename+v);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width=e?"220px":"430px";this.init=
-function(){d&&(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null))};d&&y.appendChild(p);var w=null,z=null,D=null,A=mxUtils.button(mxResources.get("create"),function(){g()});A.className="geBtn gePrimaryBtn";var F=document.createElement("div");F.style.border="1px solid #d3d3d3";F.style.position="absolute";F.style.left="160px";F.style.right="34px";F.style.top=d?"72px":"40px";F.style.bottom="68px";F.style.margin=
-"6px 0 0 -1px";F.style.padding="6px";F.style.overflow="auto";var E=document.createElement("div");E.style.cssText="position:absolute;left:30px;width:128px;top:72px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";d||(E.style.top="40px");var C={},H=1;C.basic=[{title:"blankDiagram",select:!0}];var B=C.basic;if(!e){x.appendChild(E);x.appendChild(F);var G=!1;mxUtils.get(f,function(a){if(!G){G=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var c=
-a.getAttribute("url");if(null!=c){var b=c.indexOf("/"),c=c.substring(0,b),b=C[c];null==b&&(H++,b=[],C[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=a.nextSibling}u()}})}mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&g()});f=document.createElement("div");f.style.marginTop=e?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";
-y=mxUtils.button(mxResources.get("cancel"),function(){null!=k&&k();a.hideDialog(!0)});y.className="geBtn";!a.editor.cancelFirst||h&&null==k||f.appendChild(y);e||a.isOffline()||!d||null!=b||h||(v=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),v.className="geBtn",f.appendChild(v));e||"1"==urlParams.embed||h||(e=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var c=new FilenameDialog(a,"",mxResources.get("create"),
-function(c){null!=c&&0<c.length&&(c=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(p.value)+"&create="+encodeURIComponent(c)),null==a.getCurrentFile()?window.location.href=c:window.openWindow(c))},mxResources.get("url"));a.showDialog(c.container,300,80,!0,!0);c.init()}),e.className="geBtn",f.appendChild(e));f.appendChild(A);a.editor.cancelFirst||null!=b||h&&null==k||f.appendChild(y);x.appendChild(f);this.container=x},CreateDialog=function(a,e,d,b,h,k,l,n,m,c,f,g,t,
-q,u){function x(c,b,f,p){function d(){mxEvent.addListener(q,"click",function(){var c=f;if(l){var b=w.value,p=b.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>p){var c=null!=c?c:A.value,g="";c==App.MODE_GOOGLE?g=a.drive.extension:c==App.MODE_GITHUB?g=a.gitHub.extension:c==App.MODE_TRELLO?g=a.trello.extension:c==App.MODE_DROPBOX?g=a.dropbox.extension:c==App.MODE_ONEDRIVE?g=a.oneDrive.extension:c==App.MODE_DEVICE&&(g=".xml");0<=p&&(b=b.substring(0,p));w.value=b+g}}y(f)})}var q=document.createElement("a");
-q.style.overflow="hidden";var v=document.createElement("img");v.src=c;v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.width="60px";v.style.height="60px";v.style.paddingBottom="6px";q.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";q.className="geBaseButton";q.style.position="relative";q.style.margin="4px";q.style.padding="8px 8px 10px 8px";q.style.whiteSpace="nowrap";q.appendChild(v);mxClient.IS_QUIRKS&&(q.style.cssFloat="left",q.style.zoom="1");q.style.color="gray";
-q.style.fontSize="11px";var h=document.createElement("div");q.appendChild(h);mxUtils.write(h,b);if(null!=p&&null==a[p]){v.style.visibility="hidden";mxUtils.setOpacity(h,10);var t=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});t.spin(q);var u=window.setTimeout(function(){null==a[p]&&(t.stop(),q.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(u),
-mxUtils.setOpacity(h,100),v.style.visibility="",t.stop(),d())}))}else d();z.appendChild(q);++D==g&&(mxUtils.br(z),D=0)}function y(c){var b=w.value;if(null==c||null!=b&&0<b.length)a.hideDialog(),d(b,c)}l=null!=l?l:!0;n=null!=n?n:!0;g=null!=g?g:3;var v=document.createElement("div");null==b&&a.addLanguageMenu(v);var p=document.createElement("h2");mxUtils.write(p,h||mxResources.get("create"));p.style.marginTop="0px";p.style.marginBottom="24px";v.appendChild(p);mxUtils.write(v,mxResources.get("filename")+
-":");var w=document.createElement("input");w.setAttribute("value",e);w.style.width="280px";w.style.marginLeft="10px";w.style.marginBottom="20px";this.init=function(){w.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?w.select():document.execCommand("selectAll",!1,null)};v.appendChild(w);null!=t&&null!=q&&"image/"==q.substring(0,6)&&(w.style.width="160px",h=null,"image/svg+xml"==q&&mxClient.IS_SVG?(h=document.createElement("div"),h.innerHTML=mxUtils.trim(t),t=h.getElementsByTagName("svg")[0],
-q=parseInt(t.getAttribute("width")),u=parseInt(t.getAttribute("height")),t.setAttribute("viewBox","0 0 "+q+" "+u),t.setAttribute("width","120px"),t.setAttribute("height","80px")):(h=document.createElement("img"),h.setAttribute("src","data:"+q+(u?";base64,":";utf8,")+t)),h.style.position="absolute",h.style.top="70px",h.style.right="100px",h.style.maxWidth="120px",h.style.maxHeight="80px",mxUtils.setPrefixedStyle(h.style,"transform","translate(50%,-50%)"),v.appendChild(h),m&&(h.style.cursor="pointer",
-mxEvent.addListener(h,"click",function(){y("_blank")})));mxUtils.br(v);var z=document.createElement("div");z.style.textAlign="center";var D=0;z.style.marginTop="6px";v.appendChild(z);var A=document.createElement("select");A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(h,mxResources.get("googleDrive")),A.appendChild(h),x(IMAGE_PATH+"/google-drive-logo.svg",
-mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),null!=a.gitHub&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GITHUB),mxUtils.write(h,mxResources.get("github")),A.appendChild(h),x(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.DropboxClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(h,mxResources.get("dropbox")),A.appendChild(h),a.mode==App.MODE_DROPBOX&&h.setAttribute("selected",
-"selected"),x(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),"function"===typeof window.OneDriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(h,mxResources.get("oneDrive")),A.appendChild(h),a.mode==App.MODE_ONEDRIVE&&h.setAttribute("selected","selected"),x(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),null!=a.trello&&(h=document.createElement("option"),h.setAttribute("value",
-App.MODE_TRELLO),mxUtils.write(h,mxResources.get("trello")),A.appendChild(h),x(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&!mxClient.IS_IOS)h=document.createElement("option"),h.setAttribute("value",App.MODE_DEVICE),mxUtils.write(h,mxResources.get("device")),A.appendChild(h),a.mode!=App.MODE_DEVICE&&n||h.setAttribute("selected","selected"),f&&x(IMAGE_PATH+"/osa_drive-harddisk.png",
-mxResources.get("device"),App.MODE_DEVICE);n&&isLocalStorage&&"0"!=urlParams.browser&&(n=document.createElement("option"),n.setAttribute("value",App.MODE_BROWSER),mxUtils.write(n,mxResources.get("browser")),A.appendChild(n),a.mode==App.MODE_BROWSER&&n.setAttribute("selected","selected"),x(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=c&&(h=mxUtils.button(mxResources.get("help"),
-function(){a.openLink(c)}),h.className="geBtn",n.appendChild(h));h=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});h.className="geBtn";a.editor.cancelFirst&&n.appendChild(h);null==b&&(t=mxUtils.button(mxResources.get("decideLater"),function(){y(null)}),t.className="geBtn",n.appendChild(t));m&&(m=mxUtils.button(mxResources.get("openInNewWindow"),function(){y("_blank")}),m.className="geBtn",n.appendChild(m));
-mxClient.IS_IOS||(k=mxUtils.button(k||mxResources.get("create"),function(){y(f?"download":App.MODE_DEVICE)}),k.className="geBtn gePrimaryBtn",n.appendChild(k));a.editor.cancelFirst||n.appendChild(h);mxEvent.addListener(w,"keypress",function(c){13==c.keyCode?y(App.MODE_DEVICE):27==c.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});v.appendChild(n);this.container=v},PopupDialog=function(a,e,d,b,h){h=null!=h?h:!0;var k=document.createElement("div");k.style.textAlign="left";mxUtils.write(k,
-mxResources.get("fileOpenLocation"));mxUtils.br(k);mxUtils.br(k);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){h&&a.hideDialog();null!=b&&b()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";k.appendChild(l);mxUtils.br(k);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){h&&a.hideDialog();null!=d&&d();a.openLink(e)});n.className="geBtn gePrimaryBtn";n.style.width=l.style.width;k.appendChild(n);mxUtils.br(k);mxUtils.br(k);mxUtils.write(k,
-mxResources.get("allowPopups"));this.container=k},ImageDialog=function(a,e,d,b,h,k){k=null!=k?k:!0;var l=a.editor.graph,n=document.createElement("div");mxUtils.write(n,e);e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor="default";mxClient.IS_VML||(e.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value",d);m.setAttribute("type",
-"text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));
-d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});e.appendChild(m);e.appendChild(d);n.appendChild(e);var c=function(c,f,g){var d="data:"==c.substring(0,5);!a.isOffline()||d&&"undefined"===typeof chrome?0<c.length&&a.spinner.spin(document.body,
-mxResources.get("inserting"))?a.loadImage(c,function(d){a.spinner.stop();a.hideDialog();var p=null!=f&&null!=g?Math.max(f/d.width,g/d.height):Math.min(1,Math.min(520/d.width,520/d.height));k&&(c=a.convertDataUri(c));b(c,Math.round(Number(d.width)*p),Math.round(Number(d.height)*p))},function(){a.spinner.stop();b(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),b(c)):(c=a.convertDataUri(c),f=null==f?120:f,g=null==g?100:g,a.hideDialog(),
-b(c,f,g))},f=function(f){if(null!=f){var g=h?null:l.getModel().getGeometry(l.getSelectionCell());null!=g?c(f,g.width,g.height):c(f)}else a.hideDialog(),b(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=n.parentNode,b=null;mxEvent.addListener(c,"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(f){null==
-b&&(!mxClient.IS_IE||10<document.documentMode)&&(b=a.highlightElement(c));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(c){null!=b&&(b.parentNode.removeChild(b),b=null);if(0<c.dataTransfer.files.length)a.importFiles(c.dataTransfer.files,0,0,a.maxImageSize,function(a,c,b,g,d,e){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},!mxEvent.isControlDown(c));else if(0<=mxUtils.indexOf(c.dataTransfer.types,
-"text/uri-list")){var g=c.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(g)&&f(decodeURIComponent(g))}c.stopPropagation();c.preventDefault()}),!1)}};d=document.createElement("div");d.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";d.style.textAlign="right";e=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&d.appendChild(e);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&
-null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){var g=document.createElement("input");g.setAttribute("multiple","multiple");g.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(g,"change",function(c){a.importFiles(g.files,0,0,a.maxImageSize,function(a,c,b,g,p,d){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},
-!0)});var t=mxUtils.button(mxResources.get("open"),function(){g.click()});t.className="geBtn";d.appendChild(t)}}document.createElement("canvas").getContext&&"data:image/"==m.value.substring(0,11)&&"data:image/svg"!=m.value.substring(0,14)&&(t=mxUtils.button(mxResources.get("crop"),function(){var c=new CropImageDialog(a,m.value,function(a){m.value=a});a.showDialog(c.container,200,180,!0,!0);c.init()}),t.className="geBtn",d.appendChild(t));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&
-window.self===window.top&&(t=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var c=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),t.className="geBtn",d.appendChild(t),null!=a.drive&&"1"==urlParams.photos&&(t=mxUtils.button(mxResources.get("googlePlus"),
-function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var c=gapi.auth.getToken().access_token,c=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(c).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.photoPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),
-t.className="geBtn",d.appendChild(t)));mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&f(m.value)});t=mxUtils.button(mxResources.get("apply"),function(){f(m.value)});t.className="geBtn gePrimaryBtn";d.appendChild(t);a.editor.cancelFirst||d.appendChild(e);Graph.fileSupport&&(d.style.marginTop="120px",n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.backgroundPosition="center 65%",n.style.backgroundRepeat="no-repeat",e=document.createElement("div"),e.style.position=
-"absolute",e.style.width="420px",e.style.top="58%",e.style.textAlign="center",e.style.fontSize="18px",e.style.color="#a0c3ff",mxUtils.write(e,mxResources.get("dragImagesHere")),n.appendChild(e));n.appendChild(d);this.container=n},LinkDialog=function(a,e,d,b,h){function k(a,c,b){b=mxUtils.button("",b);b.className="geBtn";b.setAttribute("title",c);c=document.createElement("img");c.style.height="26px";c.style.width="26px";c.setAttribute("src",a);b.style.minWidth="42px";b.style.verticalAlign="middle";
-b.appendChild(c);y.appendChild(b)}var l=document.createElement("div");mxUtils.write(l,mxResources.get("editLink")+":");var n=document.createElement("div");n.className="geTitle";n.style.backgroundColor="transparent";n.style.borderColor="transparent";n.style.whiteSpace="nowrap";n.style.textOverflow="clip";n.style.cursor="default";mxClient.IS_VML||(n.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("placeholder",mxResources.get("dragUrlsHere"));m.setAttribute("type","text");
-m.style.marginTop="6px";m.style.width="400px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";var c=document.createElement("div");c.setAttribute("title",mxResources.get("reset"));c.style.position="relative";c.style.left="-16px";c.style.width="12px";c.style.height="14px";c.style.cursor="pointer";c.style.display=mxClient.IS_VML?"inline":"inline-block";c.style.top=(mxClient.IS_VML?
-0:3)+"px";c.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(c,"click",function(){m.value="";m.focus()});var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","current-linkdialog");var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name",
-"current-linkdialog");var t=document.createElement("select");t.style.width="380px";if(h&&null!=a.pages){null!=e&&a.editor.graph.isPageLink(e)?(g.setAttribute("checked","checked"),g.defaultChecked=!0):(m.setAttribute("value",e),f.setAttribute("checked","checked"),f.defaultChecked=!0);m.style.width="380px";n.appendChild(f);n.appendChild(m);n.appendChild(c);mxUtils.br(n);n.appendChild(g);h=!1;for(c=0;c<a.pages.length;c++){var q=document.createElement("option");mxUtils.write(q,a.pages[c].getName()||mxResources.get("pageWithNumber",
-[c+1]));q.setAttribute("value","data:page/id,"+a.pages[c].getId());e==q.getAttribute("value")&&(q.setAttribute("selected","selected"),h=!0);t.appendChild(q)}if(!h&&g.checked){var u=document.createElement("option");mxUtils.write(u,mxResources.get("pageNotFound"));u.setAttribute("disabled","disabled");u.setAttribute("selected","selected");u.setAttribute("value","pageNotFound");t.appendChild(u);mxEvent.addListener(t,"change",function(){null==u.parentNode||u.selected||u.parentNode.removeChild(u)})}n.appendChild(t)}else m.setAttribute("value",
-e),n.appendChild(m),n.appendChild(c);l.appendChild(n);var x=mxUtils.button(d,function(){a.hideDialog();b(g.checked?"pageNotFound"!==t.value?t.value:e:m.value,LinkDialog.selectedDocs)});x.style.verticalAlign="middle";x.className="geBtn gePrimaryBtn";this.init=function(){g.checked?t.focus():(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(t,"focus",function(){f.removeAttribute("checked");
-g.setAttribute("checked","checked");g.checked=!0});mxEvent.addListener(m,"focus",function(){g.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){var c=l.parentNode,b=null;mxEvent.addListener(c,"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(f){null==b&&(!mxClient.IS_IE||10<document.documentMode)&&(b=a.highlightElement(c));f.stopPropagation();
-f.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(m.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,x.click());a.stopPropagation();a.preventDefault()}),!1)}};var y=document.createElement("div");y.style.marginTop="20px";y.style.textAlign="right";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
-d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&y.appendChild(d);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var c=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(c=DriveClient.prototype.oldAppHostname,c="https://"+c+"/#G"+a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?
-(c=DriveClient.prototype.newAppHostname,c="https://"+c+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(c="https://drive.google.com/#folders/"+a.docs[0].id);m.value=c;m.focus()}else LinkDialog.selectedDocs=null;m.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&k(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,
-function(){a.spinner.stop();if(null==a.linkPicker){var c=gapi.auth.getToken().access_token,b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),g=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),c=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(c).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(f).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);
-"1"==urlParams.photos&&c.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=c.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&k(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){m.value=a[0].link;m.focus()}})});null!=
-a.oneDrive&&k(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,c){m.value=c.value[0].webUrl;m.focus()})});null!=a.gitHub&&k(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var c=a[0],b=a[1],f=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+c+"/"+b+"/blob/"+f+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(c){13==c.keyCode&&(a.hideDialog(),
-b(g.checked?t.value:m.value,LinkDialog.selectedDocs))});y.appendChild(x);a.editor.cancelFirst||y.appendChild(d);l.appendChild(y);this.container=l},AboutDialog=function(a){var e=document.createElement("div");e.style.marginTop="6px";e.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):
-(d.setAttribute("width","176"),d.setAttribute("height","219"),d.style.width="170px",d.style.height="219px",d.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));e.appendChild(d);mxUtils.br(e);d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color="#505050";e.appendChild(d);mxUtils.br(e);mxUtils.br(e);d=document.createElement("small");d.style.color="#505050";d.innerHTML='&copy; 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
-e.appendChild(d);mxEvent.addListener(e,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=e},FeedbackDialog=function(a){var e=document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";e.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");e.appendChild(d);var b=document.createElement("input");
-b.setAttribute("type","text");b.style.marginTop="6px";b.style.width="600px";var h=mxUtils.button(mxResources.get("sendMessage"),function(){var c=(l.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;c.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(b.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+
-"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+m.value+c),function(c){a.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});h.className="geBtn gePrimaryBtn";h.setAttribute("disabled","disabled");var k=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
-mxEvent.addListener(b,"change",function(){0<b.value.length&&0<k.test(b.value)?h.removeAttribute("disabled"):h.setAttribute("disabled","disabled")});mxEvent.addListener(b,"keyup",function(){0<b.value.length&&k.test(b.value)?h.removeAttribute("disabled"):h.setAttribute("disabled","disabled")});e.appendChild(b);this.init=function(){b.focus()};var l=document.createElement("input");l.setAttribute("type","checkbox");l.setAttribute("checked","checked");l.defaultChecked=!0;d=document.createElement("p");d.style.marginTop=
-"14px";d.appendChild(l);var n=document.createElement("span");mxUtils.write(n," "+mxResources.get("includeCopyOfMyDiagram"));d.appendChild(n);mxEvent.addListener(n,"click",function(a){l.checked=!l.checked;mxEvent.consume(a)});e.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("feedback"));e.appendChild(d);var m=document.createElement("textarea");m.style.resize="none";m.style.width="600px";m.style.height="140px";m.style.marginTop="6px";m.setAttribute("placeholder",mxResources.get("commentsNotes"));
-e.appendChild(m);d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst?(d.appendChild(n),d.appendChild(h)):(d.appendChild(h),d.appendChild(n));e.appendChild(d);this.container=e};FeedbackDialog.maxAttachmentSize=1E6;
-var RevisionDialog=function(a,e,d){var b=document.createElement("div"),h=document.createElement("h3");h.style.marginTop="0px";mxUtils.write(h,mxResources.get("revisionHistory"));b.appendChild(h);var k=document.createElement("div");k.style.position="absolute";k.style.overflow="auto";k.style.width="170px";k.style.height="378px";b.appendChild(k);var l=document.createElement("div");l.style.position="absolute";l.style.border="1px solid lightGray";l.style.left="199px";l.style.width="470px";l.style.height=
-"376px";l.style.overflow="hidden";mxEvent.disableContextMenu(l);b.appendChild(l);var n=new Graph(l);n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;var m=0,c=null,f=0,g=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=c&&null!=c[f]?c[f].getAttribute("name"):"pagenumber"==a?f+1:g.apply(this,arguments)};n.getLinkForCell=function(){return null};Editor.MathJaxRender&&
-n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(c,b){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var t=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),q=a.getCurrentFile(),u=null,x=null,y=null,v=null,p=mxUtils.button("",function(){null!=y&&n.zoomIn()});p.className="geSprite geSprite-zoomin";p.setAttribute("title",mxResources.get("zoomIn"));
-p.style.outline="none";p.style.border="none";p.style.margin="2px";p.setAttribute("disabled","disabled");mxUtils.setOpacity(p,20);var w=mxUtils.button("",function(){null!=y&&n.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var z=mxUtils.button("",function(){null!=y&&(n.maxFitScale=8,n.fit(8),n.center())});z.className=
-"geSprite geSprite-fit";z.setAttribute("title",mxResources.get("fit"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var D=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});D.className="geSprite geSprite-actualsize";D.setAttribute("title",mxResources.get("actualSize"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var A=
-document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var c=a.getCurrentFile(),c=null!=c&&null!=c.getTitle()?c.getTitle():a.defaultFilename,b=mxUtils.getXml(y.documentElement);a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):
-(b="undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(a.editor.graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=v&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(v):a.spinner.spin(document.body,mxResources.get("restoring"))&&q.save(!0,function(c){a.spinner.stop();
-a.replaceFileData(v);a.hideDialog()},function(c){a.spinner.stop();a.editor.setStatus("");a.handleError(c,null!=c?mxResources.get("errorSavingFile"):null)})})});E.className="geBtn";E.setAttribute("disabled","disabled");var C=document.createElement("select");C.setAttribute("disabled","disabled");C.style.maxWidth="80px";C.style.position="relative";C.style.top="-2px";C.style.verticalAlign="bottom";C.style.marginRight="6px";C.style.display="none";var H=null;mxEvent.addListener(C,"change",function(a){null!=
-H&&(H(a),mxEvent.consume(a))});var B=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),window.openWindow(a.getUrl()))});B.className="geBtn";B.setAttribute("disabled","disabled");null!=d&&(B.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=x&&a.openLink(x.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled",
-"disabled");null!=d&&(G.style.display="none",E.className="geBtn gePrimaryBtn");h=document.createElement("div");h.style.position="absolute";h.style.top="482px";h.style.width="640px";h.style.textAlign="right";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.padding="2px";I.style.border="none";I.style.left="199px";I.style.top="442px";var J=null;if(null!=e&&0<e.length){l.style.cursor="move";var R=document.createElement("table");R.style.border=
-"1px solid lightGray";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var S=document.createElement("tbody"),O=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var T=e.length-1;0<=T;T--){var L=function(b){var g=new Date(b.modifiedDate),d=null;if(0<=g.getTime()){var h=function(b){t.stop();var e=mxUtils.parseXml(b),h=a.editor.extractGraphModel(e.documentElement,!0);if(null!=h){var u=function(c){null!=c&&(c=
-k(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c},k=function(a){var c=a.getAttribute("background");if(null==c||""==c||c==mxConstants.NONE)c="#ffffff";l.style.backgroundColor=c;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return a};C.style.display="none";C.innerHTML="";y=e;v=b;c=parseSelectFunction=null;f=0;if("mxfile"==h.nodeName){e=h.getElementsByTagName("diagram");c=[];for(b=0;b<e.length;b++)c.push(e[b]);
-f=Math.min(m,c.length-1);0<c.length&&u(c[f]);if(1<c.length)for(C.removeAttribute("disabled"),C.style.display="",b=0;b<c.length;b++)e=document.createElement("option"),mxUtils.write(e,c[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),e.setAttribute("value",b),b==f&&e.setAttribute("selected","selected"),C.appendChild(e);H=function(){f=m=parseInt(C.value);u(c[m])}}else k(h);A.innerHTML="";mxUtils.write(A,g.toLocaleDateString()+" "+g.toLocaleTimeString());A.setAttribute("title",d.getAttribute("title"));
-p.removeAttribute("disabled");w.removeAttribute("disabled");z.removeAttribute("disabled");D.removeAttribute("disabled");null!=q&&q.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),F.removeAttribute("disabled"),G.removeAttribute("disabled"),B.removeAttribute("disabled"));mxUtils.setOpacity(p,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(D,60)}else C.style.display="none",C.innerHTML="",A.innerHTML="",mxUtils.write(A,mxResources.get("errorLoadingFile"))},
-d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var k=document.createElement("td");k.style.padding="6px";k.style.whiteSpace="nowrap";b==e[e.length-1]?mxUtils.write(k,mxResources.get("current")):g.toDateString()===O?mxUtils.write(k,g.toLocaleTimeString()):mxUtils.write(k,g.toLocaleDateString()+" "+g.toLocaleTimeString());d.appendChild(k);d.setAttribute("title",g.toLocaleDateString()+" "+g.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+
-(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(a){x!=b&&(t.stop(),null!=u&&(u.style.backgroundColor=""),x=b,u=d,u.style.backgroundColor="#ebf2f9",v=y=null,A.removeAttribute("title"),A.innerHTML=mxResources.get("loading")+"...",l.style.backgroundColor="#ffffff",n.getModel().clear(),E.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),D.setAttribute("disabled",
-"disabled"),z.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),mxUtils.setOpacity(p,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(D,20),t.spin(l),b.getXml(function(a){x==b&&h(a)},function(a){t.stop();C.style.display="none";C.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(d,"dblclick",function(a){G.click();
-window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);S.appendChild(d)}return d}(e[T]);null!=L&&T==e.length-1&&(J=L)}R.appendChild(S);k.appendChild(R)}else null==q||null==a.drive&&q.constructor==window.DriveFile||null==a.dropbox&&q.constructor==window.DropboxFile?(l.style.display="none",I.style.display="none",mxUtils.write(k,mxResources.get("notAvailable"))):(l.style.display="none",I.style.display="none",mxUtils.write(k,
-mxResources.get("noRevisions")));this.init=function(){null!=J&&J.click()};k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn";I.appendChild(C);I.appendChild(p);I.appendChild(w);I.appendChild(D);I.appendChild(z);a.editor.cancelFirst?(h.appendChild(k),h.appendChild(F),h.appendChild(B),h.appendChild(E),h.appendChild(G)):(h.appendChild(F),h.appendChild(B),h.appendChild(E),h.appendChild(G),h.appendChild(k));b.appendChild(h);b.appendChild(I);b.appendChild(A);this.container=
-b},DraftDialog=function(a,e,d,b,h,k,l,n){var m=document.createElement("div"),c=document.createElement("div");c.style.marginTop="0px";c.style.whiteSpace="nowrap";c.style.overflow="auto";mxUtils.write(c,e);m.appendChild(c);var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";f.style.marginTop="10px";f.style.width="640px";f.style.top="46px";f.style.bottom="74px";f.style.overflow="hidden";mxEvent.disableContextMenu(f);m.appendChild(f);var g=new Graph(f);
-g.setEnabled(!1);g.setPanning(!0);g.panningHandler.ignoreCell=!0;g.panningHandler.useLeftButtonForPanning=!0;g.minFitScale=null;g.maxFitScale=null;g.centerZoom=!0;e=mxUtils.parseXml(d);var t=a.editor.extractGraphModel(e.documentElement,!0),q=0,u=null,x=g.getGlobalVariable;g.getGlobalVariable=function(a){return"page"==a&&null!=u&&null!=u[q]?u[q].getAttribute("name"):"pagenumber"==a?q+1:x.apply(this,arguments)};g.getLinkForCell=function(){return null};e=mxUtils.button("",function(){g.zoomIn()});e.className=
-"geSprite geSprite-zoomin";e.setAttribute("title",mxResources.get("zoomIn"));e.style.outline="none";e.style.border="none";e.style.margin="2px";mxUtils.setOpacity(e,60);d=mxUtils.button("",function(){g.zoomOut()});d.className="geSprite geSprite-zoomout";d.setAttribute("title",mxResources.get("zoomOut"));d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);c=mxUtils.button("",function(){g.maxFitScale=8;g.fit(8);g.center()});c.className="geSprite geSprite-fit";c.setAttribute("title",
-mxResources.get("fit"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);var y=mxUtils.button("",function(){g.zoomActual();g.center()});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";mxUtils.setOpacity(y,60);h=mxUtils.button(l||mxResources.get("discard"),h);h.className="geBtn";var v=document.createElement("select");v.style.maxWidth="80px";v.style.position=
-"relative";v.style.top="-2px";v.style.verticalAlign="bottom";v.style.marginRight="6px";v.style.display="none";b=mxUtils.button(k||mxResources.get("edit"),b);b.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.position="absolute";k.style.bottom="30px";k.style.width="640px";k.style.textAlign="right";l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
-this.init=function(){function c(a){if(null!=a){var c=a.getAttribute("background");if(null==c||""==c||c==mxConstants.NONE)c="#ffffff";f.style.backgroundColor=c;(new mxCodec(a.ownerDocument)).decode(a,g.getModel());g.maxFitScale=1;g.fit(8);g.center()}}function b(b){null!=b&&(b=c(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b}mxEvent.addListener(v,"change",function(a){q=parseInt(v.value);b(u[q]);mxEvent.consume(a)});if("mxfile"==t.nodeName){var d=t.getElementsByTagName("diagram");
-u=[];for(var e=0;e<d.length;e++)u.push(d[e]);0<u.length&&b(u[q]);if(1<u.length)for(v.style.display="",e=0;e<u.length;e++)d=document.createElement("option"),mxUtils.write(d,u[e].getAttribute("name")||mxResources.get("pageWithNumber",[e+1])),d.setAttribute("value",e),e==q&&d.setAttribute("selected","selected"),v.appendChild(d)}else c(t)};l.appendChild(v);l.appendChild(e);l.appendChild(d);l.appendChild(y);l.appendChild(c);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.className=
-"geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(k.appendChild(e),null!=n&&k.appendChild(n),k.appendChild(h),k.appendChild(b)):(k.appendChild(b),k.appendChild(h),null!=n&&k.appendChild(n),k.appendChild(e));m.appendChild(k);m.appendChild(l);this.container=m},FindWindow=function(a,e,d,b,h){function k(a,c,b){if("object"===typeof c.value&&null!=c.value.attributes){c=c.value.attributes;for(var f=0;f<c.length;f++)if("label"!=c[f].nodeName){var g=
-mxUtils.trim(c[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,b.length)===b||null!=a&&a.test(g))return!0}}return!1}function l(){var a=m.model.getDescendants(m.model.getRoot()),b=t.value.toLowerCase(),g=q.checked?new RegExp(b):null,d=null;c!=b&&(c=b,f=null);var e=null==f;if(0<b.length)for(var h=0;h<a.length;h++){var l=m.view.getState(a[h]);if(null!=l&&null!=l.cell.value&&(e||null==d)&&(m.model.isVertex(l.cell)||m.model.isEdge(l.cell))&&(m.isHtmlLabel(l.cell)?
-(u.innerHTML=m.getLabel(l.cell),label=mxUtils.extractTextWithWhitespace([u])):label=m.getLabel(l.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==g&&(label.substring(0,b.length)===b||k(g,l.cell,b))||null!=g&&(g.test(label)||k(g,l.cell,b))))if(e){d=l;break}else null==d&&(d=l);e=e||l==f}null!=d?(f=d,m.scrollCellToVisible(f.cell),m.isEnabled()?m.setSelectionCell(f.cell):m.highlightCell(f.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d}
-var n=a.actions.get("find"),m=a.editor.graph,c=null,f=null,g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var t=document.createElement("input");t.setAttribute("placeholder",mxResources.get("find"));t.setAttribute("type","text");t.style.marginTop="4px";t.style.marginBottom="6px";t.style.width="170px";t.style.fontSize="12px";t.style.borderRadius="4px";t.style.padding="6px";g.appendChild(t);var q=document.createElement("input");
-q.setAttribute("type","checkbox");g.appendChild(q);mxUtils.write(g,mxResources.get("regularExpression"));var u=document.createElement("div");mxUtils.br(g);var x=mxUtils.button(mxResources.get("reset"),function(){t.value="";t.style.backgroundColor="";c=f=null;t.focus()});x.setAttribute("title",mxResources.get("reset"));x.style.marginTop="6px";x.style.marginRight="4px";x.style.backgroundColor="#f5f5f5";x.style.backgroundImage="none";x.className="geBtn";g.appendChild(x);x=mxUtils.button(mxResources.get("find"),
-function(){try{t.style.backgroundColor=l()?"":"#ffcfcf"}catch(y){a.handleError(y)}});x.setAttribute("title",mxResources.get("find")+" (Enter)");x.style.marginTop="6px";x.style.backgroundColor="#4d90fe";x.style.backgroundImage="none";x.className="geBtn gePrimaryBtn";g.appendChild(x);mxEvent.addListener(t,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(c!=t.value.toLowerCase()||13==a.keyCode)try{t.style.backgroundColor=l()?"":"#ffcfcf"}catch(v){t.style.backgroundColor=
-"#ffcfcf"}});mxEvent.addListener(g,"keydown",function(c){70==c.keyCode&&a.keyHandler.isControlDown(c)&&!mxEvent.isShiftDown(c)&&(n.funct(),mxEvent.consume(c))});this.window=new mxWindow(mxResources.get("find"),g,e,d,b,h,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
-t.select():document.execCommand("selectAll",!1,null)):m.container.focus()}))},TagsWindow=function(a,e,d,b,h){function k(a){a=null!=a?a:n.model.getDescendants(n.model.getRoot());for(var c=f.value.split(" "),b=[],g=0;g<a.length;g++)if(n.model.isVertex(a[g])||n.model.isEdge(a[g])){var d=null!=a[g].value&&"object"==typeof a[g].value?mxUtils.trim(a[g].value.getAttribute(m)||""):"",p=!0;if(0<d.length)for(var d=d.toLowerCase().split(" "),e=0;e<c.length&&p;e++)var h=mxUtils.trim(c[e]).toLowerCase(),p=p&&
-(0==h.length||0<=mxUtils.indexOf(d,h));else p=0==mxUtils.trim(f.value).length;p&&b.push(a[g])}return b}function l(a,c){n.model.beginUpdate();try{for(var b=0;b<a.length;b++)n.model.setVisible(a[b],c)}finally{n.model.endUpdate()}}var n=a.editor.graph,m="tags",c=document.createElement("div");c.style.userSelect="none";c.style.overflow="hidden";c.style.padding="10px";c.style.height="100%";var f=document.createElement("input");f.setAttribute("placeholder",mxResources.get("allTags"));f.setAttribute("type",
-"text");f.style.marginTop="4px";f.style.width="260px";f.style.fontSize="12px";f.style.borderRadius="4px";f.style.padding="6px";c.appendChild(f);mxEvent.addListener(f,"dblclick",function(){var c=new FilenameDialog(a,m,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(m=a)}),mxResources.get("enterPropertyName"));a.showDialog(c.container,300,80,!0,!0);c.init()});f.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(c);var g=mxUtils.button(mxResources.get("hide"),
-function(){l(k(),!1)});g.setAttribute("title",mxResources.get("hide"));g.style.marginTop="8px";g.style.marginRight="4px";g.style.backgroundColor="#f5f5f5";g.style.backgroundImage="none";g.className="geBtn";c.appendChild(g);g=mxUtils.button(mxResources.get("show"),function(){var a=k();l(a,!0);n.isEnabled()&&n.setSelectionCells(a)});g.setAttribute("title",mxResources.get("show"));g.style.marginTop="8px";g.style.marginRight="4px";g.style.backgroundColor="#f5f5f5";g.style.backgroundImage="none";g.className=
-"geBtn";c.appendChild(g);var t=a.actions.get("tags"),g=mxUtils.button(mxResources.get("close"),function(){t.funct()});g.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");g.style.marginTop="8px";g.style.backgroundColor="#4d90fe";g.style.backgroundImage="none";g.className="geBtn gePrimaryBtn";c.appendChild(g);mxEvent.addListener(f,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||t.funct()});this.window=new mxWindow(mxResources.get("tags"),c,e,d,b,h,!0,!0);this.window.destroyOnClose=!1;
-this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(f.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?f.select():document.execCommand("selectAll",!1,null)):n.container.focus()}))},AuthDialog=function(a,e,d,b){var h=document.createElement("div");h.style.textAlign="center";var k=document.createElement("p");k.style.fontSize="16pt";k.style.padding=
-"0px";k.style.margin="0px";k.style.color="gray";mxUtils.write(k,mxResources.get("authorizationRequired"));var l="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";e==a.drive?(l=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):e==a.dropbox?(l=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):e==a.oneDrive?(l=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):
-e==a.gitHub?(l=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):e==a.trello&&(l=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[l]));var m=document.createElement("input");m.setAttribute("type","checkbox");l=mxUtils.button(mxResources.get("authorize"),function(){b(m.checked)});l.insertBefore(n,l.firstChild);l.style.marginTop="6px";l.className="geBigButton";h.appendChild(k);h.appendChild(a);
-h.appendChild(l);d&&(d=document.createElement("p"),d.style.marginTop="20px",d.appendChild(m),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberMe")),d.appendChild(k),h.appendChild(d),m.checked=!0,m.defaultChecked=!0,mxEvent.addListener(k,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)}));this.container=h},MoreShapesDialog=function(a,e,d){d=null!=d?d:a.sidebar.entries;var b=document.createElement("div");if(e){e=document.createElement("div");e.className="geDialogTitle";
-mxUtils.write(e,mxResources.get("shapes"));e.style.position="absolute";e.style.top="0px";e.style.left="0px";e.style.lineHeight="40px";e.style.height="40px";e.style.right="0px";mxClient.IS_QUIRKS&&(e.style.width="718px");var h=document.createElement("div"),k=document.createElement("div");h.style.position="absolute";h.style.top="40px";h.style.left="0px";h.style.width="202px";h.style.bottom="60px";h.style.overflow="auto";mxClient.IS_QUIRKS&&(h.style.height="437px",h.style.marginTop="1px");k.style.position=
-"absolute";k.style.left="202px";k.style.right="0px";k.style.top="40px";k.style.bottom="60px";k.style.overflow="auto";k.style.borderLeft="1px solid rgb(211, 211, 211)";k.style.textAlign="center";mxClient.IS_QUIRKS&&(k.style.width=parseInt(e.style.width)-202+"px",k.style.height=h.style.height,k.style.marginTop=h.style.marginTop);var l=null,n=[],m=document.createElement("div");m.style.position="relative";m.style.left="0px";m.style.right="0px";for(var c=0;c<d.length;c++)(function(b){var f=m.cloneNode(!1);
-f.style.fontWeight="bold";f.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";f.style.padding="6px 0px 6px 20px";mxUtils.write(f,b.title);h.appendChild(f);for(var g=0;g<b.entries.length;g++)(function(b){var f=m.cloneNode(!1);f.style.cursor="pointer";f.style.padding="4px 0px 4px 20px";var p=document.createElement("input");p.setAttribute("type","checkbox");p.checked=a.sidebar.isEntryVisible(b.id);p.defaultChecked=p.checked;f.appendChild(p);mxUtils.write(f," "+b.title);h.appendChild(f);var d=
-function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCallback?b.imageCallback(k):null!=b.image?k.innerHTML='<img border="0" src="'+b.image+'"/>':(k.innerHTML="<br>",mxUtils.write(k,mxResources.get("noPreview"))),null!=l&&(l.style.backgroundColor=""),l=f,l.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(f,"click",d);mxEvent.addListener(f,"dblclick",function(a){p.checked=!p.checked;mxEvent.consume(a)});n.push(function(){return p.checked?
-b.id:null});0==c&&0==g&&d()})(b.entries[g])})(d[c]);b.style.padding="30px";b.appendChild(e);b.appendChild(h);b.appendChild(k);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=e.style.width,d.style.paddingTop="12px");var f=document.createElement("input");f.setAttribute("type",
-"checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)e=document.createElement("span"),e.style.paddingRight="20px",e.appendChild(f),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),f.checked=!0,f.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){mxEvent.getSource(a)!=f&&(f.checked=!f.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(e.style.position="relative",e.style.top="-6px"),d.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className=
-"geBtn";var g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var c=[],b=0;b<n.length;b++){var g=n[b].apply(this,arguments);null!=g&&c.push(g)}a.sidebar.showEntries(c.join(";"),f.checked,!0)});g.className="geBtn gePrimaryBtn"}else{var t=document.createElement("table"),q=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";var u=document.createElement("tr");t.style.width="100%";e=document.createElement("td");var g=document.createElement("td"),x=document.createElement("td"),
-y=mxUtils.bind(this,function(c,b,f){var g=document.createElement("input");g.type="checkbox";t.appendChild(g);g.checked=a.sidebar.isEntryVisible(f);var p=document.createElement("span");mxUtils.write(p,b);b=document.createElement("div");b.style.display="block";b.appendChild(g);b.appendChild(p);mxEvent.addListener(p,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});c.appendChild(b);return function(){return g.checked?f:null}});u.appendChild(e);u.appendChild(g);u.appendChild(x);q.appendChild(u);
-t.appendChild(q);for(var n=[],v=0,c=0;c<d.length;c++)for(q=0;q<d[c].entries.length;q++)v++;for(var p=[e,g,x],w=0,c=0;c<d.length;c++)(function(a){for(var c=0;c<a.entries.length;c++){var b=a.entries[c];n.push(y(p[Math.floor(w/(v/3))],b.title,b.id));w++}})(d[c]);b.appendChild(t);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";f=document.createElement("input");isLocalStorage&&(f.setAttribute("type","checkbox"),f.checked=!0,f.defaultChecked=!0,d.appendChild(f),e=document.createElement("span"),
-mxUtils.write(e," "+mxResources.get("rememberThisSetting")),d.appendChild(e),mxEvent.addListener(e,"click",function(a){f.checked=!f.checked;mxEvent.consume(a)}));b.appendChild(d);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";g=mxUtils.button(mxResources.get("apply"),function(){for(var c=["search"],b=0;b<n.length;b++){var g=n[b].apply(this,arguments);null!=g&&c.push(g)}a.sidebar.showEntries(0<c.length?c.join(";"):"",f.checked);a.hideDialog()});g.className=
-"geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(e),d.appendChild(g)):(d.appendChild(g),d.appendChild(e));b.appendChild(d);this.container=b},PluginsDialog=function(a){function e(){if(0==h.length)b.innerHTML=mxResources.get("noPlugins");else{b.innerHTML="";for(var c=0;c<h.length;c++){var f=document.createElement("span");f.style.whiteSpace="nowrap";var g=document.createElement("span");g.className="geSprite geSprite-delete";
-g.style.position="relative";g.style.cursor="pointer";g.style.top="5px";g.style.marginRight="4px";g.style.display="inline-block";f.appendChild(g);mxUtils.write(f,h[c]);b.appendChild(f);mxUtils.br(b);mxEvent.addListener(g,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+h[c]+'"?',function(){h.splice(c,1);e()})}}(c))}}}var d=document.createElement("div"),b=document.createElement("div");b.style.height="120px";b.style.overflow="auto";var h=mxSettings.getPlugins().slice();
-d.appendChild(b);e();var k=mxUtils.button(mxResources.get("add"),function(){var c="",b=urlParams.p;if(null!=b&&0<b.length){for(var g=b.split(";"),b=0;b<g.length;b++){var d=App.pluginRegistry[g[b]];null!=d&&(c+=d+";")}";"==c.charAt(c.length-1)&&(c=c.substring(0,c.length-1))}c=new FilenameDialog(a,c,mxResources.get("add"),function(a){if(null!=a&&0<a.length){g=a.split(";");for(a=0;a<g.length;a++)0<g[a].length&&0>mxUtils.indexOf(h,g[a])&&h.push(g[a]);e()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+
-")");a.showDialog(c.container,300,80,!0,!0);c.init()});k.className="geBtn";var l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";var n=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(h);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});n.className="geBtn gePrimaryBtn";var m=document.createElement("div");m.style.marginTop="14px";m.style.textAlign="right";a.editor.cancelFirst?(m.appendChild(l),m.appendChild(k),
-m.appendChild(n)):(m.appendChild(k),m.appendChild(n),m.appendChild(l));d.appendChild(m);this.container=d},CropImageDialog=function(a,e,d){var b=document.createElement("div"),h=document.createElement("table"),k=document.createElement("tbody"),l=document.createElement("tr"),n=document.createElement("td");n.style.whiteSpace="nowrap";n.setAttribute("colspan","2");mxUtils.write(n,mxResources.get("loading")+"...");l.appendChild(n);k.appendChild(l);var l=document.createElement("tr"),m=document.createElement("td"),
-c=document.createElement("td");h.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var f=document.createElement("input");f.setAttribute("type","text");f.style.width="100px";f.value="0";this.init=function(){f.focus();f.select()};c.appendChild(f);l.appendChild(m);l.appendChild(c);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type",
-"text");g.style.width="100px";g.value="0";c.appendChild(g);l.appendChild(m);l.appendChild(c);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");mxUtils.write(m,mxResources.get("right")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";c.appendChild(t);l.appendChild(m);l.appendChild(c);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");
-mxUtils.write(m,mxResources.get("bottom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value="0";c.appendChild(q);l.appendChild(m);l.appendChild(c);k.appendChild(l);l=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");mxUtils.write(m,mxResources.get("circle")+":");l.appendChild(m);var u=document.createElement("input");u.setAttribute("type","checkbox");c.appendChild(u);l.appendChild(c);k.appendChild(l);h.appendChild(k);
-b.appendChild(h);var h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),x=new Image,y=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),b=c.getContext("2d"),e=x.width,h=x.height,k=parseInt(f.value),y=parseInt(g.value),e=Math.max(1,e-k-parseInt(t.value)),h=Math.max(1,h-y-parseInt(q.value));c.width=e;c.height=h;u.checked&&(b.fillStyle="#000000",b.arc(e/2,h/2,Math.min(e/2,h/2),0,2*Math.PI),b.fill(),b.globalCompositeOperation=
-"source-in");b.drawImage(x,k,y,e,h,0,0,e,h);d(c.toDataURL())});y.setAttribute("disabled","disabled");x.onload=function(){y.removeAttribute("disabled");n.innerHTML="";mxUtils.write(n,mxResources.get("width")+": "+x.width+" "+mxResources.get("height")+": "+x.height)};x.src=e;mxEvent.addListener(b,"keypress",function(a){13==a.keyCode&&y.click()});e=document.createElement("div");e.style.marginTop="20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(h),e.appendChild(y)):(e.appendChild(y),
-e.appendChild(h));b.appendChild(e);this.container=b},EditGeometryDialog=function(a,e){var d=a.editor.graph,b=1==e.length?d.getCellGeometry(e[0]):null,h=document.createElement("div"),k=document.createElement("table"),l=document.createElement("tbody"),n=document.createElement("tr"),m=document.createElement("td"),c=document.createElement("td");k.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var f=document.createElement("input");f.setAttribute("type","text");f.style.width="100px";
-f.value=null!=b?b.x:"";this.init=function(){f.focus();f.select()};c.appendChild(f);n.appendChild(m);n.appendChild(c);l.appendChild(n);n=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";g.value=null!=b?b.y:"";c.appendChild(g);n.appendChild(m);n.appendChild(c);l.appendChild(n);n=document.createElement("tr");m=document.createElement("td");
-c=document.createElement("td");mxUtils.write(m,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=b?b.width:"";c.appendChild(t);n.appendChild(m);n.appendChild(c);l.appendChild(n);n=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");mxUtils.write(m,mxResources.get("height")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=
-b?b.height:"";c.appendChild(q);n.appendChild(m);n.appendChild(c);l.appendChild(n);n=document.createElement("tr");m=document.createElement("td");c=document.createElement("td");mxUtils.write(m,mxResources.get("rotation")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=1==e.length?mxUtils.getValue(d.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";c.appendChild(u);n.appendChild(m);n.appendChild(c);l.appendChild(n);k.appendChild(l);h.appendChild(k);
-var b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var c=0;c<e.length;c++){var b=d.getCellGeometry(e[c]);null!=b&&(b=b.clone(),d.isCellMovable(e[c])&&(0<mxUtils.trim(f.value).length&&(b.x=Number(f.value)),0<mxUtils.trim(g.value).length&&(b.y=Number(g.value))),d.isCellResizable(e[c])&&(0<mxUtils.trim(t.value).length&&(b.width=Number(t.value)),0<mxUtils.trim(q.value).length&&
-(b.height=Number(q.value))),d.getModel().setGeometry(e[c],b));0<mxUtils.trim(u.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(u.value),[e[c]])}}finally{d.getModel().endUpdate()}});mxEvent.addListener(h,"keypress",function(a){13==a.keyCode&&x.click()});k=document.createElement("div");k.style.marginTop="20px";k.style.textAlign="right";a.editor.cancelFirst?(k.appendChild(b),k.appendChild(x)):(k.appendChild(x),k.appendChild(b));h.appendChild(k);this.container=h},LibraryDialog=function(a,
-e,d,b,h,k){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=q;)a=a.parentNode;var c=null;if(null!=a)for(var b=q.firstChild,c=0;null!=b&&b!=a;)b=b.nextSibling,c++;return c}function n(c,b,g,d,e,h,t,k,v){try{if(null==b||"image/"==b.substring(0,6))if(null==c&&null!=t||null==x[c]){var B=function(){E.innerHTML="";E.style.cursor="pointer";E.style.whiteSpace="nowrap";E.style.textOverflow="ellipsis";mxUtils.write(E,null!=C.title&&0<C.title.length?C.title:mxResources.get("untitled"));
-E.style.color=null==C.title||0==C.title.length?"#d0d0d0":""};q.style.backgroundImage="";u.style.display="none";var m=e,D=h;if(e>a.maxImageSize||h>a.maxImageSize){var A=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,h));e*=A;h*=A}m>D?(D=Math.round(100*D/m),m=100):(m=Math.round(100*m/D),D=100);var G=document.createElement("div");G.setAttribute("draggable","true");G.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";G.style.position="relative";G.style.cursor="move";
-mxUtils.setPrefixedStyle(G.style,"transition","transform .1s ease-in-out");if(null!=c){var J=document.createElement("img");J.setAttribute("src",w.convert(c));J.style.width=m+"px";J.style.height=D+"px";J.style.margin="10px";J.style.paddingBottom=Math.floor((100-D)/2)+"px";J.style.paddingLeft=Math.floor((100-m)/2)+"px";G.appendChild(J)}else if(null!=t){var I=a.stringToCells(a.editor.graph.decompress(t.xml));0<I.length&&(a.sidebar.createThumb(I,100,100,G,null,!0,!1),G.firstChild.style.display=mxClient.IS_QUIRKS?
-"inline":"inline-block",G.firstChild.style.cursor="")}var F=document.createElement("img");F.setAttribute("src",Editor.closeImage);F.setAttribute("border","0");F.setAttribute("title",mxResources.get("delete"));F.setAttribute("align","top");F.style.paddingTop="4px";F.style.marginLeft="-22px";F.style.cursor="pointer";mxEvent.addListener(F,"dragstart",function(a){mxEvent.consume(a)});null==c&&null!=t&&(F.style.position="relative");(function(a,c,b){mxEvent.addListener(F,"click",function(g){x[c]=null;for(var p=
-0;p<f.length;p++)if(null!=f[p].data&&f[p].data==c||null!=f[p].xml&&null!=b&&f[p].xml==b.xml){f.splice(p,1);break}G.parentNode.removeChild(a);0==f.length&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",u.style.display="");mxEvent.consume(g)});mxEvent.addListener(F,"dblclick",function(a){mxEvent.consume(a)})})(G,c,t);G.appendChild(F);G.style.marginBottom="30px";var E=document.createElement("div");E.style.position="absolute";E.style.boxSizing="border-box";E.style.bottom="-18px";E.style.left=
-"10px";E.style.right="10px";E.style.backgroundColor="#ffffff";E.style.overflow="hidden";E.style.textAlign="center";var C=null;null!=c?(C={data:c,w:e,h:h,title:v},null!=k&&(C.aspect=k),x[c]=J,f.push(C)):null!=t&&(t.aspect="fixed",f.push(t),C=t);mxEvent.addListener(E,"keydown",function(a){13==a.keyCode&&null!=p&&(p(),p=null,mxEvent.consume(a))});B();G.appendChild(E);mxEvent.addListener(E,"mousedown",function(a){"true"!=E.getAttribute("contentEditable")&&mxEvent.consume(a)});I=function(c){if(mxClient.IS_IOS||
-mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,C.title||"",mxResources.get("ok"),function(a){null!=a&&(C.title=a,B())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(c)}else if("true"!=E.getAttribute("contentEditable")){null!=p&&(p(),p=null);if(null==C.title||0==C.title.length)E.innerHTML="";E.style.textOverflow="";E.style.whiteSpace="";E.style.cursor="text";E.style.color="";E.setAttribute("contentEditable",
-"true");E.focus();document.execCommand("selectAll",!1,null);p=function(){E.removeAttribute("contentEditable");E.style.cursor="pointer";C.title=E.innerHTML;B()};mxEvent.consume(c)}};mxEvent.addListener(E,"click",I);mxEvent.addListener(G,"dblclick",I);q.appendChild(G);mxEvent.addListener(G,"dragstart",function(a){null==c&&null!=t&&(F.style.visibility="hidden",E.style.visibility="hidden");mxClient.IS_FF&&null!=t.xml&&a.dataTransfer.setData("Text",t.xml);y=l(a);mxClient.IS_GC&&(G.style.opacity="0.9");
-window.setTimeout(function(){mxUtils.setPrefixedStyle(G.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(G,30);F.style.visibility="";E.style.visibility=""},0)});mxEvent.addListener(G,"dragend",function(a){"hidden"==F.style.visibility&&(F.style.visibility="",E.style.visibility="");y=null;mxUtils.setOpacity(G,100);mxUtils.setPrefixedStyle(G.style,"transform",null)})}else z||(z=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),m=mxUtils.parseXml(c),"mxlibrary"==
-m.documentElement.nodeName){D=JSON.parse(mxUtils.getTextContent(m.documentElement));if(null!=D&&0<D.length)for(var H=0;H<D.length;H++)null!=D[H].xml?n(null,null,0,0,0,0,D[H]):n(D[H].data,null,0,0,D[H].w,D[H].h,null,"fixed",D[H].title);e=!0}else if("mxfile"==m.documentElement.nodeName){for(var R=m.documentElement.getElementsByTagName("diagram"),H=0;H<R.length;H++){var D=mxUtils.getTextContent(R[H]),I=a.stringToCells(a.editor.graph.decompress(D)),M=a.editor.graph.getBoundingBoxFromGeometry(I);n(null,
-null,0,0,0,0,{xml:D,w:M.width,h:M.height})}e=!0}}catch(X){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(X){}return null}function m(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function c(c){c.stopPropagation();c.preventDefault();z=!1;v=l(c);if(null!=y)null!=v&&v<q.children.length?(f.splice(v>y?v-1:v,0,f.splice(y,1)[0]),q.insertBefore(q.children[y],q.children[v])):(f.push(f.splice(y,1)[0]),q.appendChild(q.children[y]));
-else if(0<c.dataTransfer.files.length)a.importFiles(c.dataTransfer.files,0,0,a.maxImageSize,D(c));else if(0<=mxUtils.indexOf(c.dataTransfer.types,"text/uri-list")){var b=decodeURIComponent(c.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(b)||/(\.png)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b)||/(\.svg)($|\?)/i.test(b))&&a.loadImage(b,function(a){n(b,null,0,0,a.width,a.height);q.scrollTop=q.scrollHeight})}c.stopPropagation();c.preventDefault()}var f=[];d=document.createElement("div");
-d.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="40px";d.appendChild(g);mxUtils.write(g,mxResources.get("filename")+":");null==e&&(e=a.defaultLibraryName+".xml");var t=document.createElement("input");t.setAttribute("value",e);t.style.marginRight="20px";t.style.marginLeft="10px";t.style.width="500px";null==h||h.isRenamable()||t.setAttribute("disabled","true");this.init=function(){if(null==h||h.isRenamable())t.focus(),mxClient.IS_GC||mxClient.IS_FF||
-5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};g.appendChild(t);var q=document.createElement("div");q.style.borderWidth="1px 0px 1px 0px";q.style.borderColor="#d3d3d3";q.style.borderStyle="solid";q.style.marginTop="6px";q.style.overflow="auto";q.style.height="340px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var u=
-document.createElement("div");u.style.position="absolute";u.style.width="640px";u.style.top="260px";u.style.textAlign="center";u.style.fontSize="22px";u.style.color="#a0c3ff";mxUtils.write(u,mxResources.get("dragImagesHere"));d.appendChild(u);var x={},y=null,v=null,p=null;e=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=p&&(p(),p=null,mxEvent.consume(a))};mxEvent.addListener(q,"mousedown",e);mxEvent.addListener(q,"pointerdown",e);mxEvent.addListener(q,"touchstart",
-e);var w=new mxUrlConverter,z=!1;if(null!=b)for(e=0;e<b.length;e++)g=b[e],n(g.data,null,0,0,g.w,g.h,g,g.aspect,g.title);mxEvent.addListener(q,"dragleave",function(a){u.style.cursor="";for(var c=mxEvent.getSource(a);null!=c;){if(c==q||c==u){a.stopPropagation();a.preventDefault();break}c=c.parentNode}});var D=function(c){return function(b,f,g,p,d,e,h,t,w){null!=w&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(b,w.name)?a.parseFile(w,mxUtils.bind(this,function(b){4==b.readyState&&
-(a.spinner.stop(),200<=b.status&&299>=b.status&&(n(b.responseText,f,g,p,d,e,h,"fixed",mxEvent.isAltDown(c)?null:h.substring(0,h.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight))})):(n(b,f,g,p,d,e,h,"fixed",mxEvent.isAltDown(c)?null:h.substring(0,h.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight)}};mxEvent.addListener(q,"dragover",m);mxEvent.addListener(q,"drop",c);mxEvent.addListener(u,"dragover",m);mxEvent.addListener(u,"drop",c);d.appendChild(q);b=document.createElement("div");
-b.style.textAlign="right";b.style.marginTop="20px";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.setAttribute("id","btnCancel");e.className="geBtn";a.editor.cancelFirst&&b.appendChild(e);g=mxUtils.button(mxResources.get("export"),function(){var c=a.createLibraryDataFromImages(f),b=t.value;/(\.xml)$/i.test(b)||(b+=".xml");a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml&xml="+encodeURIComponent(c))).simulate(document,
-"_blank")});g.setAttribute("id","btnDownload");g.className="geBtn";b.appendChild(g);var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(A,"change",function(c){z=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,b,f,g,p,d,e,h,t){D(c)(a,b,f,g,p,d,e,h,t);A.value=""});q.scrollTop=q.scrollHeight}),g=mxUtils.button(mxResources.get("import"),function(){null!=p&&(p(),p=null);A.click()}),g.setAttribute("id",
-"btnAddImage"),g.className="geBtn",b.appendChild(g));g=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=p&&(p(),p=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,c,b){z=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}n(a,null,0,0,c,b);q.scrollTop=q.scrollHeight}})});g.setAttribute("id","btnAddImageUrl");g.className="geBtn";b.appendChild(g);this.saveBtnClickHandler=function(c,b,f,g){a.saveLibrary(c,
-b,f,g)};g=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=p&&(p(),p=null);this.saveBtnClickHandler(t.value,f,h,k)}));g.setAttribute("id","btnSave");g.className="geBtn gePrimaryBtn";b.appendChild(g);a.editor.cancelFirst||b.appendChild(e);d.appendChild(b);this.container=d},EditShapeDialog=function(a,e,d,b,h){b=null!=b?b:300;h=null!=h?h:120;var k,l,n=document.createElement("table"),m=document.createElement("tbody");n.style.cellPadding="4px";k=document.createElement("tr");l=
-document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,d);k.appendChild(l);m.appendChild(k);k=document.createElement("tr");l=document.createElement("td");var c=document.createElement("textarea");c.style.outline="none";c.style.resize="none";c.style.width=b-200+"px";c.style.height=h+"px";this.textarea=c;this.init=function(){c.focus();c.scrollTop=0};l.appendChild(c);k.appendChild(l);l=document.createElement("td");d=document.createElement("div");d.style.position=
-"relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=h+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);l.appendChild(d);var f=new Graph(d);f.setEnabled(!1);var g=a.editor.graph.cloneCells([e])[0];f.addCells([g]);d=f.view.getState(g);var t="";null!=d.shape&&null!=d.shape.stencil&&(t=mxUtils.getPrettyXml(d.shape.stencil.desc));mxUtils.write(c,t||"");d=f.getGraphBounds();h=Math.min(160/d.width,(h-40)/d.height);f.view.scaleAndTranslate(h,
-20/h-d.x,20/h-d.y);k.appendChild(l);m.appendChild(k);k=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&l.appendChild(h);a.isOffline()||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
-d.className="geBtn",l.appendChild(d));var q=function(b,f,g){var d=c.value,p=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(p.documentElement),p=p.documentElement.getElementsByTagName("parsererror");if(null!=p&&0<p.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(g&&a.hideDialog(),p=!b.model.contains(f),!g||p||d!=t){d=a.editor.graph.compress(d);b.getModel().beginUpdate();try{if(p){var e=a.editor.graph.getInsertPoint();f.geometry.x=e.x;
-f.geometry.y=e.y;b.addCell(f)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[f])}catch(z){throw z;}finally{b.getModel().endUpdate()}p&&b.setSelectionCell(f)}};d=mxUtils.button(mxResources.get("preview"),function(){q(f,g,!1)});d.className="geBtn";l.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,e,!0)});d.className="geBtn gePrimaryBtn";l.appendChild(d);a.editor.cancelFirst||l.appendChild(h);k.appendChild(l);m.appendChild(k);n.appendChild(m);this.container=
-n},CustomDialog=function(a,e,d,b,h,k,l){var n=document.createElement("div");n.appendChild(e);e=document.createElement("div");e.style.marginTop="16px";e.style.textAlign="right";null!=l&&e.appendChild(l);l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b()});l.className="geBtn";a.editor.cancelFirst&&e.appendChild(l);if(!a.isOffline()&&null!=k){var m=mxUtils.button(mxResources.get("help"),function(){a.openLink(k)});m.className="geBtn";e.appendChild(m)}h=mxUtils.button(h||
-mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});e.appendChild(h);h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(l);n.appendChild(e);this.cancelBtn=l;this.okButton=h;this.container=n};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
+a.photoPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),f.className="geBtn",b.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d(""!=h.value?new mxImage(mxUtils.trim(h.value),m.value,n.value):null)});f.className="geBtn gePrimaryBtn";b.appendChild(f);a.editor.cancelFirst||b.appendChild(c);e.appendChild(b);this.container=e},ParseDialog=function(a,d){function e(c,f){var b=c.split("\n");if("plantUmlPng"==f||"plantUmlSvg"==
+f){var b="plantUmlPng"==f?"https://exp.draw.io/plantuml2/png/":"https://exp.draw.io/plantuml2/svg/",g=a.editor.graph;if(a.spinner.spin(document.body,mxResources.get("inserting"))){var e=function(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"},d=function(a,c,b){c1=a>>2;c2=(a&3)<<4|c>>4;c3=(c&15)<<2|b>>6;c4=b&63;r="";r+=e(c1&63);r+=e(c2&63);r+=e(c3&63);return r+=e(c4&63)},p=
+new XMLHttpRequest;p.open("GET",b+function(a){r="";for(k=0;k<a.length;k+=3)r=k+2==a.length?r+d(a.charCodeAt(k),a.charCodeAt(k+1),0):k+1==a.length?r+d(a.charCodeAt(k),0,0):r+d(a.charCodeAt(k),a.charCodeAt(k+1),a.charCodeAt(k+2));return r}(g.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(c))))),!0);p.responseType="blob";p.onload=function(b){200<=this.status&&300>this.status?(b=new FileReader,b.readAsDataURL(this.response),b.onload=function(b){var f=new Image;f.onload=function(){a.spinner.stop();
+g.getModel().beginUpdate();try{cell=g.insertVertex(null,null,c,h.x,h.y,f.width,f.height,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(b.target.result)+";")}finally{g.getModel().endUpdate()}g.setSelectionCell(cell);g.scrollCellToVisible(g.getSelectionCell())};f.src=b.target.result},b.onerror=function(c){a.handleError(c)}):(a.spinner.stop(),a.handleError(b))};p.onerror=function(c){a.handleError(c)};p.send()}}else if("table"==f){for(var q=null,v=[],l=0,
+k=0;k<b.length;k++)if(p=mxUtils.trim(b[k]),"create table"==p.substring(0,12).toLowerCase())p=mxUtils.trim(p.substring(12)),"("==p.charAt(p.length-1)&&(p=p.substring(0,p.lastIndexOf(" "))),q=new mxCell(p,new mxGeometry(l,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),q.vertex=!0,v.push(q),p=a.editor.graph.getPreferredSizeForCell(m),
+null!=p&&(q.geometry.width=p.width+10);else if(null!=q&&")"==p.charAt(0))l+=q.geometry.width+40,q=null;else if("("!=p&&null!=q&&(p=p.substring(0,","==p.charAt(p.length-1)?p.length-1:p.length),"primary key"!=p.substring(0,11).toLowerCase())){var m=new mxCell(p,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
+m.vertex=!0;p=sb.cloneCell(m,"");p.connectable=!1;p.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";p.geometry.width=30;p.geometry.height=26;m.insert(p);p=a.editor.graph.getPreferredSizeForCell(m);null!=p&&q.geometry.width<p.width+10&&(q.geometry.width=p.width+10);q.insert(m);q.geometry.height+=26}0<v.length&&(g=a.editor.graph,b=g.view,p=g.getGraphBounds(),
+g.setSelectionCells(g.importCells(v,Math.ceil(Math.max(0,p.x/b.scale-b.translate.x)+4*g.gridSize),Math.ceil(Math.max(0,(p.y+p.height)/b.scale-b.translate.y)+4*g.gridSize))),g.scrollCellToVisible(g.getSelectionCell()))}else if("list"==f){if(0<b.length){g=a.editor.graph;m=new mxCell(b[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");m.vertex=!0;
+p=g.getPreferredSizeForCell(m);null!=p&&m.geometry.width<p.width+10&&(m.geometry.width=p.width+10);q=[m];if(1<b.length)for(k=1;k<b.length;k++)"--"==b[k]?(p=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),p.vertex=!0,m.geometry.height+=p.geometry.height,m.insert(p),q.push(p)):0<b[k].length&&";"!=b[k].charAt(0)&&(l=new mxCell(b[k],
+new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),l.vertex=!0,p=g.getPreferredSizeForCell(l),null!=p&&l.geometry.width<p.width&&(l.geometry.width=p.width),m.geometry.width=Math.max(m.geometry.width,l.geometry.width),m.geometry.height+=l.geometry.height,m.insert(l),q.push(l));g.getModel().beginUpdate();try{m=g.importCells([m],h.x,h.y)[0],g.fireEvent(new mxEventObject("cellsInserted",
+"cells",[m].concat(m.children)))}finally{g.getModel().endUpdate()}g.setSelectionCell(m);g.scrollCellToVisible(g.getSelectionCell())}}else{for(var m=function(a){var c=n[a];null==c&&(c=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),c.vertex=!0,n[a]=c,v.push(c));return c},n={},v=[],k=0;k<b.length;k++)if(";"!=b[k].charAt(0)){var F=b[k].split("->");if(2<=F.length){var l=m(F[0]),D=m(F[F.length-1]),F=new mxCell(2<F.length?F[1]:"",new mxGeometry);F.edge=!0;l.insertEdge(F,!0);D.insertEdge(F,
+!1);v.push(F)}}if(0<v.length){b=document.createElement("div");b.style.visibility="hidden";document.body.appendChild(b);g=new Graph(b);g.getModel().beginUpdate();try{v=g.importCells(v);for(k=0;k<v.length;k++)g.getModel().isVertex(v[k])&&(p=g.getPreferredSizeForCell(v[k]),v[k].geometry.width=Math.max(v[k].geometry.width,p.width),v[k].geometry.height=Math.max(v[k].geometry.height,p.height));q=new mxFastOrganicLayout(g);q.disableEdgeStyle=!1;q.forceConstant=120;q.execute(g.getDefaultParent())}finally{g.getModel().endUpdate()}g.clearCellOverlays();
+q=[];a.editor.graph.getModel().beginUpdate();try{q=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),h.x,h.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",q))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(q[0]);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());g.destroy();b.parentNode.removeChild(b)}}}function b(){return"list"==m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":
+"table"==m.value?"CREATE TABLE Persons\n(\nPersonID int,\nLastName varchar(255),\nFirstName varchar(255),\nAddress varchar(255),\nCity varchar(255)\n);":"plantUmlPng"==m.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":"plantUmlSvg"==m.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
+";Example:\na->b\nb->edge label->c\nc->a\n"}var h=a.editor.graph.getFreeInsertPoint(),l=document.createElement("div");l.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height="354px";k.style.marginBottom="16px";var m=document.createElement("select"),n=document.createElement("option");n.setAttribute("value","list");n.setAttribute("selected","selected");mxUtils.write(n,mxResources.get("list"));m.appendChild(n);n=document.createElement("option");
+n.setAttribute("value","table");mxUtils.write(n,mxResources.get("table"));m.appendChild(n);n=document.createElement("option");n.setAttribute("value","diagram");mxUtils.write(n,mxResources.get("diagram"));m.appendChild(n);n=document.createElement("option");n.setAttribute("value","plantUmlSvg");mxUtils.write(n,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");var c=document.createElement("option");c.setAttribute("value","plantUmlPng");mxUtils.write(c,mxResources.get("plantUml")+" ("+
+mxResources.get("formatPng")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&(m.appendChild(n),m.appendChild(c));var f=b();k.value=f;l.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var c=new FileReader;c.onload=function(a){k.value=a.target.result};
+c.readAsText(a)}},!1));l.appendChild(m);mxEvent.addListener(m,"change",function(){var a=b();if(0==k.value.length||k.value==f)f=a,k.value=f});n=mxUtils.button(mxResources.get("close"),function(){k.value==f?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});n.className="geBtn";a.editor.cancelFirst&&l.appendChild(n);c=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();e(k.value,m.value)});l.appendChild(c);c.className="geBtn gePrimaryBtn";a.editor.cancelFirst||
+l.appendChild(n);this.container=l},NewDialog=function(a,d,e,b,h,l,k,m,n,c,f,g,p,u){function t(){for(var a=!0;E<V.length&&(a||0!=mxUtils.mod(E,30));)a=V[E++],B(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info),a=!1}function w(){if(R)a.hideDialog(),u(R,M,A.value);else if(b)e||a.hideDialog(),b(S,A.value);else{var c=A.value;null!=c&&0<c.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?
+a.mode:null,function(b){a.createFile(c,S,null!=P&&0<P.length?P:null,null,function(){a.hideDialog()},null,b)})}}function y(a,c,b,f,q){null!=O&&(O.style.backgroundColor="transparent",O.style.border="1px solid transparent");F.removeAttribute("disabled");S=c;P=b;O=a;R=f;M=q;O.style.backgroundColor=m;O.style.border=n}function B(a,c,b,f,q,g,e){var d=document.createElement("div");d.className="geTemplate";d.style.height=L+"px";d.style.width=X+"px";null!=f&&0<f.length&&d.setAttribute("title",f);if(null!=g)d.style.backgroundImage=
+"url("+g+")",d.style.backgroundSize="contain",d.style.backgroundPosition="center center",d.style.backgroundRepeat="no-repeat",mxEvent.addListener(d,"click",function(c){y(d,null,null,a,e)}),mxEvent.addListener(d,"dblclick",function(a){w()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);d.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";var v=!1;mxEvent.addListener(d,"click",function(b){F.setAttribute("disabled",
+"disabled");d.style.backgroundColor="transparent";d.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(y(d,a.getText(),c),v&&w())}))});mxEvent.addListener(d,"dblclick",function(a){v=!0})}else d.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(b)+"</td></tr></table>",q&&y(d),mxEvent.addListener(d,"click",function(a){y(d)}),mxEvent.addListener(d,"dblclick",function(a){w()});
+J.appendChild(d)}function q(){mxEvent.addListener(J,"scroll",function(a){J.scrollTop+J.clientHeight>=J.scrollHeight&&(t(),mxEvent.consume(a))});var a=null,b;for(b in N){var f=document.createElement("div"),q=mxResources.get(b),g=N[b];null==q&&(q=b.substring(0,1).toUpperCase()+b.substring(1));18<q.length&&(q=q.substring(0,18)+"&hellip;");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";f.setAttribute("title",q+" ("+
+g.length+")");mxUtils.write(f,f.getAttribute("title"));null!=c&&(f.style.padding=c);T.appendChild(f);null==a&&(a=f,a.style.backgroundColor=k);(function(c,b){mxEvent.addListener(f,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=k,J.scrollTop=0,J.innerHTML="",E=0,V=N[c],H=null,t())})})(b,f)}t()}e=null!=e?e:!0;h=null!=h?h:!1;k=null!=k?k:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:TEMPLATE_PATH+"/index.xml";var v=document.createElement("div");
+v.style.height="100%";var x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height="46px";e&&v.appendChild(x);var z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.width="40px";z.style.height="40px";z.style.marginRight="10px";z.style.paddingBottom="4px";z.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":
+a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!d&&e&&x.appendChild(z);e&&mxUtils.write(x,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");z=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?z=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?z=a.dropbox.extension:
+a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?z=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?z=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(z=a.trello.extension);var A=document.createElement("input");A.setAttribute("value",a.defaultFilename+z);A.style.marginRight="20px";A.style.marginLeft="10px";A.style.width=d?"220px":"430px";this.init=function(){e&&(A.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",
+!1,null))};e&&x.appendChild(A);var x=!1,E=0,F=mxUtils.button(mxResources.get("create"),function(){w()});F.className="geBtn gePrimaryBtn";if(g||p){var D=[],H=null,C=function(a){F.setAttribute("disabled","disabled");for(var c=0;c<D.length;c++)D[c].className=c==a?"geBtn gePrimaryBtn":"geBtn"},x=!0,z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="30px";v.appendChild(z);var G=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){T.style.display="";J.style.left=
+"160px";C(0);J.scrollTop=0;J.innerHTML="";E=0;H!=V&&(V=H,t(),H=null)});D.push(G);z.appendChild(G);var I=function(a){T.style.display="none";J.style.left="30px";C(a?-1:1);null==H&&(H=V);J.scrollTop=0;J.innerHTML="";var c=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});c.spin(J);E=0;var b=function(a,b){c.stop();V=a;b?J.innerHTML=b:0==a.length?J.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(J.innerHTML=
+"",t())};a?p(K.value,b):g(b)};g&&(G=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){I()}),z.appendChild(G),D.push(G));if(p){G=document.createElement("span");G.style.marginLeft="10px";G.innerHTML=mxResources.get("search")+":";z.appendChild(G);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(a){13==a.keyCode&&I(!0)});z.appendChild(K);G=mxUtils.button(mxResources.get("search"),
+function(){I(!0)});G.className="geBtn";z.appendChild(G)}C(0)}var P=null,S=null,O=null,R=null,M=null,J=document.createElement("div");J.style.border="1px solid #d3d3d3";J.style.position="absolute";J.style.left="160px";J.style.right="34px";x=(e?72:40)+(x?30:0);J.style.top=x+"px";J.style.bottom="68px";J.style.margin="6px 0 0 -1px";J.style.padding="6px";J.style.overflow="auto";var T=document.createElement("div");T.style.cssText="position:absolute;left:30px;width:128px;top:"+x+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
+var L=140,X=140,N={},Y=1;N.basic=[{title:"blankDiagram",select:!0}];var V=N.basic;if(!d){v.appendChild(T);v.appendChild(J);var U=!1;mxUtils.get(f,function(a){if(!U){U=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var c=a.getAttribute("url");if(null!=c){var b=c.indexOf("/"),c=c.substring(0,b),b=N[c];null==b&&(Y++,b=[],N[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=
+a.nextSibling}q()}})}mxEvent.addListener(A,"keypress",function(a){13==a.keyCode&&w()});f=document.createElement("div");f.style.marginTop=d?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";x=mxUtils.button(mxResources.get("cancel"),function(){null!=l&&l();a.hideDialog(!0)});x.className="geBtn";!a.editor.cancelFirst||h&&null==l||f.appendChild(x);d||a.isOffline()||!e||null!=b||h||(z=mxUtils.button(mxResources.get("help"),
+function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",f.appendChild(z));d||"1"==urlParams.embed||h||(d=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var c=new FilenameDialog(a,"",mxResources.get("create"),function(c){null!=c&&0<c.length&&(c=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(A.value)+"&create="+encodeURIComponent(c)),null==a.getCurrentFile()?window.location.href=c:window.openWindow(c))},
+mxResources.get("url"));a.showDialog(c.container,300,80,!0,!0);c.init()}),d.className="geBtn",f.appendChild(d));f.appendChild(F);a.editor.cancelFirst||null!=b||h&&null==l||f.appendChild(x);v.appendChild(f);this.container=v},CreateDialog=function(a,d,e,b,h,l,k,m,n,c,f,g,p,u,t){function w(c,b,f,q){function e(){mxEvent.addListener(u,"click",function(){var c=f;if(k){var b=v.value,q=b.lastIndexOf(".");if(0>d.lastIndexOf(".")&&0>q){var c=null!=c?c:A.value,g="";c==App.MODE_GOOGLE?g=a.drive.extension:c==
+App.MODE_GITHUB?g=a.gitHub.extension:c==App.MODE_TRELLO?g=a.trello.extension:c==App.MODE_DROPBOX?g=a.dropbox.extension:c==App.MODE_ONEDRIVE?g=a.oneDrive.extension:c==App.MODE_DEVICE&&(g=".xml");0<=q&&(b=b.substring(0,q));v.value=b+g}}y(f)})}var u=document.createElement("a");u.style.overflow="hidden";var p=document.createElement("img");p.src=c;p.setAttribute("border","0");p.setAttribute("align","absmiddle");p.style.width="60px";p.style.height="60px";p.style.paddingBottom="6px";u.style.display=mxClient.IS_QUIRKS?
+"inline":"inline-block";u.className="geBaseButton";u.style.position="relative";u.style.margin="4px";u.style.padding="8px 8px 10px 8px";u.style.whiteSpace="nowrap";u.appendChild(p);mxClient.IS_QUIRKS&&(u.style.cssFloat="left",u.style.zoom="1");u.style.color="gray";u.style.fontSize="11px";var h=document.createElement("div");u.appendChild(h);mxUtils.write(h,b);if(null!=q&&null==a[q]){p.style.visibility="hidden";mxUtils.setOpacity(h,10);var t=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,
+color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});t.spin(u);var B=window.setTimeout(function(){null==a[q]&&(t.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[q]&&(window.clearTimeout(B),mxUtils.setOpacity(h,100),p.style.visibility="",t.stop(),e())}))}else e();x.appendChild(u);++z==g&&(mxUtils.br(x),z=0)}function y(c){var b=v.value;if(null==c||null!=b&&0<b.length)a.hideDialog(),e(b,c)}k=null!=k?k:!0;m=null!=m?m:!0;g=null!=
+g?g:4;var B=document.createElement("div");null==b&&a.addLanguageMenu(B);var q=document.createElement("h2");mxUtils.write(q,h||mxResources.get("create"));q.style.marginTop="0px";q.style.marginBottom="24px";B.appendChild(q);mxUtils.write(B,mxResources.get("filename")+":");var v=document.createElement("input");v.setAttribute("value",d);v.style.width="280px";v.style.marginLeft="10px";v.style.marginBottom="20px";this.init=function(){v.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
+v.select():document.execCommand("selectAll",!1,null)};B.appendChild(v);null!=p&&null!=u&&"image/"==u.substring(0,6)&&(v.style.width="160px",h=null,"image/svg+xml"==u&&mxClient.IS_SVG?(h=document.createElement("div"),h.innerHTML=mxUtils.trim(p),p=h.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),t=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+t),p.setAttribute("width","120px"),p.setAttribute("height","80px")):(h=document.createElement("img"),h.setAttribute("src",
+"data:"+u+(t?";base64,":";utf8,")+p)),h.style.position="absolute",h.style.top="70px",h.style.right="100px",h.style.maxWidth="120px",h.style.maxHeight="80px",mxUtils.setPrefixedStyle(h.style,"transform","translate(50%,-50%)"),B.appendChild(h),n&&(h.style.cursor="pointer",mxEvent.addListener(h,"click",function(){y("_blank")})));mxUtils.br(B);var x=document.createElement("div");x.style.textAlign="center";var z=0;x.style.marginTop="6px";B.appendChild(x);var A=document.createElement("select");A.style.marginLeft=
+"10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(h,mxResources.get("googleDrive")),A.appendChild(h),w(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(h,mxResources.get("oneDrive")),A.appendChild(h),a.mode==
+App.MODE_ONEDRIVE&&h.setAttribute("selected","selected"),w(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(h,mxResources.get("dropbox")),A.appendChild(h),a.mode==App.MODE_DROPBOX&&h.setAttribute("selected","selected"),w(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(h=
+document.createElement("option"),h.setAttribute("value",App.MODE_GITHUB),mxUtils.write(h,mxResources.get("github")),A.appendChild(h),w(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_TRELLO),mxUtils.write(h,mxResources.get("trello")),A.appendChild(h),w(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||
+null!=a.getCurrentFile()&&!mxClient.IS_IOS)h=document.createElement("option"),h.setAttribute("value",App.MODE_DEVICE),mxUtils.write(h,mxResources.get("device")),A.appendChild(h),a.mode!=App.MODE_DEVICE&&m||h.setAttribute("selected","selected"),f&&w(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);m&&isLocalStorage&&"0"!=urlParams.browser&&(m=document.createElement("option"),m.setAttribute("value",App.MODE_BROWSER),mxUtils.write(m,mxResources.get("browser")),A.appendChild(m),
+a.mode==App.MODE_BROWSER&&m.setAttribute("selected","selected"),w(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));m=document.createElement("div");m.style.marginTop="26px";m.style.textAlign="right";null!=c&&(h=mxUtils.button(mxResources.get("help"),function(){a.openLink(c)}),h.className="geBtn",m.appendChild(h));h=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});h.className=
+"geBtn";a.editor.cancelFirst&&m.appendChild(h);null==b&&(p=mxUtils.button(mxResources.get("decideLater"),function(){y(null)}),p.className="geBtn",m.appendChild(p));n&&(n=mxUtils.button(mxResources.get("openInNewWindow"),function(){y("_blank")}),n.className="geBtn",m.appendChild(n));mxClient.IS_IOS||(l=mxUtils.button(l||mxResources.get("create"),function(){y(f?"download":App.MODE_DEVICE)}),l.className="geBtn gePrimaryBtn",m.appendChild(l));a.editor.cancelFirst||m.appendChild(h);mxEvent.addListener(v,
+"keypress",function(c){13==c.keyCode?y(App.MODE_DEVICE):27==c.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});B.appendChild(m);this.container=B},PopupDialog=function(a,d,e,b,h){h=null!=h?h:!0;var l=document.createElement("div");l.style.textAlign="left";mxUtils.write(l,mxResources.get("fileOpenLocation"));mxUtils.br(l);mxUtils.br(l);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){h&&a.hideDialog();null!=b&&b()});k.className="geBtn";k.style.marginBottom="8px";k.style.width=
+"280px";l.appendChild(k);mxUtils.br(l);var m=mxUtils.button(mxResources.get("openInNewWindow"),function(){h&&a.hideDialog();null!=e&&e();a.openLink(d)});m.className="geBtn gePrimaryBtn";m.style.width=k.style.width;l.appendChild(m);mxUtils.br(l);mxUtils.br(l);mxUtils.write(l,mxResources.get("allowPopups"));this.container=l},ImageDialog=function(a,d,e,b,h,l){l=null!=l?l:!0;var k=a.editor.graph,m=document.createElement("div");mxUtils.write(m,d);d=document.createElement("div");d.className="geTitle";d.style.backgroundColor=
+"transparent";d.style.borderColor="transparent";d.style.whiteSpace="nowrap";d.style.textOverflow="clip";d.style.cursor="default";mxClient.IS_VML||(d.style.paddingRight="20px");var n=document.createElement("input");n.setAttribute("value",e);n.setAttribute("type","text");n.setAttribute("spellcheck","false");n.setAttribute("autocorrect","off");n.setAttribute("autocomplete","off");n.setAttribute("autocapitalize","off");n.style.marginTop="6px";n.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?
+20:-20)+"px";n.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";n.style.backgroundRepeat="no-repeat";n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";e=document.createElement("div");e.setAttribute("title",mxResources.get("reset"));e.style.position="relative";e.style.left="-16px";e.style.width="12px";e.style.height="14px";e.style.cursor="pointer";e.style.display=mxClient.IS_VML?"inline":"inline-block";e.style.top=(mxClient.IS_VML?0:3)+"px";e.style.background="url('"+
+a.editor.transparentImage+"')";mxEvent.addListener(e,"click",function(){n.value="";n.focus()});d.appendChild(n);d.appendChild(e);m.appendChild(d);var c=function(c,f,g){var d="data:"==c.substring(0,5);!a.isOffline()||d&&"undefined"===typeof chrome?0<c.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(c,function(d){a.spinner.stop();a.hideDialog();var q=null!=f&&null!=g?Math.max(f/d.width,g/d.height):Math.min(1,Math.min(520/d.width,520/d.height));l&&(c=a.convertDataUri(c));
+b(c,Math.round(Number(d.width)*q),Math.round(Number(d.height)*q))},function(){a.spinner.stop();b(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),b(c)):(c=a.convertDataUri(c),f=null==f?120:f,g=null==g?100:g,a.hideDialog(),b(c,f,g))},f=function(f){if(null!=f){var g=h?null:k.getModel().getGeometry(k.getSelectionCell());null!=g?c(f,g.width,g.height):c(f)}else a.hideDialog(),b(null)};this.init=function(){n.focus();if(Graph.fileSupport){n.setAttribute("placeholder",
+mxResources.get("dragImagesHere"));var c=m.parentNode,b=null;mxEvent.addListener(c,"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(f){null==b&&(!mxClient.IS_IE||10<document.documentMode)&&(b=a.highlightElement(c));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(c){null!=b&&(b.parentNode.removeChild(b),b=null);if(0<c.dataTransfer.files.length)a.importFiles(c.dataTransfer.files,
+0,0,a.maxImageSize,function(a,c,b,g,d,e){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},!mxEvent.isControlDown(c));else if(0<=mxUtils.indexOf(c.dataTransfer.types,"text/uri-list")){var g=c.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(g)&&f(decodeURIComponent(g))}c.stopPropagation();c.preventDefault()}),!1)}};e=document.createElement("div");e.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";e.style.textAlign=
+"right";d=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});d.className="geBtn";a.editor.cancelFirst&&e.appendChild(d);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(n.value=a.url));n.focus()};if(Graph.fileSupport){var g=document.createElement("input");g.setAttribute("multiple","multiple");g.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(g,
+"change",function(c){a.importFiles(g.files,0,0,a.maxImageSize,function(a,c,b,g,q,d){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},!0)});var p=mxUtils.button(mxResources.get("open"),function(){g.click()});p.className="geBtn";e.appendChild(p)}}document.createElement("canvas").getContext&&"data:image/"==n.value.substring(0,11)&&"data:image/svg"!=n.value.substring(0,14)&&(p=mxUtils.button(mxResources.get("crop"),function(){var c=new CropImageDialog(a,
+n.value,function(a){n.value=a});a.showDialog(c.container,200,180,!0,!0);c.init()}),p.className="geBtn",e.appendChild(p));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(p=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var c=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),
+p.className="geBtn",e.appendChild(p),null!=a.drive&&"1"==urlParams.photos&&(p=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var c=gapi.auth.getToken().access_token,c=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(c).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
+a.photoPicker=c.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),p.className="geBtn",e.appendChild(p)));mxEvent.addListener(n,"keypress",function(a){13==a.keyCode&&f(n.value)});p=mxUtils.button(mxResources.get("apply"),function(){f(n.value)});p.className="geBtn gePrimaryBtn";e.appendChild(p);a.editor.cancelFirst||e.appendChild(d);Graph.fileSupport&&(e.style.marginTop="120px",m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",m.style.backgroundPosition=
+"center 65%",m.style.backgroundRepeat="no-repeat",d=document.createElement("div"),d.style.position="absolute",d.style.width="420px",d.style.top="58%",d.style.textAlign="center",d.style.fontSize="18px",d.style.color="#a0c3ff",mxUtils.write(d,mxResources.get("dragImagesHere")),m.appendChild(d));m.appendChild(e);this.container=m},LinkDialog=function(a,d,e,b,h){function l(a,c,b){b=mxUtils.button("",b);b.className="geBtn";b.setAttribute("title",c);c=document.createElement("img");c.style.height="26px";
+c.style.width="26px";c.setAttribute("src",a);b.style.minWidth="42px";b.style.verticalAlign="middle";b.appendChild(c);y.appendChild(b)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var m=document.createElement("div");m.className="geTitle";m.style.backgroundColor="transparent";m.style.borderColor="transparent";m.style.whiteSpace="nowrap";m.style.textOverflow="clip";m.style.cursor="default";mxClient.IS_VML||(m.style.paddingRight="20px");var n=document.createElement("input");
+n.setAttribute("placeholder",mxResources.get("dragUrlsHere"));n.setAttribute("type","text");n.style.marginTop="6px";n.style.width="400px";n.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";n.style.backgroundRepeat="no-repeat";n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";var c=document.createElement("div");c.setAttribute("title",mxResources.get("reset"));c.style.position="relative";c.style.left="-16px";c.style.width="12px";c.style.height="14px";c.style.cursor="pointer";
+c.style.display=mxClient.IS_VML?"inline":"inline-block";c.style.top=(mxClient.IS_VML?0:3)+"px";c.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(c,"click",function(){n.value="";n.focus()});var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","current-linkdialog");var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";
+g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","current-linkdialog");var p=document.createElement("select");p.style.width="380px";if(h&&null!=a.pages){null!=d&&a.editor.graph.isPageLink(d)?(g.setAttribute("checked","checked"),g.defaultChecked=!0):(n.setAttribute("value",d),f.setAttribute("checked","checked"),f.defaultChecked=!0);n.style.width="380px";m.appendChild(f);m.appendChild(n);m.appendChild(c);mxUtils.br(m);m.appendChild(g);h=!1;for(c=0;c<a.pages.length;c++){var u=
+document.createElement("option");mxUtils.write(u,a.pages[c].getName()||mxResources.get("pageWithNumber",[c+1]));u.setAttribute("value","data:page/id,"+a.pages[c].getId());d==u.getAttribute("value")&&(u.setAttribute("selected","selected"),h=!0);p.appendChild(u)}if(!h&&g.checked){var t=document.createElement("option");mxUtils.write(t,mxResources.get("pageNotFound"));t.setAttribute("disabled","disabled");t.setAttribute("selected","selected");t.setAttribute("value","pageNotFound");p.appendChild(t);mxEvent.addListener(p,
+"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}m.appendChild(p)}else n.setAttribute("value",d),m.appendChild(n),m.appendChild(c);k.appendChild(m);var w=mxUtils.button(e,function(){a.hideDialog();b(g.checked?"pageNotFound"!==p.value?p.value:d:n.value,LinkDialog.selectedDocs)});w.style.verticalAlign="middle";w.className="geBtn gePrimaryBtn";this.init=function(){g.checked?p.focus():(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
+n.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(p,"focus",function(){f.removeAttribute("checked");g.setAttribute("checked","checked");g.checked=!0});mxEvent.addListener(n,"focus",function(){g.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){var c=k.parentNode,b=null;mxEvent.addListener(c,"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",
+mxUtils.bind(this,function(f){null==b&&(!mxClient.IS_IE||10<document.documentMode)&&(b=a.highlightElement(c));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(n.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,w.click());a.stopPropagation();a.preventDefault()}),!1)}};var y=document.createElement("div");
+y.style.marginTop="20px";y.style.textAlign="right";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.style.verticalAlign="middle";e.className="geBtn";a.editor.cancelFirst&&y.appendChild(e);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var c=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(c=DriveClient.prototype.oldAppHostname,c=
+"https://"+c+"/#G"+a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?(c=DriveClient.prototype.newAppHostname,c="https://"+c+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(c="https://drive.google.com/#folders/"+a.docs[0].id);n.value=c;n.focus()}else LinkDialog.selectedDocs=null;n.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&l(IMAGE_PATH+"/google-drive-logo.svg",
+mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var c=gapi.auth.getToken().access_token,b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),g=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),
+c=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(c).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(f).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&c.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
+a.linkPicker=c.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&l(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){n.value=a[0].link;n.focus()}})});null!=a.oneDrive&&l(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,c){n.value=c.value[0].webUrl;
+n.focus()})});null!=a.gitHub&&l(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var c=a[0],b=a[1],f=a[2];a=a.slice(3,a.length).join("/");n.value="https://github.com/"+c+"/"+b+"/blob/"+f+"/"+a;n.focus()}})});mxEvent.addListener(n,"keypress",function(c){13==c.keyCode&&(a.hideDialog(),b(g.checked?p.value:n.value,LinkDialog.selectedDocs))});y.appendChild(w);a.editor.cancelFirst||y.appendChild(e);k.appendChild(y);this.container=
+k},AboutDialog=function(a){var d=document.createElement("div");d.style.marginTop="6px";d.setAttribute("align","center");var e=document.createElement("img");e.style.border="0px";mxClient.IS_SVG?(e.setAttribute("width","164"),e.setAttribute("height","221"),e.style.width="164px",e.style.height="221px",e.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(e.setAttribute("width","176"),e.setAttribute("height","219"),e.style.width="170px",e.style.height="219px",e.setAttribute("src",IMAGE_PATH+
+"/logo-flat.png"));d.appendChild(e);mxUtils.br(d);e=document.createElement("small");e.innerHTML="v "+EditorUi.VERSION;e.style.color="#505050";d.appendChild(e);mxUtils.br(d);mxUtils.br(d);e=document.createElement("small");e.style.color="#505050";e.innerHTML='&copy; 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';d.appendChild(e);mxEvent.addListener(d,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=
+d},FeedbackDialog=function(a){var d=document.createElement("div"),e=document.createElement("div");mxUtils.write(e,mxResources.get("sendYourFeedbackToDrawIo"));e.style.fontSize="18px";e.style.marginBottom="18px";d.appendChild(e);e=document.createElement("div");mxUtils.write(e,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");d.appendChild(e);var b=document.createElement("input");b.setAttribute("type","text");b.style.marginTop="6px";b.style.width="600px";var h=mxUtils.button(mxResources.get("sendMessage"),
+function(){var c=(k.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;c.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(b.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+n.value+c),
+function(c){a.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});h.className="geBtn gePrimaryBtn";h.setAttribute("disabled","disabled");var l=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;mxEvent.addListener(b,"change",
+function(){0<b.value.length&&0<l.test(b.value)?h.removeAttribute("disabled"):h.setAttribute("disabled","disabled")});mxEvent.addListener(b,"keyup",function(){0<b.value.length&&l.test(b.value)?h.removeAttribute("disabled"):h.setAttribute("disabled","disabled")});d.appendChild(b);this.init=function(){b.focus()};var k=document.createElement("input");k.setAttribute("type","checkbox");k.setAttribute("checked","checked");k.defaultChecked=!0;e=document.createElement("p");e.style.marginTop="14px";e.appendChild(k);
+var m=document.createElement("span");mxUtils.write(m," "+mxResources.get("includeCopyOfMyDiagram"));e.appendChild(m);mxEvent.addListener(m,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});d.appendChild(e);e=document.createElement("div");mxUtils.write(e,mxResources.get("feedback"));d.appendChild(e);var n=document.createElement("textarea");n.style.resize="none";n.style.width="600px";n.style.height="140px";n.style.marginTop="6px";n.setAttribute("placeholder",mxResources.get("commentsNotes"));
+d.appendChild(n);e=document.createElement("div");e.style.marginTop="26px";e.style.textAlign="right";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst?(e.appendChild(m),e.appendChild(h)):(e.appendChild(h),e.appendChild(m));d.appendChild(e);this.container=d};FeedbackDialog.maxAttachmentSize=1E6;
+var RevisionDialog=function(a,d,e){var b=document.createElement("div"),h=document.createElement("h3");h.style.marginTop="0px";mxUtils.write(h,mxResources.get("revisionHistory"));b.appendChild(h);var l=document.createElement("div");l.style.position="absolute";l.style.overflow="auto";l.style.width="170px";l.style.height="378px";b.appendChild(l);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.left="199px";k.style.width="470px";k.style.height=
+"376px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);b.appendChild(k);var m=new Graph(k);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;var n=0,c=null,f=0,g=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=c&&null!=c[f]?c[f].getAttribute("name"):"pagenumber"==a?f+1:g.apply(this,arguments)};m.getLinkForCell=function(){return null};Editor.MathJaxRender&&
+m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(c,b){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),t=null,w=null,y=null,B=null,q=mxUtils.button("",function(){null!=y&&m.zoomIn()});q.className="geSprite geSprite-zoomin";q.setAttribute("title",mxResources.get("zoomIn"));
+q.style.outline="none";q.style.border="none";q.style.margin="2px";q.setAttribute("disabled","disabled");mxUtils.setOpacity(q,20);var v=mxUtils.button("",function(){null!=y&&m.zoomOut()});v.className="geSprite geSprite-zoomout";v.setAttribute("title",mxResources.get("zoomOut"));v.style.outline="none";v.style.border="none";v.style.margin="2px";v.setAttribute("disabled","disabled");mxUtils.setOpacity(v,20);var x=mxUtils.button("",function(){null!=y&&(m.maxFitScale=8,m.fit(8),m.center())});x.className=
+"geSprite geSprite-fit";x.setAttribute("title",mxResources.get("fit"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var z=mxUtils.button("",function(){null!=y&&(m.zoomActual(),m.center())});z.className="geSprite geSprite-actualsize";z.setAttribute("title",mxResources.get("actualSize"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var A=
+document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var E=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var c=a.getCurrentFile(),c=null!=c&&null!=c.getTitle()?c.getTitle():a.defaultFilename,b=mxUtils.getXml(y.documentElement);a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):
+(b="undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(a.editor.graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});E.className="geBtn";E.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=B&&a.confirm(mxResources.get("areYouSure"),function(){null!=e?e(B):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(c){a.spinner.stop();
+a.replaceFileData(B);a.hideDialog()},function(c){a.spinner.stop();a.editor.setStatus("");a.handleError(c,null!=c?mxResources.get("errorSavingFile"):null)})})});F.className="geBtn";F.setAttribute("disabled","disabled");var D=document.createElement("select");D.setAttribute("disabled","disabled");D.style.maxWidth="80px";D.style.position="relative";D.style.top="-2px";D.style.verticalAlign="bottom";D.style.marginRight="6px";D.style.display="none";var H=null;mxEvent.addListener(D,"change",function(a){null!=
+H&&(H(a),mxEvent.consume(a))});var C=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),window.openWindow(a.getUrl()))});C.className="geBtn";C.setAttribute("disabled","disabled");null!=e&&(C.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=w&&a.openLink(w.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled",
+"disabled");null!=e&&(G.style.display="none",F.className="geBtn gePrimaryBtn");h=document.createElement("div");h.style.position="absolute";h.style.top="482px";h.style.width="640px";h.style.textAlign="right";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.padding="2px";I.style.border="none";I.style.left="199px";I.style.top="442px";var K=null;if(null!=d&&0<d.length){k.style.cursor="move";var P=document.createElement("table");P.style.border=
+"1px solid lightGray";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var S=document.createElement("tbody"),O=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var R=d.length-1;0<=R;R--){var M=function(b){var g=new Date(b.modifiedDate),e=null;if(0<=g.getTime()){var h=function(b){p.stop();var d=mxUtils.parseXml(b),h=a.editor.extractGraphModel(d.documentElement,!0);if(null!=h){var t=function(c){null!=c&&(c=
+l(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c},l=function(a){var c=a.getAttribute("background");if(null==c||""==c||c==mxConstants.NONE)c="#ffffff";k.style.backgroundColor=c;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};D.style.display="none";D.innerHTML="";y=d;B=b;c=parseSelectFunction=null;f=0;if("mxfile"==h.nodeName){d=h.getElementsByTagName("diagram");c=[];for(b=0;b<d.length;b++)c.push(d[b]);
+f=Math.min(n,c.length-1);0<c.length&&t(c[f]);if(1<c.length)for(D.removeAttribute("disabled"),D.style.display="",b=0;b<c.length;b++)d=document.createElement("option"),mxUtils.write(d,c[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),d.setAttribute("value",b),b==f&&d.setAttribute("selected","selected"),D.appendChild(d);H=function(){f=n=parseInt(D.value);t(c[n])}}else l(h);A.innerHTML="";mxUtils.write(A,g.toLocaleDateString()+" "+g.toLocaleTimeString());A.setAttribute("title",e.getAttribute("title"));
+q.removeAttribute("disabled");v.removeAttribute("disabled");x.removeAttribute("disabled");z.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&F.removeAttribute("disabled"),E.removeAttribute("disabled"),G.removeAttribute("disabled"),C.removeAttribute("disabled"));mxUtils.setOpacity(q,60);mxUtils.setOpacity(v,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(z,60)}else D.style.display="none",D.innerHTML="",A.innerHTML="",mxUtils.write(A,mxResources.get("errorLoadingFile"))},
+e=document.createElement("tr");e.style.borderBottom="1px solid lightGray";e.style.fontSize="12px";e.style.cursor="pointer";var l=document.createElement("td");l.style.padding="6px";l.style.whiteSpace="nowrap";b==d[d.length-1]?mxUtils.write(l,mxResources.get("current")):g.toDateString()===O?mxUtils.write(l,g.toLocaleTimeString()):mxUtils.write(l,g.toLocaleDateString()+" "+g.toLocaleTimeString());e.appendChild(l);e.setAttribute("title",g.toLocaleDateString()+" "+g.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+
+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){w!=b&&(p.stop(),null!=t&&(t.style.backgroundColor=""),w=b,t=e,t.style.backgroundColor="#ebf2f9",B=y=null,A.removeAttribute("title"),A.innerHTML=mxResources.get("loading")+"...",k.style.backgroundColor="#ffffff",m.getModel().clear(),F.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"),z.setAttribute("disabled",
+"disabled"),x.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),mxUtils.setOpacity(q,20),mxUtils.setOpacity(v,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(z,20),p.spin(k),b.getXml(function(a){w==b&&h(a)},function(a){p.stop();D.style.display="none";D.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){G.click();
+window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);S.appendChild(e)}return e}(d[R]);null!=M&&R==d.length-1&&(K=M)}P.appendChild(S);l.appendChild(P)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(k.style.display="none",I.style.display="none",mxUtils.write(l,mxResources.get("notAvailable"))):(k.style.display="none",I.style.display="none",mxUtils.write(l,
+mxResources.get("noRevisions")));this.init=function(){null!=K&&K.click()};l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn";I.appendChild(D);I.appendChild(q);I.appendChild(v);I.appendChild(z);I.appendChild(x);a.editor.cancelFirst?(h.appendChild(l),h.appendChild(E),h.appendChild(C),h.appendChild(F),h.appendChild(G)):(h.appendChild(E),h.appendChild(C),h.appendChild(F),h.appendChild(G),h.appendChild(l));b.appendChild(h);b.appendChild(I);b.appendChild(A);this.container=
+b},DraftDialog=function(a,d,e,b,h,l,k,m){var n=document.createElement("div"),c=document.createElement("div");c.style.marginTop="0px";c.style.whiteSpace="nowrap";c.style.overflow="auto";mxUtils.write(c,d);n.appendChild(c);var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";f.style.marginTop="10px";f.style.width="640px";f.style.top="46px";f.style.bottom="74px";f.style.overflow="hidden";mxEvent.disableContextMenu(f);n.appendChild(f);var g=new Graph(f);
+g.setEnabled(!1);g.setPanning(!0);g.panningHandler.ignoreCell=!0;g.panningHandler.useLeftButtonForPanning=!0;g.minFitScale=null;g.maxFitScale=null;g.centerZoom=!0;d=mxUtils.parseXml(e);var p=a.editor.extractGraphModel(d.documentElement,!0),u=0,t=null,w=g.getGlobalVariable;g.getGlobalVariable=function(a){return"page"==a&&null!=t&&null!=t[u]?t[u].getAttribute("name"):"pagenumber"==a?u+1:w.apply(this,arguments)};g.getLinkForCell=function(){return null};d=mxUtils.button("",function(){g.zoomIn()});d.className=
+"geSprite geSprite-zoomin";d.setAttribute("title",mxResources.get("zoomIn"));d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);e=mxUtils.button("",function(){g.zoomOut()});e.className="geSprite geSprite-zoomout";e.setAttribute("title",mxResources.get("zoomOut"));e.style.outline="none";e.style.border="none";e.style.margin="2px";mxUtils.setOpacity(e,60);c=mxUtils.button("",function(){g.maxFitScale=8;g.fit(8);g.center()});c.className="geSprite geSprite-fit";c.setAttribute("title",
+mxResources.get("fit"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);var y=mxUtils.button("",function(){g.zoomActual();g.center()});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";mxUtils.setOpacity(y,60);h=mxUtils.button(k||mxResources.get("discard"),h);h.className="geBtn";var B=document.createElement("select");B.style.maxWidth="80px";B.style.position=
+"relative";B.style.top="-2px";B.style.verticalAlign="bottom";B.style.marginRight="6px";B.style.display="none";b=mxUtils.button(l||mxResources.get("edit"),b);b.className="geBtn gePrimaryBtn";l=document.createElement("div");l.style.position="absolute";l.style.bottom="30px";l.style.width="640px";l.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
+this.init=function(){function c(a){if(null!=a){var c=a.getAttribute("background");if(null==c||""==c||c==mxConstants.NONE)c="#ffffff";f.style.backgroundColor=c;(new mxCodec(a.ownerDocument)).decode(a,g.getModel());g.maxFitScale=1;g.fit(8);g.center()}}function b(b){null!=b&&(b=c(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b}mxEvent.addListener(B,"change",function(a){u=parseInt(B.value);b(t[u]);mxEvent.consume(a)});if("mxfile"==p.nodeName){var d=p.getElementsByTagName("diagram");
+t=[];for(var e=0;e<d.length;e++)t.push(d[e]);0<t.length&&b(t[u]);if(1<t.length)for(B.style.display="",e=0;e<t.length;e++)d=document.createElement("option"),mxUtils.write(d,t[e].getAttribute("name")||mxResources.get("pageWithNumber",[e+1])),d.setAttribute("value",e),e==u&&d.setAttribute("selected","selected"),B.appendChild(d)}else c(p)};k.appendChild(B);k.appendChild(d);k.appendChild(e);k.appendChild(y);k.appendChild(c);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});d.className=
+"geBtn";m=null!=m?mxUtils.button(mxResources.get("ignore"),m):null;null!=m&&(m.className="geBtn");a.editor.cancelFirst?(l.appendChild(d),null!=m&&l.appendChild(m),l.appendChild(h),l.appendChild(b)):(l.appendChild(b),l.appendChild(h),null!=m&&l.appendChild(m),l.appendChild(d));n.appendChild(l);n.appendChild(k);this.container=n},FindWindow=function(a,d,e,b,h){function l(a,c,b){if("object"===typeof c.value&&null!=c.value.attributes){c=c.value.attributes;for(var f=0;f<c.length;f++)if("label"!=c[f].nodeName){var g=
+mxUtils.trim(c[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,b.length)===b||null!=a&&a.test(g))return!0}}return!1}function k(){var a=n.model.getDescendants(n.model.getRoot()),b=p.value.toLowerCase(),g=u.checked?new RegExp(b):null,d=null;c!=b&&(c=b,f=null);var e=null==f;if(0<b.length)for(var h=0;h<a.length;h++){var k=n.view.getState(a[h]);if(null!=k&&null!=k.cell.value&&(e||null==d)&&(n.model.isVertex(k.cell)||n.model.isEdge(k.cell))&&(n.isHtmlLabel(k.cell)?
+(t.innerHTML=n.getLabel(k.cell),label=mxUtils.extractTextWithWhitespace([t])):label=n.getLabel(k.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==g&&(label.substring(0,b.length)===b||l(g,k.cell,b))||null!=g&&(g.test(label)||l(g,k.cell,b))))if(e){d=k;break}else null==d&&(d=k);e=e||k==f}null!=d?(f=d,n.scrollCellToVisible(f.cell),n.isEnabled()?n.setSelectionCell(f.cell):n.highlightCell(f.cell)):n.isEnabled()&&n.clearSelection();return 0==b.length||null!=d}
+var m=a.actions.get("find"),n=a.editor.graph,c=null,f=null,g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",mxResources.get("find"));p.setAttribute("type","text");p.style.marginTop="4px";p.style.marginBottom="6px";p.style.width="170px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";g.appendChild(p);var u=document.createElement("input");
+u.setAttribute("type","checkbox");g.appendChild(u);mxUtils.write(g,mxResources.get("regularExpression"));var t=document.createElement("div");mxUtils.br(g);var w=mxUtils.button(mxResources.get("reset"),function(){p.value="";p.style.backgroundColor="";c=f=null;p.focus()});w.setAttribute("title",mxResources.get("reset"));w.style.marginTop="6px";w.style.marginRight="4px";w.style.backgroundColor="#f5f5f5";w.style.backgroundImage="none";w.className="geBtn";g.appendChild(w);w=mxUtils.button(mxResources.get("find"),
+function(){try{p.style.backgroundColor=k()?"":"#ffcfcf"}catch(y){a.handleError(y)}});w.setAttribute("title",mxResources.get("find")+" (Enter)");w.style.marginTop="6px";w.style.backgroundColor="#4d90fe";w.style.backgroundImage="none";w.className="geBtn gePrimaryBtn";g.appendChild(w);mxEvent.addListener(p,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)m.funct();else if(c!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=k()?"":"#ffcfcf"}catch(B){p.style.backgroundColor=
+"#ffcfcf"}});mxEvent.addListener(g,"keydown",function(c){70==c.keyCode&&a.keyHandler.isControlDown(c)&&!mxEvent.isShiftDown(c)&&(m.funct(),mxEvent.consume(c))});this.window=new mxWindow(mxResources.get("find"),g,d,e,b,h,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
+p.select():document.execCommand("selectAll",!1,null)):n.container.focus()}))},TagsWindow=function(a,d,e,b,h){function l(a){a=null!=a?a:m.model.getDescendants(m.model.getRoot());for(var c=f.value.split(" "),b=[],g=0;g<a.length;g++)if(m.model.isVertex(a[g])||m.model.isEdge(a[g])){var d=null!=a[g].value&&"object"==typeof a[g].value?mxUtils.trim(a[g].value.getAttribute(n)||""):"",q=!0;if(0<d.length)for(var d=d.toLowerCase().split(" "),e=0;e<c.length&&q;e++)var p=mxUtils.trim(c[e]).toLowerCase(),q=q&&
+(0==p.length||0<=mxUtils.indexOf(d,p));else q=0==mxUtils.trim(f.value).length;q&&b.push(a[g])}return b}function k(a,c){m.model.beginUpdate();try{for(var b=0;b<a.length;b++)m.model.setVisible(a[b],c)}finally{m.model.endUpdate()}}var m=a.editor.graph,n="tags",c=document.createElement("div");c.style.userSelect="none";c.style.overflow="hidden";c.style.padding="10px";c.style.height="100%";var f=document.createElement("input");f.setAttribute("placeholder",mxResources.get("allTags"));f.setAttribute("type",
+"text");f.style.marginTop="4px";f.style.width="260px";f.style.fontSize="12px";f.style.borderRadius="4px";f.style.padding="6px";c.appendChild(f);mxEvent.addListener(f,"dblclick",function(){var c=new FilenameDialog(a,n,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(n=a)}),mxResources.get("enterPropertyName"));a.showDialog(c.container,300,80,!0,!0);c.init()});f.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(c);var g=mxUtils.button(mxResources.get("hide"),
+function(){k(l(),!1)});g.setAttribute("title",mxResources.get("hide"));g.style.marginTop="8px";g.style.marginRight="4px";g.style.backgroundColor="#f5f5f5";g.style.backgroundImage="none";g.className="geBtn";c.appendChild(g);g=mxUtils.button(mxResources.get("show"),function(){var a=l();k(a,!0);m.isEnabled()&&m.setSelectionCells(a)});g.setAttribute("title",mxResources.get("show"));g.style.marginTop="8px";g.style.marginRight="4px";g.style.backgroundColor="#f5f5f5";g.style.backgroundImage="none";g.className=
+"geBtn";c.appendChild(g);var p=a.actions.get("tags"),g=mxUtils.button(mxResources.get("close"),function(){p.funct()});g.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");g.style.marginTop="8px";g.style.backgroundColor="#4d90fe";g.style.backgroundImage="none";g.className="geBtn gePrimaryBtn";c.appendChild(g);mxEvent.addListener(f,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||p.funct()});this.window=new mxWindow(mxResources.get("tags"),c,d,e,b,h,!0,!0);this.window.destroyOnClose=!1;
+this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(f.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?f.select():document.execCommand("selectAll",!1,null)):m.container.focus()}))},AuthDialog=function(a,d,e,b){var h=document.createElement("div");h.style.textAlign="center";var l=document.createElement("p");l.style.fontSize="16pt";l.style.padding=
+"0px";l.style.margin="0px";l.style.color="gray";mxUtils.write(l,mxResources.get("authorizationRequired"));var k="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";d==a.drive?(k=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):d==a.dropbox?(k=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):d==a.oneDrive?(k=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):
+d==a.gitHub?(k=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):d==a.trello&&(k=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[k]));var n=document.createElement("input");n.setAttribute("type","checkbox");k=mxUtils.button(mxResources.get("authorize"),function(){b(n.checked)});k.insertBefore(m,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";h.appendChild(l);h.appendChild(a);
+h.appendChild(k);e&&(e=document.createElement("p"),e.style.marginTop="20px",e.appendChild(n),l=document.createElement("span"),mxUtils.write(l," "+mxResources.get("rememberMe")),e.appendChild(l),h.appendChild(e),n.checked=!0,n.defaultChecked=!0,mxEvent.addListener(l,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)}));this.container=h},MoreShapesDialog=function(a,d,e){e=null!=e?e:a.sidebar.entries;var b=document.createElement("div");if(d){d=document.createElement("div");d.className="geDialogTitle";
+mxUtils.write(d,mxResources.get("shapes"));d.style.position="absolute";d.style.top="0px";d.style.left="0px";d.style.lineHeight="40px";d.style.height="40px";d.style.right="0px";mxClient.IS_QUIRKS&&(d.style.width="718px");var h=document.createElement("div"),l=document.createElement("div");h.style.position="absolute";h.style.top="40px";h.style.left="0px";h.style.width="202px";h.style.bottom="60px";h.style.overflow="auto";mxClient.IS_QUIRKS&&(h.style.height="437px",h.style.marginTop="1px");l.style.position=
+"absolute";l.style.left="202px";l.style.right="0px";l.style.top="40px";l.style.bottom="60px";l.style.overflow="auto";l.style.borderLeft="1px solid rgb(211, 211, 211)";l.style.textAlign="center";mxClient.IS_QUIRKS&&(l.style.width=parseInt(d.style.width)-202+"px",l.style.height=h.style.height,l.style.marginTop=h.style.marginTop);var k=null,m=[],n=document.createElement("div");n.style.position="relative";n.style.left="0px";n.style.right="0px";for(var c=0;c<e.length;c++)(function(b){var f=n.cloneNode(!1);
+f.style.fontWeight="bold";f.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";f.style.padding="6px 0px 6px 20px";mxUtils.write(f,b.title);h.appendChild(f);for(var g=0;g<b.entries.length;g++)(function(b){var f=n.cloneNode(!1);f.style.cursor="pointer";f.style.padding="4px 0px 4px 20px";var q=document.createElement("input");q.setAttribute("type","checkbox");q.checked=a.sidebar.isEntryVisible(b.id);q.defaultChecked=q.checked;f.appendChild(q);mxUtils.write(f," "+b.title);h.appendChild(f);var d=
+function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCallback?b.imageCallback(l):null!=b.image?l.innerHTML='<img border="0" src="'+b.image+'"/>':(l.innerHTML="<br>",mxUtils.write(l,mxResources.get("noPreview"))),null!=k&&(k.style.backgroundColor=""),k=f,k.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(f,"click",d);mxEvent.addListener(f,"dblclick",function(a){q.checked=!q.checked;mxEvent.consume(a)});m.push(function(){return q.checked?
+b.id:null});0==c&&0==g&&d()})(b.entries[g])})(e[c]);b.style.padding="30px";b.appendChild(d);b.appendChild(h);b.appendChild(l);e=document.createElement("div");e.className="geDialogFooter";e.style.position="absolute";e.style.paddingRight="16px";e.style.color="gray";e.style.left="0px";e.style.right="0px";e.style.bottom="0px";e.style.height="60px";e.style.lineHeight="52px";mxClient.IS_QUIRKS&&(e.style.width=d.style.width,e.style.paddingTop="12px");var f=document.createElement("input");f.setAttribute("type",
+"checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)d=document.createElement("span"),d.style.paddingRight="20px",d.appendChild(f),mxUtils.write(d," "+mxResources.get("rememberThisSetting")),f.checked=!0,f.defaultChecked=!0,mxEvent.addListener(d,"click",function(a){mxEvent.getSource(a)!=f&&(f.checked=!f.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(d.style.position="relative",d.style.top="-6px"),e.appendChild(d);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className=
+"geBtn";var g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var c=[],b=0;b<m.length;b++){var g=m[b].apply(this,arguments);null!=g&&c.push(g)}a.sidebar.showEntries(c.join(";"),f.checked,!0)});g.className="geBtn gePrimaryBtn"}else{var p=document.createElement("table"),u=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";var t=document.createElement("tr");p.style.width="100%";d=document.createElement("td");var g=document.createElement("td"),w=document.createElement("td"),
+y=mxUtils.bind(this,function(c,b,f){var g=document.createElement("input");g.type="checkbox";p.appendChild(g);g.checked=a.sidebar.isEntryVisible(f);var q=document.createElement("span");mxUtils.write(q,b);b=document.createElement("div");b.style.display="block";b.appendChild(g);b.appendChild(q);mxEvent.addListener(q,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});c.appendChild(b);return function(){return g.checked?f:null}});t.appendChild(d);t.appendChild(g);t.appendChild(w);u.appendChild(t);
+p.appendChild(u);for(var m=[],B=0,c=0;c<e.length;c++)for(u=0;u<e[c].entries.length;u++)B++;for(var q=[d,g,w],v=0,c=0;c<e.length;c++)(function(a){for(var c=0;c<a.entries.length;c++){var b=a.entries[c];m.push(y(q[Math.floor(v/(B/3))],b.title,b.id));v++}})(e[c]);b.appendChild(p);e=document.createElement("div");e.style.marginTop="18px";e.style.textAlign="center";f=document.createElement("input");isLocalStorage&&(f.setAttribute("type","checkbox"),f.checked=!0,f.defaultChecked=!0,e.appendChild(f),d=document.createElement("span"),
+mxUtils.write(d," "+mxResources.get("rememberThisSetting")),e.appendChild(d),mxEvent.addListener(d,"click",function(a){f.checked=!f.checked;mxEvent.consume(a)}));b.appendChild(e);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";g=mxUtils.button(mxResources.get("apply"),function(){for(var c=["search"],b=0;b<m.length;b++){var g=m[b].apply(this,arguments);null!=g&&c.push(g)}a.sidebar.showEntries(0<c.length?c.join(";"):"",f.checked);a.hideDialog()});g.className=
+"geBtn gePrimaryBtn";e=document.createElement("div");e.style.marginTop="26px";e.style.textAlign="right"}a.editor.cancelFirst?(e.appendChild(d),e.appendChild(g)):(e.appendChild(g),e.appendChild(d));b.appendChild(e);this.container=b},PluginsDialog=function(a){function d(){if(0==h.length)b.innerHTML=mxResources.get("noPlugins");else{b.innerHTML="";for(var c=0;c<h.length;c++){var f=document.createElement("span");f.style.whiteSpace="nowrap";var g=document.createElement("span");g.className="geSprite geSprite-delete";
+g.style.position="relative";g.style.cursor="pointer";g.style.top="5px";g.style.marginRight="4px";g.style.display="inline-block";f.appendChild(g);mxUtils.write(f,h[c]);b.appendChild(f);mxUtils.br(b);mxEvent.addListener(g,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+h[c]+'"?',function(){h.splice(c,1);d()})}}(c))}}}var e=document.createElement("div"),b=document.createElement("div");b.style.height="120px";b.style.overflow="auto";var h=mxSettings.getPlugins().slice();
+e.appendChild(b);d();var l=mxUtils.button(mxResources.get("add"),function(){var c="",b=urlParams.p;if(null!=b&&0<b.length){for(var g=b.split(";"),b=0;b<g.length;b++){var e=App.pluginRegistry[g[b]];null!=e&&(c+=e+";")}";"==c.charAt(c.length-1)&&(c=c.substring(0,c.length-1))}c=new FilenameDialog(a,c,mxResources.get("add"),function(a){if(null!=a&&0<a.length){g=a.split(";");for(a=0;a<g.length;a++)0<g[a].length&&0>mxUtils.indexOf(h,g[a])&&h.push(g[a]);d()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+
+")");a.showDialog(c.container,300,80,!0,!0);c.init()});l.className="geBtn";var k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";var m=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(h);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});m.className="geBtn gePrimaryBtn";var n=document.createElement("div");n.style.marginTop="14px";n.style.textAlign="right";a.editor.cancelFirst?(n.appendChild(k),n.appendChild(l),
+n.appendChild(m)):(n.appendChild(l),n.appendChild(m),n.appendChild(k));e.appendChild(n);this.container=e},CropImageDialog=function(a,d,e){var b=document.createElement("div"),h=document.createElement("table"),l=document.createElement("tbody"),k=document.createElement("tr"),m=document.createElement("td");m.style.whiteSpace="nowrap";m.setAttribute("colspan","2");mxUtils.write(m,mxResources.get("loading")+"...");k.appendChild(m);l.appendChild(k);var k=document.createElement("tr"),n=document.createElement("td"),
+c=document.createElement("td");h.style.paddingLeft="6px";mxUtils.write(n,mxResources.get("left")+":");var f=document.createElement("input");f.setAttribute("type","text");f.style.width="100px";f.value="0";this.init=function(){f.focus();f.select()};c.appendChild(f);k.appendChild(n);k.appendChild(c);l.appendChild(k);k=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");mxUtils.write(n,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type",
+"text");g.style.width="100px";g.value="0";c.appendChild(g);k.appendChild(n);k.appendChild(c);l.appendChild(k);k=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");mxUtils.write(n,mxResources.get("right")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value="0";c.appendChild(p);k.appendChild(n);k.appendChild(c);l.appendChild(k);k=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");
+mxUtils.write(n,mxResources.get("bottom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value="0";c.appendChild(u);k.appendChild(n);k.appendChild(c);l.appendChild(k);k=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");mxUtils.write(n,mxResources.get("circle")+":");k.appendChild(n);var t=document.createElement("input");t.setAttribute("type","checkbox");c.appendChild(t);k.appendChild(c);l.appendChild(k);h.appendChild(l);
+b.appendChild(h);var h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),w=new Image,y=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),b=c.getContext("2d"),d=w.width,h=w.height,k=parseInt(f.value),l=parseInt(g.value),d=Math.max(1,d-k-parseInt(p.value)),h=Math.max(1,h-l-parseInt(u.value));c.width=d;c.height=h;t.checked&&(b.fillStyle="#000000",b.arc(d/2,h/2,Math.min(d/2,h/2),0,2*Math.PI),b.fill(),b.globalCompositeOperation=
+"source-in");b.drawImage(w,k,l,d,h,0,0,d,h);e(c.toDataURL())});y.setAttribute("disabled","disabled");w.onload=function(){y.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+w.width+" "+mxResources.get("height")+": "+w.height)};w.src=d;mxEvent.addListener(b,"keypress",function(a){13==a.keyCode&&y.click()});d=document.createElement("div");d.style.marginTop="20px";d.style.textAlign="right";a.editor.cancelFirst?(d.appendChild(h),d.appendChild(y)):(d.appendChild(y),
+d.appendChild(h));b.appendChild(d);this.container=b},EditGeometryDialog=function(a,d){var e=a.editor.graph,b=1==d.length?e.getCellGeometry(d[0]):null,h=document.createElement("div"),l=document.createElement("table"),k=document.createElement("tbody"),m=document.createElement("tr"),n=document.createElement("td"),c=document.createElement("td");l.style.paddingLeft="6px";mxUtils.write(n,mxResources.get("left")+":");var f=document.createElement("input");f.setAttribute("type","text");f.style.width="100px";
+f.value=null!=b?b.x:"";this.init=function(){f.focus();f.select()};c.appendChild(f);m.appendChild(n);m.appendChild(c);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");mxUtils.write(n,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";g.value=null!=b?b.y:"";c.appendChild(g);m.appendChild(n);m.appendChild(c);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");
+c=document.createElement("td");mxUtils.write(n,mxResources.get("width")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=b?b.width:"";c.appendChild(p);m.appendChild(n);m.appendChild(c);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");mxUtils.write(n,mxResources.get("height")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=
+b?b.height:"";c.appendChild(u);m.appendChild(n);m.appendChild(c);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");c=document.createElement("td");mxUtils.write(n,mxResources.get("rotation")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=1==d.length?mxUtils.getValue(e.getCellStyle(d[0]),mxConstants.STYLE_ROTATION,0):"";c.appendChild(t);m.appendChild(n);m.appendChild(c);k.appendChild(m);l.appendChild(k);h.appendChild(l);
+var b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),w=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e.getModel().beginUpdate();try{for(var c=0;c<d.length;c++){var b=e.getCellGeometry(d[c]);null!=b&&(b=b.clone(),e.isCellMovable(d[c])&&(0<mxUtils.trim(f.value).length&&(b.x=Number(f.value)),0<mxUtils.trim(g.value).length&&(b.y=Number(g.value))),e.isCellResizable(d[c])&&(0<mxUtils.trim(p.value).length&&(b.width=Number(p.value)),0<mxUtils.trim(u.value).length&&
+(b.height=Number(u.value))),e.getModel().setGeometry(d[c],b));0<mxUtils.trim(t.value).length&&e.setCellStyles(mxConstants.STYLE_ROTATION,Number(t.value),[d[c]])}}finally{e.getModel().endUpdate()}});mxEvent.addListener(h,"keypress",function(a){13==a.keyCode&&w.click()});l=document.createElement("div");l.style.marginTop="20px";l.style.textAlign="right";a.editor.cancelFirst?(l.appendChild(b),l.appendChild(w)):(l.appendChild(w),l.appendChild(b));h.appendChild(l);this.container=h},LibraryDialog=function(a,
+d,e,b,h,l){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var c=null;if(null!=a)for(var b=u.firstChild,c=0;null!=b&&b!=a;)b=b.nextSibling,c++;return c}function m(c,b,g,d,e,p,h,l,B){try{if(null==b||"image/"==b.substring(0,6))if(null==c&&null!=h||null==w[c]){var C=function(){E.innerHTML="";E.style.cursor="pointer";E.style.whiteSpace="nowrap";E.style.textOverflow="ellipsis";mxUtils.write(E,null!=H.title&&0<H.title.length?H.title:mxResources.get("untitled"));
+E.style.color=null==H.title||0==H.title.length?"#d0d0d0":""};u.style.backgroundImage="";t.style.display="none";var z=e,n=p;if(e>a.maxImageSize||p>a.maxImageSize){var A=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,p));e*=A;p*=A}z>n?(n=Math.round(100*n/z),z=100):(z=Math.round(100*z/n),n=100);var G=document.createElement("div");G.setAttribute("draggable","true");G.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";G.style.position="relative";G.style.cursor="move";
+mxUtils.setPrefixedStyle(G.style,"transition","transform .1s ease-in-out");if(null!=c){var I=document.createElement("img");I.setAttribute("src",v.convert(c));I.style.width=z+"px";I.style.height=n+"px";I.style.margin="10px";I.style.paddingBottom=Math.floor((100-n)/2)+"px";I.style.paddingLeft=Math.floor((100-z)/2)+"px";G.appendChild(I)}else if(null!=h){var K=a.stringToCells(a.editor.graph.decompress(h.xml));0<K.length&&(a.sidebar.createThumb(K,100,100,G,null,!0,!1),G.firstChild.style.display=mxClient.IS_QUIRKS?
+"inline":"inline-block",G.firstChild.style.cursor="")}var F=document.createElement("img");F.setAttribute("src",Editor.closeImage);F.setAttribute("border","0");F.setAttribute("title",mxResources.get("delete"));F.setAttribute("align","top");F.style.paddingTop="4px";F.style.marginLeft="-22px";F.style.cursor="pointer";mxEvent.addListener(F,"dragstart",function(a){mxEvent.consume(a)});null==c&&null!=h&&(F.style.position="relative");(function(a,c,b){mxEvent.addListener(F,"click",function(g){w[c]=null;for(var q=
+0;q<f.length;q++)if(null!=f[q].data&&f[q].data==c||null!=f[q].xml&&null!=b&&f[q].xml==b.xml){f.splice(q,1);break}G.parentNode.removeChild(a);0==f.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(g)});mxEvent.addListener(F,"dblclick",function(a){mxEvent.consume(a)})})(G,c,h);G.appendChild(F);G.style.marginBottom="30px";var E=document.createElement("div");E.style.position="absolute";E.style.boxSizing="border-box";E.style.bottom="-18px";E.style.left=
+"10px";E.style.right="10px";E.style.backgroundColor="#ffffff";E.style.overflow="hidden";E.style.textAlign="center";var H=null;null!=c?(H={data:c,w:e,h:p,title:B},null!=l&&(H.aspect=l),w[c]=I,f.push(H)):null!=h&&(h.aspect="fixed",f.push(h),H=h);mxEvent.addListener(E,"keydown",function(a){13==a.keyCode&&null!=q&&(q(),q=null,mxEvent.consume(a))});C();G.appendChild(E);mxEvent.addListener(E,"mousedown",function(a){"true"!=E.getAttribute("contentEditable")&&mxEvent.consume(a)});K=function(c){if(mxClient.IS_IOS||
+mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,H.title||"",mxResources.get("ok"),function(a){null!=a&&(H.title=a,C())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(c)}else if("true"!=E.getAttribute("contentEditable")){null!=q&&(q(),q=null);if(null==H.title||0==H.title.length)E.innerHTML="";E.style.textOverflow="";E.style.whiteSpace="";E.style.cursor="text";E.style.color="";E.setAttribute("contentEditable",
+"true");E.focus();document.execCommand("selectAll",!1,null);q=function(){E.removeAttribute("contentEditable");E.style.cursor="pointer";H.title=E.innerHTML;C()};mxEvent.consume(c)}};mxEvent.addListener(E,"click",K);mxEvent.addListener(G,"dblclick",K);u.appendChild(G);mxEvent.addListener(G,"dragstart",function(a){null==c&&null!=h&&(F.style.visibility="hidden",E.style.visibility="hidden");mxClient.IS_FF&&null!=h.xml&&a.dataTransfer.setData("Text",h.xml);y=k(a);mxClient.IS_GC&&(G.style.opacity="0.9");
+window.setTimeout(function(){mxUtils.setPrefixedStyle(G.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(G,30);F.style.visibility="";E.style.visibility=""},0)});mxEvent.addListener(G,"dragend",function(a){"hidden"==F.style.visibility&&(F.style.visibility="",E.style.visibility="");y=null;mxUtils.setOpacity(G,100);mxUtils.setPrefixedStyle(G.style,"transform",null)})}else x||(x=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),z=mxUtils.parseXml(c),"mxlibrary"==
+z.documentElement.nodeName){n=JSON.parse(mxUtils.getTextContent(z.documentElement));if(null!=n&&0<n.length)for(var D=0;D<n.length;D++)null!=n[D].xml?m(null,null,0,0,0,0,n[D]):m(n[D].data,null,0,0,n[D].w,n[D].h,null,"fixed",n[D].title);e=!0}else if("mxfile"==z.documentElement.nodeName){for(var P=z.documentElement.getElementsByTagName("diagram"),D=0;D<P.length;D++){var n=mxUtils.getTextContent(P[D]),K=a.stringToCells(a.editor.graph.decompress(n)),Q=a.editor.graph.getBoundingBoxFromGeometry(K);m(null,
+null,0,0,0,0,{xml:n,w:Q.width,h:Q.height})}e=!0}}catch(Z){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(Z){}return null}function n(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function c(c){c.stopPropagation();c.preventDefault();x=!1;B=k(c);if(null!=y)null!=B&&B<u.children.length?(f.splice(B>y?B-1:B,0,f.splice(y,1)[0]),u.insertBefore(u.children[y],u.children[B])):(f.push(f.splice(y,1)[0]),u.appendChild(u.children[y]));
+else if(0<c.dataTransfer.files.length)a.importFiles(c.dataTransfer.files,0,0,a.maxImageSize,z(c));else if(0<=mxUtils.indexOf(c.dataTransfer.types,"text/uri-list")){var b=decodeURIComponent(c.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(b)||/(\.png)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b)||/(\.svg)($|\?)/i.test(b))&&a.loadImage(b,function(a){m(b,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}c.stopPropagation();c.preventDefault()}var f=[];e=document.createElement("div");
+e.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="40px";e.appendChild(g);mxUtils.write(g,mxResources.get("filename")+":");null==d&&(d=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",d);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==h||h.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==h||h.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||
+5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};g.appendChild(p);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop="6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=
+document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));e.appendChild(t);var w={},y=null,B=null,q=null;d=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=q&&(q(),q=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",d);mxEvent.addListener(u,"pointerdown",d);mxEvent.addListener(u,"touchstart",
+d);var v=new mxUrlConverter,x=!1;if(null!=b)for(d=0;d<b.length;d++)g=b[d],m(g.data,null,0,0,g.w,g.h,g,g.aspect,g.title);mxEvent.addListener(u,"dragleave",function(a){t.style.cursor="";for(var c=mxEvent.getSource(a);null!=c;){if(c==u||c==t){a.stopPropagation();a.preventDefault();break}c=c.parentNode}});var z=function(c){return function(b,f,g,q,d,e,p,h,v){null!=v&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(b,v.name)?a.parseFile(v,mxUtils.bind(this,function(b){4==b.readyState&&
+(a.spinner.stop(),200<=b.status&&299>=b.status&&(m(b.responseText,f,g,q,d,e,p,"fixed",mxEvent.isAltDown(c)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(m(b,f,g,q,d,e,p,"fixed",mxEvent.isAltDown(c)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,"drop",c);mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,"drop",c);e.appendChild(u);b=document.createElement("div");
+b.style.textAlign="right";b.style.marginTop="20px";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});d.setAttribute("id","btnCancel");d.className="geBtn";a.editor.cancelFirst&&b.appendChild(d);g=mxUtils.button(mxResources.get("export"),function(){var c=a.createLibraryDataFromImages(f),b=p.value;/(\.xml)$/i.test(b)||(b+=".xml");a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml&xml="+encodeURIComponent(c))).simulate(document,
+"_blank")});g.setAttribute("id","btnDownload");g.className="geBtn";b.appendChild(g);var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(A,"change",function(c){x=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,b,f,g,q,d,e,p,h){z(c)(a,b,f,g,q,d,e,p,h);A.value=""});u.scrollTop=u.scrollHeight}),g=mxUtils.button(mxResources.get("import"),function(){null!=q&&(q(),q=null);A.click()}),g.setAttribute("id",
+"btnAddImage"),g.className="geBtn",b.appendChild(g));g=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=q&&(q(),q=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,c,b){x=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}m(a,null,0,0,c,b);u.scrollTop=u.scrollHeight}})});g.setAttribute("id","btnAddImageUrl");g.className="geBtn";b.appendChild(g);this.saveBtnClickHandler=function(c,b,f,g){a.saveLibrary(c,
+b,f,g)};g=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=q&&(q(),q=null);this.saveBtnClickHandler(p.value,f,h,l)}));g.setAttribute("id","btnSave");g.className="geBtn gePrimaryBtn";b.appendChild(g);a.editor.cancelFirst||b.appendChild(d);e.appendChild(b);this.container=e},EditShapeDialog=function(a,d,e,b,h){b=null!=b?b:300;h=null!=h?h:120;var l,k,m=document.createElement("table"),n=document.createElement("tbody");m.style.cellPadding="4px";l=document.createElement("tr");k=
+document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,e);l.appendChild(k);n.appendChild(l);l=document.createElement("tr");k=document.createElement("td");var c=document.createElement("textarea");c.style.outline="none";c.style.resize="none";c.style.width=b-200+"px";c.style.height=h+"px";this.textarea=c;this.init=function(){c.focus();c.scrollTop=0};k.appendChild(c);l.appendChild(k);k=document.createElement("td");e=document.createElement("div");e.style.position=
+"relative";e.style.border="1px solid gray";e.style.top="6px";e.style.width="200px";e.style.height=h+4+"px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);k.appendChild(e);var f=new Graph(e);f.setEnabled(!1);var g=a.editor.graph.cloneCells([d])[0];f.addCells([g]);e=f.view.getState(g);var p="";null!=e.shape&&null!=e.shape.stencil&&(p=mxUtils.getPrettyXml(e.shape.stencil.desc));mxUtils.write(c,p||"");e=f.getGraphBounds();h=Math.min(160/e.width,(h-40)/e.height);f.view.scaleAndTranslate(h,
+20/h-e.x,20/h-e.y);l.appendChild(k);n.appendChild(l);l=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&k.appendChild(h);a.isOffline()||(e=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
+e.className="geBtn",k.appendChild(e));var u=function(b,f,g){var d=c.value,q=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(q.documentElement),q=q.documentElement.getElementsByTagName("parsererror");if(null!=q&&0<q.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(g&&a.hideDialog(),q=!b.model.contains(f),!g||q||d!=p){d=a.editor.graph.compress(d);b.getModel().beginUpdate();try{if(q){var e=a.editor.graph.getInsertPoint();f.geometry.x=e.x;
+f.geometry.y=e.y;b.addCell(f)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[f])}catch(x){throw x;}finally{b.getModel().endUpdate()}q&&b.setSelectionCell(f)}};e=mxUtils.button(mxResources.get("preview"),function(){u(f,g,!1)});e.className="geBtn";k.appendChild(e);e=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,d,!0)});e.className="geBtn gePrimaryBtn";k.appendChild(e);a.editor.cancelFirst||k.appendChild(h);l.appendChild(k);n.appendChild(l);m.appendChild(n);this.container=
+m},CustomDialog=function(a,d,e,b,h,l,k){var m=document.createElement("div");m.appendChild(d);d=document.createElement("div");d.style.marginTop="16px";d.style.textAlign="right";null!=k&&d.appendChild(k);k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b()});k.className="geBtn";a.editor.cancelFirst&&d.appendChild(k);if(!a.isOffline()&&null!=l){var n=mxUtils.button(mxResources.get("help"),function(){a.openLink(l)});n.className="geBtn";d.appendChild(n)}h=mxUtils.button(h||
+mxResources.get("ok"),function(){a.hideDialog();null!=e&&e()});d.appendChild(h);h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(k);m.appendChild(d);this.cancelBtn=k;this.okButton=h;this.container=m};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
IMAGE_PATH+"/spin.gif";Editor.tweetImage=IMAGE_PATH+"/tweet.png";Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.blankImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";Editor.hiResImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAh1BMVEUAAABMTExERERBQUFBQUFFRUVAQEBCQkJAQEA6OjpDQ0NKSkpBQUFBQUFERERERERBQUFCQkJCQkJCQkJJSUlBQUFCQkJDQ0NDQ0NCQkJDQ0NBQUFBQUFCQkJBQUFCQkJCQkJDQ0NCQkJHR0dBQUFCQkJCQkJAQEBCQkJDQ0NAQEBERERCQkIk1hS2AAAAKnRSTlMAAjj96BL7PgQFRwfu3TYazKuVjRXl1V1DPCn1uLGjnWNVIgy9hU40eGqPkM38AAACG0lEQVRYw+2X63KbMBCFzwZblgGDceN74muatpLe//m6MHV3gHGFAv2RjM94MAbxzdnVsQbBDKwH8AH8MDAyafzjqYeyOG04XE7RS8nIRDXg6BlT+rA0nmtAPh+NQRDxIASIMG44rAMrGunBgHwy3uUldxggIStGKp2f+DQc2O4h4eQsX3O2IFB/oEbsjOKbStnjAEA+zJ0ylZTbgvoDn8xNyn6Dbj5Kd4GsNpABa6duQPfSdEj88TgMAhKuCWjAkgmFXPLnsD0pWd3OFGdrMugQII/eOMPEiGOzqPMIeWrcSoMCg71W1pXBPvCP+gS/OdXqQ3uW23+93XGWLl/OaBb805bNcBPoEIcVJsnHzcxpZH86u5KZ9gDby5dQCcnKqdbke4ItI4Tzd7IW9hZQt4EO6GG9b9sYuuK9Wwn8TIr2xKbF2+3Nhr+qxChJ/AI6pIfCu4z4Zowp4ZUNihz79vewzctnHDwTvQO/hCdFBzrUGDOPn2Y/F8YKT4oOATLvlhOznzmBSdFBJWtc58y7r+UVFOCQczy3wpN6pegDqHtsCPTGvH9JuTO0Dyg8icldYPk+RB6g8Aofj4m2EKBvtTmUPD9xDd1pPcSReV2U5iD/ik2yrngtvvqBfPzOvKiDTKTsCdoHZJ7pLLffgTwlJ5vJdtJV2/jiAYaLvLGhMAEDO5QcDg2M/jOw/8Zn+K3ZwJvHT7ZffgC/NvA3zcybTeIfE4EAAAAASUVORK5CYII=":
@@ -6483,40 +6487,40 @@ a.defaultEdgeStyle);a.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=a.emp
b.parentNode.insertBefore(c,b),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins)for(App.initPluginCallback(),c=0;c<a.plugins.length;c++)mxscript(a.plugins[c])}};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(c){c=null!=c&&"mxlibrary"!=c.nodeName?this.extractGraphModel(c):null;if(null!=c){var b=c.getElementsByTagName("parsererror");if(null!=b&&0<b.length){var b=b[0],f=b.getElementsByTagName("div");
null!=f&&0<f.length&&(b=f[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==c.nodeName){b=c.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(f=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=f&&(g=new mxCodec(f.ownerDocument),g.decode(f,this.graph.getStylesheet())));else if(f=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),
null!=f){var g=new mxCodec(f.ownerDocument);g.decode(f,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==c.getAttribute("math");b=c.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;this.graph.setShadowVisible("1"==c.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||
-"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?
-"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(w){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==
+"Invalid data",toString:function(){return this.message}};};var d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?
+"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(v){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==
typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=b&&0<b.length)for(var g=0;g<b.length;g++)if("mxgraph"==b[g].getAttribute("class")){f.push(b[g]);break}0<f.length&&(b=f[0].getAttribute("data-mxgraph"),null!=b?(f=JSON.parse(b),null!=f&&null!=f.xml&&(f=mxUtils.parseXml(f.xml),a=f.documentElement)):(f=f[0].getElementsByTagName("div"),0<f.length&&(b=mxUtils.getTextContent(f[0]),b=this.graph.decompress(b),0<b.length&&(f=mxUtils.parseXml(b),a=f.documentElement))))}if(null!=a&&
"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||c||(f=null,"diagram"==a.nodeName?f=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(f=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=f&&
-(b=this.graph.decompress(mxUtils.getTextContent(f)),null!=b&&0<b.length&&(a=mxUtils.parseXml(b).documentElement)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);return a};var d=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;d.apply(this,arguments)};Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
+(b=this.graph.decompress(mxUtils.getTextContent(f)),null!=b&&0<b.length&&(a=mxUtils.parseXml(b).documentElement)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);return a};var e=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;e.apply(this,arguments)};Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
var b=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){b.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&null!=Editor.MathJaxRender?!0:this.originalNoForeignObject};Editor.initMath=function(a,c){a=null!=a?a:"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,
messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(c||{jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};
Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,c){this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");if(null!=f&&0<f.length){var g=
document.createElement("script");g.type="text/javascript";g.src=a;f[0].parentNode.appendChild(g)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;var c=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,
-function(a,b,f,g){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==f?c.push(f.replace(/\\"/g,'"')):void 0!==g&&c.push(g);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var h=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){h.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var k=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
-mxSettings.save()}}if(null!=window.StyleFormatPanel){var l=Format.prototype.init;Format.prototype.init=function(){l.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var n=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?n.apply(this,arguments):this.clear()};var m=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=m.apply(this,
+function(a,b,f,g){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==f?c.push(f.replace(/\\"/g,'"')):void 0!==g&&c.push(g);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var h=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){h.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var l=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){l.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
+mxSettings.save()}}if(null!=window.StyleFormatPanel){var k=Format.prototype.init;Format.prototype.init=function(){k.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var m=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?m.apply(this,arguments):this.clear()};var n=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=n.apply(this,
arguments);if(mxClient.IS_SVG){var c=this.editorUi,b=c.editor.graph;a.appendChild(this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var f=new ChangePageSetup(c);f.ignoreColor=!0;f.ignoreImage=!0;f.shadowVisible=a;b.model.execute(f)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}}))}return a};var c=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=c.apply(this,arguments);var b=this.editorUi;if(b.editor.graph.isEnabled()){var f=b.getCurrentFile();null!=f&&f.isAutosaveOptional()&&(f=this.createOption(mxResources.get("autosave"),function(){return b.editor.autosave},function(a){b.editor.setAutosave(a)},{install:function(a){this.listener=function(){a(b.editor.autosave)};b.editor.addListener("autosaveChanged",this.listener)},destroy:function(){b.editor.removeListener(this.listener)}}),a.appendChild(f))}return a};
StyleFormatPanel.prototype.defaultColorSchemes=[[null,{fill:"#f5f5f5",stroke:"#666666"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[null,{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},
{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){"image"!=this.format.createSelectionState().style.shape&&
this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments)};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);
c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return g.apply(this,arguments)};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){f.getModel().beginUpdate();try{var b=
-f.getSelectionCells();for(c=0;c<b.length;c++){for(var g=f.getModel().getStyle(b[c]),p=0;p<d.length;p++)g=mxUtils.removeStylename(g,d[p]);null!=a?(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,a.fill),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,a.stroke),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,"#000000"),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,
+f.getSelectionCells();for(c=0;c<b.length;c++){for(var g=f.getModel().getStyle(b[c]),q=0;q<d.length;q++)g=mxUtils.removeStylename(g,d[q]);null!=a?(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,a.fill),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,a.stroke),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(g=mxUtils.setStyle(g,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.setStyle(g,mxConstants.STYLE_STROKECOLOR,"#000000"),g=mxUtils.setStyle(g,mxConstants.STYLE_GRADIENTCOLOR,
null));f.getModel().setStyle(b[c],g)}}finally{f.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";null!=a?(null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?c.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":c.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":c.style.backgroundColor=
a.fill,c.style.border="1px solid "+a.stroke):(c.style.backgroundColor="#ffffff",c.style.border="1px solid #000000");g.appendChild(c)}g.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(g),c(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var f=this.editorUi.editor.graph,g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.paddingLeft="24px";g.style.paddingRight=
"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(g);var d="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var e=document.createElement("div");e.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
-mxEvent.addListener(e,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var h=document.createElement("div");h.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
-1<this.defaultColorSchemes.length&&(a.appendChild(e),a.appendChild(h));mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(e);b(h);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
+mxEvent.addListener(e,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var p=document.createElement("div");p.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
+1<this.defaultColorSchemes.length&&(a.appendChild(e),a.appendChild(p));mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(e);b(p);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
(b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var f=this.editorUi.editor.graph,g=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=g&&null!=g.shape&&null!=g.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px":
(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize=
-"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var t=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}t.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
+"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var p=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}p.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var f=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,
-c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}return f.apply(this,arguments)}};var q=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){q.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.highlightCell=function(a,
+c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}return f.apply(this,arguments)}};var u=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){u.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.highlightCell=function(a,
c,b){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var f=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),g=new mxCellHighlight(this,c,f,!1);g.highlight(a);window.setTimeout(function(){null!=g.shape&&(mxUtils.setPrefixedStyle(g.shape.node.style,"transition","all 1200ms ease-in-out"),g.shape.node.style.opacity=0);window.setTimeout(function(){g.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;
-var f=a.ownerDocument,g=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");g.setAttribute("id",this.shadowId);var p=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");p.setAttribute("in","SourceAlpha");p.setAttribute("stdDeviation",this.svgShadowBlur);p.setAttribute("result","blur");g.appendChild(p);p=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");
-p.setAttribute("in","blur");p.setAttribute("dx",this.svgShadowSize);p.setAttribute("dy",this.svgShadowSize);p.setAttribute("result","offsetBlur");g.appendChild(p);p=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");p.setAttribute("flood-color",this.svgShadowColor);p.setAttribute("flood-opacity",this.svgShadowOpacity);p.setAttribute("result","offsetColor");g.appendChild(p);p=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):
-f.createElement("feComposite");p.setAttribute("in","offsetColor");p.setAttribute("in2","offsetBlur");p.setAttribute("operator","in");p.setAttribute("result","offsetBlur");g.appendChild(p);p=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");p.setAttribute("in","SourceGraphic");p.setAttribute("in2","offsetBlur");g.appendChild(p);p=a.getElementsByTagName("defs");0==p.length?(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),
-null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=p[0];f.appendChild(g);b||((c||a.getElementsByTagName("g")[0]).setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6)));return g};Graph.prototype.setShadowVisible=function(a,c){mxClient.IS_SVG&&(c=null!=c?c:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter",
+var f=a.ownerDocument,g=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");g.setAttribute("id",this.shadowId);var q=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");q.setAttribute("in","SourceAlpha");q.setAttribute("stdDeviation",this.svgShadowBlur);q.setAttribute("result","blur");g.appendChild(q);q=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");
+q.setAttribute("in","blur");q.setAttribute("dx",this.svgShadowSize);q.setAttribute("dy",this.svgShadowSize);q.setAttribute("result","offsetBlur");g.appendChild(q);q=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");q.setAttribute("flood-color",this.svgShadowColor);q.setAttribute("flood-opacity",this.svgShadowOpacity);q.setAttribute("result","offsetColor");g.appendChild(q);q=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):
+f.createElement("feComposite");q.setAttribute("in","offsetColor");q.setAttribute("in2","offsetBlur");q.setAttribute("operator","in");q.setAttribute("result","offsetBlur");g.appendChild(q);q=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");q.setAttribute("in","SourceGraphic");q.setAttribute("in2","offsetBlur");g.appendChild(q);q=a.getElementsByTagName("defs");0==q.length?(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),
+null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=q[0];f.appendChild(g);b||((c||a.getElementsByTagName("g")[0]).setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6)));return g};Graph.prototype.setShadowVisible=function(a,c){mxClient.IS_SVG&&(c=null!=c?c:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter",
"url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),c&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=this.model.getChildCount(this.model.root),c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.getValue(this.getCellStyle(c),"locked","0"));null!=c&&this.setDefaultParent(c)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];
mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=
[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/transmission"]=
@@ -6524,86 +6528,86 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist
[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=
[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",
STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
-[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var u=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,f,g,d,e,h,t,q){if(null!=b&&null==mxMarker.markers[b]){var p=this.getPackageForType(b);null!=p&&mxStencilRegistry.getStencil(p)}return u.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){n.value=Math.max(1,
-Math.min(h,Math.max(parseInt(n.value),parseInt(l.value))));l.value=Math.max(1,Math.min(h,Math.min(parseInt(n.value),parseInt(l.value))))}function f(c){function b(c,b,g){var p=c.getGraphBounds(),d=0,e=0,h=X.get(),q=1/c.pageScale,t=y.checked;if(t)var q=parseInt(P.value),k=parseInt(M.value),q=Math.min(h.height*k/(p.height/c.view.scale),h.width*q/(p.width/c.view.scale));else q=parseInt(x.value)/(100*c.pageScale),isNaN(q)&&(f=1/c.pageScale,x.value="100 %");h=mxRectangle.fromRectangle(h);h.width=Math.ceil(h.width*
-f);h.height=Math.ceil(h.height*f);q*=f;!t&&c.pageVisible?(p=c.getPageLayout(),d-=p.x*h.width,e-=p.y*h.height):t=!0;if(null==b){b=PrintDialog.createPrintPreview(c,q,h,0,d,e,t);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var u=b.writeHead;b.writeHead=function(c){u.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var l=b.renderPage;b.renderPage=
-function(a,c,b,f,g,p){var d=l.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:d.className="geDisableMathJax";return d}}b.open(null,null,g,!0)}else{h=c.background;if(null==h||""==h||h==mxConstants.NONE)h="#ffffff";b.backgroundColor=h;b.autoOrigin=t;b.appendGraph(c,q,d,e,g,!0)}return b}var f=parseInt(V.value)/100;isNaN(f)&&(f=1,V.value="100 %");var f=.75*f,p=l.value,e=n.value,d=!k.checked,h=null;d&&(d=p==t&&e==t);if(!d&&null!=a.pages&&a.pages.length){var q=0,d=a.pages.length-1;k.checked||
-(q=parseInt(p)-1,d=parseInt(e)-1);for(var u=q;u<=d;u++){var w=a.pages[u],p=w==a.currentPage?g:null;if(null==p){var p=a.createTemporaryGraph(g.getStylesheet()),e=!0,q=!1,v=null,m=null;null==w.viewState&&null==w.mapping&&null==w.root&&a.updatePageRoot(w);null!=w.viewState?(e=w.viewState.pageVisible,q=w.viewState.mathEnabled,v=w.viewState.background,m=w.viewState.backgroundImage):null!=w.mapping&&null!=w.mapping.diagramMap&&(q="0"!=w.mapping.diagramMap.get("mathEnabled"),v=w.mapping.diagramMap.get("background"),
-m=w.mapping.diagramMap.get("backgroundImage"),m=null!=m&&0<m.length?JSON.parse(m):null);p.background=v;p.backgroundImage=null!=m?new mxImage(m.src,m.width,m.height):null;p.pageVisible=e;p.mathEnabled=q;var B=p.getGlobalVariable;p.getGlobalVariable=function(a){return"page"==a?w.getName():"pagenumber"==a?u+1:B.apply(this,arguments)};document.body.appendChild(p.container);a.updatePageRoot(w);p.model.setRoot(w.root)}h=b(p,h,u!=d);p!=g&&p.container.parentNode.removeChild(p.container)}}else h=b(g);h.mathEnabled&&
-(d=h.wnd.document,d.writeln('<script type="text/x-mathjax-config">'),d.writeln("MathJax.Hub.Config({"),d.writeln('messageStyle: "none",'),d.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),d.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),d.writeln("TeX: {"),d.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),d.writeln("},"),d.writeln("tex2jax: {"),d.writeln('\tignoreClass: "geDisableMathJax"'),d.writeln("},"),
-d.writeln("asciimath2jax: {"),d.writeln('\tignoreClass: "geDisableMathJax"'),d.writeln("}"),d.writeln("});"),c&&(d.writeln("MathJax.Hub.Queue(function () {"),d.writeln("window.print();"),d.writeln("});")),d.writeln("\x3c/script>"),d.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));h.closeDocument();!h.mathEnabled&&c&&PrintDialog.printPreview(h)}var g=a.editor.graph,d=document.createElement("div"),e=document.createElement("h3");
-e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,c||mxResources.get("print"));d.appendChild(e);var h=1,t=1,q=document.createElement("div");q.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio");k.setAttribute("name","pages-printdialog");q.appendChild(k);e=document.createElement("span");
-mxUtils.write(e,mxResources.get("printAllPages"));q.appendChild(e);mxUtils.br(q);var u=k.cloneNode(!0);k.setAttribute("checked","checked");u.setAttribute("value","range");q.appendChild(u);e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");q.appendChild(e);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;";l.setAttribute("value","1");l.setAttribute("type","number");l.setAttribute("min","1");l.style.width="50px";q.appendChild(l);e=document.createElement("span");
-mxUtils.write(e,mxResources.get("to"));q.appendChild(e);var n=l.cloneNode(!0);q.appendChild(n);mxEvent.addListener(l,"focus",function(){u.checked=!0});mxEvent.addListener(n,"focus",function(){u.checked=!0});mxEvent.addListener(l,"change",b);mxEvent.addListener(n,"change",b);if(null!=a.pages&&(h=a.pages.length,null!=a.currentPage))for(e=0;e<a.pages.length;e++)if(a.currentPage==a.pages[e]){t=e+1;l.value=t;n.value=t;break}l.setAttribute("max",h);n.setAttribute("max",h);1<h&&d.appendChild(q);var v=document.createElement("div");
-v.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");v.appendChild(m);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));v.appendChild(e);var x=document.createElement("input");x.style.cssText="margin:0 8px 0 8px;";x.setAttribute("value","100 %");x.style.width="50px";v.appendChild(x);mxEvent.addListener(x,"focus",function(){m.checked=!0});
-d.appendChild(v);var q=q.cloneNode(!1),y=m.cloneNode(!0);y.setAttribute("value","fit");m.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(y);q.appendChild(e);v=document.createElement("table");v.style.display="inline-block";var T=document.createElement("tbody"),L=document.createElement("tr"),N=L.cloneNode(!0),U=document.createElement("td"),K=U.cloneNode(!0),Y=U.cloneNode(!0),Q=U.cloneNode(!0),
-aa=U.cloneNode(!0),W=U.cloneNode(!0);U.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(U,mxResources.get("fitTo"));var P=document.createElement("input");P.style.cssText="margin:0 8px 0 8px;";P.setAttribute("value","1");P.setAttribute("min","1");P.setAttribute("type","number");P.style.width="40px";K.appendChild(P);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));Y.appendChild(e);mxUtils.write(Q,mxResources.get("fitToBy"));var M=P.cloneNode(!0);
-aa.appendChild(M);mxEvent.addListener(P,"focus",function(){y.checked=!0});mxEvent.addListener(M,"focus",function(){y.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));W.appendChild(e);L.appendChild(U);L.appendChild(K);L.appendChild(Y);N.appendChild(Q);N.appendChild(aa);N.appendChild(W);T.appendChild(L);T.appendChild(N);v.appendChild(T);q.appendChild(v);d.appendChild(q);q=document.createElement("div");e=document.createElement("div");e.style.fontWeight=
-"bold";e.style.marginBottom="12px";mxUtils.write(e,mxResources.get("paperSize"));q.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var X=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);q.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));q.appendChild(e);var V=document.createElement("input");V.style.cssText="margin:0 8px 0 8px;";V.setAttribute("value","100 %");V.style.width=
-"60px";q.appendChild(V);d.appendChild(q);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});q.className="geBtn";a.editor.cancelFirst&&e.appendChild(q);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",e.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),
-function(){a.hideDialog();f(!1)}),v.className="geBtn",e.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});v.className="geBtn gePrimaryBtn";e.appendChild(v);a.editor.cancelFirst||e.appendChild(q);d.appendChild(e);this.container=d};var x=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||
-(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(x.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),
-null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.0.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
+[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var t=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,f,g,d,e,p,h,u){if(null!=b&&null==mxMarker.markers[b]){var q=this.getPackageForType(b);null!=q&&mxStencilRegistry.getStencil(q)}return t.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){m.value=Math.max(1,
+Math.min(p,Math.max(parseInt(m.value),parseInt(l.value))));l.value=Math.max(1,Math.min(p,Math.min(parseInt(m.value),parseInt(l.value))))}function f(c){function b(c,b,g){var q=c.getGraphBounds(),d=0,e=0,p=Z.get(),h=1/c.pageScale,u=B.checked;if(u)var h=parseInt(U.value),t=parseInt(Q.value),h=Math.min(p.height*t/(q.height/c.view.scale),p.width*h/(q.width/c.view.scale));else h=parseInt(y.value)/(100*c.pageScale),isNaN(h)&&(f=1/c.pageScale,y.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*
+f);p.height=Math.ceil(p.height*f);h*=f;!u&&c.pageVisible?(q=c.getPageLayout(),d-=q.x*p.width,e-=q.y*p.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,h,p,0,d,e,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var l=b.writeHead;b.writeHead=function(c){l.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var k=b.renderPage;b.renderPage=
+function(a,c,b,f,g,q){var d=k.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:d.className="geDisableMathJax";return d}}b.open(null,null,g,!0)}else{p=c.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";b.backgroundColor=p;b.autoOrigin=u;b.appendGraph(c,h,d,e,g,!0)}return b}var f=parseInt(W.value)/100;isNaN(f)&&(f=1,W.value="100 %");var f=.75*f,q=l.value,e=m.value,d=!t.checked,p=null;d&&(d=q==h&&e==h);if(!d&&null!=a.pages&&a.pages.length){var u=0,d=a.pages.length-1;t.checked||
+(u=parseInt(q)-1,d=parseInt(e)-1);for(var k=u;k<=d;k++){var v=a.pages[k],q=v==a.currentPage?g:null;if(null==q){var q=a.createTemporaryGraph(g.getStylesheet()),e=!0,u=!1,n=null,w=null;null==v.viewState&&null==v.mapping&&null==v.root&&a.updatePageRoot(v);null!=v.viewState?(e=v.viewState.pageVisible,u=v.viewState.mathEnabled,n=v.viewState.background,w=v.viewState.backgroundImage):null!=v.mapping&&null!=v.mapping.diagramMap&&(u="0"!=v.mapping.diagramMap.get("mathEnabled"),n=v.mapping.diagramMap.get("background"),
+w=v.mapping.diagramMap.get("backgroundImage"),w=null!=w&&0<w.length?JSON.parse(w):null);q.background=n;q.backgroundImage=null!=w?new mxImage(w.src,w.width,w.height):null;q.pageVisible=e;q.mathEnabled=u;var C=q.getGlobalVariable;q.getGlobalVariable=function(a){return"page"==a?v.getName():"pagenumber"==a?k+1:C.apply(this,arguments)};document.body.appendChild(q.container);a.updatePageRoot(v);q.model.setRoot(v.root)}p=b(q,p,k!=d);q!=g&&q.container.parentNode.removeChild(q.container)}}else p=b(g);p.mathEnabled&&
+(d=p.wnd.document,d.writeln('<script type="text/x-mathjax-config">'),d.writeln("MathJax.Hub.Config({"),d.writeln('messageStyle: "none",'),d.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),d.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),d.writeln("TeX: {"),d.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),d.writeln("},"),d.writeln("tex2jax: {"),d.writeln('\tignoreClass: "geDisableMathJax"'),d.writeln("},"),
+d.writeln("asciimath2jax: {"),d.writeln('\tignoreClass: "geDisableMathJax"'),d.writeln("}"),d.writeln("});"),c&&(d.writeln("MathJax.Hub.Queue(function () {"),d.writeln("window.print();"),d.writeln("});")),d.writeln("\x3c/script>"),d.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));p.closeDocument();!p.mathEnabled&&c&&PrintDialog.printPreview(p)}var g=a.editor.graph,d=document.createElement("div"),e=document.createElement("h3");
+e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,c||mxResources.get("print"));d.appendChild(e);var p=1,h=1,u=document.createElement("div");u.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","all");t.setAttribute("type","radio");t.setAttribute("name","pages-printdialog");u.appendChild(t);e=document.createElement("span");
+mxUtils.write(e,mxResources.get("printAllPages"));u.appendChild(e);mxUtils.br(u);var k=t.cloneNode(!0);t.setAttribute("checked","checked");k.setAttribute("value","range");u.appendChild(k);e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");u.appendChild(e);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;";l.setAttribute("value","1");l.setAttribute("type","number");l.setAttribute("min","1");l.style.width="50px";u.appendChild(l);e=document.createElement("span");
+mxUtils.write(e,mxResources.get("to"));u.appendChild(e);var m=l.cloneNode(!0);u.appendChild(m);mxEvent.addListener(l,"focus",function(){k.checked=!0});mxEvent.addListener(m,"focus",function(){k.checked=!0});mxEvent.addListener(l,"change",b);mxEvent.addListener(m,"change",b);if(null!=a.pages&&(p=a.pages.length,null!=a.currentPage))for(e=0;e<a.pages.length;e++)if(a.currentPage==a.pages[e]){h=e+1;l.value=h;m.value=h;break}l.setAttribute("max",p);m.setAttribute("max",p);1<p&&d.appendChild(u);var n=document.createElement("div");
+n.style.marginBottom="10px";var w=document.createElement("input");w.style.marginRight="8px";w.setAttribute("value","adjust");w.setAttribute("type","radio");w.setAttribute("name","printZoom");n.appendChild(w);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));n.appendChild(e);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","100 %");y.style.width="50px";n.appendChild(y);mxEvent.addListener(y,"focus",function(){w.checked=!0});
+d.appendChild(n);var u=u.cloneNode(!1),B=w.cloneNode(!0);B.setAttribute("value","fit");w.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(B);u.appendChild(e);n=document.createElement("table");n.style.display="inline-block";var R=document.createElement("tbody"),M=document.createElement("tr"),J=M.cloneNode(!0),T=document.createElement("td"),L=T.cloneNode(!0),X=T.cloneNode(!0),N=T.cloneNode(!0),
+Y=T.cloneNode(!0),V=T.cloneNode(!0);T.style.textAlign="right";N.style.textAlign="right";mxUtils.write(T,mxResources.get("fitTo"));var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","1");U.setAttribute("min","1");U.setAttribute("type","number");U.style.width="40px";L.appendChild(U);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));X.appendChild(e);mxUtils.write(N,mxResources.get("fitToBy"));var Q=U.cloneNode(!0);Y.appendChild(Q);
+mxEvent.addListener(U,"focus",function(){B.checked=!0});mxEvent.addListener(Q,"focus",function(){B.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));V.appendChild(e);M.appendChild(T);M.appendChild(L);M.appendChild(X);J.appendChild(N);J.appendChild(Y);J.appendChild(V);R.appendChild(M);R.appendChild(J);n.appendChild(R);u.appendChild(n);d.appendChild(u);u=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom=
+"12px";mxUtils.write(e,mxResources.get("paperSize"));u.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var Z=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);u.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));u.appendChild(e);var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","100 %");W.style.width="60px";u.appendChild(W);
+d.appendChild(u);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";u=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});u.className="geBtn";a.editor.cancelFirst&&e.appendChild(u);a.isOffline()||(n=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),n.className="geBtn",e.appendChild(n));PrintDialog.previewEnabled&&(n=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
+f(!1)}),n.className="geBtn",e.appendChild(n));n=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});n.className="geBtn gePrimaryBtn";e.appendChild(n);a.editor.cancelFirst||e.appendChild(u);d.appendChild(e);this.container=d};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
+this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(w.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=
+this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.0.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=
-!(!a.getContext||!a.getContext("2d"))}catch(q){}try{var b=document.createElement("canvas"),g=new Image;g.onload=function(){try{b.getContext("2d").drawImage(g,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(u){}};g.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(q){}try{b=
-document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(q){}})();EditorUi.prototype.openLink=function(a){return window.open(a)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,g){localStorage.setItem(a,b);g()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};
+!(!a.getContext||!a.getContext("2d"))}catch(u){}try{var b=document.createElement("canvas"),g=new Image;g.onload=function(){try{b.getContext("2d").drawImage(g,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(t){}};g.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(u){}try{b=
+document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(u){}})();EditorUi.prototype.openLink=function(a){return window.open(a)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,g){localStorage.setItem(a,b);g()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};
EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||
!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,g){g=null!=g?g:24;var c=new Spinner({lines:12,length:g,width:Math.round(g/3),radius:Math.round(g/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(g,d){var e=!1;this.active||(f.call(this,g),this.active=!0,null!=d&&(e=document.createElement("div"),e.style.position="absolute",e.style.whiteSpace="nowrap",e.style.background="#4B4243",e.style.color=
"white",e.style.fontFamily="Helvetica, Arial",e.style.fontSize="9pt",e.style.padding="6px",e.style.paddingLeft="10px",e.style.paddingRight="10px",e.style.zIndex=2E9,e.style.left=Math.max(0,a)+"px",e.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(e.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(e.style,"boxShadow","2px 2px 3px 0px #ddd"),e.innerHTML=d+"...",g.appendChild(e),c.status=e,mxClient.IS_VML&&
(null==document.documentMode||8>=document.documentMode)&&(e.style.left=Math.round(Math.max(0,a-e.offsetWidth/2))+"px",e.style.top=Math.round(Math.max(0,b+70-e.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(g,d)}));this.stop();return a}),e=!0);return e};var d=c.stop;c.stop=function(){d.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};
-return c};EditorUi.parsePng=function(a,b,g){function c(a,c){var b=d;d+=c;return a.substring(b,d)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var d=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(c(a,4),"IHDR"!=c(a,4))null!=g&&g();else{c(a,17);do{g=f(a);var e=c(a,4);if(null!=b&&b(d-8,e,g))break;value=c(a,g);c(a,4);if("IEND"==e)break}while(g)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=
-mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(t){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var g=c.indexOf("&lt;mxfile ");if(0<=g){var d=c.lastIndexOf("&lt;/mxfile&gt;");d>g&&(b=c.substring(g,d+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var e=
-mxUtils.parseXml(c),h=this.editor.extractGraphModel(e.documentElement,null!=this.pages),b=null!=h?mxUtils.getXml(h):""}catch(x){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,
-!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=
-urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};
-EditorUi.prototype.createFileData=function(a,b,g,d,e,h,k,l,n,p){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;n=null!=n?n:!0;var c,f=null;null==g||g.getMode()==App.MODE_DEVICE||g.getMode()==App.MODE_BROWSER?c="_blank":f=c=d;if(null==a)return"";var q=a;if("mxfile"!=q.nodeName.toLowerCase()){var t=b.zapGremlins(mxUtils.getXml(a)),q=b.compress(t);if(b.decompress(q)!=t)return t;t=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(t,q);q=a.ownerDocument.createElement("mxfile");q.appendChild(t)}p?
-(q=q.cloneNode(!0),q.removeAttribute("userAgent"),q.removeAttribute("version"),q.removeAttribute("editor"),q.removeAttribute("type")):(q.setAttribute("userAgent",navigator.userAgent),q.setAttribute("version",EditorUi.VERSION),q.setAttribute("editor","www.draw.io"),a=null!=g?g.getMode():this.mode,null!=a&&q.setAttribute("type",a));a=mxUtils.getXml(q);if(!h&&!e&&(k||null!=g&&/(\.html)$/i.test(g.getTitle())))a=this.getHtml2(mxUtils.getXml(q),b,null!=g?g.getTitle():null,c,f);else if(h||!e&&null!=g&&/(\.svg)$/i.test(g.getTitle()))null==
-g||g.getMode()!=App.MODE_DEVICE&&g.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,l,n,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,f);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var e=
-0;e<this.pages.length;e++){var d=this.pages[e].mapping;this.currentPage!=this.pages[e]&&null!=d&&d.needsUpdate&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(d.graphModel),d.writeRealtimeToNode(f),f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(f))),mxUtils.setTextContent(this.pages[e].node,f),d.needsUpdate=!1);c.appendChild(this.pages[e].node)}}return c};EditorUi.prototype.getFileData=function(a,b,g,e,d,h,k,l){d=null!=d?d:!0;k=null!=k?k:this.getXmlFileData(d,null!=
-h?h:!1);h=this.editor.graph;var c=this.getCurrentFile();if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=c&&/(\.svg)$/i.test(c.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var f=h.getGlobalVariable,q=this.pages[0];h.getGlobalVariable=function(a){return"page"==a?q.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(q.root)}a=this.createFileData(k,h,c,window.location.href,a,b,g,e,d,l);h!=this.editor.graph&&h.container.parentNode.removeChild(h.container);
-return a};EditorUi.prototype.getHtml=function(a,b,g,d,e,h){h=null!=h?h:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=h?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),q=b.view.scale;h=Math.floor(c.x/q-b.view.translate.x);q=Math.floor(c.y/q-b.view.translate.y);c=b.background;null==e&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",h);a.setAttribute("y0",q)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom",
-"1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=d&&a.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";d=this.editor.graph.compress(a);this.editor.graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':
-">")+"\n<head>\n"+(null==e?null!=g?"<title>"+mxUtils.htmlEntities(g)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+"</div>\n</div>\n"+(null==e?'<script type="text/javascript" src="'+f+'">\x3c/script>':
-'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,g,e,d){null!=d&&(d=d.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,
-this.currentPage));return(null==d?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=d?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==d?null!=g?"<title>"+mxUtils.htmlEntities(g)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=d?'<meta http-equiv="refresh" content="0;URL=\''+d+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
+return c};EditorUi.parsePng=function(a,b,g){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(c(a,4),"IHDR"!=c(a,4))null!=g&&g();else{c(a,17);do{g=f(a);var d=c(a,4);if(null!=b&&b(e-8,d,g))break;value=c(a,g);c(a,4);if("IEND"==d)break}while(g)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=
+mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(p){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var g=c.indexOf("&lt;mxfile ");if(0<=g){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>g&&(b=c.substring(g,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var d=
+mxUtils.parseXml(c),h=this.editor.extractGraphModel(d.documentElement,null!=this.pages),b=null!=h?mxUtils.getXml(h):""}catch(w){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,
+!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,e=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<e.length||1==e.length&&e[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=e.length-1;0<=d;d--){var h=this.updatePageRoot(new DiagramPage(e[d]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[d+1]));c.model.execute(new ChangePage(this,h,0==d?h:null,0))}}else"0"!=
+urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(d=0;d<b.length;d++)c.model.execute(new ChangePage(this,b[d],null))}finally{c.model.endUpdate()}}};
+EditorUi.prototype.createFileData=function(a,b,g,e,d,h,l,k,m,q){b=null!=b?b:this.editor.graph;d=null!=d?d:!1;m=null!=m?m:!0;var c,f=null;null==g||g.getMode()==App.MODE_DEVICE||g.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var p=a;if("mxfile"!=p.nodeName.toLowerCase()){var u=b.zapGremlins(mxUtils.getXml(a)),p=b.compress(u);if(b.decompress(p)!=u)return u;u=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,p);p=a.ownerDocument.createElement("mxfile");p.appendChild(u)}q?
+(p=p.cloneNode(!0),p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type")):(p.setAttribute("userAgent",navigator.userAgent),p.setAttribute("version",EditorUi.VERSION),p.setAttribute("editor","www.draw.io"),a=null!=g?g.getMode():this.mode,null!=a&&p.setAttribute("type",a));a=mxUtils.getXml(p);if(!h&&!d&&(l||null!=g&&/(\.html)$/i.test(g.getTitle())))a=this.getHtml2(mxUtils.getXml(p),b,null!=g?g.getTitle():null,c,f);else if(h||!d&&null!=g&&/(\.svg)$/i.test(g.getTitle()))null==
+g||g.getMode()!=App.MODE_DEVICE&&g.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,k,m,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,f);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var e=
+0;e<this.pages.length;e++){var d=this.pages[e].mapping;this.currentPage!=this.pages[e]&&null!=d&&d.needsUpdate&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(d.graphModel),d.writeRealtimeToNode(f),f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(f))),mxUtils.setTextContent(this.pages[e].node,f),d.needsUpdate=!1);c.appendChild(this.pages[e].node)}}return c};EditorUi.prototype.getFileData=function(a,b,g,e,d,h,l,k,m){d=null!=d?d:!0;l=null!=l?l:this.getXmlFileData(d,null!=
+h?h:!1);m=null!=m?m:this.getCurrentFile();h=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=m&&/(\.svg)$/i.test(m.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var c=h.getGlobalVariable,f=this.pages[0];h.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(f.root)}a=this.createFileData(l,h,m,window.location.href,a,b,g,e,d,k);h!=this.editor.graph&&
+h.container.parentNode.removeChild(h.container);return a};EditorUi.prototype.getHtml=function(a,b,g,e,d,h){h=null!=h?h:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=h?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),p=b.view.scale;h=Math.floor(c.x/p-b.view.translate.x);p=Math.floor(c.y/p-b.view.translate.y);c=b.background;null==d&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",h);a.setAttribute("y0",
+p)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=d&&(d=d.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==d?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=d?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==d?null!=g?"<title>"+mxUtils.htmlEntities(g)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=d?'<meta http-equiv="refresh" content="0;URL=\''+d+"'\"/>\n":"")+"</head>\n<body"+(null==d&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+
+"</div>\n</div>\n"+(null==d?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+d+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,g,e,d){null!=d&&(d=d.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};
+null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==d?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=d?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==d?null!=g?"<title>"+mxUtils.htmlEntities(g)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=d?'<meta http-equiv="refresh" content="0;URL=\''+d+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==d?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+d+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;var b=null!=a&&0<a.length?
mxUtils.parseXml(a).documentElement:null;a=null!=b?this.editor.extractGraphModel(b,!0):null;null!=a&&(b=a);if(null!=b&&"mxfile"==b.nodeName&&(a=b.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<a.length||1==a.length&&a[0].hasAttribute("name"))){this.fileNode=b;this.pages=[];for(b=0;b<a.length;b++){var c=new DiagramPage(a[b]);null==c.getName()&&c.setName(mxResources.get("pageWithNumber",[b+1]));this.pages.push(c)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||
0))];b=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=b&&(this.fileNode=b.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(b.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(b);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(){var a=this.getCurrentFile(),a=null!=a&&null!=
-a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,g,d,e,h){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(),f=c+"."+a;if("xml"==a){var q='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(f,a,q,"text/xml")}else if("html"==
-a)q=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,q,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(b,c){try{var f=this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var g=this.createDownloadRequest(b,a,d,c);this.editor.graph.pageVisible=f;return g}catch(H){this.handleError(H)}}));else{var p=null,t=
-mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);var l=this.editor.graph.getSvg(k,null,null,null,null,d);g&&this.editor.graph.addSvgShadow(l);this.convertImages(l,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();t('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
-mxUtils.getXml(a))})))}else f=c+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),d)}}catch(A){this.handleError(A)}};EditorUi.prototype.createDownloadRequest=function(a,b,g,d){var c=this.editor.graph.getGraphBounds();g=this.getFileData(!0,null,null,null,g,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||g.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var e=
+a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,g,d,e,h){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(),f=c+"."+a;if("xml"==a){var p='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(f,a,p,"text/xml")}else if("html"==
+a)p=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,p,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(b,c){try{var f=this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var g=this.createDownloadRequest(b,a,d,c);this.editor.graph.pageVisible=f;return g}catch(H){this.handleError(H)}}));else{var q=null,u=
+mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(q)}))});if("svg"==a){var l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);var k=this.editor.graph.getSvg(l,null,null,null,null,d);g&&this.editor.graph.addSvgShadow(k);this.convertImages(k,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();u('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
+mxUtils.getXml(a))})))}else f=c+".svg",q=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();u(a)}),d)}}catch(A){this.handleError(A)}};EditorUi.prototype.createDownloadRequest=function(a,b,g,d){var c=this.editor.graph.getGraphBounds();g=this.getFileData(!0,null,null,null,g,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||g.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var e=
0;e<this.pages.length;e++)if(this.pages[e]==this.currentPage){f="&from="+e;break}return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&base64="+d+"&embedXml="+c+"&xml="+encodeURIComponent(g)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var b=!1;this.hideDialog();var c=this.getCurrentFile();this.setCurrentFile(null);null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);
a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>"));!this.editor.chromeless||this.editor.editable?
(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.lightbox&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));b=!0;this.isOffline()||null==a.getMode()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),
-mode:a.getMode()})}catch(q){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(q){}}catch(q){null!=window.console&&console.log("error in fileLoaded:",a,q);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=q&&null!=q.message?":err:"+encodeURIComponent(q.message):"")+(null!=
-q&&null!=q.stack?"&stack="+encodeURIComponent(q.stack):"")}catch(u){}this.handleError(q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?c.constructor==DriveFile?this.loadFile(c.getHash()):this.fileLoaded(c):d()}))}else d();return b};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
-"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,g,d,e,h,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
+mode:a.getMode()})}catch(u){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(u){}}catch(u){null!=window.console&&console.log("error in fileLoaded:",a,u);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=u&&null!=u.message?":err:"+encodeURIComponent(u.message):"")+(null!=
+u&&null!=u.stack?"&stack="+encodeURIComponent(u.stack):"")}catch(t){}this.handleError(u,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?c.constructor==DriveFile?this.loadFile(c.getHash()):this.fileLoaded(c):d()}))}else d();return b};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
+"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,g,d,e,h,l){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);return mxUtils.getXml(b)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),
".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;
var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,g){if(null!=
this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,d=mxUtils.bind(this,function(b,c){if(0==b.length&&a.isEditable())null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding=
-"8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f);else for(var g=0;g<b.length;g++){var d=b[g],e=d.data;if(null!=e){var e=this.convertDataUri(e),p="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(p+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(p+"image="+e,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(e=this.stringToCells(this.editor.graph.decompress(d.xml)),0<e.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(e,
+"8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f);else for(var g=0;g<b.length;g++){var d=b[g],e=d.data;if(null!=e){var e=this.convertDataUri(e),q="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(q+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(q+"image="+e,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(e=this.stringToCells(this.editor.graph.decompress(d.xml)),0<e.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(e,
d.w,d.h,d.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
-mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);g=null!=g&&0<g.length?g:a.getTitle();var h=this.sidebar.addPalette(a.getHash(),g,!0,mxUtils.bind(this,function(a){d(b,a)}));this.repositionLibrary(c);var k=h.parentNode.previousSibling;g=k.getAttribute("title");null!=g&&0<g.length&&".scratchpad"!=a.title&&k.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+g);
-var p=document.createElement("div");p.style.position="absolute";p.style.right="0px";p.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");k.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("align","top");l.setAttribute("border","0");l.className="geButton";l.style.marginRight="1px";l.style.marginTop="-1px";p.appendChild(l);var n=
-null;mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var m=this.editor.graph,A=null,F=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),h,b,a,a.getMode());mxEvent.consume(c)}),E=mxUtils.bind(this,function(c){a.setModified(!0);
-a.isAutosave()?(null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A),A=l.cloneNode(!1),A.setAttribute("src",Editor.spinImage),A.setAttribute("title",mxResources.get("saving")),A.style.cursor="default",A.style.marginRight="2px",A.style.marginTop="-2px",p.insertBefore(A,p.firstChild),k.style.paddingRight=18*p.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=A&&null!=A.parentNode&&(A.parentNode.removeChild(A),k.style.paddingRight=18*p.childNodes.length+
-"px")})):null==n&&(n=l.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),p.insertBefore(n,p.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(k.style.paddingRight=18*p.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),k.style.paddingRight=18*p.childNodes.length+"px")}),C=
-mxUtils.bind(this,function(a,c,g,d){a=m.cloneCells(mxUtils.sortCells(m.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var p=m.getCellGeometry(a[e]);null!=p&&p.translate(-c.x,-c.y)}h.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,d||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=d&&(a.title=d);b.push(a);E(g);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),
-H=mxUtils.bind(this,function(a){if(m.isSelectionEmpty())m.getRubberband().isActive()?(m.getRubberband().execute(a),m.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=m.getSelectionCells(),c=m.view.getBounds(b),f=m.view.scale;c.x/=f;c.y/=f;c.width/=f;c.height/=f;c.x-=m.view.translate.x;c.y-=m.view.translate.y;C(b,c)}mxEvent.consume(a)});h.style.border="3px solid transparent";mxEvent.addGestureListeners(h,function(){},
-mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":h.style.border="3px dotted rgb(254, 137, 12)",h.style.cursor="copy",m.panningManager.stop(),m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){m.isMouseDown&&
-null!=m.panningManager&&null!=m.graphHandler&&(h.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),h.style.cursor="default",this.sidebar.showTooltips=!0,m.panningManager.stop(),m.graphHandler.reset(),m.isMouseDown=!1,m.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(h,"mouseleave",mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="visible",h.style.border="3px solid transparent",h.style.cursor=
-"",m.autoScroll=!0,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!0),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(h,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":h.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";h.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
-mxEvent.addListener(h,"drop",mxUtils.bind(this,function(a){h.style.border="3px solid transparent";h.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,g,e,p,k,l,t,q,u){if(null!=c&&"image/"==g.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,k,l),c)],c[0].vertex=
-!0,C(c,new mxRectangle(0,0,k,l),a,mxEvent.isAltDown(a)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var w=!1,m=mxUtils.bind(this,function(c,g){if(null!=c&&"text/xml"==g){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));d(p,h);b=b.concat(p);E(a);this.spinner.stop();w=!0}catch(V){}else if("mxfile"==e.documentElement.nodeName)try{for(var k=
-e.documentElement.getElementsByTagName("diagram"),e=0;e<k.length;e++){var p=mxUtils.getTextContent(k[e]),l=this.stringToCells(this.editor.graph.decompress(p)),t=this.editor.graph.getBoundingBoxFromGeometry(l);C(l,new mxRectangle(0,0,t.width,t.height),a)}w=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}w||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});!this.isOffline()&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,t)&&null!=u?this.parseFile(u,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?m(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):m(c,g)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(h,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(h.style.border=
-"3px solid transparent",h.style.cursor="");a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",IMAGE_PATH+"/edit.gif");l.setAttribute("title",mxResources.get("edit"));p.insertBefore(l,p.firstChild);mxEvent.addListener(l,"click",F);mxEvent.addListener(h,"dblclick",function(a){mxEvent.getSource(a)==h&&F(a)});g=l.cloneNode(!1);g.setAttribute("src",Editor.plusImage);g.setAttribute("title",mxResources.get("add"));p.insertBefore(g,p.firstChild);mxEvent.addListener(g,"click",
-H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(g=document.createElement("span"),g.setAttribute("title",mxResources.get("help")),g.style.cssText="color:gray;text-decoration:none;",g.className="geButton",mxUtils.write(g,"?"),mxEvent.addGestureListeners(g,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),p.insertBefore(g,p.firstChild))}k.appendChild(p);k.style.paddingRight=18*p.childNodes.length+"px"}};"1"==urlParams.offline||
+mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);g=null!=g&&0<g.length?g:a.getTitle();var h=this.sidebar.addPalette(a.getHash(),g,!0,mxUtils.bind(this,function(a){d(b,a)}));this.repositionLibrary(c);var l=h.parentNode.previousSibling;g=l.getAttribute("title");null!=g&&0<g.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+g);
+var q=document.createElement("div");q.style.position="absolute";q.style.right="0px";q.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(q.style.backgroundColor="inherit");l.style.position="relative";var k=document.createElement("img");k.setAttribute("src",Dialog.prototype.closeImage);k.setAttribute("title",mxResources.get("close"));k.setAttribute("align","top");k.setAttribute("border","0");k.className="geButton";k.style.marginRight="1px";k.style.marginTop="-1px";q.appendChild(k);var m=
+null;mxEvent.addListener(k,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var n=this.editor.graph,A=null,E=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),h,b,a,a.getMode());mxEvent.consume(c)}),F=mxUtils.bind(this,function(c){a.setModified(!0);
+a.isAutosave()?(null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A),A=k.cloneNode(!1),A.setAttribute("src",Editor.spinImage),A.setAttribute("title",mxResources.get("saving")),A.style.cursor="default",A.style.marginRight="2px",A.style.marginTop="-2px",q.insertBefore(A,q.firstChild),l.style.paddingRight=18*q.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=A&&null!=A.parentNode&&(A.parentNode.removeChild(A),l.style.paddingRight=18*q.childNodes.length+
+"px")})):null==m&&(m=k.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),q.insertBefore(m,q.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()||(l.style.paddingRight=18*q.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),l.style.paddingRight=18*q.childNodes.length+"px")}),D=
+mxUtils.bind(this,function(a,c,g,d){a=n.cloneCells(mxUtils.sortCells(n.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var q=n.getCellGeometry(a[e]);null!=q&&q.translate(-c.x,-c.y)}h.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,d||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=d&&(a.title=d);b.push(a);F(g);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),
+H=mxUtils.bind(this,function(a){if(n.isSelectionEmpty())n.getRubberband().isActive()?(n.getRubberband().execute(a),n.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=n.getSelectionCells(),c=n.view.getBounds(b),f=n.view.scale;c.x/=f;c.y/=f;c.width/=f;c.height/=f;c.x-=n.view.translate.x;c.y-=n.view.translate.y;D(b,c)}mxEvent.consume(a)});h.style.border="3px solid transparent";mxEvent.addGestureListeners(h,function(){},
+mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":h.style.border="3px dotted rgb(254, 137, 12)",h.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!1),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){n.isMouseDown&&
+null!=n.panningManager&&null!=n.graphHandler&&(h.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),h.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(h,"mouseleave",mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",h.style.border="3px solid transparent",h.style.cursor=
+"",n.autoScroll=!0,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!0),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(h,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":h.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";h.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
+mxEvent.addListener(h,"drop",mxUtils.bind(this,function(a){h.style.border="3px solid transparent";h.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,g,e,q,p,k,l,u,v){if(null!=c&&"image/"==g.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,k),c)],c[0].vertex=
+!0,D(c,new mxRectangle(0,0,p,k),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var t=!1,m=mxUtils.bind(this,function(c,g){if(null!=c&&"text/xml"==g){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var q=JSON.parse(mxUtils.getTextContent(e.documentElement));d(q,h);b=b.concat(q);F(a);this.spinner.stop();t=!0}catch(W){}else if("mxfile"==e.documentElement.nodeName)try{for(var p=
+e.documentElement.getElementsByTagName("diagram"),e=0;e<p.length;e++){var q=mxUtils.getTextContent(p[e]),k=this.stringToCells(this.editor.graph.decompress(q)),l=this.editor.graph.getBoundingBoxFromGeometry(k);D(k,new mxRectangle(0,0,l.width,l.height),a)}t=!0}catch(W){null!=window.console&&console.log("error in drop handler:",W)}}t||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});!this.isOffline()&&
+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?m(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):m(c,g)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(h,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(h.style.border=
+"3px solid transparent",h.style.cursor="");a.stopPropagation();a.preventDefault()}));k=k.cloneNode(!1);k.setAttribute("src",IMAGE_PATH+"/edit.gif");k.setAttribute("title",mxResources.get("edit"));q.insertBefore(k,q.firstChild);mxEvent.addListener(k,"click",E);mxEvent.addListener(h,"dblclick",function(a){mxEvent.getSource(a)==h&&E(a)});g=k.cloneNode(!1);g.setAttribute("src",Editor.plusImage);g.setAttribute("title",mxResources.get("add"));q.insertBefore(g,q.firstChild);mxEvent.addListener(g,"click",
+H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(g=document.createElement("span"),g.setAttribute("title",mxResources.get("help")),g.style.cssText="color:gray;text-decoration:none;",g.className="geButton",mxUtils.write(g,"?"),mxEvent.addGestureListeners(g,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),q.insertBefore(g,q.firstChild))}l.appendChild(q);l.style.paddingRight=18*q.childNodes.length+"px"}};"1"==urlParams.offline||
EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));
a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet","styles/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",
Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet","styles/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",
@@ -6620,21 +6624,21 @@ function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.us
EditorUi.prototype.saveCanvas=function(a,b,g){var c="jpeg"==g?"jpg":g,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,g);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+g,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};
EditorUi.prototype.doSaveLocalFile=function(a,b,g,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,g):new Blob([a],{type:g}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)g=window.open("about:blank","_blank"),null==g?mxUtils.popup(a,!0):(g.document.write(a),g.document.close(),g.document.execCommand("SaveAs",!0,b),g.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height=
"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof c.download;if(f||this.isOffline()){c.href=URL.createObjectURL(d?this.base64ToBlob(a,g):new Blob([a],{type:g}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(y){}}else this.createEchoRequest(a,
-b,g,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,g,d,e,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=g?"&mime="+g:"")+(null!=e?"&format="+e:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),f=c.length,d=Math.ceil(f/1024),e=Array(d),h=0;h<d;++h){for(var k=1024*h,l=Math.min(k+1024,f),p=Array(l-k),w=0;k<l;++w,++k)p[w]=
-c[k].charCodeAt(0);e[h]=new Uint8Array(p)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,g,d,e,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,c){try{if("_blank"==c)if(null==g||"image/"!=g.substring(0,6)||"image/svg"==g.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,
-!1)),f.document.close())}else this.openInNewWindow(a,g,d);else c==App.MODE_DEVICE?this.doSaveLocalFile(a,b,g,d):null!=b&&0<b.length&&this.pickFolder(c,mxUtils.bind(this,function(f){try{this.exportFile(a,b,g,d,c,f)}catch(z){this.handleError(z)}}))}catch(w){this.handleError(w)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,h,k,null,null,4<e?3:4,a,g,d);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};
+b,g,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,g,d,e,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=g?"&mime="+g:"")+(null!=e?"&format="+e:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),f=c.length,d=Math.ceil(f/1024),e=Array(d),h=0;h<d;++h){for(var k=1024*h,l=Math.min(k+1024,f),q=Array(l-k),v=0;k<l;++v,++k)q[v]=
+c[k].charCodeAt(0);e[h]=new Uint8Array(q)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,g,d,e,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,c){try{if("_blank"==c)if(null==g||"image/"!=g.substring(0,6)||"image/svg"==g.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,
+!1)),f.document.close())}else this.openInNewWindow(a,g,d);else c==App.MODE_DEVICE?this.doSaveLocalFile(a,b,g,d):null!=b&&0<b.length&&this.pickFolder(c,mxUtils.bind(this,function(f){try{this.exportFile(a,b,g,d,c,f)}catch(x){this.handleError(x)}}))}catch(v){this.handleError(v)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,h,k,null,null,4<e?3:4,a,g,d);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};
EditorUi.prototype.openInNewWindow=function(a,b,g){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(g?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(g?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,
-!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div");
+!0)};var d=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div");
var f=b.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=
f.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";f=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=f.zIndex;var g=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});g.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){g.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height=
"auto";this.exportDialog.style.padding="10px";var b=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",b);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(b.substring(b.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null,
-this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}e.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,g,d,e){this.isLocalFileSave()?this.saveLocalFile(g,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(g,a,d,e,b,c)}),g,
+this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}d.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,g,d,e){this.isLocalFileSave()?this.saveLocalFile(g,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(g,a,d,e,b,c)}),g,
e,d)};EditorUi.prototype.saveRequest=function(a,b,g,d,e,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=g("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(g){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,
-a,h,!0,c,g)}catch(D){this.handleError(D)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,c,g)}catch(D){this.handleError(D)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
+a,h,!0,c,g)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,c,g)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
!1,!1,k,null,null,4<c?3:4,d,h,e);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,g,d,e,h){};EditorUi.prototype.pickFolder=function(a,b,g){b(null)};EditorUi.prototype.exportSvg=function(a,b,g,d,e,h,k,l,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();g=null!=g?g:c;c=b?null:this.editor.graph.background;
-c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,l,null,g);d&&this.editor.graph.addSvgShadow(f);var t=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,g,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,
-this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(t,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==
-this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,q,this.thumbImageCache)):q(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,g,d,e,h){h=null!=h?h:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");g&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);d&&c.setAttribute("disabled","disabled");h&&(a.appendChild(c),mxUtils.write(a,b),e||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,
+c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,l,null,g);d&&this.editor.graph.addSvgShadow(f);var p=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,g,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,
+this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(p,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==
+this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,u,this.thumbImageCache)):u(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,g,d,e,h){h=null!=h?h:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");g&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);d&&c.setAttribute("disabled","disabled");h&&(a.appendChild(c),mxUtils.write(a,b),e||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,
b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var f=this.getCurrentFile(),d="";null!=f&&f.getMode()!=App.MODE_DEVICE&&f.getMode()!=App.MODE_BROWSER&&(d=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("makeCopy"));e.appendChild(f);f=document.createElement("option");
f.setAttribute("value","custom");mxUtils.write(f,mxResources.get("custom")+"...");e.appendChild(f);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,d,mxResources.get("ok"),function(a){null!=a?d=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||
b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":d:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){h.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=d&&d!=mxConstants.NONE?"border:1px solid black;background-color:"+d:"background-position:center center;background-repeat:no-repeat;background-image:url('"+
@@ -6643,111 +6647,111 @@ e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow
mxClient.IS_FF?"4px 2px 4px 2px":"4px";h.style.marginLeft="4px";h.style.height="22px";h.style.width="22px";h.style.position="relative";h.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";h.className="geColorBtn";a.appendChild(h);mxUtils.br(a);return{getColor:function(){return d},getTarget:function(){return f.value},focus:function(){f.focus()}}};EditorUi.prototype.createLink=function(a,b,g,e,d,h,k,l){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=d&&0<d.length&&f.push("edit="+encodeURIComponent(d)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(g&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?g="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),l||null==c||c.constructor!=window.DriveFile?g="#R"+encodeURIComponent(g?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(g="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+g};EditorUi.prototype.createHtml=function(a,
-b,g,e,d,h,k,l,m,p,w){this.getBasenames();var c={};""!=d&&d!=mxConstants.NONE&&(c.highlight=d);"auto"!==e&&(c.target=e);m||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;g=parseInt(g);isNaN(g)||100==g||(c.zoom=g/100);g=[];k&&(g.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(g.push("zoom"),c.resize=!0);l&&g.push("layers");0<g.length&&(m&&g.push("lightbox"),c.toolbar=g.join(" "));null!=p&&0<p.length&&(c.edit=p);null!=
-a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=g?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";w(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
+b,g,e,d,h,k,l,m,q,v){this.getBasenames();var c={};""!=d&&d!=mxConstants.NONE&&(c.highlight=d);"auto"!==e&&(c.target=e);m||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;g=parseInt(g);isNaN(g)||100==g||(c.zoom=g/100);g=[];k&&(g.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(g.push("zoom"),c.resize=!0);l&&g.push("layers");0<g.length&&(m&&g.push("lightbox"),c.toolbar=g.join(" "));null!=q&&0<q.length&&(c.edit=q);null!=
+a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=g?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";v(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,g,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var d=document.createElement("div");d.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var h=document.createElement("input");h.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
-h.setAttribute("value","url");h.setAttribute("type","radio");h.setAttribute("name","type-embedhtmldialog");f=h.cloneNode(!0);f.setAttribute("value","copy");d.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));d.appendChild(k);mxUtils.br(d);d.appendChild(h);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));d.appendChild(k);var p=this.getCurrentFile();null==g&&null!=p&&p.constructor==window.DriveFile&&(k=
-document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),d.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(p.getId())})));f.setAttribute("checked","checked");null==g&&h.setAttribute("disabled","disabled");c.appendChild(d);var l=this.addLinkSection(c),t=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
-":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value="100%";c.appendChild(m);var n=this.addCheckbox(c,mxResources.get("fit"),!0),d=null!=this.pages&&1<this.pages.length,F=F=this.addCheckbox(c,mxResources.get("allPages"),d,!d),E=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,C),B=H.getEditInput();
-B.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&C.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(h.checked?g:null,t.checked,m.value,l.getTarget(),l.getColor(),n.checked,F.checked,E.checked,C.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
+h.setAttribute("value","url");h.setAttribute("type","radio");h.setAttribute("name","type-embedhtmldialog");f=h.cloneNode(!0);f.setAttribute("value","copy");d.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));d.appendChild(k);mxUtils.br(d);d.appendChild(h);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));d.appendChild(k);var q=this.getCurrentFile();null==g&&null!=q&&q.constructor==window.DriveFile&&(k=
+document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),d.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(q.getId())})));f.setAttribute("checked","checked");null==g&&h.setAttribute("disabled","disabled");c.appendChild(d);var l=this.addLinkSection(c),p=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value="100%";c.appendChild(m);var n=this.addCheckbox(c,mxResources.get("fit"),!0),d=null!=this.pages&&1<this.pages.length,E=E=this.addCheckbox(c,mxResources.get("allPages"),d,!d),F=this.addCheckbox(c,mxResources.get("layers"),!0),D=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,D),C=H.getEditInput();
+C.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled");C.checked&&D.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(h.checked?g:null,p.checked,m.value,l.getTarget(),l.getColor(),n.checked,E.checked,F.checked,D.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
EditorUi.prototype.showPublishLinkDialog=function(a,b,g,d,e,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var k=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=k&&k.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
-p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));p.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));l.style.marginTop="12px";l.className="geBtn";p.appendChild(l);c.appendChild(p);l=document.createElement("a");
-l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));p.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
-this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var t=null,q=null;if(null!=g||null!=d)a+=30,mxUtils.write(c,mxResources.get("width")+":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.marginRight="16px",t.style.width="50px",t.style.marginLeft="6px",t.style.marginRight="16px",t.style.marginBottom="10px",t.value="100%",c.appendChild(t),mxUtils.write(c,mxResources.get("height")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px",
-q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",c.appendChild(q),mxUtils.br(c);var m=this.addLinkSection(c,h);g=null!=this.pages&&1<this.pages.length;var n=null;if(null==k||k.constructor!=window.DriveFile||b)n=this.addCheckbox(c,mxResources.get("allPages"),g,!g);var u=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,u),H=C.getEditInput(),B=this.addCheckbox(c,mxResources.get("layers"),!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";
-B.style.marginTop="8px";mxEvent.addListener(u,"change",function(){u.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&u.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){e(m.getTarget(),m.getColor(),null==n?!0:n.checked,u.checked,C.getLink(),B.checked,null!=t?t.value:null,null!=
-q?q.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=t?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)):m.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,g,d){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
+q=document.createElement("div");q.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));q.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));l.style.marginTop="12px";l.className="geBtn";q.appendChild(l);c.appendChild(q);l=document.createElement("a");
+l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));q.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
+this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var p=null,m=null;if(null!=g||null!=d)a+=30,mxUtils.write(c,mxResources.get("width")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.marginRight="16px",p.style.width="50px",p.style.marginLeft="6px",p.style.marginRight="16px",p.style.marginBottom="10px",p.value="100%",c.appendChild(p),mxUtils.write(c,mxResources.get("height")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.width="50px",
+m.style.marginLeft="6px",m.style.marginBottom="10px",m.value=d+"px",c.appendChild(m),mxUtils.br(c);var u=this.addLinkSection(c,h);g=null!=this.pages&&1<this.pages.length;var n=null;if(null==k||k.constructor!=window.DriveFile||b)n=this.addCheckbox(c,mxResources.get("allPages"),g,!g);var t=this.addCheckbox(c,mxResources.get("lightbox"),!0),D=this.addEditButton(c,t),H=D.getEditInput(),C=this.addCheckbox(c,mxResources.get("layers"),!0);C.style.marginLeft=H.style.marginLeft;C.style.marginBottom="16px";
+C.style.marginTop="8px";mxEvent.addListener(t,"change",function(){t.checked?(C.removeAttribute("disabled"),H.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&t.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){e(u.getTarget(),u.getColor(),null==n?!0:n.checked,t.checked,D.getLink(),C.checked,null!=p?p.value:null,null!=
+m?m.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,g,d){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
c.appendChild(f);var e=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),h=d?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=h&&(h.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){g(!e.checked,null!=h?h.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,g,d,e,h,k,l){k=null!=k?k:!0;var c=document.createElement("div");c.style.whiteSpace=
-"nowrap";var f=this.editor.graph,t="jpeg"==l?170:280,q=document.createElement("h3");mxUtils.write(q,a);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(q);mxUtils.write(c,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";c.appendChild(m);mxUtils.write(c,mxResources.get("borderWidth")+
-":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.value=this.lastExportBorder||"0";c.appendChild(n);mxUtils.br(c);var u=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),y=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight=
-"8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type","checkbox");h&&(c.appendChild(x),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),t+=26,mxEvent.addListener(y,"change",function(){y.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop=
-"16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),t+=26);var G=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=l),I=null!=this.pages&&1<this.pages.length,J=this.addCheckbox(c,I?mxResources.get("allPages"):"",I,!I,null,"jpeg"!=l);J.style.marginLeft="24px";J.style.marginBottom="16px";I||(J.style.visibility=
-"hidden");mxEvent.addListener(G,"change",function(){G.checked&&I?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});k&&I||J.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=n.value;this.lastExportZoom=m.value;e(m.value,u.checked,!y.checked,H.checked,G.checked,B.checked,n.value,x.checked,!J.checked)}),null,g,d);this.showDialog(a.container,320,t,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,g,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var k=this.addCheckbox(c,mxResources.get("fit"),!0),p=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&d,
-!d),l=this.addCheckbox(c,g),t=this.addCheckbox(c,mxResources.get("lightbox"),!0),q=this.addEditButton(c,t),m=q.getEditInput(),n=1<f.model.getChildCount(f.model.getRoot()),E=this.addCheckbox(c,mxResources.get("layers"),n,!n);E.style.marginLeft=m.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(t,"change",function(){t.checked?(n&&E.removeAttribute("disabled"),m.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"));
-m.checked&&t.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(k.checked,p.checked,l.checked,t.checked,q.getLink(),E.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,g,d,e,h,k,l){function c(b){var c=" ",p="";d&&(c=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(e?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");var l="";g&&(l=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');k('<img src="'+b+'"'+l+(""!=p?' style="'+p+'"':"")+c+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}),
-null,!0,g?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var t="";g&&(t="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+t+"&xml="+encodeURIComponent(b));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&299>=q.getStatus()?c("data:image/png;base64,"+q.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,d,e,h,k,l){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var t=f[g].getAttribute("href");null!=t&&"#"==t.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var q=" ",m="";e&&(q="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(h?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){l('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=m?' style="'+m+'"':"")+q+"/>")}))}else m="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(h?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),m+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=m&&c.setAttribute("style",m),l(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+
+"nowrap";var f=this.editor.graph,p="jpeg"==l?170:280,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(m);mxUtils.write(c,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+
+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var t=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),w=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),y=document.createElement("input");y.style.marginTop="16px";y.style.marginRight=
+"8px";y.style.marginLeft="24px";y.setAttribute("disabled","disabled");y.setAttribute("type","checkbox");h&&(c.appendChild(y),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),p+=26,mxEvent.addListener(w,"change",function(){w.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),C=document.createElement("input");C.style.marginTop=
+"16px";C.style.marginRight="8px";C.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||C.setAttribute("disabled","disabled");b&&(c.appendChild(C),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),p+=26);var G=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=l),I=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,I?mxResources.get("allPages"):"",I,!I,null,"jpeg"!=l);K.style.marginLeft="24px";K.style.marginBottom="16px";I||(K.style.visibility=
+"hidden");mxEvent.addListener(G,"change",function(){G.checked&&I?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});k&&I||K.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=n.value;e(n.value,t.checked,!w.checked,H.checked,G.checked,C.checked,u.value,y.checked,!K.checked)}),null,g,d);this.showDialog(a.container,320,p,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,g,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var k=this.addCheckbox(c,mxResources.get("fit"),!0),q=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&d,
+!d),l=this.addCheckbox(c,g),p=this.addCheckbox(c,mxResources.get("lightbox"),!0),m=this.addEditButton(c,p),n=m.getEditInput(),u=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(c,mxResources.get("layers"),u,!u);F.style.marginLeft=n.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(u&&F.removeAttribute("disabled"),n.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled"));
+n.checked&&p.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(k.checked,q.checked,l.checked,p.checked,m.getLink(),F.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,h,k,l,m){function c(b){var c=" ",g="";e&&(c=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(h?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var q="";d&&(q=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');l('<img src="'+b+'"'+q+(""!=g?' style="'+g+'"':"")+c+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){m({message:mxResources.get("unknownError")})}),
+null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?c("data:image/png;base64,"+p.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,d,e,h,k,l){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var m=" ",n="";e&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(h?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",n+="cursor:pointer;");a&&(n+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){l('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=n?' style="'+n+'"':"")+m+"/>")}))}else n="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(h?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),n+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),n+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=n&&c.setAttribute("style",n),l(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+
" "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var f=a.getElementsByTagName("diagram");if(0<
-f.length){var c=f[0],d=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:d.apply(this,arguments)}}}null!=c&&(f=b.decompress(mxUtils.getTextContent(c)),null!=f&&0<f.length&&(a=mxUtils.parseXml(f).documentElement))}f=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(u){}finally{this.editor.graph=f}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph,
+f.length){var c=f[0],d=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:d.apply(this,arguments)}}}null!=c&&(f=b.decompress(mxUtils.getTextContent(c)),null!=f&&0<f.length&&(a=mxUtils.parseXml(f).documentElement))}f=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(t){}finally{this.editor.graph=f}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph,
f=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),f=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),e=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container);
-c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(p){null!=b&&b(p)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg=
+c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(q){null!=b&&b(q)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg=
function(a,b,d,e,h,k,l){l=b.background;l==mxConstants.NONE&&(l=null);b=b.getSvg(l,null,null,null,null,k);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=h)this.convertImages(b,mxUtils.bind(this,function(a){h((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
-mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,h,k,l,m,n){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,h?this.getFileData(!0,null,null,null,d,m):null,n)}catch(z){"Invalid image"==z.message?this.downloadFile(n):this.handleError(z)}}),null,
-this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,k,l)}catch(w){this.spinner.stop(),this.handleError(w)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[c[0]],g=1;g<c.length;g++){var h=
-c[g].indexOf(")");f.push('url("');f.push(e[b(c[g].substring(0,h))]);f.push('"'+c[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<c.length)for(var k=1;k<c.length;k++){var l=c[k].indexOf(")"),m=null,p=c[k].indexOf("format(",l);0<p&&(m=b(c[k].substring(p+7,c[k].indexOf(")",p))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b=
+mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,h,k,l,m,n){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,h?this.getFileData(!0,null,null,null,d,m):null,n)}catch(x){"Invalid image"==x.message?this.downloadFile(n):this.handleError(x)}}),null,
+this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,k,l)}catch(v){this.spinner.stop(),this.handleError(v)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[c[0]],g=1;g<c.length;g++){var h=
+c[g].indexOf(")");f.push('url("');f.push(e[b(c[g].substring(0,h))]);f.push('"'+c[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<c.length)for(var k=1;k<c.length;k++){var l=c[k].indexOf(")"),m=null,q=c[k].indexOf("format(",l);0<q&&(m=b(c[k].substring(q+7,c[k].indexOf(")",q))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b=
"application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;h()}),mxUtils.bind(this,
-function(a){d--;h()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[k].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,h,k,l,m,n,p,w,z,D,A){k=null!=k?k:!0;z=null!=z?z:this.editor.graph;D=null!=D?D:0;var c=n?null:z.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==n&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(z.getSvg(c,null,null,A,null,null!=l?l:!0),mxUtils.bind(this,function(f){var d=new Image;d.onload=mxUtils.bind(this,
-function(){try{var e=document.createElement("canvas"),g=parseInt(f.getAttribute("width")),p=parseInt(f.getAttribute("height"));m=null!=m?m:1;null!=b&&(m=k?Math.min(1,Math.min(3*b/(4*p),b/g)):b/g);g=Math.ceil(m*g)+2*D;p=Math.ceil(m*p)+2*D;e.setAttribute("width",g);e.setAttribute("height",p);var l=e.getContext("2d");null!=c&&(l.beginPath(),l.rect(0,0,g,p),l.fillStyle=c,l.fill());l.scale(m,m);l.drawImage(d,D/m,D/m);a(e)}catch(R){null!=h&&h(R)}});d.onerror=function(a){null!=h&&h(a)};try{p&&this.editor.graph.addSvgShadow(f);
-var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;f.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(z,f,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(f))}))});this.loadFonts(e)}catch(B){null!=h&&h(B)}}),d,w)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
-a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var h=a.getElementsByTagName(d),p=0;p<h.length;p++)mxUtils.bind(this,function(d){var h=
-e.convert(d.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var p=f[h];null==p?(c++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,p)}})(h[p])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,h,k){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);h=null!=h?h:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
+function(a){d--;h()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[k].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,h,k,l,m,n,q,v,x,z,A){k=null!=k?k:!0;x=null!=x?x:this.editor.graph;z=null!=z?z:0;var c=n?null:x.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==n&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(x.getSvg(c,null,null,A,null,null!=l?l:!0),mxUtils.bind(this,function(f){var d=new Image;d.onload=mxUtils.bind(this,
+function(){try{var e=document.createElement("canvas"),g=parseInt(f.getAttribute("width")),q=parseInt(f.getAttribute("height"));m=null!=m?m:1;null!=b&&(m=k?Math.min(1,Math.min(3*b/(4*q),b/g)):b/g);g=Math.ceil(m*g)+2*z;q=Math.ceil(m*q)+2*z;e.setAttribute("width",g);e.setAttribute("height",q);var l=e.getContext("2d");null!=c&&(l.beginPath(),l.rect(0,0,g,q),l.fillStyle=c,l.fill());l.scale(m,m);l.drawImage(d,z/m,z/m);a(e)}catch(P){null!=h&&h(P)}});d.onerror=function(a){null!=h&&h(a)};try{q&&this.editor.graph.addSvgShadow(f);
+var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;f.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(x,f,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(f))}))});this.loadFonts(e)}catch(C){null!=h&&h(C)}}),d,v)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
+a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var h=a.getElementsByTagName(d),q=0;q<h.length;q++)mxUtils.bind(this,function(d){var h=
+e.convert(d.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var q=f[h];null==q?(c++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,q)}})(h[q])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,h,k){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);h=null!=h?h:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}k=null!=k?k:"data:image/png;base64,";f=k+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,
-function(){h&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(v){null!=d&&d(v)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=
-function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,h){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var p=k.getElementsByTagName("diagram");
-if(1==p.length)k=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=k&&"mxGraphModel"===k.nodeName&&(c=f.importGraphModel(k,b,d,e))}}catch(D){throw h||this.handleError(D,mxResources.get("invalidOrMissingFile")),
-D;}return c};EditorUi.prototype.importLucidChart=function(a,b,d,e,h){var c=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,h)}catch(x){this.handleError(x)}finally{null!=h&&h()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,h){h=JSON.parse(a);a=
+function(){h&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(B){null!=d&&d(B)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=
+function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,h){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var q=k.getElementsByTagName("diagram");
+if(1==q.length)k=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(q[0]))).documentElement;else if(1<q.length){f.model.beginUpdate();try{for(a=0;a<q.length;a++){var l=this.updatePageRoot(new DiagramPage(q[a])),p=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[p+1]));f.model.execute(new ChangePage(this,l,l,p))}}finally{f.model.endUpdate()}}}null!=k&&"mxGraphModel"===k.nodeName&&(c=f.importGraphModel(k,b,d,e))}}catch(z){throw h||this.handleError(z,mxResources.get("invalidOrMissingFile")),
+z;}return c};EditorUi.prototype.importLucidChart=function(a,b,d,e,h){var c=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,h)}catch(w){this.handleError(w)}finally{null!=h&&h()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,h){h=JSON.parse(a);a=
[];if(null!=h.state){h=JSON.parse(h.state);for(var c in h.Pages)a.push(h.Pages[c]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(h);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=
function(a,b,d,e,h,k,l){k=null!=k?k:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(h||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=
-this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,k,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,k,!0),0<g.length)return g}catch(w){}this.loadImage(a,mxUtils.bind(this,
+this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,k,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,k,!0),0<g.length)return g}catch(v){}this.loadImage(a,mxUtils.bind(this,
function(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);c.setSelectionCell(c.insertVertex(null,
null,"",c.snap(b),c.snap(d),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
if(this.isCompatibleString(a))return this.importXml(a,b,d,k);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,k);else{c=this.editor.graph;h=null;c.getModel().beginUpdate();try{h=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[h])),h.value=a,c.updateCellSize(h),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(h.value)&&
c.setLinkForCell(h,h.value),h.geometry.width+=c.gridSize,h.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[h]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=
-function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,d,e,h,k,l,m,n,p,w){p=null!=p?p:!0;var c=!1,f=null;"image"==b.substring(0,5)?(n=!1,"image/png"==b.substring(0,9)&&(b=w?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,p),n=!0)),n||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
-1))),p&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,h,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,p);null!=m&&m(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(c=!0,this.parseFile(null!=
-n?n:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,l))):b=this.importXml(a,d,e,p));null!=m&&m(b)}}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,p));c||null==m||m(f);return f};
+function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,d,e,h,k,l,m,n,q,v){q=null!=q?q:!0;var c=!1,f=null;"image"==b.substring(0,5)?(n=!1,"image/png"==b.substring(0,9)&&(b=v?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,q),n=!0)),n||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
+1))),q&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,h,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,q);null!=m&&m(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(c=!0,this.parseFile(null!=
+n?n:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,l))):b=this.importXml(a,d,e,q));null!=m&&m(b)}}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,q));c||null==m||m(f);return f};
EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,h,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}h=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&
240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};
-EditorUi.prototype.importFiles=function(a,b,d,e,h,k,l,m,n,p,w,z){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;p=null!=p?p:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var t=w||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>t){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,n=g.gridSize;h=null!=h?h:mxUtils.bind(this,function(a,b,f,d,e,g,h,p,k){return null!=a&&"<mxlibrary"==a.substring(0,
-10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,f,d,e,g,h,p,k,c,z)});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var t=a.length,q=t,u=[],v=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(u);else{var c=[];g.getModel().beginUpdate();try{for(var f=0;f<u.length;f++){var d=u[f]();null!=d&&(c=c.concat(d))}}finally{g.getModel().endUpdate()}}k(c)}}),
-x=0;x<t;x++)mxUtils.bind(this,function(c){var k=a[c],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var m=a.target.result,t=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(t+1)))),u=mxUtils.parseXml(q),q=u.getElementsByTagName("svg");if(0<q.length){var q=q[0],B=z?null:q.getAttribute("content");null!=B&&"<"!=B.charAt(0)&&"%"!=B.charAt(0)&&(B=unescape(window.atob?atob(B):Base64.decode(B,!0)));
-null!=B&&"%"==B.charAt(0)&&(B=decodeURIComponent(B));null==B||"<mxfile "!==B.substring(0,8)&&"<mxGraphModel "!==B.substring(0,14)?v(c,mxUtils.bind(this,function(){try{if(m.substring(0,t+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var f=a[0],p=parseFloat(f.getAttribute("width")),l=parseFloat(f.getAttribute("height")),q=f.getAttribute("viewBox");if(null==q||0==q.length)f.setAttribute("viewBox","0 0 "+p+" "+l);else if(isNaN(p)||isNaN(l)){var w=q.split(" ");3<w.length&&(p=parseFloat(w[2]),
-l=parseFloat(w[3]))}m=this.createSvgDataUri(mxUtils.getXml(f));var B=Math.min(1,Math.min(e/Math.max(1,p)),e/Math.max(1,l)),z=h(m,k.type,b+c*n,d+c*n,Math.max(1,Math.round(p*B)),Math.max(1,Math.round(l*B)),k.name);if(isNaN(p)||isNaN(l)){var G=new Image;G.onload=mxUtils.bind(this,function(){p=Math.max(1,G.width);l=Math.max(1,G.height);z[0].geometry.width=p;z[0].geometry.height=l;f.setAttribute("viewBox","0 0 "+p+" "+l);m=this.createSvgDataUri(mxUtils.getXml(f));var a=m.indexOf(";");0<a&&(m=m.substring(0,
-a)+m.substring(m.indexOf(",",a+1)));g.setCellStyles("image",m,[z[0]])});G.src=this.createSvgDataUri(mxUtils.getXml(f))}return z}}}catch(Z){}return null})):v(c,mxUtils.bind(this,function(){return h(B,"text/xml",b+c*n,d+c*n,0,0,k.name)}))}}else{q=!1;if("image/png"==k.type){var G=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=G&&0<G.length){var x=new Image;x.src=a.target.result;v(c,mxUtils.bind(this,function(){return h(G,"text/xml",b+c*n,d+c*n,x.width,x.height,k.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?
-(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,l,m){v(c,mxUtils.bind(this,function(){if(null!=g&&g.length<p){var t=f&&this.isResampleImage(a.target.result,w)?Math.min(1,
-Math.min(e/l,e/m)):1;return h(g,k.type,b+c*n,d+c*n,Math.round(l*t),Math.round(m*t),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,w)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else h(a.target.result,k.type,b+c*n,d+c*n,240,160,k.name,function(a){v(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(k.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(k,
-mxUtils.bind(this,function(a){v(c,mxUtils.bind(this,function(){var b=k.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(k,mxUtils.bind(this,function(a){v(c,mxUtils.bind(this,function(){return this.importXml(a,b+c*n,d+c*n)}))})):h(null,k.type,b+c*n,d+c*n,240,160,k.name,function(a){v(c,function(){return a})},k):"image"==k.type.substring(0,5)?m.readAsDataURL(k):
-m.readAsText(k)})(x)});g?this.confirmImageResize(function(a){f=a;u()},n):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(f,d){if(f||b)mxSettings.setResizeImages(f?d:null),mxSettings.save();c();a(d)};null==f||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){d(a,!0)},
+EditorUi.prototype.importFiles=function(a,b,d,e,h,k,l,m,n,q,v,x){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;q=null!=q?q:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=v||this.resampleThreshold,u=0;u<a.length;u++)if("image/"==a[u].type.substring(0,6)&&a[u].size>p){g=!0;break}var t=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;h=null!=h?h:mxUtils.bind(this,function(a,b,f,d,e,g,h,q,k){return null!=a&&"<mxlibrary"==a.substring(0,
+10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,f,d,e,g,h,q,k,c,x)});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,u=n,t=[],w=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--u){this.spinner.stop();if(null!=m)m(t);else{var c=[];g.getModel().beginUpdate();try{for(var f=0;f<t.length;f++){var d=t[f]();null!=d&&(c=c.concat(d))}}finally{g.getModel().endUpdate()}}k(c)}}),
+z=0;z<n;z++)mxUtils.bind(this,function(c){var k=a[c],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var m=a.target.result,n=m.indexOf(","),u=decodeURIComponent(escape(atob(m.substring(n+1)))),t=mxUtils.parseXml(u),u=t.getElementsByTagName("svg");if(0<u.length){var u=u[0],C=x?null:u.getAttribute("content");null!=C&&"<"!=C.charAt(0)&&"%"!=C.charAt(0)&&(C=unescape(window.atob?atob(C):Base64.decode(C,!0)));
+null!=C&&"%"==C.charAt(0)&&(C=decodeURIComponent(C));null==C||"<mxfile "!==C.substring(0,8)&&"<mxGraphModel "!==C.substring(0,14)?w(c,mxUtils.bind(this,function(){try{if(m.substring(0,n+1),null!=t){var a=t.getElementsByTagName("svg");if(0<a.length){var f=a[0],q=parseFloat(f.getAttribute("width")),l=parseFloat(f.getAttribute("height")),v=f.getAttribute("viewBox");if(null==v||0==v.length)f.setAttribute("viewBox","0 0 "+q+" "+l);else if(isNaN(q)||isNaN(l)){var u=v.split(" ");3<u.length&&(q=parseFloat(u[2]),
+l=parseFloat(u[3]))}m=this.createSvgDataUri(mxUtils.getXml(f));var C=Math.min(1,Math.min(e/Math.max(1,q)),e/Math.max(1,l)),x=h(m,k.type,b+c*p,d+c*p,Math.max(1,Math.round(q*C)),Math.max(1,Math.round(l*C)),k.name);if(isNaN(q)||isNaN(l)){var I=new Image;I.onload=mxUtils.bind(this,function(){q=Math.max(1,I.width);l=Math.max(1,I.height);x[0].geometry.width=q;x[0].geometry.height=l;f.setAttribute("viewBox","0 0 "+q+" "+l);m=this.createSvgDataUri(mxUtils.getXml(f));var a=m.indexOf(";");0<a&&(m=m.substring(0,
+a)+m.substring(m.indexOf(",",a+1)));g.setCellStyles("image",m,[x[0]])});I.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(aa){}return null})):w(c,mxUtils.bind(this,function(){return h(C,"text/xml",b+c*p,d+c*p,0,0,k.name)}))}}else{u=!1;if("image/png"==k.type){var I=x?null:this.extractGraphModelFromPng(a.target.result);if(null!=I&&0<I.length){var z=new Image;z.src=a.target.result;w(c,mxUtils.bind(this,function(){return h(I,"text/xml",b+c*p,d+c*p,z.width,z.height,k.name)}));u=!0}}u||(mxClient.IS_CHROMEAPP?
+(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,l,m){w(c,mxUtils.bind(this,function(){if(null!=g&&g.length<q){var n=f&&this.isResampleImage(a.target.result,v)?Math.min(1,
+Math.min(e/l,e/m)):1;return h(g,k.type,b+c*p,d+c*p,Math.round(l*n),Math.round(m*n),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,v)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else h(a.target.result,k.type,b+c*p,d+c*p,240,160,k.name,function(a){w(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(k.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(k,
+mxUtils.bind(this,function(a){w(c,mxUtils.bind(this,function(){var b=k.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(k,mxUtils.bind(this,function(a){w(c,mxUtils.bind(this,function(){return this.importXml(a,b+c*p,d+c*p)}))})):h(null,k.type,b+c*p,d+c*p,240,160,k.name,function(a){w(c,function(){return a})},k):"image"==k.type.substring(0,5)?m.readAsDataURL(k):
+m.readAsText(k)})(z)});g?this.confirmImageResize(function(a){f=a;t()},n):t()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(f,d){if(f||b)mxSettings.setResizeImages(f?d:null),mxSettings.save();c();a(d)};null==f||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){d(a,!0)},
function(a){d(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):d(!1,f)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=
-function(){b(f)};f.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,h,k){h=null!=h?h:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,k))try{var g=Math.max(c/h,f/h);if(1<g){var p=Math.round(c/g),l=Math.round(f/g),m=document.createElement("canvas");m.width=p;m.height=l;m.getContext("2d").drawImage(a,0,0,p,l);var n=m.toDataURL();if(n.length<b.length){var t=
-document.createElement("canvas");t.width=p;t.height=l;var q=t.toDataURL();n!==q&&(b=n,c=p,f=l)}}}catch(E){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var b=d,h=0;8>h;h++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[d]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,h){function c(a,b){var c=k;k+=b;return a.substring(c,k)}
-function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=h&&h();else if(c(a,4),"IHDR"!=c(a,4))null!=h&&h();else{c(a,17);h=a.substring(0,k);do{var p=f(a);if("IDAT"==c(a,4)){h=a.substring(0,k-8);d=d+String.fromCharCode(0)+
-("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);h+=g(d.length)+b+d+g(e^4294967295);h+=a.substring(k-8,a.length);break}h+=a.substring(k-8,k-4+p);c(a,p);c(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(h):Base64.encode(h,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
-function(a,c,f){a=d.substring(a+8,a+8+f);"zTXt"==c?(f=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,f)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(f+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(q){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=
-function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph,e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
-b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var h=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};h.call(this,b,c,e)};k.apply(this,arguments);
-mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var l=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:l.apply(this,
+function(){b(f)};f.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,h,k){h=null!=h?h:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,k))try{var g=Math.max(c/h,f/h);if(1<g){var q=Math.round(c/g),l=Math.round(f/g),m=document.createElement("canvas");m.width=q;m.height=l;m.getContext("2d").drawImage(a,0,0,q,l);var p=m.toDataURL();if(p.length<b.length){var n=
+document.createElement("canvas");n.width=q;n.height=l;var u=n.toDataURL();p!==u&&(b=p,c=q,f=l)}}}catch(F){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var b=e,h=0;8>h;h++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[e]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,h){function c(a,b){var c=k;k+=b;return a.substring(c,k)}
+function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=h&&h();else if(c(a,4),"IHDR"!=c(a,4))null!=h&&h();else{c(a,17);h=a.substring(0,k);do{var q=f(a);if("IDAT"==c(a,4)){h=a.substring(0,k-8);d=d+String.fromCharCode(0)+
+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);h+=g(d.length)+b+d+g(e^4294967295);h+=a.substring(k-8,a.length);break}h+=a.substring(k-8,k-4+q);c(a,q);c(a,4)}while(q);return"data:image/png;base64,"+(window.btoa?btoa(h):Base64.encode(h,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
+function(a,c,f){a=d.substring(a+8,a+8+f);"zTXt"==c?(f=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,f)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(f+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=
+function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph,e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
+b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var h=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};h.call(this,b,c,e)};l.apply(this,arguments);
+mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:k.apply(this,
arguments)};var m=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var h=c.indexOf(",");0<h&&(h=b.getPageById(c.substring(h+1)),e=null!=h?h.getName():mxResources.get("pageNotFound"))}h=m.call(this,c,e);f&&mxEvent.addListener(h,"click",function(b){a(c);mxEvent.consume(b)});return h};var n=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");null==f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?n.apply(this,arguments):
-(d.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var v=this.actions.get("print");v.setEnabled(!mxClient.IS_IOS||!navigator.standalone);v.visible=v.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){w.innerHTML="&nbsp;";w.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
+(d.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var B=this.actions.get("print");B.setEnabled(!mxClient.IS_IOS||!navigator.standalone);B.visible=B.isEnabled();if(!this.editor.chromeless||this.editor.editable){var q=function(){window.setTimeout(function(){v.innerHTML="&nbsp;";v.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||d.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,
-d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var h=f[index];if("file"===h.kind){if(b.isEditing())this.importFiles([h.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var g=this.editor.graph.getInsertPoint();this.importFiles([h.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(T){}}),
-!1);var w=document.createElement("div");w.style.position="absolute";w.style.whiteSpace="nowrap";w.style.overflow="hidden";w.style.display="block";w.contentEditable=!0;mxUtils.setOpacity(w,0);w.style.width="1px";w.style.height="1px";w.innerHTML="&nbsp;";var z=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||
-d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||z||(w.style.left=d.container.scrollLeft+10+"px",w.style.top=d.container.scrollTop+10+"px",d.container.appendChild(w),z=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){w.focus();document.execCommand("selectAll",!1,null)},0):(w.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
-function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!z||224!=b&&17!=b&&91!=b||(z=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),w.parentNode.removeChild(w))}),0)}));mxEvent.addListener(w,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(w),p())}));mxEvent.addListener(w,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(w,!0),p())}));mxEvent.addListener(w,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&
-!d.isCellLocked(d.getDefaultParent())&&(w.innerHTML="&nbsp;",w.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,w);w.innerHTML="&nbsp;"}),0))}),!0);var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==w?!0:D.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
+d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var h=f[index];if("file"===h.kind){if(b.isEditing())this.importFiles([h.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var g=this.editor.graph.getInsertPoint();this.importFiles([h.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(R){}}),
+!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace="nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,0);v.style.width="1px";v.style.height="1px";v.innerHTML="&nbsp;";var x=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||
+d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||x||(v.style.left=d.container.scrollLeft+10+"px",v.style.top=d.container.scrollTop+10+"px",d.container.appendChild(v),x=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll",!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
+function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!x||224!=b&&17!=b&&91!=b||(x=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),v.parentNode.removeChild(v))}),0)}));mxEvent.addListener(v,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(v),q())}));mxEvent.addListener(v,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(v,!0),q())}));mxEvent.addListener(v,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&
+!d.isCellLocked(d.getDefaultParent())&&(v.innerHTML="&nbsp;",v.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,v);v.innerHTML="&nbsp;"}),0))}),!0);var z=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==v?!0:z.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),
d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=
Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));
-a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){v=document.createElement("div");v.style.position="absolute";v.style.top="95px";v.style.left="250px";v.style.width="2000px";v.style.height="30px";v.style.background="whiteSmoke";document.body.appendChild(v);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);
-var F=document.createElement("div");F.style.position="absolute";F.style.top="95px";F.style.left="220px";F.style.width="30px";F.style.height="30px";F.style.background="whiteSmoke";document.body.appendChild(F);this.vRuler=new mxRuler(this.editor.graph,A,!0);this.hRuler=new mxRuler(this.editor.graph,v,!1)}if("1"==urlParams.test){v=document.getElementById("geFooter");null!=v&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
-this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),v.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
-this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}v=document.getElementById("geInfo");null!=v&&v.parentNode.removeChild(v);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(d.container,
-"dragleave",function(a){d.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(a){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(a){null!=C&&(C.parentNode.removeChild(C),C=null);if(d.isEnabled()){var b=
+a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="250px";B.style.width="2000px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);
+var E=document.createElement("div");E.style.position="absolute";E.style.top="95px";E.style.left="220px";E.style.width="30px";E.style.height="30px";E.style.background="whiteSmoke";document.body.appendChild(E);this.vRuler=new mxRuler(this.editor.graph,A,!0);this.hRuler=new mxRuler(this.editor.graph,B,!1)}if("1"==urlParams.test){B=document.getElementById("geFooter");null!=B&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
+this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),B.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
+this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}B=document.getElementById("geInfo");null!=B&&B.parentNode.removeChild(B);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var D=null;mxEvent.addListener(d.container,
+"dragleave",function(a){d.isEnabled()&&(null!=D&&(D.parentNode.removeChild(D),D=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(a){null==D&&(!mxClient.IS_IE||10<document.documentMode)&&(D=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(a){null!=D&&(D.parentNode.removeChild(D),D=null);if(d.isEnabled()){var b=
mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,h=b.y/e-c.y;mxEvent.isAltDown(a)&&(h=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,h,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var g=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
-if(null!=b)d.setSelectionCells(this.importXml(b,f,h,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var p=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=p;var k=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(p=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(p)||(k=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(p=b[0].getAttribute("href")));var l=!0,m=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(p,
-f,h,!0,k,null,l))});k&&p.length>this.resampleThreshold?this.confirmImageResize(function(a){l=a;m()},mxEvent.isControlDown(a)):m()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,h,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+if(null!=b)d.setSelectionCells(this.importXml(b,f,h,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var q=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=q;var k=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(q=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(q)||(k=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(q=b[0].getAttribute("href")));var l=!0,m=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(q,
+f,h,!0,k,null,l))});k&&q.length>this.resampleThreshold?this.confirmImageResize(function(a){l=a;m()},mxEvent.isControlDown(a)):m()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,h,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
g+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(g,f,h,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,h,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);
mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),
e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&
-(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var h=e.lastIndexOf("%3E");0<=h&&h<e.length-3&&(e=e.substring(0,h+3))}catch(v){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e=k)}catch(v){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=
-e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};
+(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var h=e.lastIndexOf("%3E");0<=h&&h<e.length-3&&(e=e.substring(0,h+3))}catch(B){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e=k)}catch(B){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=
+e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(B){}}}}};
EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),
mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:
a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==
@@ -6756,8 +6760,8 @@ c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.
2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length)if(!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml"),Graph.fileSupport&&
!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml",this.parseFile(a,mxUtils.bind(this,function(a){if(4==a.readyState)if(this.spinner.stop(),200<=a.status&&299>=a.status)if(a=a.responseText,"<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);null!=e&&".vssx"==e.toLowerCase().substring(e.length-5)&&(e=e.substring(0,
-filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
-0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),
+filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
+0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(B){this.handleError(B,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),
this.openLocalFile(d,e,b)});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),
this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),
null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d);return b};EditorUi.prototype.addBasenamesForCell=function(a,
@@ -6766,40 +6770,41 @@ function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatCont
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
-h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var g=f.data;if("json"==urlParams.proto){try{g=
-JSON.parse(g)}catch(G){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();var l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
+h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(K){}return a}if(f.source==(window.opener||window.parent)){var g=f.data;if("json"==urlParams.proto){try{g=
+JSON.parse(g)}catch(I){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();var l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){l=null;l="data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):h(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,
-function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(G){k.postMessage(JSON.stringify({event:"draft",
-error:G.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
-return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var m=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&
-null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var t=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(n);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
-g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var t=this.createTemporaryGraph(t.getStylesheet()),x=t.getGlobalVariable,y=this.pages[0];t.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,
-function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);m=this.createLoadMessage("export");
-if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";
-if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
-this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&
-(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
-l),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{a(g,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var B=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
-e=B();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=B();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
-b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=
-function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
-"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
-mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
-(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,p=40,n=0,z=this.editor.graph;z.getGraphBounds();for(var D=function(){z.setSelectionCells(P);
-z.scrollCellToVisible(z.getSelectionCell())},A=z.getFreeInsertPoint(),F=A.x,E=A.y,A=E,C=null,H="auto",B=[],G=null,I=null,J=0;J<b.length&&"#"==b[J].charAt(0);){a=b[J];for(J++;J<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[J].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[J].substring(1)),J++;if("#"!=a.charAt(1)){var R=a.indexOf(":");if(0<R){var S=mxUtils.trim(a.substring(1,R)),O=mxUtils.trim(a.substring(R+1));"label"==S?C=z.sanitizeHtml(O):"style"==S?e=O:"identity"==S&&0<O.length&&"-"!=O?h=
-O:"width"==S?k=O:"height"==S?l=O:"ignore"==S?I=O.split(","):"connect"==S?B.push(JSON.parse(O)):"link"==S?G=O:"padding"==S?n=parseFloat(O):"edgespacing"==S?m=parseFloat(O):"nodespacing"==S?p=parseFloat(O):"layout"==S&&(H=O)}}}var T=this.editor.csvToArray(b[J]);a=null;if(null!=h)for(var L=0;L<T.length;L++)if(h==T[L]){a=L;break}null==C&&(C="%"+T[0]+"%");if(null!=B)for(var N=0;N<B.length;N++)null==d[B[N].to]&&(d[B[N].to]={});z.model.beginUpdate();try{for(L=J+1;L<b.length;L++){var U=this.editor.csvToArray(b[L]);
-if(U.length==T.length){var K=null,Y=null!=a?U[a]:null;null!=Y&&(K=z.model.getCell(Y));null==K&&(K=new mxCell(C,new mxGeometry(F,A,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=Y);for(var Q=0;Q<U.length;Q++)z.setAttributeForCell(K,T[Q],U[Q]);z.setAttributeForCell(K,"placeholders","1");K.style=z.replacePlaceholders(K,K.style);for(N=0;N<B.length;N++)d[B[N].to][K.getAttribute(B[N].to)]=K;null!=G&&"link"!=G&&(z.setLinkForCell(K,K.getAttribute(G)),z.setAttributeForCell(K,G,null));z.fireEvent(new mxEventObject("cellsInserted",
-"cells",[K]));var aa=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==k?aa.width+n:parseFloat(k);K.geometry.height="auto"==l?aa.height+n:parseFloat(l);A+=K.geometry.height+p;c.push(z.addCell(K))}}for(var W=c.slice(),P=c.slice(),N=0;N<B.length;N++)for(var M=B[N],L=0;L<c.length;L++){var K=c[L],X=K.getAttribute(M.from);if(null!=X){z.setAttributeForCell(K,M.from,null);for(var V=X.split(","),Q=0;Q<V.length;Q++){var ba=d[M.to][V[Q]];null!=ba&&(C=M.label,null!=M.fromlabel&&(C=(K.getAttribute(M.fromlabel)||
-"")+(C||"")),null!=M.tolabel&&(C=(C||"")+(ba.getAttribute(M.tolabel)||"")),P.push(z.insertEdge(null,null,C||"",M.invert?ba:K,M.invert?K:ba,M.style||z.createCurrentEdgeStyle())),mxUtils.remove(M.invert?K:ba,W))}}}if(null!=I)for(L=0;L<c.length;L++)for(K=c[L],Q=0;Q<I.length;Q++)z.setAttributeForCell(K,mxUtils.trim(I[Q]),null);var ca=new mxParallelEdgeLayout(z);ca.spacing=m;var ga=function(){ca.execute(z.getDefaultParent());for(var a=0;a<c.length;a++){var b=z.getCellGeometry(c[a]);b.x=Math.round(z.snap(b.x));
-b.y=Math.round(z.snap(b.y));"auto"==k&&(b.width=Math.round(z.snap(b.width)));"auto"==l&&(b.height=Math.round(z.snap(b.height)))}};if("circle"==H){var da=new mxCircleLayout(z);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(z.getDefaultParent());ga()},!0,D);D=null}else if("horizontaltree"==H||"verticaltree"==H||"auto"==H&&P.length==2*c.length-1&&1==W.length){z.view.validate();
-var ea=new mxCompactTreeLayout(z,"horizontaltree"==H);ea.levelDistance=p;ea.edgeRouting=!1;ea.resetEdges=!1;this.executeLayout(function(){ea.execute(z.getDefaultParent(),0<W.length?W[0]:null)},!0,D);D=null}else if("horizontalflow"==H||"verticalflow"==H||"auto"==H&&1==W.length){z.view.validate();var fa=new mxHierarchicalLayout(z,"horizontalflow"==H?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=p;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(z.getDefaultParent(),
-P);z.moveCells(P,F,E)},!0,D);D=null}else if("organic"==H||"auto"==H&&P.length>c.length){z.view.validate();var Z=new mxFastOrganicLayout(z);Z.forceConstant=3*p;Z.resetEdges=!1;var ia=Z.isVertexIgnored;Z.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(z);ca.spacing=m;this.executeLayout(function(){Z.execute(z.getDefaultParent());ga()},!0,D);D=null}this.hideDialog()}finally{z.model.endUpdate()}null!=D&&D()}}catch(ja){this.handleError(ja)}};
-EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
-d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
+function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(I){k.postMessage(JSON.stringify({event:"draft",
+error:I.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var l=1==g.enableRecent,m=1==g.enableSearch,l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=
+a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==g.action)this.searchReadyCallback(g.list,g.errorMsg);else if("recentDocsList"==
+g.action)this.recentReadyCallback(g.list,g.errorMsg);else{if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var n=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==g.action){if("png"==
+g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var p=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var t=this.editor.graph,u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(b),"*")}),w=mxUtils.bind(this,function(a){null==
+a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var t=this.createTemporaryGraph(t.getStylesheet()),y=t.getGlobalVariable,C=this.pages[0];t.getGlobalVariable=function(a){return"page"==a?C.getName():"pagenumber"==a?1:y.apply(this,arguments)};document.body.appendChild(t.container);
+t.model.setRoot(C.root)}this.exportToCanvas(mxUtils.bind(this,function(a){w(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){w(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):w(null)}),mxUtils.bind(this,function(){w(null)}))}}else{null!=
+g.xml&&0<g.xml.length&&this.setFileData(g.xml);n=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=g.format;else if("html"==g.format)p=this.editor.getGraphXml(),n.data=this.getHtml(p,this.editor.graph),n.xml=mxUtils.getXml(p),n.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
+l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),
+mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(n),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=
+g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
+this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}}g=h(g);c=!0;try{a(g,f)}catch(I){this.handleError(I)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var G=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
+1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=G();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=G();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
+b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):
+urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
+"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
+a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
+function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,q=40,n=0,x=this.editor.graph;x.getGraphBounds();
+for(var z=function(){x.setSelectionCells(U);x.scrollCellToVisible(x.getSelectionCell())},A=x.getFreeInsertPoint(),E=A.x,F=A.y,A=F,D=null,H="auto",C=[],G=null,I=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var S=mxUtils.trim(a.substring(1,P)),O=mxUtils.trim(a.substring(P+1));"label"==S?D=x.sanitizeHtml(O):"style"==
+S?e=O:"identity"==S&&0<O.length&&"-"!=O?h=O:"width"==S?k=O:"height"==S?l=O:"ignore"==S?I=O.split(","):"connect"==S?C.push(JSON.parse(O)):"link"==S?G=O:"padding"==S?n=parseFloat(O):"edgespacing"==S?m=parseFloat(O):"nodespacing"==S?q=parseFloat(O):"layout"==S&&(H=O)}}}var R=this.editor.csvToArray(b[K]);a=null;if(null!=h)for(var M=0;M<R.length;M++)if(h==R[M]){a=M;break}null==D&&(D="%"+R[0]+"%");if(null!=C)for(var J=0;J<C.length;J++)null==d[C[J].to]&&(d[C[J].to]={});x.model.beginUpdate();try{for(M=K+
+1;M<b.length;M++){var T=this.editor.csvToArray(b[M]);if(T.length==R.length){var L=null,X=null!=a?T[a]:null;null!=X&&(L=x.model.getCell(X));null==L&&(L=new mxCell(D,new mxGeometry(E,A,0,0),e||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=X);for(var N=0;N<T.length;N++)x.setAttributeForCell(L,R[N],T[N]);x.setAttributeForCell(L,"placeholders","1");L.style=x.replacePlaceholders(L,L.style);for(J=0;J<C.length;J++)d[C[J].to][L.getAttribute(C[J].to)]=L;null!=G&&"link"!=G&&(x.setLinkForCell(L,L.getAttribute(G)),
+x.setAttributeForCell(L,G,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var Y=this.editor.graph.getPreferredSizeForCell(L);L.geometry.width="auto"==k?Y.width+n:parseFloat(k);L.geometry.height="auto"==l?Y.height+n:parseFloat(l);A+=L.geometry.height+q;c.push(x.addCell(L))}}for(var V=c.slice(),U=c.slice(),J=0;J<C.length;J++)for(var Q=C[J],M=0;M<c.length;M++){var L=c[M],Z=L.getAttribute(Q.from);if(null!=Z){x.setAttributeForCell(L,Q.from,null);for(var W=Z.split(","),N=0;N<W.length;N++){var ba=
+d[Q.to][W[N]];null!=ba&&(D=Q.label,null!=Q.fromlabel&&(D=(L.getAttribute(Q.fromlabel)||"")+(D||"")),null!=Q.tolabel&&(D=(D||"")+(ba.getAttribute(Q.tolabel)||"")),U.push(x.insertEdge(null,null,D||"",Q.invert?ba:L,Q.invert?L:ba,Q.style||x.createCurrentEdgeStyle())),mxUtils.remove(Q.invert?L:ba,V))}}}if(null!=I)for(M=0;M<c.length;M++)for(L=c[M],N=0;N<I.length;N++)x.setAttributeForCell(L,mxUtils.trim(I[N]),null);var ca=new mxParallelEdgeLayout(x);ca.spacing=m;var ga=function(){ca.execute(x.getDefaultParent());
+for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==k&&(b.width=Math.round(x.snap(b.width)));"auto"==l&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==H){var da=new mxCircleLayout(x);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(x.getDefaultParent());ga()},!0,z);z=null}else if("horizontaltree"==H||
+"verticaltree"==H||"auto"==H&&U.length==2*c.length-1&&1==V.length){x.view.validate();var ea=new mxCompactTreeLayout(x,"horizontaltree"==H);ea.levelDistance=q;ea.edgeRouting=!1;ea.resetEdges=!1;this.executeLayout(function(){ea.execute(x.getDefaultParent(),0<V.length?V[0]:null)},!0,z);z=null}else if("horizontalflow"==H||"verticalflow"==H||"auto"==H&&1==V.length){x.view.validate();var fa=new mxHierarchicalLayout(x,"horizontalflow"==H?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=
+q;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),U);x.moveCells(U,E,F)},!0,z);z=null}else if("organic"==H||"auto"==H&&U.length>c.length){x.view.validate();var aa=new mxFastOrganicLayout(x);aa.forceConstant=3*q;aa.resetEdges=!1;var ia=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(x);ca.spacing=m;this.executeLayout(function(){aa.execute(x.getDefaultParent());ga()},!0,z);z=null}this.hideDialog()}finally{x.model.endUpdate()}null!=
+z&&z()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
+d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,h=b.outline;h.pageScale=e.pageScale;h.pageFormat=
-e.pageFormat;h.background=e.background;h.pageVisible=e.pageVisible;h.background=e.background;var f=mxUtils.getCurrentStyle(e.container);h.container.style.backgroundColor=f.backgroundColor;null!=e.view.backgroundPageShape&&null!=h.view.backgroundPageShape&&(h.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||
+a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
+e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||
c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
@@ -6807,10 +6812,10 @@ this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.is
"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b=
'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+
IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
-EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
+EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("rename").setEnabled(null!=d&&d.isRenamable());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());
-a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var m=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);m.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,k){var c=a.editor.graph;if("xml"==
+a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);n.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,k){var c=a.editor.graph;if("xml"==
d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,k)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),l=Math.floor(g.width*h/c.view.scale),m=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+
encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+m+"&border="+k+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
@@ -6822,27 +6827,27 @@ mxSettings.settings.version=mxSettings.currentVersion,localStorage.setItem(mxSet
mxSettings.settings.recentColors&&(mxSettings.settings.recentColors=[]),null==mxSettings.settings.libraries&&(mxSettings.settings.libraries=Sidebar.prototype.defaultEntries),null==mxSettings.settings.customLibraries&&(mxSettings.settings.customLibraries=Editor.defaultCustomLibraries),null==mxSettings.settings.ui&&(mxSettings.settings.ui=""),null==mxSettings.settings.formatWidth&&(mxSettings.settings.formatWidth=mxSettings.defaultFormatWidth),null!=mxSettings.settings.lastAlert&&delete mxSettings.settings.lastAlert,
null==mxSettings.settings.currentEdgeStyle?mxSettings.settings.currentEdgeStyle=Graph.prototype.defaultEdgeStyle:10>=mxSettings.settings.version&&(mxSettings.settings.currentEdgeStyle.orthogonalLoop=1,mxSettings.settings.currentEdgeStyle.jettySize="auto"),null==mxSettings.settings.currentVertexStyle&&(mxSettings.settings.currentVertexStyle=Graph.prototype.defaultVertexStyle),null==mxSettings.settings.createTarget&&(mxSettings.settings.createTarget=!1),null==mxSettings.settings.pageFormat&&(mxSettings.settings.pageFormat=
mxGraph.prototype.pageFormat),null==mxSettings.settings.search&&(mxSettings.settings.search=!0),null==mxSettings.settings.showStartScreen&&(mxSettings.settings.showStartScreen=!0),null==mxSettings.settings.gridColor&&(mxSettings.settings.gridColor=mxGraphView.prototype.gridColor),null==mxSettings.settings.autosave&&(mxSettings.settings.autosave=!0),null!=mxSettings.settings.scratchpadSeen&&delete mxSettings.settings.scratchpadSeen))},clear:function(){isLocalStorage&&localStorage.removeItem(mxSettings.key)}};
-("undefined"==typeof mxLoadSettings||mxLoadSettings)&&mxSettings.load();App=function(a,e,d){EditorUi.call(this,a,e,null!=d?d:"1"==urlParams.lightbox);mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
-(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,d,e){var b=null;try{b=window.open(a)}catch(n){}null==b||void 0===b?this.showDialog((new PopupDialog(this,a,d,e)).container,320,140,!0,!0):null!=d&&d()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.isOffline()||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");
+("undefined"==typeof mxLoadSettings||mxLoadSettings)&&mxSettings.load();App=function(a,d,e){EditorUi.call(this,a,d,null!=e?e:"1"==urlParams.lightbox);mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
+(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,d,e){var b=null;try{b=window.open(a)}catch(m){}null==b||void 0===b?this.showDialog((new PopupDialog(this,a,d,e)).container,320,140,!0,!0):null!=d&&d()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.isOffline()||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");
this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(b){null!=window.console&&console.log("Plugin Error:",b,App.DrawPlugins[a])}window.Draw.loadPlugin=mxUtils.bind(this,function(a){a(this)})}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";
App.MODE_GITHUB="github";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="https://unpkg.com/dropbox@2.5.13/dist/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL="https://js.live.net/v7.2/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.FOOTER_PLUGIN_URL="https://www.jgraph.com/drawio-footer.js";
App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",doors:"/plugins/doors.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",update:"/plugins/update.js",trees:"/plugins/trees/trees.js","import":"/plugins/import.js",
replay:"/plugins/replay.js",anon:"/plugins/anonymize.js",tr:"/plugins/trello.js"};
-App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var e=document.cookie.split(";"),d=0;d<e.length;d++){var b=mxUtils.trim(e[d]);if("MODE="==b.substring(0,5)){a=b.substring(5);break}}null!=a&&isLocalStorage&&(e=new Date,e.setYear(e.getFullYear()-1),document.cookie="MODE=; expires="+e.toUTCString(),localStorage.setItem(".mode",a))}return a};
+App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var d=document.cookie.split(";"),e=0;e<d.length;e++){var b=mxUtils.trim(d[e]);if("MODE="==b.substring(0,5)){a=b.substring(5);break}}null!=a&&isLocalStorage&&(d=new Date,d.setYear(d.getFullYear()-1),document.cookie="MODE=; expires="+d.toUTCString(),localStorage.setItem(".mode",a))}return a};
(function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode,null==App.mode&&(App.mode=App.getStoredMode())),null!=window.mxscript&&("1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&
-"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0,
-2)?(mxscript(App.DROPBOX_URL),mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=
-null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?(mxscript(App.TRELLO_JQUERY_URL),mxscript(App.TRELLO_URL)):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})();
-App.main=function(a,e){var d=null;EditorUi.enableLogging&&(window.onerror=function(a,b,e,h,k){try{if(a!=d&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){d=a;var c=new Image,f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";c.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+
-"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(e)+(null!=h?":colno:"+encodeURIComponent(h):"")+(null!=k&&null!=k.stack?"&stack="+encodeURIComponent(k.stack):"")}}catch(x){}});if(null!=window.mxscript){if("1"==urlParams.offline){mxscript("js/shapes.min.js");var b=document.createElement("iframe");b.setAttribute("width","0");b.setAttribute("height","0");b.setAttribute("src","offline.html");document.body.appendChild(b)}if("0"!=urlParams.plugins&&
-"1"!=urlParams.offline){var b=mxSettings.getPlugins(),h=urlParams.p;App.initPluginCallback();if(null!=h){var k="";"1"==urlParams.drawdev&&(k=document.location.protocol+"//drawhost.jgraph.com/");for(var l=h.split(";"),h=0;h<l.length;h++){var n=App.pluginRegistry[l[h]];null!=n?mxscript(k+n):null!=window.console&&console.log("Unknown plugin:",l[h])}}else"0"==urlParams.chrome||EditorUi.isElectronApp||mxscript(App.FOOTER_PLUGIN_URL);if(null!=b&&0<b.length&&"0"!=urlParams.plugins){k=window.location.protocol+
-"//"+window.location.host;l=!0;for(h=0;h<b.length&&l;h++)"/"!=b[h].charAt(0)&&b[h].substring(0,k.length)!=k&&(l=!1);if(l||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[b.join("\n")]).replace(/\\n/g,"\n")))for(h=0;h<b.length;h++)try{mxscript(b[h])}catch(m){}}}"function"===typeof window.DriveClient&&
-"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback"):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;b=mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,
-mxLanguage);mxUtils.getAll("1"!=urlParams.dev?[b]:[b,"dark"==uiTheme?STYLE_PATH+"/dark-default.xml":STYLE_PATH+"/default.xml"],function(b){mxResources.parse(b[0].getText());1<b.length&&(Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=b[1].getDocumentElement());b=null!=e?e():new App(new Editor("0"==urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||
-"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=
-urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?
-mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML=
-'Error loading page. <a href="javascript:void(0);" onclick="location.reload();">Please try refreshing.</a>'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
+"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js",null,null,null,mxClient.IS_SVG):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==
+window.location.hash.substring(0,2)?(mxscript(App.DROPBOX_URL),mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=
+null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?(mxscript(App.TRELLO_JQUERY_URL),mxscript(App.TRELLO_URL)):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})();
+App.main=function(a,d){var e=null;EditorUi.enableLogging&&(window.onerror=function(a,b,d,h,k){try{if(a!=e&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){e=a;var c=new Image,f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";c.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+
+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=h?":colno:"+encodeURIComponent(h):"")+(null!=k&&null!=k.stack?"&stack="+encodeURIComponent(k.stack):"")}}catch(w){}});if(null!=window.mxscript){if("1"==urlParams.offline){mxscript("js/shapes.min.js");var b=document.createElement("iframe");b.setAttribute("width","0");b.setAttribute("height","0");b.setAttribute("src","offline.html");document.body.appendChild(b)}if("0"!=urlParams.plugins&&
+"1"!=urlParams.offline){var b=mxSettings.getPlugins(),h=urlParams.p;App.initPluginCallback();if(null!=h){var l="";"1"==urlParams.drawdev&&(l=document.location.protocol+"//drawhost.jgraph.com/");for(var k=h.split(";"),h=0;h<k.length;h++){var m=App.pluginRegistry[k[h]];null!=m?mxscript(l+m):null!=window.console&&console.log("Unknown plugin:",k[h])}}else"0"==urlParams.chrome||EditorUi.isElectronApp||mxscript(App.FOOTER_PLUGIN_URL,null,null,null,mxClient.IS_SVG);if(null!=b&&0<b.length&&"0"!=urlParams.plugins){l=
+window.location.protocol+"//"+window.location.host;k=!0;for(h=0;h<b.length&&k;h++)"/"!=b[h].charAt(0)&&b[h].substring(0,l.length)!=l&&(k=!1);if(k||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[b.join("\n")]).replace(/\\n/g,"\n")))for(h=0;h<b.length;h++)try{mxscript(b[h])}catch(n){}}}"function"===
+typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;b=mxResources.getDefaultBundle(RESOURCE_BASE,
+mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage);mxUtils.getAll("1"!=urlParams.dev?[b]:[b,"dark"==uiTheme?STYLE_PATH+"/dark-default.xml":STYLE_PATH+"/default.xml"],function(b){mxResources.parse(b[0].getText());1<b.length&&(Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=b[1].getDocumentElement());b=null!=d?d():new App(new Editor("0"==urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&
+("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&
+("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||
+10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},
+function(){document.getElementById("geStatus").innerHTML='Error loading page. <a href="javascript:void(0);" onclick="location.reload();">Please try refreshing.</a>'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
App.prototype.chevronUpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUY1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NjA1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1RDUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1RTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg+qUokAAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAAL0lEQVR42mJgRgMMRAswMKAKMDDARBjg8lARBoR6KImkH0wTbygT6YaS4DmAAAMAYPkClOEDDD0AAAAASUVORK5CYII=":
IMAGE_PATH+"/chevron-up.png";
App.prototype.chevronDownImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUI1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NUM1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1OTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1QTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsCtve8AAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAALUlEQVR42mJgRgMMRAkwQEXBNAOcBSPhclB1cNVwfcxI+vEZykSpoSR6DiDAAF23ApT99bZ+AAAAAElFTkSuQmCC":IMAGE_PATH+
@@ -6852,116 +6857,116 @@ App.prototype.formatShowImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgo
App.prototype.formatHideImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdCREY5REI1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdCREY5REM1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0JERjlEOTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0JERjlEQTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqjT9SMAAAAGUExURQAAAP///6XZn90AAAACdFJOU/8A5bcwSgAAAB9JREFUeNpiYEQDDEQJMMABTAAmNdAC6A4j0XMAAQYAcbwA1Xvj1CgAAAAASUVORK5CYII=":IMAGE_PATH+
"/format-hide.png";App.prototype.fullscreenImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjgAAbGxAy4AEh5gNwBBGByoIBAIueBd12TUjqAAAAAElFTkSuQmCC":IMAGE_PATH+"/fullscreen.png";App.prototype.timeout=25E3;"1"!=urlParams.embed?App.prototype.menubarHeight=60:App.prototype.footerHeight=0;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(a){App.DrawPlugins.push(a)})};
App.prototype.init=function(){EditorUi.prototype.init.apply(this,arguments);this.defaultLibraryName=mxResources.get("untitledLibrary");this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);this.gitHub=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this);null!=this.gitHub&&this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()}));
-if("1"!=urlParams.embed||"1"==urlParams.od){var a=mxUtils.bind(this,function(){"undefined"!==typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=a)});a()}if("1"!=urlParams.embed||"1"==urlParams.tr){var e=mxUtils.bind(this,function(){"undefined"!==
-typeof window.Trello?(this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))):null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=e)});e()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var d=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,function(){this.drive=new DriveClient(this);
+if("1"!=urlParams.embed||"1"==urlParams.od){var a=mxUtils.bind(this,function(){"undefined"!==typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=a)});a()}if("1"!=urlParams.embed||"1"==urlParams.tr){var d=mxUtils.bind(this,function(){"undefined"!==
+typeof window.Trello?(this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))):null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=d)});d()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var e=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,function(){this.drive=new DriveClient(this);
"420247213240"==this.drive.appId&&this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&(a=document.getElementById("geFooterItem2"),null!=a&&(a.innerHTML='<a href="https://support.draw.io/display/DO/2014/11/27/Switching+application+in+Google+Drive" target="_blank" title="IMPORTANT NOTICE" >IMPORTANT NOTICE</a>'))}));this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries();
this.checkLicense()}));this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:client,drive-realtime,drive-share",mxUtils.bind(this,function(b){null!=gapi.drive&&null!=gapi.drive.realtime&&gapi.client.load("drive","v2",mxUtils.bind(this,function(){this.defineCustomObjects();gapi.auth.init(mxUtils.bind(this,function(){null!=gapi.client.drive&&a()}))}))})),window.DrawGapiClientCallback=null):a()}else null==
-window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=d)});d()}if("1"!=urlParams.embed||"1"==urlParams.db){var b=mxUtils.bind(this,function(){"function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose?(window.DrawDropboxClientCallback=null,this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))):null==window.DrawDropboxClientCallback&&
+window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=e)});e()}if("1"!=urlParams.embed||"1"==urlParams.db){var b=mxUtils.bind(this,function(){"function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose?(window.DrawDropboxClientCallback=null,this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))):null==window.DrawDropboxClientCallback&&
(window.DrawDropboxClientCallback=b)});b()}"1"!=urlParams.embed?(this.bg=this.createBackground(),document.body.appendChild(this.bg),this.diagramContainer.style.visibility="hidden",this.formatContainer.style.visibility="hidden",this.hsplit.style.display="none",this.sidebarContainer.style.display="none",this.sidebarFooterContainer.style.display="none","1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode):null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();
null!=this.menubar&&(this.buttonContainer=document.createElement("div"),this.buttonContainer.style.display="inline-block",this.buttonContainer.style.paddingRight="48px",this.buttonContainer.style.position="absolute",this.buttonContainer.style.right="0px",this.menubar.container.appendChild(this.buttonContainer));"atlas"==uiTheme&&null!=this.menubar&&(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display="none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",
IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.style.paddingTop="11px",this.icon.style.marginLeft="4px",this.icon.style.marginRight="6px",mxClient.IS_QUIRKS&&(this.icon.style.marginTop="12px"),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild))};
App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"cdn.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"jgraph.github.io"==window.location.hostname)};App.prototype.isLegacyDriveDomain=function(){return 0==urlParams.drive||"legacy.draw.io"==window.location.hostname};
-App.prototype.checkLicense=function(){var a=this.drive.getUser(),e=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=e){var d=e.lastIndexOf("@"),b=e;0<=d&&(b=e.substring(d+1));mxUtils.post("/license","domain="+encodeURIComponent(b)+"&email="+encodeURIComponent(e)+"&ds="+encodeURIComponent(a.displayName)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=a.getStatus()&&299>=a.getStatus()){var d=
-a.getText();if(0<d.length){var e=JSON.parse(d);null!=e&&this.handleLicense(e,b)}}}catch(n){}}))}};
-App.prototype.handleLicense=function(a,e){var d=document.getElementById("geFooter"),b=null;if(null!=d&&null!=a)if(b=a.expiry,null!=a.footer)d.innerHTML=decodeURIComponent(a.footer);else if(this.hideFooter(),null!=b&&"never"!=b){var h=new Date(Date.parse(b)),k=Math.round((h-Date.now())/864E5);if(90>k){var l="https://support.draw.io/display/DKB/draw.io+footer+state+that+license+is+expiring+on+Google+For+Work+account?domain="+encodeURIComponent(e);d.style.height="100%";d.style.margin="0px";d.style.display=
-"";0>k?(this.footerHeight=80,d.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert geBlink"><a href="'+l+'" style="padding-top:16px;" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseHasExpired",[e,h.toLocaleDateString()])+"</a></td></tr></table>"):(this.footerHeight=46,d.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert"><a href="'+
-l+'" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseWillExpire",[e,h.toLocaleDateString()])+"</a></td></tr></table>");this.refresh()}}return b};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.chromeless&&this.editor.graph.lightbox&&null==a.realtime?a.getData():this.getFileData(!0)};
+App.prototype.checkLicense=function(){var a=this.drive.getUser(),d=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=d){var e=d.lastIndexOf("@"),b=d;0<=e&&(b=d.substring(e+1));mxUtils.post("/license","domain="+encodeURIComponent(b)+"&email="+encodeURIComponent(d)+"&ds="+encodeURIComponent(a.displayName)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=a.getStatus()&&299>=a.getStatus()){var d=
+a.getText();if(0<d.length){var e=JSON.parse(d);null!=e&&this.handleLicense(e,b)}}}catch(m){}}))}};
+App.prototype.handleLicense=function(a,d){var e=document.getElementById("geFooter"),b=null;if(null!=e&&null!=a)if(b=a.expiry,null!=a.footer)e.innerHTML=decodeURIComponent(a.footer);else if(this.hideFooter(),null!=b&&"never"!=b){var h=new Date(Date.parse(b)),l=Math.round((h-Date.now())/864E5);if(90>l){var k="https://support.draw.io/display/DKB/draw.io+footer+state+that+license+is+expiring+on+Google+For+Work+account?domain="+encodeURIComponent(d);e.style.height="100%";e.style.margin="0px";e.style.display=
+"";0>l?(this.footerHeight=80,e.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert geBlink"><a href="'+k+'" style="padding-top:16px;" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseHasExpired",[d,h.toLocaleDateString()])+"</a></td></tr></table>"):(this.footerHeight=46,e.innerHTML='<table height="100%"><tr><td valign="middle" align="center" class="geStatusAlert"><a href="'+
+k+'" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top" style="margin-right:6px">'+mxResources.get("licenseWillExpire",[d,h.toLocaleDateString()])+"</a></td></tr></table>");this.refresh()}}return b};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.chromeless&&this.editor.graph.lightbox&&null==a.realtime?a.getData():this.getFileData(!0)};
App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);var a=this.getCurrentFile();this.actions.get("revisionHistory").setEnabled(null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile))};App.prototype.updateDraft=function(){isLocalStorage&&null!=localStorage&&localStorage.setItem(".draft",JSON.stringify({modified:(new Date).getTime(),data:this.getFileData()}))};App.prototype.getDraft=function(){return null};
-App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var e=this.getRecent();if(null==e)e=[];else for(var d=0;d<e.length;d++)e[d].id==a.id&&e.splice(d,1);null!=e&&(e.unshift(a),e=e.slice(0,5),localStorage.setItem(".recent",JSON.stringify(e)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(e){}return null}};
-App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(e){}};App.prototype.removeDraft=function(){if(isLocalStorage&&null!=localStorage&&"0"==urlParams.splash)try{localStorage.removeItem(".draft")}catch(a){}};
+App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var d=this.getRecent();if(null==d)d=[];else for(var e=0;e<d.length;e++)d[e].id==a.id&&d.splice(e,1);null!=d&&(d.unshift(a),d=d.slice(0,5),localStorage.setItem(".recent",JSON.stringify(d)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(d){}return null}};
+App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(d){}};App.prototype.removeDraft=function(){if(isLocalStorage&&null!=localStorage&&"0"==urlParams.splash)try{localStorage.removeItem(".draft")}catch(a){}};
App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var a=this.getCurrentFile();if(null!=a)if(a.constructor!=LocalFile||""!=a.getHash()||a.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.chromeless){if(a.constructor!=DriveFile&&a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
-App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.lightbox){var a=this.editor.appName,e=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=e&&(a=(null!=e.getTitle()?e.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],e,d=0;256>d;d++){e=d;for(var b=0;8>b;b++)e=e&1?3988292384^e>>>1:e>>>1;a[d]=e}return a};
-App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var e=-1,d=0;d<a.length;d++)e=e>>>8^this.crcTable[(e^a.charCodeAt(d))&255];return(e^-1)>>>0};
-App.prototype.getThumbnail=function(a,e){var d=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var b=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var b=this.createTemporaryGraph(b.getStylesheet()),h=b.getGlobalVariable,k=this.pages[0];b.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:h.apply(this,arguments)};document.body.appendChild(b.container);b.model.setRoot(k.root)}if(mxClient.IS_CHROMEAPP||!b.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
-function(a){b!=this.editor.graph&&b.container.parentNode.removeChild(b.container);e(a)}),a,this.thumbImageCache,"#ffffff",function(){e()},null,null,null,null,null,null,b),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var l=document.createElement("canvas"),n=b.getGraphBounds(),m=a/n.width,m=Math.min(1,Math.min(3*a/(4*n.height),m)),c=Math.floor(n.x),f=Math.floor(n.y);l.setAttribute("width",Math.ceil(m*(n.width+4)));l.setAttribute("height",Math.ceil(m*(n.height+4)));var g=l.getContext("2d");
-g.scale(m,m);g.translate(-c,-f);var t=b.background;if(null==t||""==t||t==mxConstants.NONE)t="#ffffff";g.save();g.fillStyle=t;g.fillRect(c,f,Math.ceil(n.width+4),Math.ceil(n.height+4));g.restore();var q=new mxJsCanvas(l),u=new mxAsyncCanvas(this.thumbImageCache);q.images=this.thumbImageCache.images;var x=new mxImageExport;x.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};x.drawText=function(a,
-b){};x.drawState(b.getView().getState(b.model.root),u);u.finish(mxUtils.bind(this,function(){x.drawState(b.getView().getState(b.model.root),q);b!=this.editor.graph&&b.container.parentNode.removeChild(b.container);e(l)}));d=!0}}catch(y){b!=this.editor.graph&&b.container.parentNode.removeChild(b.container)}return d};
+App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.lightbox){var a=this.editor.appName,d=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=d&&(a=(null!=d.getTitle()?d.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],d,e=0;256>e;e++){d=e;for(var b=0;8>b;b++)d=d&1?3988292384^d>>>1:d>>>1;a[e]=d}return a};
+App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var d=-1,e=0;e<a.length;e++)d=d>>>8^this.crcTable[(d^a.charCodeAt(e))&255];return(d^-1)>>>0};
+App.prototype.getThumbnail=function(a,d){var e=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var b=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var b=this.createTemporaryGraph(b.getStylesheet()),h=b.getGlobalVariable,l=this.pages[0];b.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:h.apply(this,arguments)};document.body.appendChild(b.container);b.model.setRoot(l.root)}if(mxClient.IS_CHROMEAPP||!b.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
+function(a){b!=this.editor.graph&&b.container.parentNode.removeChild(b.container);d(a)}),a,this.thumbImageCache,"#ffffff",function(){d()},null,null,null,null,null,null,b),e=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var k=document.createElement("canvas"),m=b.getGraphBounds(),n=a/m.width,n=Math.min(1,Math.min(3*a/(4*m.height),n)),c=Math.floor(m.x),f=Math.floor(m.y);k.setAttribute("width",Math.ceil(n*(m.width+4)));k.setAttribute("height",Math.ceil(n*(m.height+4)));var g=k.getContext("2d");
+g.scale(n,n);g.translate(-c,-f);var p=b.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";g.save();g.fillStyle=p;g.fillRect(c,f,Math.ceil(m.width+4),Math.ceil(m.height+4));g.restore();var u=new mxJsCanvas(k),t=new mxAsyncCanvas(this.thumbImageCache);u.images=this.thumbImageCache.images;var w=new mxImageExport;w.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};w.drawText=function(a,
+b){};w.drawState(b.getView().getState(b.model.root),t);t.finish(mxUtils.bind(this,function(){w.drawState(b.getView().getState(b.model.root),u);b!=this.editor.graph&&b.container.parentNode.removeChild(b.container);d(k)}));e=!0}}catch(y){b!=this.editor.graph&&b.container.parentNode.removeChild(b.container)}return e};
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
-(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(e,d){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(d)if(isLocalStorage)localStorage.setItem(".mode",e);else if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+1);document.cookie="MODE="+e+"; expires="+b.toUTCString()}null!=this.appIcon&&(b=this.getCurrentFile(),e=null!=b?b.getMode():null,e==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
-[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):e==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):e==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default"))}})();
-App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var e=this.getCurrentFile(),d=null!=e?e.getMode():null;d==App.MODE_GOOGLE?null!=e.desc&&null!=e.desc.mimeType?this.openLink("https://drive.google.com/drive/u/0/search?q=type:"+e.desc.mimeType+"&authuser=0"):null!=e.desc&&0<e.desc.parents.length?this.openLink("https://drive.google.com/drive/folders/"+e.desc.parents[0].id):this.openLink("https://drive.google.com/?authuser=0"):d==App.MODE_DROPBOX?this.openLink("https://www.dropbox.com/"):
-d==App.MODE_ONEDRIVE?this.openLink("https://onedrive.live.com/"):d==App.MODE_TRELLO?this.openLink("https://trello.com/"):d==App.MODE_GITHUB&&(null!=e&&e.constructor==GitHubFile?this.openLink(e.meta.html_url):this.openLink("https://github.com/"))}mxEvent.consume(a)};App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie="MODE=; expires="+a.toUTCString()}};
+(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(d,e){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(e)if(isLocalStorage)localStorage.setItem(".mode",d);else if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+1);document.cookie="MODE="+d+"; expires="+b.toUTCString()}null!=this.appIcon&&(b=this.getCurrentFile(),d=null!=b?b.getMode():null,d==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
+[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):d==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):d==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default"))}})();
+App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var d=this.getCurrentFile(),e=null!=d?d.getMode():null;e==App.MODE_GOOGLE?null!=d.desc&&null!=d.desc.mimeType?this.openLink("https://drive.google.com/drive/u/0/search?q=type:"+d.desc.mimeType+"&authuser=0"):null!=d.desc&&0<d.desc.parents.length?this.openLink("https://drive.google.com/drive/folders/"+d.desc.parents[0].id):this.openLink("https://drive.google.com/?authuser=0"):e==App.MODE_DROPBOX?this.openLink("https://www.dropbox.com/"):
+e==App.MODE_ONEDRIVE?this.openLink("https://onedrive.live.com/"):e==App.MODE_TRELLO?this.openLink("https://trello.com/"):e==App.MODE_GITHUB&&(null!=d&&d.constructor==GitHubFile?this.openLink(d.meta.html_url):this.openLink("https://github.com/"))}mxEvent.consume(a)};App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie="MODE=; expires="+a.toUTCString()}};
App.prototype.getDiagramId=function(){var a=window.location.hash;null!=a&&0<a.length&&(a=a.substring(1));return a};
-App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create;null!=a&&(a=decodeURIComponent(a));if(null!=a&&0<a.length&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)){var e=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(e.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b,e){this.spinner.stop();null==b&&(b=urlParams.title,e=!0,b=null!=b?decodeURIComponent(b):this.defaultFilename);0<(this.useCanvasForExport?
--1:".png"==b.substring(b.length-4))&&(b=b.substring(0,b.length-4)+".xml");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,b):new LocalFile(this,a,b,e))}))}}catch(d){}};
-App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:client,drive-realtime,drive-share",mxUtils.bind(this,function(e){null==gapi.drive||null==gapi.drive.realtime?(this.drive=this.mode=null,a()):gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null==gapi.client.drive&&(this.drive=this.mode=null);a()}))}))}))};
+App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create;null!=a&&(a=decodeURIComponent(a));if(null!=a&&0<a.length&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)){var d=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(d.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b,d){this.spinner.stop();null==b&&(b=urlParams.title,d=!0,b=null!=b?decodeURIComponent(b):this.defaultFilename);0<(this.useCanvasForExport?
+-1:".png"==b.substring(b.length-4))&&(b=b.substring(0,b.length-4)+".xml");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,b):new LocalFile(this,a,b,d))}))}}catch(e){}};
+App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:client,drive-realtime,drive-share",mxUtils.bind(this,function(d){null==gapi.drive||null==gapi.drive.realtime?(this.drive=this.mode=null,a()):gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null==gapi.client.drive&&(this.drive=this.mode=null);a()}))}))}))};
App.prototype.load=function(){if("1"!=urlParams.embed){if(this.spinner.spin(document.body,mxResources.get("starting"))){try{this.stateArg=null!=urlParams.state&&null!=this.drive?JSON.parse(decodeURIComponent(urlParams.state)):null}catch(a){}this.editor.graph.setEnabled(null!=this.getCurrentFile());null!=window.location.hash&&0!=window.location.hash.length||null==this.drive||null==this.stateArg||null==this.stateArg.userId||this.drive.setUserId(this.stateArg.userId);null!=urlParams.fileId?(window.location.hash=
"G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,function(){this.start()}))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})};
-App.prototype.showAlert=function(a){if(null!=a&&0<a.length){var e=document.createElement("div");e.className="geAlert";e.style.zIndex=2E9;e.style.left="50%";e.style.top="-100%";mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(e.style,"transition","all 1s ease");e.innerHTML=a;a=document.createElement("a");a.className="geAlertLink";a.style.textAlign="right";a.style.marginTop="20px";a.style.display="block";a.setAttribute("href","javascript:void(0);");a.setAttribute("title",
-mxResources.get("close"));a.innerHTML=mxResources.get("close");e.appendChild(a);mxEvent.addListener(a,"click",function(a){null!=e.parentNode&&(e.parentNode.removeChild(e),mxEvent.consume(a))});document.body.appendChild(e);window.setTimeout(function(){e.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(e.style,"transition","all 2s ease");e.style.opacity="0";window.setTimeout(function(){null!=e.parentNode&&e.parentNode.removeChild(e)},2E3)},15E3)}};
-App.prototype.start=function(){this.bg.parentNode.removeChild(this.bg);this.restoreLibraries();this.spinner.stop();try{if("1"!=urlParams.client&&"1"!=urlParams.embed&&mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{var b=this.getDiagramId(),d=this.getCurrentFile();null!=d&&d.getHash()==b||this.loadFile(b,!0)}catch(n){null!=document.body&&this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=
+App.prototype.showAlert=function(a){if(null!=a&&0<a.length){var d=document.createElement("div");d.className="geAlert";d.style.zIndex=2E9;d.style.left="50%";d.style.top="-100%";mxUtils.setPrefixedStyle(d.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(d.style,"transition","all 1s ease");d.innerHTML=a;a=document.createElement("a");a.className="geAlertLink";a.style.textAlign="right";a.style.marginTop="20px";a.style.display="block";a.setAttribute("href","javascript:void(0);");a.setAttribute("title",
+mxResources.get("close"));a.innerHTML=mxResources.get("close");d.appendChild(a);mxEvent.addListener(a,"click",function(a){null!=d.parentNode&&(d.parentNode.removeChild(d),mxEvent.consume(a))});document.body.appendChild(d);window.setTimeout(function(){d.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(d.style,"transition","all 2s ease");d.style.opacity="0";window.setTimeout(function(){null!=d.parentNode&&d.parentNode.removeChild(d)},2E3)},15E3)}};
+App.prototype.start=function(){this.bg.parentNode.removeChild(this.bg);this.restoreLibraries();this.spinner.stop();try{if("1"!=urlParams.client&&"1"!=urlParams.embed&&mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{var b=this.getDiagramId(),d=this.getCurrentFile();null!=d&&d.getHash()==b||this.loadFile(b,!0)}catch(m){null!=document.body&&this.handleError(m,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=
a?a.getHash():""}))}})),(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var a=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a=mxUtils.bind(this,function(a){"data:image/png;base64,"==a.substring(0,22)&&(a=this.extractGraphModelFromPng(a));var b=urlParams.title,b=null!=b?decodeURIComponent(b):
this.defaultFilename;a=new LocalFile(this,a,b,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(a.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(a);this.getCurrentFile().setModified(!this.editor.chromeless)}),b=window.opener||window.parent;if(b!=window){var d=urlParams.create;null!=d?a(b[decodeURIComponent(d)]):(d=urlParams.data,null!=d?a(decodeURIComponent(d)):this.installMessageHandler(mxUtils.bind(this,function(c,d){d.source==b&&a(c)})))}}else if(null==
-this.dialog)if("1"==urlParams.demo)d=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=d;else{d=!1;try{d=null!=window.opener&&null!=window.opener.openFile}catch(c){}if(d)this.spinner.spin(document.body,mxResources.get("loading"));else if(d=this.getDiagramId(),"0"!=urlParams.splash||null!=d&&0!=d.length)this.loadFile(this.getDiagramId());else{var e=this.getDraft(),m=null!=e?e.data:this.getFileData(),d=Editor.useLocalStorage;this.createFile(this.defaultFilename,
-m,null,null,null,null,null,!0);Editor.useLocalStorage=d;null!=e&&(d=this.getCurrentFile(),null!=d&&d.addUnsavedStatus())}}});null!=this.drive&&this.defineCustomObjects();var e=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=e&&0<e.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var d=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create",
+this.dialog)if("1"==urlParams.demo)d=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=d;else{d=!1;try{d=null!=window.opener&&null!=window.opener.openFile}catch(c){}if(d)this.spinner.spin(document.body,mxResources.get("loading"));else if(d=this.getDiagramId(),"0"!=urlParams.splash||null!=d&&0!=d.length)this.loadFile(this.getDiagramId());else{var e=this.getDraft(),n=null!=e?e.data:this.getFileData(),d=Editor.useLocalStorage;this.createFile(this.defaultFilename,
+n,null,null,null,null,null,!0);Editor.useLocalStorage=d;null!=e&&(d=this.getCurrentFile(),null!=d&&d.addUnsavedStatus())}}});null!=this.drive&&this.defineCustomObjects();var d=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=d&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var e=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create",
"title"]))}),b=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var b=urlParams.title,b=null!=b?decodeURIComponent(b):this.defaultFilename;a=this.getServiceCount(!0);var d=4>=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage;this.createFile(0<a.length?a:this.defaultFilename,this.getFileData(),null,
-null,null,null,null,!0);Editor.useLocalStorage=c}else this.createFile(a,this.getFileData(!0),null,b)}),null,null,null,null,"1"==urlParams.browser,null,null,!0,d);this.showDialog(b.container,380,a>d?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),e=decodeURIComponent(e);if("http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8))try{null!=window.opener&&null!=window.opener[e]?b(window.opener[e]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(h){this.handleError(h,
-mxResources.get("errorLoadingFile"))}else this.loadTemplate(e,function(a){b(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),d)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action&&null!=this.stateArg.ids&&(window.location.hash="G"+this.stateArg.ids[0]),(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?
+null,null,null,null,!0);Editor.useLocalStorage=c}else this.createFile(a,this.getFileData(!0),null,b)}),null,null,null,null,"1"==urlParams.browser,null,null,!0,d);this.showDialog(b.container,380,a>d?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),d=decodeURIComponent(d);if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{null!=window.opener&&null!=window.opener[d]?b(window.opener[d]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(h){this.handleError(h,
+mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(a){b(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),e)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action&&null!=this.stateArg.ids&&(window.location.hash="G"+this.stateArg.ids[0]),(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?
(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(h){this.handleError(h)}};
-App.prototype.showSplash=function(a){var e=this.getServiceCount(!0,!0),d=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>e||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=a)}),!0)});if(this.editor.chromeless)this.handleError({message:mxResources.get("noFileSelected")},
-mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(null==this.mode||a){a=4==e?2:3;var b=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();d()}),a);this.showDialog(b.container,3>a?260:300,4<=e?420:300,!0,!1);b.init()}else null==urlParams.create&&d()};
-App.prototype.addLanguageMenu=function(a,e){var d=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){d=document.createElement("div");d.setAttribute("title",mxResources.get("language"));d.className="geIcon geSprite geSprite-globe";d.style.position="absolute";d.style.cursor="pointer";d.style.bottom="20px";d.style.right="20px";if(e){d.style.direction="rtl";d.style.textAlign="right";d.style.right="24px";var b=document.createElement("span");b.style.display="inline-block";
-b.style.fontSize="12px";b.style.margin="5px 24px 0 0";b.style.color="gray";mxUtils.write(b,mxResources.get("language"));d.appendChild(b)}mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var e=mxUtils.getOffset(d);
-b.popup(e.x,e.y+d.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(d)}return d};
+App.prototype.showSplash=function(a){var d=this.getServiceCount(!0,!0),e=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>d||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=a)}),!0)});if(this.editor.chromeless)this.handleError({message:mxResources.get("noFileSelected")},
+mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(null==this.mode||a){a=4==d?2:3;var b=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();e()}),a);this.showDialog(b.container,3>a?260:300,4<=d?420:300,!0,!1);b.init()}else null==urlParams.create&&e()};
+App.prototype.addLanguageMenu=function(a,d){var e=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){e=document.createElement("div");e.setAttribute("title",mxResources.get("language"));e.className="geIcon geSprite geSprite-globe";e.style.position="absolute";e.style.cursor="pointer";e.style.bottom="20px";e.style.right="20px";if(d){e.style.direction="rtl";e.style.textAlign="right";e.style.right="24px";var b=document.createElement("span");b.style.display="inline-block";
+b.style.fontSize="12px";b.style.margin="5px 24px 0 0";b.style.color="gray";mxUtils.write(b,mxResources.get("language"));e.appendChild(b)}mxEvent.addListener(e,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var d=mxUtils.getOffset(e);
+b.popup(d.x,d.y+e.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(e)}return e};
App.prototype.defineCustomObjects=function(){null!=gapi.drive.realtime&&null!=gapi.drive.realtime.custom&&(gapi.drive.realtime.custom.registerType(mxRtCell,"Cell"),mxRtCell.prototype.cellId=gapi.drive.realtime.custom.collaborativeField("cellId"),mxRtCell.prototype.type=gapi.drive.realtime.custom.collaborativeField("type"),mxRtCell.prototype.value=gapi.drive.realtime.custom.collaborativeField("value"),mxRtCell.prototype.xmlValue=gapi.drive.realtime.custom.collaborativeField("xmlValue"),mxRtCell.prototype.style=
gapi.drive.realtime.custom.collaborativeField("style"),mxRtCell.prototype.geometry=gapi.drive.realtime.custom.collaborativeField("geometry"),mxRtCell.prototype.visible=gapi.drive.realtime.custom.collaborativeField("visible"),mxRtCell.prototype.collapsed=gapi.drive.realtime.custom.collaborativeField("collapsed"),mxRtCell.prototype.connectable=gapi.drive.realtime.custom.collaborativeField("connectable"),mxRtCell.prototype.parent=gapi.drive.realtime.custom.collaborativeField("parent"),mxRtCell.prototype.children=
gapi.drive.realtime.custom.collaborativeField("children"),mxRtCell.prototype.source=gapi.drive.realtime.custom.collaborativeField("source"),mxRtCell.prototype.target=gapi.drive.realtime.custom.collaborativeField("target"))};mxRtCell=function(){};mxCodecRegistry.getCodec(mxCell).exclude.push("rtCell");mxCell.prototype.mxTransient.push("rtCell");
-App.prototype.pickFile=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var e=this.getPeerForMode(a);if(null!=e)e.pickFile();else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var d=
-Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,d){this.useCanvasForExport||".png"!=d.substring(d.length-4)||(d=d.substring(0,d.length-4)+".xml");this.fileLoaded(a==App.MODE_BROWSER?new StorageFile(this,b,d):new LocalFile(this,b,d))}));var b=this.dialog,h=b.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;h.apply(b,arguments);null==this.getCurrentFile()&&this.showSplash()})}else{var k=
-document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&this.openFiles(k.files)}));k.click()}}};
-App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_TRELLO){var e=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=e&&e.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
-mxResources.get("loading"))&&e.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){window.openNew=!1;window.openKey="open";var d=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=
-new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,d):new LocalLibrary(this,b,d))}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=d;window.openFile=null})}else{var b=document.createElement("input");
-b.setAttribute("type","file");mxEvent.addListener(b,"change",mxUtils.bind(this,function(){if(null!=b.files)for(var a=0;a<b.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(b.files[a])}));b.click()}};
-App.prototype.saveLibrary=function(a,e,d,b,h,k,l){b=null!=b?b:this.mode;h=null!=h?h:!1;k=null!=k?k:!1;var n=this.createLibraryDataFromImages(e),m=mxUtils.bind(this,function(a){this.spinner.stop();null!=l&&l();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==d&&b==App.MODE_DEVICE&&(d=new LocalLibrary(this,n,a));if(null==d)this.pickFolder(b,mxUtils.bind(this,function(c){b==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
-n,c,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,e)}),m,this.drive.libraryMimeType):b==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,e)}),m,c):b==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,n,mxUtils.bind(this,
-function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,e)}),m,c):b==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,e)}),m,c):b==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();
-this.hideDialog(!0);this.libraryLoaded(a,e)}),m,c):b==App.MODE_BROWSER?(c=mxUtils.bind(this,function(){var b=new StorageLibrary(this,n,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,e)}),m)}),null==localStorage.getItem(a)?c():this.confirm(mxResources.get("replaceIt",[a]),c)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(h||this.spinner.spin(document.body,mxResources.get("saving"))){d.setData(n);var c=mxUtils.bind(this,
-function(){d.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);k||this.libraryLoaded(d,e);null!=l&&l()}),m)});if(a!=d.getTitle()){var f=d.getHash();d.rename(a,mxUtils.bind(this,function(a){d.constructor!=LocalLibrary&&f!=d.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(d.getHash()));this.removeLibrarySidebar(f);c()}),m)}else c()}};
-App.prototype.saveFile=function(a){var e=this.getCurrentFile();if(null!=e){var d=mxUtils.bind(this,function(){this.removeDraft();e.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==e.getTitle()||null==this.mode){var b=null!=e.getTitle()?e.getTitle():this.defaultFilename,h=!mxClient.IS_IOS||!navigator.standalone,k=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var l=4>=a?2:6<a?4:3,b=new CreateDialog(this,
-b,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==k&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname))):k!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf("."),/(\.svg)$/i.test(a),
-/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,h,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,l);this.showDialog(b.container,460,a>l?390:270,!0,!0);b.init()}else this.save(e.getTitle(),d)}};
-EditorUi.prototype.loadTemplate=function(a,e,d){var b=a;this.isCorsEnabledForUrl(b)||(b="t="+(new Date).getTime(),b=PROXY_URL+"?url="+encodeURIComponent(a)+"&"+b);this.loadUrl(b,mxUtils.bind(this,function(b){!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&e(a.responseText)}),a):(/(\.png)($|\?)/i.test(a)&&
-(b=this.extractGraphModelFromPng(b)),e(b))}),d,/(\.png)($|\?)/i.test(a))};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
-App.prototype.createFile=function(a,e,d,b,h,k,l,n){b=n?null:null!=b?b:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){e=null!=e?e:this.emptyDiagramXml;var m=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(a){m();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});b==App.MODE_GOOGLE&&null!=this.drive?(l=null!=this.stateArg?this.stateArg.folderId:l,this.drive.insertFile(a,e,l,mxUtils.bind(this,
-function(a){m();this.fileCreated(a,d,k,h)}),c)):b==App.MODE_GITHUB&&null!=this.gitHub?this.pickFolder(b,mxUtils.bind(this,function(b){this.gitHub.insertFile(a,e,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,k,h)}),c,!1,b)})):b==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(a,e,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,k,h)}),c,!1,l):b==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(a,e,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,k,h)}),c):
-b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(a,e,mxUtils.bind(this,function(a){m();this.fileCreated(a,d,k,h)}),c,!1,l):b==App.MODE_BROWSER?(m(),b=mxUtils.bind(this,function(){var b=new StorageFile(this,e,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(b,d,k,h)}),c)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(m(),this.fileCreated(new LocalFile(this,
-e,a,null==b),d,k,h))}};
-App.prototype.fileCreated=function(a,e,d,b){var h=window.location.pathname;null!=e&&0<e.length&&(h+="?libs="+e);h=this.getUrl(h);a.getMode()!=App.MODE_DEVICE&&(h+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var k=a.getData(),k=0<k.length?this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0):null,l=window.location.protocol+"//"+window.location.hostname+h,n=k,m=null;null!=k&&/\.svg$/i.test(a.getTitle())&&(m=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(m.container),
-n=this.decodeNodeIntoGraph(n,m));a.setData(this.createFileData(k,m,a,l));null!=m&&m.container.parentNode.removeChild(m.container);var c=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(){c();var f=this.getCurrentFile();null==d&&null!=f&&(d=!f.isModified()&&null==f.getMode());var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);d&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));null!=e&&this.sidebar.showEntries(e)}),
-l=mxUtils.bind(this,function(){d||null==f||!f.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=b&&b();null==d||d?l():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=b&&b(),window.openWindow(h,null,l))});a.constructor==LocalFile||a.constructor==DriveFile?f():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,
+App.prototype.pickFile=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var d=this.getPeerForMode(a);if(null!=d)d.pickFile();else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var e=
+Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,d){this.useCanvasForExport||".png"!=d.substring(d.length-4)||(d=d.substring(0,d.length-4)+".xml");this.fileLoaded(a==App.MODE_BROWSER?new StorageFile(this,b,d):new LocalFile(this,b,d))}));var b=this.dialog,h=b.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=e;h.apply(b,arguments);null==this.getCurrentFile()&&this.showSplash()})}else{var l=
+document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&this.openFiles(l.files)}));l.click()}}};
+App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_TRELLO){var d=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=d&&d.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
+mxResources.get("loading"))&&d.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){window.openNew=!1;window.openKey="open";var e=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=
+new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,d):new LocalLibrary(this,b,d))}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=e;window.openFile=null})}else{var b=document.createElement("input");
+b.setAttribute("type","file");mxEvent.addListener(b,"change",mxUtils.bind(this,function(){if(null!=b.files)for(var a=0;a<b.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(b.files[a])}));b.click()}};
+App.prototype.saveLibrary=function(a,d,e,b,h,l,k){b=null!=b?b:this.mode;h=null!=h?h:!1;l=null!=l?l:!1;var m=this.createLibraryDataFromImages(d),n=mxUtils.bind(this,function(a){this.spinner.stop();null!=k&&k();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==e&&b==App.MODE_DEVICE&&(e=new LocalLibrary(this,m,a));if(null==e)this.pickFolder(b,mxUtils.bind(this,function(c){b==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
+m,c,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),n,this.drive.libraryMimeType):b==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),n,c):b==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,m,mxUtils.bind(this,
+function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),n,c):b==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),n,c):b==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();
+this.hideDialog(!0);this.libraryLoaded(a,d)}),n,c):b==App.MODE_BROWSER?(c=mxUtils.bind(this,function(){var b=new StorageLibrary(this,m,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,d)}),n)}),null==localStorage.getItem(a)?c():this.confirm(mxResources.get("replaceIt",[a]),c)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(h||this.spinner.spin(document.body,mxResources.get("saving"))){e.setData(m);var c=mxUtils.bind(this,
+function(){e.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);l||this.libraryLoaded(e,d);null!=k&&k()}),n)});if(a!=e.getTitle()){var f=e.getHash();e.rename(a,mxUtils.bind(this,function(a){e.constructor!=LocalLibrary&&f!=e.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(e.getHash()));this.removeLibrarySidebar(f);c()}),n)}else c()}};
+App.prototype.saveFile=function(a){var d=this.getCurrentFile();if(null!=d){var e=mxUtils.bind(this,function(){this.removeDraft();d.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==d.getTitle()||null==this.mode){var b=null!=d.getTitle()?d.getTitle():this.defaultFilename,h=!mxClient.IS_IOS||!navigator.standalone,l=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var k=4>=a?2:6<a?4:3,b=new CreateDialog(this,
+b,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==l&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,e)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname))):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf("."),/(\.svg)$/i.test(a),
+/(\.html)$/i.test(a)),null,b,e,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,e))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,h,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,k);this.showDialog(b.container,460,a>k?390:270,!0,!0);b.init()}else this.save(d.getTitle(),e)}};
+EditorUi.prototype.loadTemplate=function(a,d,e){var b=a;this.isCorsEnabledForUrl(b)||(b="t="+(new Date).getTime(),b=PROXY_URL+"?url="+encodeURIComponent(a)+"&"+b);this.loadUrl(b,mxUtils.bind(this,function(b){!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&d(a.responseText)}),a):(/(\.png)($|\?)/i.test(a)&&
+(b=this.extractGraphModelFromPng(b)),d(b))}),e,/(\.png)($|\?)/i.test(a))};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
+App.prototype.createFile=function(a,d,e,b,h,l,k,m){b=m?null:null!=b?b:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){d=null!=d?d:this.emptyDiagramXml;var n=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(a){n();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});b==App.MODE_GOOGLE&&null!=this.drive?(k=null!=this.stateArg?this.stateArg.folderId:k,this.drive.insertFile(a,d,k,mxUtils.bind(this,
+function(a){n();this.fileCreated(a,e,l,h)}),c)):b==App.MODE_GITHUB&&null!=this.gitHub?this.pickFolder(b,mxUtils.bind(this,function(b){this.gitHub.insertFile(a,d,mxUtils.bind(this,function(a){n();this.fileCreated(a,e,l,h)}),c,!1,b)})):b==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(a,d,mxUtils.bind(this,function(a){n();this.fileCreated(a,e,l,h)}),c,!1,k):b==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(a,d,mxUtils.bind(this,function(a){n();this.fileCreated(a,e,l,h)}),c):
+b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(a,d,mxUtils.bind(this,function(a){n();this.fileCreated(a,e,l,h)}),c,!1,k):b==App.MODE_BROWSER?(n(),b=mxUtils.bind(this,function(){var b=new StorageFile(this,d,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(b,e,l,h)}),c)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(n(),this.fileCreated(new LocalFile(this,
+d,a,null==b),e,l,h))}};
+App.prototype.fileCreated=function(a,d,e,b){var h=window.location.pathname;null!=d&&0<d.length&&(h+="?libs="+d);h=this.getUrl(h);a.getMode()!=App.MODE_DEVICE&&(h+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var l=a.getData(),l=0<l.length?this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0):null,k=window.location.protocol+"//"+window.location.hostname+h,m=l,n=null;null!=l&&/\.svg$/i.test(a.getTitle())&&(n=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(n.container),
+m=this.decodeNodeIntoGraph(m,n));a.setData(this.createFileData(l,n,a,k));null!=n&&n.container.parentNode.removeChild(n.container);var c=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(){c();var f=this.getCurrentFile();null==e&&null!=f&&(e=!f.isModified()&&null==f.getMode());var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);e&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));null!=d&&this.sidebar.showEntries(d)}),
+l=mxUtils.bind(this,function(){e||null==f||!f.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=b&&b();null==e||e?l():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=b&&b(),window.openWindow(h,null,l))});a.constructor==LocalFile||a.constructor==DriveFile?f():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,
function(){f()}),mxUtils.bind(this,function(a){c();this.handleError(a)}))}};
-App.prototype.loadFile=function(a,e,d){this.hideDialog();var b=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var b=localStorage.getItem(a);if(null!=b)this.fileLoaded(new StorageFile(this,b,a));else throw{message:mxResources.get("fileNotFound")};}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"),
-mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=d)this.spinner.stop(),this.fileLoaded(d);else if("R"==a.charAt(0))this.spinner.stop(),b=decodeURIComponent(a.substring(1)),"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)),
-b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),b.getHash=function(){return a},this.fileLoaded(b);else if("U"==a.charAt(0)){var h=decodeURIComponent(a.substring(1));this.loadTemplate(h,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=h,g=h.lastIndexOf("."),k=d.lastIndexOf("/");g>k&&0<k&&(d=d.substring(k+1,g),g=h.substring(g),this.useCanvasForExport||
-".png"!=g||(g=".xml"),".svg"===g||".xml"===g||".html"===g||".png"===g)&&(c=d+g)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b)||"https://drive.google.com/uc?id="!=h.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient||(this.hideDialog(),b=mxUtils.bind(this,function(){return null!=this.drive?(this.spinner.stop(),this.loadFile("G"+h.substring(31,h.lastIndexOf("&")),e),!0):!1}),!b()&&this.spinner.spin(document.body,
+App.prototype.loadFile=function(a,d,e){this.hideDialog();var b=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var b=localStorage.getItem(a);if(null!=b)this.fileLoaded(new StorageFile(this,b,a));else throw{message:mxResources.get("fileNotFound")};}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"),
+mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=e)this.spinner.stop(),this.fileLoaded(e);else if("R"==a.charAt(0))this.spinner.stop(),b=decodeURIComponent(a.substring(1)),"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)),
+b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),b.getHash=function(){return a},this.fileLoaded(b);else if("U"==a.charAt(0)){var h=decodeURIComponent(a.substring(1));this.loadTemplate(h,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var e=h,g=h.lastIndexOf("."),k=e.lastIndexOf("/");g>k&&0<k&&(e=e.substring(k+1,g),g=h.substring(g),this.useCanvasForExport||
+".png"!=g||(g=".xml"),".svg"===g||".xml"===g||".html"===g||".png"===g)&&(c=e+g)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b)||"https://drive.google.com/uc?id="!=h.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient||(this.hideDialog(),b=mxUtils.bind(this,function(){return null!=this.drive?(this.spinner.stop(),this.loadFile("G"+h.substring(31,h.lastIndexOf("&")),d),!0):!1}),!b()&&this.spinner.spin(document.body,
mxResources.get("loading"))&&this.addListener("clientLoaded",b))}}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}))}else b=null,"G"==a.charAt(0)?b=this.drive:"D"==a.charAt(0)?b=this.dropbox:"W"==a.charAt(0)?b=this.oneDrive:"H"==a.charAt(0)?b=this.gitHub:"T"==a.charAt(0)&&(b=this.trello),null==b?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),
mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""})):(a=decodeURIComponent(a.substring(1)),b.getFile(a,mxUtils.bind(this,function(a){this.spinner.stop();this.fileLoaded(a)}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):
-window.location.hash=a.getHash()}))})))}),h=this.getCurrentFile(),k=mxUtils.bind(this,function(){null!=h&&h.isModified()?this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=h&&(window.location.hash=h.getHash())}),b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});null==a||0==a.length?k():null!=h&&h.isModified()&&!e?window.openWindow(this.getUrl()+"#"+a,null,k):k()};
-App.prototype.getLibraryStorageHint=function(a){var e=a.getTitle();a.constructor!=LocalLibrary&&(e+="\n"+a.getHash());a.constructor==DriveLibrary?e+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?e+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?e+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?e+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?e+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?e+=" ("+
-mxResources.get("browser")+")":a.constructor==LocalLibrary&&(e+=" ("+mxResources.get("device")+")");return e};
-App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a){mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),e=mxUtils.bind(this,function(d){if(null!=d)for(var b=0;b<d.length;b++){var e=encodeURIComponent(decodeURIComponent(d[b]));mxUtils.bind(this,function(b){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){this.pendingLibraries[b]=!0;var d=b.substring(0,
+window.location.hash=a.getHash()}))})))}),h=this.getCurrentFile(),l=mxUtils.bind(this,function(){null!=h&&h.isModified()?this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=h&&(window.location.hash=h.getHash())}),b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});null==a||0==a.length?l():null!=h&&h.isModified()&&!d?window.openWindow(this.getUrl()+"#"+a,null,l):l()};
+App.prototype.getLibraryStorageHint=function(a){var d=a.getTitle();a.constructor!=LocalLibrary&&(d+="\n"+a.getHash());a.constructor==DriveLibrary?d+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?d+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?d+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?d+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?d+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?d+=" ("+
+mxResources.get("browser")+")":a.constructor==LocalLibrary&&(d+=" ("+mxResources.get("device")+")");return d};
+App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a){mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),d=mxUtils.bind(this,function(d){if(null!=d)for(var b=0;b<d.length;b++){var e=encodeURIComponent(decodeURIComponent(d[b]));mxUtils.bind(this,function(b){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){this.pendingLibraries[b]=!0;var d=b.substring(0,
1);if("L"==d){if(isLocalStorage||mxClient.IS_CHROMEAPP)try{var e=decodeURIComponent(b.substring(1));this.getLocalData(e,mxUtils.bind(this,function(c){".scratchpad"==e&&null==c&&(c=this.emptyLibraryXml);null!=c?this.loadLibrary(new StorageLibrary(this,c,e)):a(b)}))}catch(f){a(b)}}else if("U"==d){var h=decodeURIComponent(b.substring(1));this.isOffline()||(d=h,this.isCorsEnabledForUrl(d)||(d="t="+(new Date).getTime(),d=PROXY_URL+"?url="+encodeURIComponent(h)+"&"+d),mxUtils.get(d,mxUtils.bind(this,function(c){if(200<=
c.getStatus()&&299>=c.getStatus())try{this.loadLibrary(new UrlLibrary(this,c.getText(),h)),delete this.pendingLibraries[b]}catch(g){a(b)}else a(b)}),function(){a(b)}))}else{var c=null;"G"==d?null!=this.drive&&null!=this.drive.user&&(c=this.drive):"H"==d?null!=this.gitHub&&null!=this.gitHub.getUser()&&(c=this.gitHub):"T"==d?null!=this.trello&&this.trello.isAuthorized()&&(c=this.trello):"D"==d?null!=this.dropbox&&null!=this.dropbox.getUser()&&(c=this.dropbox):"W"==d&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&
-(c=this.oneDrive);null!=c?c.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(c){try{this.loadLibrary(c),delete this.pendingLibraries[b]}catch(g){a(b)}}),function(c){a(b)}):delete this.pendingLibraries[b]}}})(e)}});e(mxSettings.getCustomLibraries());e((urlParams.clibs||"").split(";"))}};
+(c=this.oneDrive);null!=c?c.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(c){try{this.loadLibrary(c),delete this.pendingLibraries[b]}catch(g){a(b)}}),function(c){a(b)}):delete this.pendingLibraries[b]}}})(e)}});d(mxSettings.getCustomLibraries());d((urlParams.clibs||"").split(";"))}};
App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile?null==this.shareButton&&(this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.padding="0 10px 0 10px",this.shareButton.style.marginTop="-4px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight="28px",this.shareButton.style.minWidth=
"0px",this.shareButton.style.cssFloat="right",a=document.createElement("img"),a.setAttribute("src",this.shareImage),a.setAttribute("align","absmiddle"),a.style.marginRight="4px",a.style.marginTop="-3px",this.shareButton.appendChild(a),mxUtils.write(this.shareButton,mxResources.get("share")),mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()})),this.buttonContainer.appendChild(this.shareButton)):null!=this.shareButton&&(this.shareButton.parentNode.removeChild(this.shareButton),
this.shareButton=null)}};
-App.prototype.save=function(a,e){var d=this.getCurrentFile(),b=mxResources.get("saving");null!=d&&d.constructor==DriveFile&&(b=mxResources.get("createRevision"));if(null!=d&&this.spinner.spin(document.body,b)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.bind(this,function(a){this.spinner.stop();this.getCurrentFile()==d&&(d.isModified()?d.isAutosave()||d.addUnsavedStatus():this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))));null!=
-e&&e()}),h=mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});a==d.getTitle()?d.save(!0,b,h):d.saveAs(a,b,h)}};
-App.prototype.pickFolder=function(a,e,d){d=null!=d?d:!0;var b=this.spinner.pause();d&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){b();if(a.action==google.picker.Action.PICKED){var d=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(d=a.docs[0].id);e(d)}})):d&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){b();null!=a&&null!=a.value&&0<a.value.length&&(a=a.value[0].id,e(a))})):d&&a==App.MODE_GITHUB&&
-null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){b();e(a)})):d&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){b();e(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
-App.prototype.exportFile=function(a,e,d,b,h,k){h==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(e,b?this.base64ToBlob(a,d):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):h==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(e,a,k,mxUtils.bind(this,function(a){this.spinner.stop()}),
-mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),d,b,!1):h==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(e,b?this.base64ToBlob(a,d):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,k):h==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(e,a,mxUtils.bind(this,
-function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,k,b):h==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(e,b?this.base64ToBlob(a,d):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,k):h==App.MODE_BROWSER&&(d=mxUtils.bind(this,function(){localStorage.setItem(e,a)}),null==localStorage.getItem(e)?
-d():this.confirm(mxResources.get("replaceIt",[e]),d))};
-App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var e=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,e);this.fname.setAttribute("title",e+" - "+mxResources.get("rename"))}this.editor.graph.setEnabled(a.isEditable());null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?window.location.hash=a:0<window.location.hash.length&&(window.location.hash=
-""))}};App.prototype.toggleChat=function(){var a=this.getCurrentFile();if(null!=a){if(null==a.chatWindow){var e=document.body.offsetWidth-300;a.chatWindow=new ChatWindow(this,mxResources.get("chatWindowTitle"),document.getElementById("geChat"),e,80,250,350,a.realtime);a.chatWindow.window.setVisible(!1)}a.chatWindow.window.setVisible(!a.chatWindow.window.isVisible())}};
-App.prototype.showAuthDialog=function(a,e,d,b){var h=this.spinner.pause();this.showDialog((new AuthDialog(this,a,e,mxUtils.bind(this,function(a){try{null!=d&&d(a,mxUtils.bind(this,function(){this.hideDialog();h()}))}catch(l){this.editor.setStatus(mxUtils.htmlEntities(l.message))}}))).container,300,e?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
-App.prototype.convertFile=function(a,e,d,b,h,k){var l=e;/\.svg$/i.test(l)||(l=l.substring(0,e.lastIndexOf("."))+b);var n=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(n=!0);if(/\.vsdx$/i.test(e)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var m=new XMLHttpRequest;m.open("GET",a,!0);n||(m.responseType="blob");m.onload=mxUtils.bind(this,function(){var a=null;n?(a=JSON.parse(m.responseText),a=this.base64ToBlob(a.content,
-"application/octet-stream")):a=new Blob([m.response],{type:"application/octet-stream"});this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?h(new LocalFile(this,a.responseText,l,!0)):null!=k&&k({message:mxResources.get("errorLoadingFile")}))}),e)});m.send()}else{var c=mxUtils.bind(this,function(b){try{/\.png$/i.test(e)?(temp=this.extractGraphModelFromPng(b),null!=temp?h(new LocalFile(this,temp,l,!0)):h(new LocalFile(this,b,e,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&
-this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?h(new LocalFile(this,a.responseText,l,!0)):null!=k&&k({message:mxResources.get("errorLoadingFile")}))}),e):h(new LocalFile(this,b,l,!0))}catch(g){null!=k&&k(g)}});d=/\.png$/i.test(e)||/\.jpe?g$/i.test(e)||null!=d&&"image/"==d.substring(0,6);n?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
-h){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(e)?"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));c(b)}}else null!=k&&k({code:App.ERROR_UNKNOWN})}),function(){null!=k&&k({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=k&&k({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,c,k,d)}};
+App.prototype.save=function(a,d){var e=this.getCurrentFile(),b=mxResources.get("saving");null!=e&&e.constructor==DriveFile&&(b=mxResources.get("createRevision"));if(null!=e&&this.spinner.spin(document.body,b)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.bind(this,function(a){this.spinner.stop();this.getCurrentFile()==e&&(e.isModified()?e.isAutosave()||e.addUnsavedStatus():this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))));null!=
+d&&d()}),h=mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});a==e.getTitle()?e.save(!0,b,h):e.saveAs(a,b,h)}};
+App.prototype.pickFolder=function(a,d,e){e=null!=e?e:!0;var b=this.spinner.pause();e&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){b();if(a.action==google.picker.Action.PICKED){var e=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(e=a.docs[0].id);d(e)}})):e&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){b();null!=a&&null!=a.value&&0<a.value.length&&(a=a.value[0].id,d(a))})):e&&a==App.MODE_GITHUB&&
+null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){b();d(a)})):e&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){b();d(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
+App.prototype.exportFile=function(a,d,e,b,h,l){h==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(d,b?this.base64ToBlob(a,e):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):h==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(d,a,l,mxUtils.bind(this,function(a){this.spinner.stop()}),
+mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),e,b,!1):h==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(d,b?this.base64ToBlob(a,e):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,l):h==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(d,a,mxUtils.bind(this,
+function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,l,b):h==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(d,b?this.base64ToBlob(a,e):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,l):h==App.MODE_BROWSER&&(e=mxUtils.bind(this,function(){localStorage.setItem(d,a)}),null==localStorage.getItem(d)?
+e():this.confirm(mxResources.get("replaceIt",[d]),e))};
+App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var d=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,d);this.fname.setAttribute("title",d+" - "+mxResources.get("rename"))}this.editor.graph.setEnabled(a.isEditable());null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?window.location.hash=a:0<window.location.hash.length&&(window.location.hash=
+""))}};App.prototype.toggleChat=function(){var a=this.getCurrentFile();if(null!=a){if(null==a.chatWindow){var d=document.body.offsetWidth-300;a.chatWindow=new ChatWindow(this,mxResources.get("chatWindowTitle"),document.getElementById("geChat"),d,80,250,350,a.realtime);a.chatWindow.window.setVisible(!1)}a.chatWindow.window.setVisible(!a.chatWindow.window.isVisible())}};
+App.prototype.showAuthDialog=function(a,d,e,b){var h=this.spinner.pause();this.showDialog((new AuthDialog(this,a,d,mxUtils.bind(this,function(a){try{null!=e&&e(a,mxUtils.bind(this,function(){this.hideDialog();h()}))}catch(k){this.editor.setStatus(mxUtils.htmlEntities(k.message))}}))).container,300,d?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
+App.prototype.convertFile=function(a,d,e,b,h,l){var k=d;/\.svg$/i.test(k)||(k=k.substring(0,d.lastIndexOf("."))+b);var m=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(m=!0);if(/\.vsdx$/i.test(d)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var n=new XMLHttpRequest;n.open("GET",a,!0);m||(n.responseType="blob");n.onload=mxUtils.bind(this,function(){var a=null;m?(a=JSON.parse(n.responseText),a=this.base64ToBlob(a.content,
+"application/octet-stream")):a=new Blob([n.response],{type:"application/octet-stream"});this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?h(new LocalFile(this,a.responseText,k,!0)):null!=l&&l({message:mxResources.get("errorLoadingFile")}))}),d)});n.send()}else{var c=mxUtils.bind(this,function(b){try{/\.png$/i.test(d)?(temp=this.extractGraphModelFromPng(b),null!=temp?h(new LocalFile(this,temp,k,!0)):h(new LocalFile(this,b,d,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&
+this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?h(new LocalFile(this,a.responseText,k,!0)):null!=l&&l({message:mxResources.get("errorLoadingFile")}))}),d):h(new LocalFile(this,b,k,!0))}catch(g){null!=l&&l(g)}});e=/\.png$/i.test(d)||/\.jpe?g$/i.test(d)||null!=e&&"image/"==e.substring(0,6);m?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
+h){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(d)?"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));c(b)}}else null!=l&&l({code:App.ERROR_UNKNOWN})}),function(){null!=l&&l({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=l&&l({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,c,l,e)}};
App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="40px";this.appIcon.style.backgroundColor="#f18808";this.appIcon.style.height=this.menubarHeight+"px";mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(a){this.appIconClicked(a)}));var a=mxClient.IS_SVG?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+)":
"url('"+IMAGE_PATH+"/logo-white.png')";this.appIcon.style.backgroundImage=a;this.appIcon.style.backgroundPosition="center center";this.appIcon.style.backgroundRepeat="no-repeat";mxUtils.setPrefixedStyle(this.appIcon.style,"transition","all 125ms linear");mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a=a.getMode(),a==App.MODE_GOOGLE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)":a==App.MODE_DROPBOX?
this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)":a==App.MODE_ONEDRIVE?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)":a==App.MODE_GITHUB?this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)":a==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)"))}));mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,function(){this.appIcon.style.backgroundImage=a}));
@@ -6969,10 +6974,10 @@ this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)":
"javascript:void(0);");this.fname.setAttribute("title",mxResources.get("rename"));this.fname.className="geItem";this.fname.style.padding="2px 8px 2px 8px";this.fname.style.display="inline";this.fname.style.fontSize="18px";this.fname.style.whiteSpace="nowrap";mxEvent.addListener(this.fname,"click",mxUtils.bind(this,function(a){var b=this.getCurrentFile();null!=b&&b.isRenamable()&&this.actions.get("rename").funct();mxEvent.consume(a)}));this.fnameWrapper.appendChild(this.fname);"1"!=urlParams.embed&&
(this.menubarContainer.appendChild(this.fnameWrapper),this.menubar.container.style.position="absolute",this.menubar.container.style.paddingLeft="52px",this.menubar.container.style.boxSizing="border-box",this.menubar.container.style.top="29px",this.toolbar.container.style.paddingLeft="56px");this.toggleFormatElement=document.createElement("a");this.toggleFormatElement.setAttribute("href","javascript:void(0);");this.toggleFormatElement.setAttribute("title",mxResources.get("formatPanel")+" ("+Editor.ctrlKey+
"+Shift+P)");this.toggleFormatElement.style.position="absolute";this.toggleFormatElement.style.display="inline-block";this.toggleFormatElement.style.top="5px";this.toggleFormatElement.style.right="atlas"!=uiTheme&&"1"!=urlParams.embed?"26px":"10px";this.toggleFormatElement.style.padding="2px";this.toggleFormatElement.style.fontSize="14px";this.toggleFormatElement.className="atlas"!=uiTheme?"geButton":"";this.toggleFormatElement.style.width="16px";this.toggleFormatElement.style.height="16px";this.toggleFormatElement.style.backgroundPosition=
-"50% 50%";this.toggleFormatElement.style.backgroundRepeat="no-repeat";this.toolbarContainer.appendChild(this.toggleFormatElement);"dark"==uiTheme&&(this.toggleFormatElement.style.filter="invert(100%)");mxEvent.addListener(this.toggleFormatElement,"click",mxUtils.bind(this,function(a){this.actions.get("formatPanel").funct();mxEvent.consume(a)}));var e=mxUtils.bind(this,function(){this.toggleFormatElement.style.backgroundImage=0<this.formatWidth?"url('"+this.formatShowImage+"')":"url('"+this.formatHideImage+
-"')"});this.addListener("formatWidthChanged",e);e();this.fullscreenElement=document.createElement("a");this.fullscreenElement.setAttribute("href","javascript:void(0);");this.fullscreenElement.setAttribute("title",mxResources.get("fullscreen"));this.fullscreenElement.style.position="absolute";this.fullscreenElement.style.display="inline-block";this.fullscreenElement.style.top="5px";this.fullscreenElement.style.right="atlas"!=uiTheme&&"1"!=urlParams.embed?"42px":"26px";this.fullscreenElement.style.padding=
-"2px";this.fullscreenElement.style.fontSize="14px";this.fullscreenElement.className="atlas"!=uiTheme?"geButton":"";this.fullscreenElement.style.width="16px";this.fullscreenElement.style.height="16px";this.fullscreenElement.style.backgroundPosition="50% 50%";this.fullscreenElement.style.backgroundRepeat="no-repeat";this.fullscreenElement.style.backgroundImage="url('"+this.fullscreenImage+"')";this.toolbarContainer.appendChild(this.fullscreenElement);var d=this.hsplitPosition,b=!1;"dark"==uiTheme&&
-(this.fullscreenElement.style.filter="invert(100%)");mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,function(a){"atlas"!=uiTheme&&"1"!=urlParams.embed&&this.toggleCompactMode(!b);this.toggleFormatPanel(!b);this.hsplitPosition=b?d:0;this.hideFooter();b=!b;mxEvent.consume(a)}));"atlas"==uiTheme&&(mxUtils.setOpacity(this.toggleFormatElement,70),mxUtils.setOpacity(this.fullscreenElement,70),this.toggleFormatElement.style.right="6px",this.fullscreenElement.style.right="22px",this.toggleFormatElement.style.top=
+"50% 50%";this.toggleFormatElement.style.backgroundRepeat="no-repeat";this.toolbarContainer.appendChild(this.toggleFormatElement);"dark"==uiTheme&&(this.toggleFormatElement.style.filter="invert(100%)");mxEvent.addListener(this.toggleFormatElement,"click",mxUtils.bind(this,function(a){this.actions.get("formatPanel").funct();mxEvent.consume(a)}));var d=mxUtils.bind(this,function(){this.toggleFormatElement.style.backgroundImage=0<this.formatWidth?"url('"+this.formatShowImage+"')":"url('"+this.formatHideImage+
+"')"});this.addListener("formatWidthChanged",d);d();this.fullscreenElement=document.createElement("a");this.fullscreenElement.setAttribute("href","javascript:void(0);");this.fullscreenElement.setAttribute("title",mxResources.get("fullscreen"));this.fullscreenElement.style.position="absolute";this.fullscreenElement.style.display="inline-block";this.fullscreenElement.style.top="5px";this.fullscreenElement.style.right="atlas"!=uiTheme&&"1"!=urlParams.embed?"42px":"26px";this.fullscreenElement.style.padding=
+"2px";this.fullscreenElement.style.fontSize="14px";this.fullscreenElement.className="atlas"!=uiTheme?"geButton":"";this.fullscreenElement.style.width="16px";this.fullscreenElement.style.height="16px";this.fullscreenElement.style.backgroundPosition="50% 50%";this.fullscreenElement.style.backgroundRepeat="no-repeat";this.fullscreenElement.style.backgroundImage="url('"+this.fullscreenImage+"')";this.toolbarContainer.appendChild(this.fullscreenElement);var e=this.hsplitPosition,b=!1;"dark"==uiTheme&&
+(this.fullscreenElement.style.filter="invert(100%)");mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,function(a){"atlas"!=uiTheme&&"1"!=urlParams.embed&&this.toggleCompactMode(!b);this.toggleFormatPanel(!b);this.hsplitPosition=b?e:0;this.hideFooter();b=!b;mxEvent.consume(a)}));"atlas"==uiTheme&&(mxUtils.setOpacity(this.toggleFormatElement,70),mxUtils.setOpacity(this.fullscreenElement,70),this.toggleFormatElement.style.right="6px",this.fullscreenElement.style.right="22px",this.toggleFormatElement.style.top=
"8px",this.fullscreenElement.style.top="8px");"1"!=urlParams.embed&&(this.toggleElement=document.createElement("a"),this.toggleElement.setAttribute("href","javascript:void(0);"),this.toggleElement.setAttribute("title",mxResources.get("collapseExpand")),this.toggleElement.className="geButton",this.toggleElement.style.position="absolute",this.toggleElement.style.display="inline-block",this.toggleElement.style.width="16px",this.toggleElement.style.height="16px",this.toggleElement.style.color="#666",
this.toggleElement.style.top="5px",this.toggleElement.style.right="10px",this.toggleElement.style.padding="2px",this.toggleElement.style.fontSize="14px",this.toggleElement.style.textDecoration="none",this.toggleElement.style.backgroundImage="url('"+this.chevronUpImage+"')",this.toggleElement.style.backgroundPosition="50% 50%",this.toggleElement.style.backgroundRepeat="no-repeat","dark"==uiTheme&&(this.toggleElement.style.filter="invert(100%)"),mxEvent.addListener(this.toggleElement,"click",mxUtils.bind(this,
function(a){this.toggleCompactMode();mxEvent.consume(a)})),"atlas"!=uiTheme&&this.toolbarContainer.appendChild(this.toggleElement),740>=screen.height&&"undefined"!==typeof this.toggleElement.click&&window.setTimeout(mxUtils.bind(this,function(){this.toggleElement.click()}),0))}};
@@ -6993,90 +6998,90 @@ null!=this.gitHub&&d(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils
function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==TrelloFile){var b=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.trello.logout()}));b||(d=document.createElement("div"),d.style.textAlign="center",d.style.padding="20px 20px 10px 10px",d.innerHTML=mxResources.get("notConnected"),this.userPanel.appendChild(d));document.body.appendChild(this.userPanel)}mxEvent.consume(a)})),
mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(a){mxEvent.isConsumed(a)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)})));var a=null;null!=this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?a=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?a=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(a=this.gitHub.getUser());
null!=a?(this.userElement.innerHTML="",560<screen.width&&(mxUtils.write(this.userElement,a.displayName),this.userElement.style.display="block")):this.userElement.style.display="none"}else null!=this.userElement&&(this.userElement.parentNode.removeChild(this.userElement),this.userElement=null)};var editorResetGraph=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);this.graph.pageFormat=mxSettings.getPageFormat()};(function(){var a=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){a.apply(this,arguments);this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px"};Menus.prototype.createHelpLink=function(a){var b=document.createElement("span");b.setAttribute("title",mxResources.get("help"));b.style.cssText="color:blue;text-decoration:underline;margin-left:12px;cursor:help;";
-var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);b.appendChild(d);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){null!=this.editorUi.menubar&&this.editorUi.menubar.hideMenu();this.editorUi.openLink(a);mxEvent.consume(b)}));return b};Menus.prototype.addLinkToItem=function(a,d){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(d))};var e=Menus.prototype.init;Menus.prototype.init=function(){e.apply(this,
-arguments);var a=this.editorUi,d=a.editor.graph,k=mxUtils.bind(d,d.isEnabled),l=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),n=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),m=("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||
+var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);b.appendChild(d);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){null!=this.editorUi.menubar&&this.editorUi.menubar.hideMenu();this.editorUi.openLink(a);mxEvent.consume(b)}));return b};Menus.prototype.addLinkToItem=function(a,d){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(d))};var d=Menus.prototype.init;Menus.prototype.init=function(){d.apply(this,
+arguments);var a=this.editorUi,e=a.editor.graph,l=mxUtils.bind(e,e.isEnabled),k=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),m=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),n=("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||
"drive.draw.io"==window.location.hostname||"legacy.draw.io"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),c=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);a.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");
a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/
-100,c,d,e,f,g,h,!k,l)}),!0,null,"svg")}));a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatXml"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(e);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?
+100,c,d,e,f,g,h,!k,l)}),!0,null,"svg")}));a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatXml"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(d);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,e.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?
"compressed":"allPages"),!0);g.style.marginBottom="16px";mxEvent.addListener(f,"change",function(){f.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",c?!g.checked:null,null,!f.checked,c?null:!g.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){a.showPublishLinkDialog(mxResources.get("url"),
-!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,h,k,p,l){a.createHtml(b,c,d,e,f,g,h,k,p,l,mxUtils.bind(this,function(b,c){var d=
+!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,h,k,q,l){a.createHtml(b,c,d,e,f,g,h,k,q,l,mxUtils.bind(this,function(b,c){var d=
a.getBaseFilename(),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,mxResources.get("formatPdf"))).container,
-360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=document.createElement("h3");mxUtils.write(c,mxResources.get("formatPdf"));c.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(c);var e=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),f=a.addCheckbox(b,mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport);f.style.marginBottom="16px";a.pdfPageExport||
-mxEvent.addListener(e,"change",function(){e.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!e.checked,null,!f.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){a.fileLoaded(null)});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();
-if(1==d.getSelectionCount()){var b=d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();if(null==b||b.constructor!=DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile||null==a.dropbox&&b.constructor==DropboxFile)a.showError(mxResources.get("error"),
+360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=document.createElement("h3");mxUtils.write(c,mxResources.get("formatPdf"));c.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(c);var d=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,e.isSelectionEmpty()),f=a.addCheckbox(b,mxResources.get("crop"),!e.pageVisible||!a.pdfPageExport,!a.pdfPageExport);f.style.marginBottom="16px";a.pdfPageExport||
+mxEvent.addListener(d,"change",function(){d.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!d.checked,null,!f.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){a.fileLoaded(null)});a.actions.addAction("editShape...",mxUtils.bind(this,function(){e.getSelectionCells();
+if(1==e.getSelectionCount()){var b=e.getSelectionCell(),c=e.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();if(null==b||b.constructor!=DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile||null==a.dropbox&&b.constructor==DropboxFile)a.showError(mxResources.get("error"),
mxResources.get("notAvailable"),mxResources.get("ok"));else if(a.spinner.spin(document.body,mxResources.get("loading")))if(b.constructor==DropboxFile){var c=a.dropbox.client.filesListRevisions({path:b.stat.path_lower,limit:100});c.then(mxUtils.bind(this,function(c){a.spinner.stop();try{for(var d=[],e=c.entries.length-1;0<=e;e--)(function(c){d.push({modifiedDate:c.client_modified,fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+
-"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(E){a.handleError(E)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-
+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(F){a.handleError(F)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-
1]===d?b.desc.headRevisionId:d.id}),function(b){a.drive.getXmlFile(b,null,function(a){e(a.getData())},function(a){f(a)})},function(a){f(a)})};d.getUrl=function(){return a.getUrl(window.location.pathname+"?rev="+d.id+"&chrome=0&edit=_blank")+window.location.hash}})(c.items[d]);d=new RevisionDialog(a,c.items);a.showDialog(d.container,640,480,!0,!0);d.init()},function(b){a.spinner.stop();a.handleError(b)})});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+
"+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))});if("undefined"!==typeof MathJax){var f=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=
-!a.isMathEnabled();d.model.execute(b)});f.setToggleAction(!0);f.setSelectedCallback(function(){return a.isMathEnabled()});f.isEnabled=k}isLocalStorage&&(f=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),f.setToggleAction(!0),f.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var g=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});g.setToggleAction(!0);g.setSelectedCallback(function(){return g.isEnabled()&&
-a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=d.getSelectionCells(),c=[],e=0;e<b.length;e++)d.getModel().isVertex(b[e])&&c.push(b[e]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,180,180,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var t="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" ");
-a.actions.addAction("copyStyle",function(){var b=d.view.getState(d.getSelectionCell());if(d.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=d.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var e=b[c],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f),e=e.substring(f+1);null==a.copiedStyle[g]&&"none"==e&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&
-null!=a.copiedStyle){d.getModel().beginUpdate();try{for(var b=d.getSelectionCells(),c=0;c<b.length;c++)for(var e=d.view.getState(b[c]),f=0;f<t.length;f++){var g=t[f],h=a.copiedStyle[g];e.style[g]!=h&&d.setCellStyles(g,h,[b[c]])}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,
+!a.isMathEnabled();e.model.execute(b)});f.setToggleAction(!0);f.setSelectedCallback(function(){return a.isMathEnabled()});f.isEnabled=l}isLocalStorage&&(f=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),f.setToggleAction(!0),f.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var g=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});g.setToggleAction(!0);g.setSelectedCallback(function(){return g.isEnabled()&&
+a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=e.getSelectionCells(),c=[],d=0;d<b.length;d++)e.getModel().isVertex(b[d])&&c.push(b[d]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,180,180,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var p="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" ");
+a.actions.addAction("copyStyle",function(){var b=e.view.getState(e.getSelectionCell());if(e.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=e.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var d=b[c],f=d.indexOf("=");if(0<=f){var g=d.substring(0,f),d=d.substring(f+1);null==a.copiedStyle[g]&&"none"==d&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(e.isEnabled()&&!e.isSelectionEmpty()&&
+null!=a.copiedStyle){e.getModel().beginUpdate();try{for(var b=e.getSelectionCells(),c=0;c<b.length;c++)for(var d=e.view.getState(b[c]),f=0;f<p.length;f++){var g=p[f],h=a.copiedStyle[g];d.style[g]!=h&&e.setCellStyles(g,h,[b[c]])}}finally{e.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,
320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!k,l)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,
function(b,c){a.downloadFile(c?"xmlpng":"png",null,null,b)}))}));a.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,h,!k,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),
-null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg",null,null,b)}),!0)}));f=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){d.setShadowVisible(!d.shadowVisible)}));f.setToggleAction(!0);f.setSelectedCallback(function(){return d.shadowVisible});var q=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){q||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){q=!1}),q=!0)},null,null,"F1"));a.actions.addAction("userManual...",
+null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg",null,null,b)}),!0)}));f=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){e.setShadowVisible(!e.shadowVisible)}));f.setToggleAction(!0);f.setSelectedCallback(function(){return e.shadowVisible});var u=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){u||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){u=!1}),u=!0)},null,null,"F1"));a.actions.addAction("userManual...",
function(){a.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")});a.actions.addAction("support...",function(){a.openLink("https://about.draw.io/support/")});a.actions.addAction("exportOptionsDisabled...",function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP?a.openLink("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?a.openLink("shortcuts.svg"):
a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});f=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",
function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));f.setToggleAction(!0);f.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));f=a.actions.addAction("find...",mxUtils.bind(this,function(){null==
this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,204,140),this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));f.setToggleAction(!0);f.setSelectedCallback(mxUtils.bind(this,function(){return null!=
-this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){var b=mxUtils.bind(this,function(){if("undefined"!==typeof VsdxExport)try{(new VsdxExport(a)).exportCurrentDiagrams()}catch(w){}});"undefined"!==typeof VsdxExport||this.loadingVsdx||a.isOffline()?window.setTimeout(b,0):(this.loadingVsdx=!0,mxscript("js/vsdx.min.js",b))}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",
+this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){var b=mxUtils.bind(this,function(){if("undefined"!==typeof VsdxExport)try{(new VsdxExport(a)).exportCurrentDiagrams()}catch(v){}});"undefined"!==typeof VsdxExport||this.loadingVsdx||a.isOffline()?window.setTimeout(b,0):(this.loadingVsdx=!0,mxscript("js/vsdx.min.js",b))}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",
new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);
-for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var u=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=u.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",
-c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"]);else{var e=b.addItem("Search:",null,null,c,null,null,!1);e.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";e.style.cursor="default";var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","25");f.style.marginLeft="8px";
-mxEvent.addListener(f,"keypress",mxUtils.bind(this,function(a){var b=mxUtils.trim(f.value);13==a.keyCode&&0<b.length&&(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),this.editorUi.logEvent({category:"Help",action:"search",label:b}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0))}));e.firstChild.nextSibling.appendChild(f);mxEvent.addGestureListeners(f,function(a){document.activeElement!=f&&f.focus();mxEvent.consume(a)},
+for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var t=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=t.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",
+c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"]);else{var d=b.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","25");f.style.marginLeft="8px";
+mxEvent.addListener(f,"keypress",mxUtils.bind(this,function(a){var b=mxUtils.trim(f.value);13==a.keyCode&&0<b.length&&(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),this.editorUi.logEvent({category:"Help",action:"search",label:b}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0))}));d.firstChild.nextSibling.appendChild(f);mxEvent.addGestureListeners(f,function(a){document.activeElement!=f&&f.focus();mxEvent.consume(a)},
function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){f.focus()},0);this.addMenuItems(b,["-","quickStart","userManual","keyboardShortcuts","-"]);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"]);this.addMenuItems(b,["support","-","about"])}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);
this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);
-this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=d.getGraphBounds(),b=d.view.translate,e=d.view.scale;d.insertVertex(c,null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),
-mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){d.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+d.compress(mxUtils.getXml(d.encodeCells(d.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",
-mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));e.scale(1/c);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var k=e.restore;e.restore=function(){g--;k.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);l.apply(this,arguments);mxLog.debug("leaving shape",
-a,g)};a.drawState(d.getView().getState(d.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&
+this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=e.getGraphBounds(),b=e.view.translate,d=e.view.scale;e.insertVertex(c,null,"",a.x/d-b.x,a.y/d-b.y,a.width/d,a.height/d,"fillColor=none;strokeColor=red;")})),
+mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){e.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+e.compress(mxUtils.getXml(e.encodeCells(e.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",
+mxUtils.bind(this,function(){var a=new mxImageExport,b=e.getGraphBounds(),c=e.view.scale,d=mxUtils.createXmlDocument(),f=d.createElement("output");d.appendChild(f);d=new mxXmlCanvas2D(f);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var g=0,h=d.save;d.save=function(){g++;h.apply(this,arguments)};var k=d.restore;d.restore=function(){g--;k.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);l.apply(this,arguments);mxLog.debug("leaving shape",
+a,g)};a.drawState(e.getView().getState(e.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&
(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&
(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&
this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],c),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-","testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?
-mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(d.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",
-function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,l,p){a.createHtml(b,c,d,e,f,g,h,k,l,p,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");
+mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(e.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",
+function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,l,q){a.createHtml(b,c,d,e,f,g,h,k,l,q,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");
d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft="26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+
window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&
a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();
b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);
-b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=d.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-d.view.translate.y)/d.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),
+b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=e.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-e.view.translate.y)/e.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),
function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+h+";height:"+k+';" src="'+a.createLink(b,c,d,e,f,g,l)+'"></iframe>');a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(h){a.spinner.stop();h=new EmbedDialog(a,
a.createLink(b,c,d,e,f,g,h));a.showDialog(h.container,440,240,!0,!0);h.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)f=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),
f.setToggleAction(!0),f.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,156,!0,!1)});f=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});f.setToggleAction(!0);f.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=
-function(b){d.isEditing()&&d.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=c;b&&(e.exit=!0);c=JSON.stringify(e)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),
+function(b){e.isEditing()&&e.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var d=a.createLoadMessage("save");d.xml=c;b&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),
a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,
["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],
-c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,e){function f(b){if(b&&Graph.fileSupport&&!mxClient.IS_IE&&!mxClient.IS_IE11){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(){null!=c.files&&a.importFiles(c.files,
-null,null,a.maxImageSize)});c.click()}else{window.openNew=!1;window.openKey="import";var e=Editor.useLocalStorage;Editor.useLocalStorage=!b;window.openFile=new OpenFile(function(b){a.hideDialog(b)});window.openFile.setConsumer(function(b,c){d.setSelectionCells(a.importXml(b))});a.showDialog((new OpenDialog(a)).container,360,220,!0,!0,function(){window.openFile=null});var f=a.dialog,g=f.close;a.dialog.close=function(b){Editor.useLocalStorage=e;g.apply(f,arguments);b&&null==a.getCurrentFile()&&"1"!=
-urlParams.embed&&a.showSplash()}}}function g(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=k(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");h(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var h=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),
-h=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),k=d.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,l=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,l,m){f=g?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,h,k,Math.round(l*f),Math.round(m*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),
-g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,h,k,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=
-typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){g(a.drive)},e):l&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},e,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){g(a.gitHub)},e);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){g(a.dropbox)},e):n&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
-e,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){g(a.oneDrive)},e):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},e,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){g(a.trello)},e):c&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},e,null,!1);b.addSeparator(e);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
-"...",null,function(){f(!1)},e);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){f(!0)},e);a.isOffline()||(b.addSeparator(e),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){h(a,c,b)},function(){a.spinner.stop();
-a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},e));b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},e)})).isEnabled=k;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&b.addCheckmark(d,
+c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,d){function f(b){if(b&&Graph.fileSupport&&!mxClient.IS_IE&&!mxClient.IS_IE11){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(){null!=c.files&&a.importFiles(c.files,
+null,null,a.maxImageSize)});c.click()}else{window.openNew=!1;window.openKey="import";var d=Editor.useLocalStorage;Editor.useLocalStorage=!b;window.openFile=new OpenFile(function(b){a.hideDialog(b)});window.openFile.setConsumer(function(b,c){e.setSelectionCells(a.importXml(b))});a.showDialog((new OpenDialog(a)).container,360,220,!0,!0,function(){window.openFile=null});var f=a.dialog,g=f.close;a.dialog.close=function(b){Editor.useLocalStorage=d;g.apply(f,arguments);b&&null==a.getCurrentFile()&&"1"!=
+urlParams.embed&&a.showSplash()}}}function g(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=l(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");h(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var h=mxUtils.bind(this,function(b,c,d){var f=e.view,g=e.getGraphBounds(),
+h=e.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*e.gridSize)),k=e.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*e.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,l=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,l,m){f=g?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,h,k,Math.round(l*f),Math.round(m*f),d,function(b){a.spinner.stop();e.setSelectionCells(b);e.scrollCellToVisible(e.getSelectionCell())})}),
+g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,h,k,0,0,d,function(b){a.spinner.stop();e.setSelectionCells(b);e.scrollCellToVisible(e.getSelectionCell())})}),l=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=
+typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){g(a.drive)},d):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){g(a.gitHub)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){g(a.dropbox)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
+d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){g(a.oneDrive)},d):n&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){g(a.trello)},d):c&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
+"...",null,function(){f(!1)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){f(!0)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){h(a,c,b)},function(){a.spinner.stop();
+a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d));b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},d)})).isEnabled=l;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&b.addCheckmark(d,
Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));this.editorUi.actions.addAction("rename...",mxUtils.bind(this,
function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),
-b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}})).isEnabled=function(){return this.enabled&&k.apply(this,arguments)};a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():
+b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}})).isEnabled=function(){return this.enabled&&l.apply(this,arguments)};a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():
a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,
-function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(a.getEditBlankXml(),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=
-a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://www.draw.io/app")}));
+function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,
+function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://www.draw.io/app")}));
a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://download.draw.io")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||
-this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var x="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle - fromText".split(" "),y=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),
-c)},v=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.container.focus();d.setSelectionCell(a);d.scrollCellToVisible(a);return a};a.actions.addAction("insertText",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(v("Text",40,20,
-"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=k;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=k;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",80,80,"ellipse;whiteSpace=wrap;html=1;")},
-null,null,Editor.ctrlKey+"+Shift+K").isEnabled=k;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=k;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<x.length;c++)"-"==x[c]?a.addSeparator(b):y(a,b,mxResources.get(x[c])+"...",x[c])})));
+this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var w="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle - fromText".split(" "),y=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),
+c)},B=function(a,b,c,d){var f=e.isMouseInsertPoint()?e.getInsertPoint():e.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),d);a.vertex=!0;e.getModel().beginUpdate();try{a=e.addCell(a),e.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{e.getModel().endUpdate()}e.container.focus();e.setSelectionCell(a);e.scrollCellToVisible(a);return a};a.actions.addAction("insertText",function(){e.isEnabled()&&!e.isCellLocked(e.getDefaultParent())&&e.startEditingAtCell(B("Text",40,20,
+"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=l;a.actions.addAction("insertRectangle",function(){e.isEnabled()&&!e.isCellLocked(e.getDefaultParent())&&B("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=l;a.actions.addAction("insertEllipse",function(){e.isEnabled()&&!e.isCellLocked(e.getDefaultParent())&&B("",80,80,"ellipse;whiteSpace=wrap;html=1;")},
+null,null,Editor.ctrlKey+"+Shift+K").isEnabled=l;a.actions.addAction("insertRhombus",function(){e.isEnabled()&&!e.isCellLocked(e.getDefaultParent())&&B("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=l;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<w.length;c++)"-"==w[c]?a.addSeparator(b):y(a,b,mxResources.get(w[c])+"...",w[c])})));
this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,d){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},
-d):l&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},d):n&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,
-function(){a.pickFile(App.MODE_ONEDRIVE)},d):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},d):c&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},
+d):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,
+function(){a.pickFile(App.MODE_ONEDRIVE)},d):n&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},d):c&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},
d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},
-mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));this.put("newLibrary",new Menu(function(b,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):l&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,
-function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},d):n&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},d):m&&b.addItem(mxResources.get("oneDrive")+" ("+
+mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));this.put("newLibrary",new Menu(function(b,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,
+function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},d):n&&b.addItem(mxResources.get("oneDrive")+" ("+
mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},d):c&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+
-"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)}));this.put("openLibraryFrom",new Menu(function(b,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):l&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},
-d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):n&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",
+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)}));this.put("openLibraryFrom",new Menu(function(b,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},
+d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):n&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",
null,function(){a.pickLibrary(App.MODE_TRELLO)},d):c&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=
-new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(E){a.handleError(E,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},
+new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(F){a.handleError(F,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},
function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,
(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,
"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&
@@ -7084,89 +7089,89 @@ this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","edit
b.addSeparator(c);a.isOffline()||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],c);a.isOfflineApp()||"1"==urlParams.embed||this.addMenuItems(b,["offline"],c)})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,
["-","pageSetup","print","-","save"],c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",
b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);
-this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var d=Menus.prototype.menuCreated;
-Menus.prototype.menuCreated=function(a,e){if(480>=screen.width&&a==this.get("help")){e.style.paddingRight="0px";e.style.paddingLeft="0px";e.innerHTML="";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("valign","bottom");b.setAttribute("src",Editor.helpImage);e.appendChild(b)}d.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
-DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,e,d){this.ui=a;this.page=e;this.previous=this.name=d}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
-function MovePage(a,e,d){this.ui=a;this.oldIndex=e;this.newIndex=d}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
-function SelectPage(a,e){this.ui=a;this.previousPage=this.page=e;this.neverShown=!0;null!=e&&(this.neverShown=null==e.viewState,this.ui.updatePageRoot(e))}
-SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,e=this.ui.editor,d=e.graph,b=e.graph.compress(d.zapGremlins(mxUtils.getXml(e.getGraphXml(!0))));mxUtils.setTextContent(a.node,b);a.viewState=d.getViewState();a.root=d.model.root;d.view.clear(a.root,!0);d.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;d.model.rootChanged(a.root);d.setViewState(a.viewState);
-e.fireEvent(new mxEventObject("setViewState","change",this));d.gridEnabled=d.gridEnabled&&(!this.ui.editor.chromeless||"1"==urlParams.grid);e.updateGraphComponents();d.view.validate();d.sizeDidChange();this.neverShown&&(this.neverShown=!1,d.selectUnlockedLayer());e.graph.fireEvent(new mxEventObject(mxEvent.ROOT));e.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,e,d,b){SelectPage.call(this,a,d);this.relatedPage=e;this.index=b;this.previousIndex=null}
+this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var e=Menus.prototype.menuCreated;
+Menus.prototype.menuCreated=function(a,d){if(480>=screen.width&&a==this.get("help")){d.style.paddingRight="0px";d.style.paddingLeft="0px";d.innerHTML="";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("valign","bottom");b.setAttribute("src",Editor.helpImage);d.appendChild(b)}e.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
+DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,d,e){this.ui=a;this.page=d;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
+function MovePage(a,d,e){this.ui=a;this.oldIndex=d;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
+function SelectPage(a,d){this.ui=a;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d))}
+SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,d=this.ui.editor,e=d.graph,b=d.graph.compress(e.zapGremlins(mxUtils.getXml(d.getGraphXml(!0))));mxUtils.setTextContent(a.node,b);a.viewState=e.getViewState();a.root=e.model.root;e.view.clear(a.root,!0);e.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;e.model.rootChanged(a.root);e.setViewState(a.viewState);
+d.fireEvent(new mxEventObject("setViewState","change",this));e.gridEnabled=e.gridEnabled&&(!this.ui.editor.chromeless||"1"==urlParams.grid);d.updateGraphComponents();e.view.validate();e.sizeDidChange();this.neverShown&&(this.neverShown=!1,e.selectUnlockedLayer());d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,d,e,b){SelectPage.call(this,a,e);this.relatedPage=d;this.index=b;this.previousIndex=null}
mxUtils.extend(ChangePage,SelectPage);ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var a=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(a,1);this.index=a}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;SelectPage.prototype.execute.apply(this,arguments)};
-EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var e=0;e<this.pages.length;e++)if(this.pages[e].getId()==a)return this.pages[e];return null};
-EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,e=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height;this.tabContainer.style.height=
-null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";b!=this.tabContainer.style.height&&this.refresh(!1)}e.apply(a.view,arguments)});var d=!1,b=null,h=mxUtils.bind(this,function(){this.updateTabContainer();var e=this.currentPage;null!=e&&e!=b&&(null==e.viewState||null==e.viewState.scrollLeft?(this.resetScrollbars(),a.lightbox&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=
-a.view.translate.x*a.view.scale+e.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+e.viewState.scrollTop),b=e);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?d||(1!=MathJax.Hub.queue.pending||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})),MathJax.Hub.Queue(mxUtils.bind(this,function(){d=!0}))):"undefined"===typeof Editor.MathJaxClear||
-this.editor.graph.mathEnabled||(d=!0,Editor.MathJaxClear())});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var d=b.getProperty("edit").changes,e=0;e<d.length;e++)if(d[e]instanceof SelectPage||d[e]instanceof RenamePage||d[e]instanceof MovePage||d[e]instanceof mxRootChange){h();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
-Graph.prototype.createViewState=function(a){var e=a.getAttribute("page"),d=a.getAttribute("pageScale"),b=a.getAttribute("pageWidth"),h=a.getAttribute("pageHeight"),k=a.getAttribute("background"),l=a.getAttribute("backgroundImage"),l=null!=l&&0<l.length?JSON.parse(l):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
-a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=k&&0<k.length?k:this.defaultGraphBackground,backgroundImage:null!=l?new mxImage(l.src,l.width,l.height):null,pageScale:null!=d?d:mxGraph.prototype.pageScale,pageFormat:null!=b&&null!=h?new mxRectangle(0,0,parseFloat(b),parseFloat(h)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
+EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var d=0;d<this.pages.length;d++)if(this.pages[d].getId()==a)return this.pages[d];return null};
+EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,d=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height;this.tabContainer.style.height=
+null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";b!=this.tabContainer.style.height&&this.refresh(!1)}d.apply(a.view,arguments)});var e=!1,b=null,h=mxUtils.bind(this,function(){this.updateTabContainer();var d=this.currentPage;null!=d&&d!=b&&(null==d.viewState||null==d.viewState.scrollLeft?(this.resetScrollbars(),a.lightbox&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=
+a.view.translate.x*a.view.scale+d.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+d.viewState.scrollTop),b=d);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?e||(1!=MathJax.Hub.queue.pending||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})),MathJax.Hub.Queue(mxUtils.bind(this,function(){e=!0}))):"undefined"===typeof Editor.MathJaxClear||
+this.editor.graph.mathEnabled||(e=!0,Editor.MathJaxClear())});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var d=b.getProperty("edit").changes,e=0;e<d.length;e++)if(d[e]instanceof SelectPage||d[e]instanceof RenamePage||d[e]instanceof MovePage||d[e]instanceof mxRootChange){h();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
+Graph.prototype.createViewState=function(a){var d=a.getAttribute("page"),e=a.getAttribute("pageScale"),b=a.getAttribute("pageWidth"),h=a.getAttribute("pageHeight"),l=a.getAttribute("background"),k=a.getAttribute("backgroundImage"),k=null!=k&&0<k.length?JSON.parse(k):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
+a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=l&&0<l.length?l:this.defaultGraphBackground,backgroundImage:null!=k?new mxImage(k.src,k.width,k.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=b&&null!=h?new mxRectangle(0,0,parseFloat(b),parseFloat(h)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}};
Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),
arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled}};
Graph.prototype.setViewState=function(a){null!=a?(this.lastPasteXml=a.lastPasteXml,this.pasteCounter=a.pasteCounter||0,this.mathEnabled=a.mathEnabled,this.gridEnabled=a.gridEnabled,this.gridSize=a.gridSize,this.graphHandler.guidesEnabled=a.guidesEnabled,this.foldingEnabled=a.foldingEnabled,this.setShadowVisible(a.shadowVisible,!1),this.scrollbars=a.scrollbars,this.pageVisible=a.pageVisible,this.background=a.background,this.backgroundImage=a.backgroundImage,this.pageScale=a.pageScale,this.pageFormat=
a.pageFormat,this.view.scale=a.scale,this.view.currentRoot=a.currentRoot,this.defaultParent=a.defaultParent,this.connectionArrowsEnabled=a.arrows,this.setTooltips(a.tooltips),this.setConnectable(a.connect),this.model.contains(this.view.currentRoot)||(this.view.currentRoot=null),this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer()),null!=a.translate&&(this.view.translate=a.translate)):(this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=!0,this.gridSize=
mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat=mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.background=this.defaultGraphBackground,this.backgroundImage=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=!1,this.connectionArrowsEnabled=!0);this.preferPageSize=
-this.pageBreaksVisible=this.pageVisible};EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var e=this.editor.extractGraphModel(a.node);if(null!=e){a.graphModelNode=e;a.viewState=this.editor.graph.createViewState(e);var d=new mxCodec(e.ownerDocument);a.root=d.decode(e).root}else a.root=this.editor.graph.model.createRoot()}return a};
-EditorUi.prototype.selectPage=function(a,e){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);e=null!=e?e:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var b=new SelectPage(this,a);b.execute();d.add(b);d.notify();e||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))};
-EditorUi.prototype.selectNextPage=function(a){var e=this.currentPage;null!=e&&null!=this.pages&&(e=mxUtils.indexOf(this.pages,e),a?this.selectPage(this.pages[mxUtils.mod(e+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(e-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(a,e){if(this.editor.graph.isEnabled()){a=null!=a?a:this.createPage();e=null!=e?e:this.pages.length;var d=new ChangePage(this,a,a,e);this.editor.graph.model.execute(d)}return a};
-EditorUi.prototype.createPage=function(a){var e=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"));e.setName(null!=a?a:this.createPageName());return e};EditorUi.prototype.createPageName=function(){for(var a={},e=0;e<this.pages.length;e++){var d=this.pages[e].getName();null!=d&&0<d.length&&(a[d]=d)}e=this.pages.length;do d=mxResources.get("pageWithNumber",[++e]);while(null!=a[d]);return d};
-EditorUi.prototype.removePage=function(a){var e=this.editor.graph;if(e.isEnabled()){e.model.beginUpdate();try{var d=this.currentPage;if(d==a)if(1<this.pages.length){var b=mxUtils.indexOf(this.pages,a);b==this.pages.length-1?b--:b++;d=this.pages[b]}else d=this.insertPage(),e.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1])));e.model.execute(new ChangePage(this,a,d))}finally{e.model.endUpdate()}}return a};
-EditorUi.prototype.duplicatePage=function(a,e){var d=this.editor.graph,b=null;d.isEnabled()&&(d.isEditing()&&d.stopEditing(),b=a.node.cloneNode(!1),b.removeAttribute("id"),b=new DiagramPage(b),b.root=d.cloneCells([d.model.root])[0],b.viewState=d.getViewState(),b.viewState.scale=1,b.viewState.scrollLeft=null,b.viewState.scrollRight=null,b.setName(e),b=this.insertPage(b,mxUtils.indexOf(this.pages,a)+1));return b};
-EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var e=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(d){null!=d&&0<d.length&&this.editor.graph.model.execute(new RenamePage(this,a,d))}),mxResources.get("rename"));this.showDialog(e.container,300,80,!0,!0);e.init()}return a};EditorUi.prototype.movePage=function(a,e){this.editor.graph.model.execute(new MovePage(this,a,e))};
+this.pageBreaksVisible=this.pageVisible};EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var d=this.editor.extractGraphModel(a.node);if(null!=d){a.graphModelNode=d;a.viewState=this.editor.graph.createViewState(d);var e=new mxCodec(d.ownerDocument);a.root=e.decode(d).root}else a.root=this.editor.graph.model.createRoot()}return a};
+EditorUi.prototype.selectPage=function(a,d){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d=null!=d?d:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var e=this.editor.graph.model.createUndoableEdit();e.ignoreEdit=!0;var b=new SelectPage(this,a);b.execute();e.add(b);e.notify();d||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))};
+EditorUi.prototype.selectNextPage=function(a){var d=this.currentPage;null!=d&&null!=this.pages&&(d=mxUtils.indexOf(this.pages,d),a?this.selectPage(this.pages[mxUtils.mod(d+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(d-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(a,d){if(this.editor.graph.isEnabled()){a=null!=a?a:this.createPage();d=null!=d?d:this.pages.length;var e=new ChangePage(this,a,a,d);this.editor.graph.model.execute(e)}return a};
+EditorUi.prototype.createPage=function(a){var d=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"));d.setName(null!=a?a:this.createPageName());return d};EditorUi.prototype.createPageName=function(){for(var a={},d=0;d<this.pages.length;d++){var e=this.pages[d].getName();null!=e&&0<e.length&&(a[e]=e)}d=this.pages.length;do e=mxResources.get("pageWithNumber",[++d]);while(null!=a[e]);return e};
+EditorUi.prototype.removePage=function(a){var d=this.editor.graph;if(d.isEnabled()){d.model.beginUpdate();try{var e=this.currentPage;if(e==a)if(1<this.pages.length){var b=mxUtils.indexOf(this.pages,a);b==this.pages.length-1?b--:b++;e=this.pages[b]}else e=this.insertPage(),d.model.execute(new RenamePage(this,e,mxResources.get("pageWithNumber",[1])));d.model.execute(new ChangePage(this,a,e))}finally{d.model.endUpdate()}}return a};
+EditorUi.prototype.duplicatePage=function(a,d){var e=this.editor.graph,b=null;e.isEnabled()&&(e.isEditing()&&e.stopEditing(),b=a.node.cloneNode(!1),b.removeAttribute("id"),b=new DiagramPage(b),b.root=e.cloneCells([e.model.root])[0],b.viewState=e.getViewState(),b.viewState.scale=1,b.viewState.scrollLeft=null,b.viewState.scrollRight=null,b.setName(d),b=this.insertPage(b,mxUtils.indexOf(this.pages,a)+1));return b};
+EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(d){null!=d&&0<d.length&&this.editor.graph.model.execute(new RenamePage(this,a,d))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return a};EditorUi.prototype.movePage=function(a,d){this.editor.graph.model.execute(new MovePage(this,a,d))};
EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#dcdcdc";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a};
-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,e=document.createElement("div");e.style.position="relative";e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.style.verticalAlign="top";e.style.height=this.tabContainer.style.height;e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.style.fontSize="12px";e.style.marginLeft="30px";for(var d=this.editor.chromeless?29:59,b=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-d)/this.pages.length)+1),h=null,k=0;k<this.pages.length;k++)mxUtils.bind(this,function(b,d){this.pages[b]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",d.style.fontWeight="bold",d.style.borderTopStyle="none"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),h=b):mxEvent.consume(c)}));mxEvent.addListener(d,
-"dragend",mxUtils.bind(this,function(a){h=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=h&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=h&&b!=h&&this.movePage(h,b);a.stopPropagation();a.preventDefault()}));e.appendChild(d)})(k,this.createTabForPage(this.pages[k],b,this.pages[k]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(e);
-b=this.createPageMenuTab();this.tabContainer.appendChild(b);b=null;this.isPageInsertTabVisible()&&(b=this.createPageInsertTab(),this.tabContainer.appendChild(b));if(e.clientWidth>this.tabContainer.clientWidth-d){null!=b&&(b.style.position="absolute",b.style.right="0px",e.style.marginRight="30px");var l=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");l.style.position="absolute";l.style.right=this.editor.chromeless?"29px":"55px";l.style.fontSize="13pt";this.tabContainer.appendChild(l);var n=this.createControlTab(4,
-"&nbsp;&#10095;");n.style.position="absolute";n.style.right=this.editor.chromeless?"0px":"29px";n.style.fontSize="13pt";this.tabContainer.appendChild(n);var m=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));e.style.width=m+"px";mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){e.scrollLeft-=Math.max(20,m-20);mxUtils.setOpacity(l,0<e.scrollLeft?100:50);mxUtils.setOpacity(n,e.scrollLeft<e.scrollWidth-e.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(l,
-0<e.scrollLeft?100:50);mxUtils.setOpacity(n,e.scrollLeft<e.scrollWidth-e.clientWidth?100:50);mxEvent.addListener(n,"click",mxUtils.bind(this,function(a){e.scrollLeft+=Math.max(20,m-20);mxUtils.setOpacity(l,0<e.scrollLeft?100:50);mxUtils.setOpacity(n,e.scrollLeft<e.scrollWidth-e.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
-EditorUi.prototype.createTab=function(a){var e=document.createElement("div");e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.style.whiteSpace="nowrap";e.style.boxSizing="border-box";e.style.position="relative";e.style.overflow="hidden";e.style.marginLeft="-1px";e.style.height=this.tabContainer.clientHeight+"px";e.style.padding="8px 4px 8px 4px";e.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #c0c0c0";e.style.borderBottomStyle="solid";e.style.backgroundColor=this.tabContainer.style.backgroundColor;
-e.style.cursor="default";e.style.color="gray";a&&(mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(e.style.backgroundColor="dark"==uiTheme?"black":"#d3d3d3",mxEvent.consume(a))})),mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){e.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return e};
-EditorUi.prototype.createControlTab=function(a,e){var d=this.createTab(!0);d.style.paddingTop=a+"px";d.style.cursor="pointer";d.style.width="30px";d.style.lineHeight="30px";d.innerHTML=e;null!=d.firstChild&&null!=d.firstChild.style&&mxUtils.setOpacity(d.firstChild,40);return d};
+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,d=document.createElement("div");d.style.position="relative";d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.style.verticalAlign="top";d.style.height=this.tabContainer.style.height;d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.fontSize="12px";d.style.marginLeft="30px";for(var e=this.editor.chromeless?29:59,b=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
+e)/this.pages.length)+1),h=null,l=0;l<this.pages.length;l++)mxUtils.bind(this,function(b,e){this.pages[b]==this.currentPage?(e.className="geActivePage",e.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",e.style.fontWeight="bold",e.style.borderTopStyle="none"):e.className="geInactivePage";e.setAttribute("draggable","true");mxEvent.addListener(e,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),h=b):mxEvent.consume(c)}));mxEvent.addListener(e,
+"dragend",mxUtils.bind(this,function(a){h=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=h&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){null!=h&&b!=h&&this.movePage(h,b);a.stopPropagation();a.preventDefault()}));d.appendChild(e)})(l,this.createTabForPage(this.pages[l],b,this.pages[l]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(d);
+b=this.createPageMenuTab();this.tabContainer.appendChild(b);b=null;this.isPageInsertTabVisible()&&(b=this.createPageInsertTab(),this.tabContainer.appendChild(b));if(d.clientWidth>this.tabContainer.clientWidth-e){null!=b&&(b.style.position="absolute",b.style.right="0px",d.style.marginRight="30px");var k=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");k.style.position="absolute";k.style.right=this.editor.chromeless?"29px":"55px";k.style.fontSize="13pt";this.tabContainer.appendChild(k);var m=this.createControlTab(4,
+"&nbsp;&#10095;");m.style.position="absolute";m.style.right=this.editor.chromeless?"0px":"29px";m.style.fontSize="13pt";this.tabContainer.appendChild(m);var n=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));d.style.width=n+"px";mxEvent.addListener(k,"click",mxUtils.bind(this,function(a){d.scrollLeft-=Math.max(20,n-20);mxUtils.setOpacity(k,0<d.scrollLeft?100:50);mxUtils.setOpacity(m,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(k,
+0<d.scrollLeft?100:50);mxUtils.setOpacity(m,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.addListener(m,"click",mxUtils.bind(this,function(a){d.scrollLeft+=Math.max(20,n-20);mxUtils.setOpacity(k,0<d.scrollLeft?100:50);mxUtils.setOpacity(m,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
+EditorUi.prototype.createTab=function(a){var d=document.createElement("div");d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.style.whiteSpace="nowrap";d.style.boxSizing="border-box";d.style.position="relative";d.style.overflow="hidden";d.style.marginLeft="-1px";d.style.height=this.tabContainer.clientHeight+"px";d.style.padding="8px 4px 8px 4px";d.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #c0c0c0";d.style.borderBottomStyle="solid";d.style.backgroundColor=this.tabContainer.style.backgroundColor;
+d.style.cursor="default";d.style.color="gray";a&&(mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(d.style.backgroundColor="dark"==uiTheme?"black":"#d3d3d3",mxEvent.consume(a))})),mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,function(a){d.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return d};
+EditorUi.prototype.createControlTab=function(a,d){var e=this.createTab(!0);e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.style.lineHeight="30px";e.innerHTML=d;null!=e.firstChild&&null!=e.firstChild.style&&mxUtils.setOpacity(e.firstChild,40);return e};
EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var d=0;d<this.pages.length;d++)mxUtils.bind(this,
function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[c])}),b);this.pages[c]==this.currentPage&&a.addCheckmark(d,Editor.checkmarkImage)})(d);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var e=this.currentPage;null!=e&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(e)}),b),a.addItem(mxResources.get("rename"),
-null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxEvent.getClientX(a),e=mxEvent.getClientY(a);d.popup(b,e,null,a);this.setCurrentMenu(d);
+null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxEvent.getClientX(a),h=mxEvent.getClientY(a);d.popup(b,h,null,a);this.setCurrentMenu(d);
mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a};
-EditorUi.prototype.createTabForPage=function(a,e,d){d=this.createTab(d);var b=a.getName();d.setAttribute("title",b);mxUtils.write(d,b);d.style.maxWidth=e+"px";d.style.width=e+"px";this.addTabListeners(a,d);42<e&&(d.style.textOverflow="ellipsis");return d};
-EditorUi.prototype.addTabListeners=function(a,e){mxEvent.disableContextMenu(e);var d=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,h=!1;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(e){b=null!=this.currentMenu;h=a==this.currentPage;d.isMouseDown||h||this.selectPage(a)}),null,mxUtils.bind(this,function(k){if(d.isEnabled()&&!d.isMouseDown&&(mxEvent.isTouchEvent(k)&&h||mxEvent.isPopupTrigger(k))){d.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(k)||!b){var l=new mxPopupMenu(this.createPageMenu(a));l.div.className+=" geMenubarMenu";l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);this.resetCurrentMenu();l.destroy()});var n=mxEvent.getClientX(k),m=mxEvent.getClientY(k);l.popup(n,m,null,k);this.setCurrentMenu(l,e)}mxEvent.consume(k)}}))};
-EditorUi.prototype.createPageMenu=function(a,e){return mxUtils.bind(this,function(d,b){d.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),b);d.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),b);d.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,e)}),b);d.addSeparator(b);d.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
-mxResources.get("copyOf",[a.getName()]))}),b)})};(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,d,b){b.setAttribute("page",d.page.getId());return b};a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){b.page=a.ui.getPageById(d.getAttribute("page"));b.previous=b.name;return b};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","neverShown"]);a.afterEncode=function(a,d,b){b.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(b.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,b));return b};a.beforeDecode=function(a,d,b){b.ui=a.ui;b.relatedPage=b.ui.getPageById(d.getAttribute("relatedPage"));if(null==b.relatedPage){var e=document.createElement("diagram");e.setAttribute("id",d.getAttribute("relatedPage"));
-e.setAttribute("name",d.getAttribute("name"));b.relatedPage=new DiagramPage(e);d=d.cloneNode(!0);e=d.firstChild;if(null!=e)for(b.relatedPage.root=a.decodeCell(e,!1),b=e.nextSibling,e.parentNode.removeChild(e),e=b;null!=e;){b=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_ELEMENT){var k=e.getAttribute("id");null==a.lookup(k)&&a.decodeCell(e)}e.parentNode.removeChild(e);e=b}}return d};a.afterDecode=function(a,d,b){b.index=b.previousIndex;return b};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",e=Graph.prototype.foldCells;
-Graph.prototype.foldCells=function(a,b,d,n,m){b=null!=b?b:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=d.slice(),f=[],g=0;g<d.length;g++){var h=this.view.getState(d[g]),k=null!=h?h.style:this.getCellStyle(d[g]);"1"==mxUtils.getValue(k,"treeFolding","0")&&(this.traverse(d[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=d[g]&&f.push(a);return a==d[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(d[g],
-a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);d=c;d=e.apply(this,arguments)}finally{this.model.endUpdate()}return d};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return x.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=x.getParent(a),b=u.view.getState(a),u.view.getState(a),b="tree"==(null!=b?b.style:u.getCellStyle(a)).containerType);
-return b}function e(a){var b=!1;null!=a&&(a=x.getParent(a),b=u.view.getState(a),u.view.getState(a),b=null!=(null!=b?b.style:u.getCellStyle(a)).childLayout);return b}function n(a){a=u.view.getState(a);if(null!=a){var b=u.getIncomingEdges(a.cell);if(0<b.length&&(b=u.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
-a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function m(a,b){b=null!=b?b:!0;u.model.beginUpdate();try{var c=u.model.getParent(a),d=u.getIncomingEdges(a),e=u.cloneCells([d[0],a]);u.model.setTerminal(e[0],u.model.getTerminal(d[0],!0),!0);var f=n(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
-10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);u.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=u.view.getState(a),k=u.view.scale;if(null!=h){var l=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?l.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:l.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var m=u.getOutgoingEdges(u.model.getTerminal(d[0],
-!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=d=0;q<m.length;q++){var t=u.model.getTerminal(m[q],!1);if(f==n(t)){var B=u.view.getState(t);t!=a&&null!=B&&(p&&b!=B.getCenterX()<h.getCenterX()||!p&&b!=B.getCenterY()<h.getCenterY())&&mxUtils.intersects(l,B)&&(d=10+Math.max(d,(Math.min(l.x+l.width,B.x+B.width)-Math.max(l.x,B.x))/k),g=10+Math.max(g,(Math.min(l.y+l.height,B.y+B.height)-Math.max(l.y,B.y))/k))}}p?g=0:d=0;for(q=0;q<m.length;q++)if(t=u.model.getTerminal(m[q],
-!1),f==n(t)&&(B=u.view.getState(t),t!=a&&null!=B&&(p&&b!=B.getCenterX()<h.getCenterX()||!p&&b!=B.getCenterY()<h.getCenterY()))){var v=[];u.traverse(B.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});u.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return u.addCells(e,c)}finally{u.model.endUpdate()}}function c(a){u.model.beginUpdate();try{var b=n(a),c=u.getIncomingEdges(a),d=u.cloneCells([c[0],a]);u.model.setTerminal(c[0],d[1],!1);u.model.setTerminal(d[0],d[1],!0);u.model.setTerminal(d[0],a,!1);
-var e=u.model.getParent(a),f=e.geometry,g=[];u.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);u.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,k=-40):b==mxConstants.DIRECTION_WEST?(h=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);u.moveCells(g,h,k);return u.addCells(d,e)}finally{u.model.endUpdate()}}function f(a){u.model.beginUpdate();try{var b=
-u.model.getParent(a),c=u.getIncomingEdges(a),d=u.cloneCells([c[0],a]);u.model.setTerminal(d[0],a,!0);var c=u.getOutgoingEdges(a),e=b.geometry,f=[];u.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=u.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=u.view.getBounds(f),l=n(a),m=u.view.translate,p=u.view.scale;l==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height-
-e.y+40):l==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=l==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-m.y+-e.y+10);return u.addCells(d,b)}finally{u.model.endUpdate()}}function g(a,
-b,c){a=u.getOutgoingEdges(a);c=u.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=u.view.getState(u.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function t(a,b){var c=n(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
-c==mxConstants.DIRECTION_WEST)==d&&c!=b?q.actions.get("selectParent").funct():c==b?(d=u.getOutgoingEdges(a),null!=d&&0<d.length&&u.setSelectionCell(u.model.getTerminal(d[0],!1))):(c=u.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(u.model.getTerminal(c[0],!0),d,a),c=u.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&u.setSelectionCell(d[c].cell)))))}var q=this,u=q.editor.graph,x=u.getModel();mxResources.parse("selectChildren=Select Children");
-mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var y=q.menus.createPopupMenu;q.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);if(1==u.getSelectionCount()){c=u.getSelectionCell();var e=u.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(u.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(u.getSelectionCell())&&
-(a.addSeparator(),0<u.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};q.actions.addAction("selectChildren",function(){if(u.isEnabled()&&1==u.getSelectionCount()){var a=u.getSelectionCell(),a=u.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(u.model.getTerminal(a[c],!1));u.setSelectionCells(b)}}},null,null,"Alt+Shift+X");q.actions.addAction("selectSiblings",function(){if(u.isEnabled()&&1==u.getSelectionCount()){var a=u.getSelectionCell(),
-a=u.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=u.getOutgoingEdges(u.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(u.model.getTerminal(a[c],!1));u.setSelectionCells(b)}}},null,null,"Alt+Shift+S");q.actions.addAction("selectParent",function(){if(u.isEnabled()&&1==u.getSelectionCount()){var a=u.getSelectionCell(),a=u.getIncomingEdges(a);null!=a&&0<a.length&&u.setSelectionCell(u.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");q.actions.addAction("selectDescendants",
-function(){if(u.isEnabled()&&1==u.getSelectionCount()){var a=u.getSelectionCell(),b=[];u.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});u.setSelectionCells(b)}},null,null,"Alt+Shift+T");var v=u.removeCells;u.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];x.isEdge(g)&&d(g)&&(e.push(g),g=x.getTerminal(g,!1));b(g)?(u.traverse(g,!0,
-function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=u.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return v.apply(this,arguments)};q.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var p=u.duplicateCells;u.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=u.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=u.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
-a)}this.model.beginUpdate();try{var h=p.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=u.getIncomingEdges(h[e]),g=u.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var l=this.cloneCells([g[0]])[0];this.addEdge(l,u.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var w=u.moveCells;u.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
-if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<a.length;p++)if(b(a[p])||u.model.isEdge(a[p])&&null==u.model.getTerminal(a[p],!0)){f=u.model.getParent(a[p]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var q=u.getIncomingEdges(a[0]);if(0<q.length){var t=u.view.getState(u.model.getTerminal(q[0],!0));if(null!=t){var v=u.view.getState(l);null!=v&&(c=(v.getCenterX()-t.getCenterX())/u.view.scale,d=(v.getCenterY()-t.getCenterY())/u.view.scale)}}}}k=w.apply(this,arguments);
-if(null!=k&&null!=a&&k.length==a.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))b(l)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],l,!0);else if(b(a[p])&&(q=u.getIncomingEdges(a[p]),0<q.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],l,!0);else if(0==u.getIncomingEdges(k[p]).length){m=l;if(null==m||m==u.model.getParent(a[p]))m=u.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e,
-u.getDefaultParent(),m,k[p])}}finally{this.model.endUpdate()}return k};if(null!=q.sidebar){var z=q.sidebar.dropAndConnect;q.sidebar.dropAndConnect=function(a,c,d,e){var f=u.model,g=null;f.beginUpdate();try{if(g=z.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=u.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var D={88:q.actions.get("selectChildren"),
-84:q.actions.get("selectSubtree"),80:q.actions.get("selectParent"),83:q.actions.get("selectSiblings")},A=q.onKeyDown;q.onKeyDown=function(a){try{if(u.isEnabled()&&!u.isEditing()&&b(u.getSelectionCell())&&1==u.getSelectionCount()){var d=null;0<u.getIncomingEdges(u.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(u.getSelectionCell()):f(u.getSelectionCell()):13==a.which&&(d=m(u.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&u.model.isEdge(d[0])?u.setSelectionCell(u.model.getTerminal(d[0],
-!1)):u.setSelectionCell(d[d.length-1]),null!=q.hoverIcons&&q.hoverIcons.update(u.view.getState(u.getSelectionCell())),u.startEditingAtCell(u.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=D[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(t(u.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(t(u.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(t(u.getSelectionCell(),
-mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(t(u.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(J){console.log("error",J)}mxEvent.isConsumed(a)||A.apply(this,arguments)};var F=u.connectVertex;u.connectVertex=function(a,d,e,g,h,k){var l=u.getIncomingEdges(a);return b(a)&&0<l.length?(e=n(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,h=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==h?c(a):m(a,d!=mxConstants.DIRECTION_NORTH&&
-d!=mxConstants.DIRECTION_WEST)):F.call(this,a,d,e,g,h,k)};u.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&u.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var E=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){E.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
+EditorUi.prototype.createTabForPage=function(a,d,e){e=this.createTab(e);var b=a.getName();e.setAttribute("title",b);mxUtils.write(e,b);e.style.maxWidth=d+"px";e.style.width=d+"px";this.addTabListeners(a,e);42<d&&(e.style.textOverflow="ellipsis");return e};
+EditorUi.prototype.addTabListeners=function(a,d){mxEvent.disableContextMenu(d);var e=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,h=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(d){b=null!=this.currentMenu;h=a==this.currentPage;e.isMouseDown||h||this.selectPage(a)}),null,mxUtils.bind(this,function(l){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(l)&&h||mxEvent.isPopupTrigger(l))){e.popupMenuHandler.hideMenu();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(l)||!b){var k=new mxPopupMenu(this.createPageMenu(a));k.div.className+=" geMenubarMenu";k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);this.resetCurrentMenu();k.destroy()});var m=mxEvent.getClientX(l),n=mxEvent.getClientY(l);k.popup(m,n,null,l);this.setCurrentMenu(k,d)}mxEvent.consume(l)}}))};
+EditorUi.prototype.createPageMenu=function(a,d){return mxUtils.bind(this,function(e,b){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),b);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),b);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,d)}),b);e.addSeparator(b);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
+mxResources.get("copyOf",[a.getName()]))}),b)})};(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})();
+(function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,e,b){b.setAttribute("page",e.page.getId());return b};a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.page=a.ui.getPageById(e.getAttribute("page"));b.previous=b.name;return b};mxCodecRegistry.register(a)})();
+(function(){var a=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","neverShown"]);a.afterEncode=function(a,e,b){b.setAttribute("relatedPage",e.relatedPage.getId());null==e.index&&(b.setAttribute("name",e.relatedPage.getName()),null!=e.relatedPage.root&&a.encodeCell(e.relatedPage.root,b));return b};a.beforeDecode=function(a,e,b){b.ui=a.ui;b.relatedPage=b.ui.getPageById(e.getAttribute("relatedPage"));if(null==b.relatedPage){var d=document.createElement("diagram");d.setAttribute("id",e.getAttribute("relatedPage"));
+d.setAttribute("name",e.getAttribute("name"));b.relatedPage=new DiagramPage(d);e=e.cloneNode(!0);d=e.firstChild;if(null!=d)for(b.relatedPage.root=a.decodeCell(d,!1),b=d.nextSibling,d.parentNode.removeChild(d),d=b;null!=d;){b=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var l=d.getAttribute("id");null==a.lookup(l)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=b}}return e};a.afterDecode=function(a,e,b){b.index=b.previousIndex;return b};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",d=Graph.prototype.foldCells;
+Graph.prototype.foldCells=function(a,b,e,m,n){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var h=this.view.getState(e[g]),k=null!=h?h.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(k,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g],
+a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=d.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return w.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=w.getParent(a),b=t.view.getState(a),t.view.getState(a),b="tree"==(null!=b?b.style:t.getCellStyle(a)).containerType);
+return b}function e(a){var b=!1;null!=a&&(a=w.getParent(a),b=t.view.getState(a),t.view.getState(a),b=null!=(null!=b?b.style:t.getCellStyle(a)).childLayout);return b}function m(a){a=t.view.getState(a);if(null!=a){var b=t.getIncomingEdges(a.cell);if(0<b.length&&(b=t.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
+a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function n(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=t.cloneCells([d[0],a]);t.model.setTerminal(e[0],t.model.getTerminal(d[0],!0),!0);var f=m(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
+10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=t.view.getState(a),k=t.view.scale;if(null!=h){var l=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?l.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:l.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var n=t.getOutgoingEdges(t.model.getTerminal(d[0],
+!0));if(null!=n){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=d=0;q<n.length;q++){var u=t.model.getTerminal(n[q],!1);if(f==m(u)){var C=t.view.getState(u);u!=a&&null!=C&&(p&&b!=C.getCenterX()<h.getCenterX()||!p&&b!=C.getCenterY()<h.getCenterY())&&mxUtils.intersects(l,C)&&(d=10+Math.max(d,(Math.min(l.x+l.width,C.x+C.width)-Math.max(l.x,C.x))/k),g=10+Math.max(g,(Math.min(l.y+l.height,C.y+C.height)-Math.max(l.y,C.y))/k))}}p?g=0:d=0;for(q=0;q<n.length;q++)if(u=t.model.getTerminal(n[q],
+!1),f==m(u)&&(C=t.view.getState(u),u!=a&&null!=C&&(p&&b!=C.getCenterX()<h.getCenterX()||!p&&b!=C.getCenterY()<h.getCenterY()))){var v=[];t.traverse(C.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});t.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function c(a){t.model.beginUpdate();try{var b=m(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);
+var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,k=-40):b==mxConstants.DIRECTION_WEST?(h=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);t.moveCells(g,h,k);return t.addCells(d,e)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=
+t.model.getParent(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(d[0],a,!0);var c=t.getOutgoingEdges(a),e=b.geometry,f=[];t.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=t.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=t.view.getBounds(f),l=m(a),n=t.view.translate,p=t.view.scale;l==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x-e.x+10,d[1].geometry.y+=a.geometry.height-
+e.y+40):l==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=l==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-n.y+-e.y+10);return t.addCells(d,b)}finally{t.model.endUpdate()}}function g(a,
+b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=t.view.getState(t.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function p(a,b){var c=m(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
+c==mxConstants.DIRECTION_WEST)==d&&c!=b?u.actions.get("selectParent").funct():c==b?(d=t.getOutgoingEdges(a),null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(t.model.getTerminal(c[0],!0),d,a),c=t.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&t.setSelectionCell(d[c].cell)))))}var u=this,t=u.editor.graph,w=t.getModel();mxResources.parse("selectChildren=Select Children");
+mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var y=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);if(1==t.getSelectionCount()){c=t.getSelectionCell();var e=t.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(t.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(t.getSelectionCell())&&
+(a.addSeparator(),0<t.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};u.actions.addAction("selectChildren",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),
+a=t.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=t.getOutgoingEdges(t.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);null!=a&&0<a.length&&t.setSelectionCell(t.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",
+function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),b=[];t.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});t.setSelectionCells(b)}},null,null,"Alt+Shift+T");var B=t.removeCells;t.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];w.isEdge(g)&&d(g)&&(e.push(g),g=w.getTerminal(g,!1));b(g)?(t.traverse(g,!0,
+function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=t.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return B.apply(this,arguments)};u.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var q=t.duplicateCells;t.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
+a)}this.model.beginUpdate();try{var h=q.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=t.getIncomingEdges(h[e]),g=t.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var l=this.cloneCells([g[0]])[0];this.addEdge(l,t.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var v=t.moveCells;t.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
+if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<a.length;p++)if(b(a[p])||t.model.isEdge(a[p])&&null==t.model.getTerminal(a[p],!0)){f=t.model.getParent(a[p]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var q=t.getIncomingEdges(a[0]);if(0<q.length){var u=t.view.getState(t.model.getTerminal(q[0],!0));if(null!=u){var w=t.view.getState(l);null!=w&&(c=(w.getCenterX()-u.getCenterX())/t.view.scale,d=(w.getCenterY()-u.getCenterY())/t.view.scale)}}}}k=v.apply(this,arguments);
+if(null!=k&&null!=a&&k.length==a.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))b(l)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],l,!0);else if(b(a[p])&&(q=t.getIncomingEdges(a[p]),0<q.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],l,!0);else if(0==t.getIncomingEdges(k[p]).length){m=l;if(null==m||m==t.model.getParent(a[p]))m=t.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e,
+t.getDefaultParent(),m,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var x=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=x.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=t.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var z={88:u.actions.get("selectChildren"),
+84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},A=u.onKeyDown;u.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&&b(t.getSelectionCell())&&1==t.getSelectionCount()){var d=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(t.getSelectionCell()):f(t.getSelectionCell()):13==a.which&&(d=n(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&t.model.isEdge(d[0])?t.setSelectionCell(t.model.getTerminal(d[0],
+!1)):t.setSelectionCell(d[d.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=z[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(t.getSelectionCell(),
+mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(K){console.log("error",K)}mxEvent.isConsumed(a)||A.apply(this,arguments)};var E=t.connectVertex;t.connectVertex=function(a,d,e,g,h,k){var l=t.getIncomingEdges(a);return b(a)&&0<l.length?(e=m(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,h=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==h?c(a):n(a,d!=mxConstants.DIRECTION_NORTH&&
+d!=mxConstants.DIRECTION_WEST)):E.call(this,a,d,e,g,h,k)};t.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&t.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);
-this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var C=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){C.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
+this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var D=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){D.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var b=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=b.apply(this,arguments),d=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");
b.vertex=!0;var d=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");c.geometry.relative=!0;c.edge=!0;b.insertEdge(c,!0);d.insertEdge(c,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
-e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var h=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");h.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-k.geometry.relative=!0;k.edge=!0;b.insertEdge(k,!0);h.insertEdge(k,!1);var u=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");u.vertex=!0;var x=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-x.geometry.relative=!0;x.edge=!0;b.insertEdge(x,!0);u.insertEdge(x,!1);a.insert(c);a.insert(g);a.insert(k);a.insert(x);a.insert(b);a.insert(d);a.insert(e);a.insert(h);a.insert(u);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
+e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var h=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");h.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+l.geometry.relative=!0;l.edge=!0;b.insertEdge(l,!0);h.insertEdge(l,!1);var t=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");t.vertex=!0;var w=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+w.geometry.relative=!0;w.edge=!0;b.insertEdge(w,!0);t.insertEdge(w,!1);a.insert(c);a.insert(g);a.insert(l);a.insert(w);a.insert(b);a.insert(d);a.insert(e);a.insert(h);a.insert(t);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Organization",
diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js
index 7db9b6fc..3ae68988 100644
--- a/src/main/webapp/js/diagramly/App.js
+++ b/src/main/webapp/js/diagramly/App.js
@@ -291,7 +291,7 @@ App.getStoredMode = function()
window.location.hash == '') || (window.location.hash != null &&
window.location.hash.substring(0, 2) == '#G'))
{
- mxscript('https://apis.google.com/js/api.js');
+ mxscript('https://apis.google.com/js/api.js', null, null, null, mxClient.IS_SVG);
}
// Keeps lazy loading for fallback to authenticated Google file if not public in loadFile
else if (urlParams['chrome'] == '0' && (window.location.hash == null ||
@@ -494,7 +494,7 @@ App.main = function(callback, createUi)
}
else if (urlParams['chrome'] != '0' && !EditorUi.isElectronApp)
{
- mxscript(App.FOOTER_PLUGIN_URL);
+ mxscript(App.FOOTER_PLUGIN_URL, null, null, null, mxClient.IS_SVG);
}
if (plugins != null && plugins.length > 0 && urlParams['plugins'] != '0')
@@ -537,7 +537,7 @@ App.main = function(callback, createUi)
(urlParams['embed'] == '1' && urlParams['gapi'] == '1')) && isSvgBrowser &&
isLocalStorage && (document.documentMode == null || document.documentMode >= 10))))
{
- mxscript('https://apis.google.com/js/api.js?onload=DrawGapiClientCallback');
+ mxscript('https://apis.google.com/js/api.js?onload=DrawGapiClientCallback', null, null, null, mxClient.IS_SVG);
}
// Disables client
else if (typeof window.gapi === 'undefined')
diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.js
index ea3f6a8c..4ca06d82 100644
--- a/src/main/webapp/js/diagramly/Dialogs.js
+++ b/src/main/webapp/js/diagramly/Dialogs.js
@@ -2629,7 +2629,7 @@ var ParseDialog = function(editorUi, title)
/**
* Constructs a new dialog for creating files from templates.
*/
-var NewDialog = function(editorUi, compact, showName, callback, createOnly, cancelCallback, leftHighlight, rightHighlight, rightHighlightBorder, itemPadding, templateFile)
+var NewDialog = function(editorUi, compact, showName, callback, createOnly, cancelCallback, leftHighlight, rightHighlight, rightHighlightBorder, itemPadding, templateFile, recentDocsCallback, searchDocsCallback, openExtDocCallback)
{
showName = (showName != null) ? showName : true;
createOnly = (createOnly != null) ? createOnly : false;
@@ -2638,13 +2638,18 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
rightHighlightBorder = (rightHighlightBorder != null) ? rightHighlightBorder : '1px solid #ccd9ea';
templateFile = (templateFile != null) ? templateFile : TEMPLATE_PATH + '/index.xml';
+
var outer = document.createElement('div');
outer.style.height = '100%';
var header = document.createElement('div');
header.style.whiteSpace = 'nowrap';
header.style.height = '46px';
- outer.appendChild(header);
+
+ if (showName)
+ {
+ outer.appendChild(header);
+ }
var logo = document.createElement('img');
logo.setAttribute('border', '0');
@@ -2745,13 +2750,197 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
header.appendChild(nameInput);
}
+ var hasTabs = false;
+
+ var i0 = 0;
+
+ // Dynamic loading
+ function addTemplates()
+ {
+ var first = true;
+
+ //TODO support paging of external templates
+ while (i0 < templates.length && (first || mxUtils.mod(i0, 30) != 0))
+ {
+ var tmp = templates[i0++];
+ addButton(tmp.url, tmp.libs, tmp.title, tmp.tooltip? tmp.tooltip : tmp.title, tmp.select, tmp.imgUrl, tmp.info);
+ first = false;
+ }
+ };
+
+ var createButton = mxUtils.button(mxResources.get('create'), function()
+ {
+ create();
+ });
+
+ createButton.className = 'geBtn gePrimaryBtn';
+
+ if (recentDocsCallback || searchDocsCallback)
+ {
+
+ var tabsEl = [];
+ var oldTemplates = null;
+
+ var setActiveTab = function(index)
+ {
+ createButton.setAttribute('disabled', 'disabled');
+
+ for (var i = 0; i < tabsEl.length; i++)
+ {
+ if (i == index)
+ tabsEl[i].className = 'geBtn gePrimaryBtn';
+ else
+ tabsEl[i].className = 'geBtn';
+ }
+ }
+
+ hasTabs = true;
+ var tabs = document.createElement('div');
+ tabs.style.whiteSpace = 'nowrap';
+ tabs.style.height = '30px';
+ outer.appendChild(tabs);
+
+ var templatesTab = mxUtils.button(mxResources.get('Templates', null, 'Templates'), function()
+ {
+ list.style.display = '';
+ div.style.left = '160px';
+ setActiveTab(0);
+
+ div.scrollTop = 0;
+ div.innerHTML = '';
+ i0 = 0;
+
+ if (oldTemplates != templates)
+ {
+ templates = oldTemplates;
+ addTemplates();
+ oldTemplates = null;
+ }
+ });
+
+ tabsEl.push(templatesTab);
+ tabs.appendChild(templatesTab);
+
+ var getExtTemplates = function(isSearch)
+ {
+ list.style.display = 'none';
+ div.style.left = '30px';
+
+ setActiveTab(isSearch? -1 : 1); //deselect all of them if isSearch
+
+ if (oldTemplates == null)
+ {
+ oldTemplates = templates;
+ }
+
+ div.scrollTop = 0;
+ div.innerHTML = '';
+
+ var spinner = new Spinner({
+ lines: 12, // The number of lines to draw
+ length: 10, // The length of each line
+ width: 5, // The line thickness
+ radius: 10, // The radius of the inner circle
+ rotate: 0, // The rotation offset
+ color: '#000', // #rgb or #rrggbb
+ speed: 1.5, // Rounds per second
+ trail: 60, // Afterglow percentage
+ shadow: false, // Whether to render a shadow
+ hwaccel: false, // Whether to use hardware acceleration
+ top: '40%',
+ zIndex: 2e9 // The z-index (defaults to 2000000000)
+ });
+ spinner.spin(div);
+
+ i0 = 0;
+
+ var callback = function(list, errorMsg)
+ {
+ spinner.stop();
+
+ templates = list;
+
+ if (errorMsg)
+ {
+ div.innerHTML = errorMsg;
+ }
+ else if (list.length == 0)
+ {
+ div.innerHTML = mxResources.get('noDiagrams', null, 'No Diagrams Found');
+ }
+ else
+ {
+ div.innerHTML = '';
+ addTemplates();
+ }
+ }
+
+ if (isSearch)
+ searchDocsCallback(searchInput.value, callback);
+ else
+ recentDocsCallback(callback);
+ }
+
+ if (recentDocsCallback)
+ {
+ var recentTab = mxUtils.button(mxResources.get('Recent', null, 'Recent'), function()
+ {
+ getExtTemplates();
+ });
+
+ tabs.appendChild(recentTab);
+ tabsEl.push(recentTab);
+ }
+
+ if (searchDocsCallback)
+ {
+ var searchTab = document.createElement('span');
+ searchTab.style.marginLeft = '10px';
+ searchTab.innerHTML = mxResources.get('search') + ":";
+ tabs.appendChild(searchTab);
+
+ var searchInput = document.createElement('input');
+ searchInput.style.marginRight = '10px';
+ searchInput.style.marginLeft = '10px';
+ searchInput.style.width = '220px';
+
+ mxEvent.addListener(searchInput, 'keypress', function(e)
+ {
+ if (e.keyCode == 13)
+ {
+ getExtTemplates(true);
+ }
+ });
+
+ tabs.appendChild(searchInput);
+
+ var searchBtn = mxUtils.button(mxResources.get('search'), function()
+ {
+ getExtTemplates(true);
+ });
+
+ searchBtn.className = 'geBtn';
+
+ tabs.appendChild(searchBtn);
+ }
+
+ setActiveTab(0);
+ }
+
var templateLibs = null;
var templateXml = null;
var selectedElt = null;
+ var templateExtUrl = null;
+ var templateInfoObj = null;
function create()
{
- if (callback)
+ if (templateExtUrl)
+ {
+ editorUi.hideDialog();
+ openExtDocCallback(templateExtUrl, templateInfoObj, nameInput.value);
+ }
+ else if (callback)
{
if (!showName)
{
@@ -2782,36 +2971,26 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
}
};
- var createButton = mxUtils.button(mxResources.get('create'), function()
- {
- create();
- });
-
- createButton.className = 'geBtn gePrimaryBtn';
-
var div = document.createElement('div');
div.style.border = '1px solid #d3d3d3';
div.style.position = 'absolute';
div.style.left = '160px';
div.style.right = '34px';
- div.style.top = (showName) ? '72px' : '40px';
+ var divTop = (showName) ? 72 : 40;
+ divTop += hasTabs? 30 : 0;
+ div.style.top = divTop + 'px';
div.style.bottom = '68px';
div.style.margin = '6px 0 0 -1px';
div.style.padding = '6px';
div.style.overflow = 'auto';
var list = document.createElement('div');
- list.style.cssText = 'position:absolute;left:30px;width:128px;top:72px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;';
-
- if (!showName)
- {
- list.style.top = '40px';
- }
+ list.style.cssText = 'position:absolute;left:30px;width:128px;top:' + divTop + 'px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;';
var w = 140;
var h = 140;
- function selectElement(elt, xml, libs)
+ function selectElement(elt, xml, libs, extUrl, infoObj)
{
if (selectedElt != null)
{
@@ -2819,15 +2998,19 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
selectedElt.style.border = '1px solid transparent';
}
+ createButton.removeAttribute('disabled');
+
templateXml = xml;
templateLibs = libs;
selectedElt = elt;
+ templateExtUrl = extUrl;
+ templateInfoObj = infoObj;
selectedElt.style.backgroundColor = rightHighlight;
selectedElt.style.border = rightHighlightBorder;
};
- function addButton(url, libs, title, tooltip, select)
+ function addButton(url, libs, title, tooltip, select, imgUrl, infoObj)
{
var elt = document.createElement('div');
elt.className = 'geTemplate';
@@ -2839,7 +3022,25 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
elt.setAttribute('title', tooltip);
}
- if (url != null && url.length > 0)
+ if (imgUrl != null)
+ {
+ elt.style.backgroundImage = 'url(' + imgUrl + ')';
+ elt.style.backgroundSize = 'contain';
+ elt.style.backgroundPosition = 'center center';
+ elt.style.backgroundRepeat = 'no-repeat';
+
+ mxEvent.addListener(elt, 'click', function(evt)
+ {
+ selectElement(elt, null, null, url, infoObj);
+ });
+
+ mxEvent.addListener(elt, 'dblclick', function(evt)
+ {
+ create();
+ });
+
+ }
+ else if (url != null && url.length > 0)
{
var png = url.substring(0, url.length - 4) + '.png';
@@ -2859,7 +3060,6 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
{
if (req.getStatus() >= 200 && req.getStatus() <= 299)
{
- createButton.removeAttribute('disabled');
selectElement(elt, req.getText(), libs);
if (createIt)
@@ -2905,25 +3105,11 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
// Adds local basic templates
categories['basic'] = [{title: 'blankDiagram', select: true}];
+
var templates = categories['basic'];
function initUi()
{
- var i0 = 0;
-
- // Dynamic loading
- function addTemplates()
- {
- var first = true;
-
- while (i0 < templates.length && (first || mxUtils.mod(i0, 30) != 0))
- {
- var tmp = templates[i0++];
- addButton(tmp.url, tmp.libs, tmp.title, tmp.tooltip, tmp.select);
- first = false;
- }
- };
-
mxEvent.addListener(div, 'scroll', function(evt)
{
if (div.scrollTop + div.clientHeight >= div.scrollHeight)
@@ -2980,8 +3166,10 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
div.scrollTop = 0;
div.innerHTML = '';
i0 = 0;
+
templates = categories[cat2];
- addTemplates();
+ oldTemplates = null;
+ addTemplates();
}
});
})(cat, entry);
@@ -3131,7 +3319,7 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
{
overrideExtension = (overrideExtension != null) ? overrideExtension : true;
allowBrowser = (allowBrowser != null) ? allowBrowser : true;
- rowLimit = (rowLimit != null) ? rowLimit : 3;
+ rowLimit = (rowLimit != null) ? rowLimit : 4;
var div = document.createElement('div');
var showButtons = true;
@@ -3347,15 +3535,20 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
addLogo(IMAGE_PATH + '/google-drive-logo.svg', mxResources.get('googleDrive'), App.MODE_GOOGLE, 'drive');
}
-
- if (editorUi.gitHub != null)
+
+ if (typeof window.OneDriveClient === 'function')
{
- var gitHubOption = document.createElement('option');
- gitHubOption.setAttribute('value', App.MODE_GITHUB);
- mxUtils.write(gitHubOption, mxResources.get('github'));
- serviceSelect.appendChild(gitHubOption);
+ var oneDriveOption = document.createElement('option');
+ oneDriveOption.setAttribute('value', App.MODE_ONEDRIVE);
+ mxUtils.write(oneDriveOption, mxResources.get('oneDrive'));
+ serviceSelect.appendChild(oneDriveOption);
- addLogo(IMAGE_PATH + '/github-logo.svg', mxResources.get('github'), App.MODE_GITHUB, 'gitHub');
+ if (editorUi.mode == App.MODE_ONEDRIVE)
+ {
+ oneDriveOption.setAttribute('selected', 'selected');
+ }
+
+ addLogo(IMAGE_PATH + '/onedrive-logo.svg', mxResources.get('oneDrive'), App.MODE_ONEDRIVE, 'oneDrive');
}
if (typeof window.DropboxClient === 'function')
@@ -3372,22 +3565,17 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
addLogo(IMAGE_PATH + '/dropbox-logo.svg', mxResources.get('dropbox'), App.MODE_DROPBOX, 'dropbox');
}
-
- if (typeof window.OneDriveClient === 'function')
+
+ if (editorUi.gitHub != null)
{
- var oneDriveOption = document.createElement('option');
- oneDriveOption.setAttribute('value', App.MODE_ONEDRIVE);
- mxUtils.write(oneDriveOption, mxResources.get('oneDrive'));
- serviceSelect.appendChild(oneDriveOption);
-
- if (editorUi.mode == App.MODE_ONEDRIVE)
- {
- oneDriveOption.setAttribute('selected', 'selected');
- }
+ var gitHubOption = document.createElement('option');
+ gitHubOption.setAttribute('value', App.MODE_GITHUB);
+ mxUtils.write(gitHubOption, mxResources.get('github'));
+ serviceSelect.appendChild(gitHubOption);
- addLogo(IMAGE_PATH + '/onedrive-logo.svg', mxResources.get('oneDrive'), App.MODE_ONEDRIVE, 'oneDrive');
+ addLogo(IMAGE_PATH + '/github-logo.svg', mxResources.get('github'), App.MODE_GITHUB, 'gitHub');
}
-
+
if (editorUi.trello != null)
{
var trelloOption = document.createElement('option');
@@ -3482,7 +3670,7 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
var btns = document.createElement('div');
btns.style.marginTop = (showButtons) ? '26px' : '38px';
- btns.style.textAlign = (showButtons) ? 'center' : 'right';
+ btns.style.textAlign = 'right';
if (!showButtons)
{
diff --git a/src/main/webapp/js/diagramly/DrawioFile.js b/src/main/webapp/js/diagramly/DrawioFile.js
index 041a7a39..ee0a0951 100644
--- a/src/main/webapp/js/diagramly/DrawioFile.js
+++ b/src/main/webapp/js/diagramly/DrawioFile.js
@@ -103,7 +103,7 @@ DrawioFile.prototype.save = function(revision, success, error, unloading)
*/
DrawioFile.prototype.updateFileData = function()
{
- this.setData(this.ui.getFileData());
+ this.setData(this.ui.getFileData(null, null, null, null, null, null, null, null, this));
};
/**
diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js
index 862152dd..966c6dac 100644
--- a/src/main/webapp/js/diagramly/EditorUi.js
+++ b/src/main/webapp/js/diagramly/EditorUi.js
@@ -769,14 +769,14 @@
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
- EditorUi.prototype.getFileData = function(forceXml, forceSvg, forceHtml, embeddedCallback, ignoreSelection, currentPage, node, compact)
+ EditorUi.prototype.getFileData = function(forceXml, forceSvg, forceHtml, embeddedCallback, ignoreSelection, currentPage, node, compact, file)
{
ignoreSelection = (ignoreSelection != null) ? ignoreSelection : true;
currentPage = (currentPage != null) ? currentPage : false;
node = (node != null) ? node : this.getXmlFileData(ignoreSelection, currentPage);
+ file = (file != null) ? file : this.getCurrentFile();
var graph = this.editor.graph;
- var file = this.getCurrentFile();
// Exports SVG for first page while other page is visible by creating a graph
// LATER: Add caching for the graph or SVG while not on first page
@@ -8482,6 +8482,9 @@
{
this.spinner.stop();
+ var enableRecentDocs = data.enableRecent == 1;
+ var enableSearchDocs = data.enableSearch == 1;
+
var dlg = new NewDialog(this, false, data.callback != null, mxUtils.bind(this, function(xml, name)
{
xml = xml || this.emptyDiagramXml;
@@ -8502,7 +8505,24 @@
this.editor.setStatus('');
}
}
- }));
+ }), null, null, null, null, null, null, null,
+ enableRecentDocs? mxUtils.bind(this, function(recentReadyCallback)
+ {
+ this.recentReadyCallback = recentReadyCallback;
+
+ parent.postMessage(JSON.stringify({event: 'recentDocs'}), '*');
+ }) : null,
+ enableSearchDocs? mxUtils.bind(this, function(searchStr, searchReadyCallback)
+ {
+ this.searchReadyCallback = searchReadyCallback;
+
+ parent.postMessage(JSON.stringify({event: 'searchDocs', searchStr: searchStr}), '*');
+ }) : null,
+ function(url, info, name)
+ {
+ parent.postMessage(JSON.stringify({event: 'template', docUrl: url, info: info,
+ name: name}), '*');
+ });
this.showDialog(dlg.container, 620, 440, true, false, mxUtils.bind(this, function(cancel)
{
@@ -8515,6 +8535,14 @@
return;
}
+ else if (data.action == 'searchDocsList')
+ {
+ this.searchReadyCallback(data.list, data.errorMsg);
+ }
+ else if (data.action == 'recentDocsList')
+ {
+ this.recentReadyCallback(data.list, data.errorMsg);
+ }
else if (data.action == 'status')
{
if (data.messageKey != null)
diff --git a/src/main/webapp/js/diagramly/Menus.js b/src/main/webapp/js/diagramly/Menus.js
index f92422be..bb3e1cde 100644
--- a/src/main/webapp/js/diagramly/Menus.js
+++ b/src/main/webapp/js/diagramly/Menus.js
@@ -1918,7 +1918,7 @@
else
{
// Creates a copy with no predefined storage
- editorUi.editor.editAsNew(editorUi.getEditBlankXml(), title);
+ editorUi.editor.editAsNew(this.editorUi.getFileData(true), title);
}
}
}));
diff --git a/src/main/webapp/js/diagramly/StorageFile.js b/src/main/webapp/js/diagramly/StorageFile.js
index 3f324579..cca1516e 100644
--- a/src/main/webapp/js/diagramly/StorageFile.js
+++ b/src/main/webapp/js/diagramly/StorageFile.js
@@ -187,7 +187,7 @@ StorageFile.prototype.rename = function(title, success, error)
{
this.ui.getLocalData(title, mxUtils.bind(this, function(data)
{
- this.ui.confirm(mxResources.get('replaceIt', [title]), mxUtils.bind(this, function()
+ var fn = mxUtils.bind(this, function()
{
this.title = title;
@@ -201,7 +201,16 @@ StorageFile.prototype.rename = function(title, success, error)
{
this.ui.removeLocalData(oldTitle, success);
}), error);
- }), error);
+ });
+
+ if (data != null)
+ {
+ this.ui.confirm(mxResources.get('replaceIt', [title]), fn, error);
+ }
+ else
+ {
+ fn();
+ }
}));
}
else
diff --git a/src/main/webapp/js/embed-static.min.js b/src/main/webapp/js/embed-static.min.js
index a1ebb3b3..1eb0f3f7 100644
--- a/src/main/webapp/js/embed-static.min.js
+++ b/src/main/webapp/js/embed-static.min.js
@@ -184,7 +184,7 @@ f)+"\n"+u+"}":"{"+z.join(",")+"}";f=u;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.0.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.0.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
@@ -1659,16 +1659,16 @@ arguments);null!=b&&(b.width+=10,b.height+=4,this.gridEnabled&&(b.width=this.sna
h.setTerminalPoint(k,!1);h.setTerminalPoint(l,!0);b.setGeometry(e,h);var m=this.view.getState(e),n=this.view.getState(f),v=this.view.getState(g);if(null!=m){var p=null!=n?this.getConnectionConstraint(m,n,!0):null,q=null!=v?this.getConnectionConstraint(m,v,!1):null;this.setConnectionConstraint(e,f,!0,q);this.setConnectionConstraint(e,g,!1,p)}c.push(e)}}else if(b.isVertex(e)&&(h=this.getCellGeometry(e),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var r=h.width;h.width=h.height;
h.height=r;b.setGeometry(e,h);var u=this.view.getState(e);if(null!=u){var t=u.style[mxConstants.STYLE_DIRECTION]||"east";"east"==t?t="south":"south"==t?t="west":"west"==t?t="north":"north"==t&&(t="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,t,[e])}c.push(e)}}}finally{b.endUpdate()}return c};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var b=this.model.getDescendants(a.cell);
if(0<b.length)for(var c=0;c<b.length;c++)this.isReplacePlaceholders(b[c])&&this.view.invalidate(b[c],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,b,c){b=this.zapGremlins(b);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),e=a;null!=e;){if(e==this.model.getRoot()||null!=e.value&&"object"==typeof e.value&&e.hasAttribute(d)){this.setAttributeForCell(e,d,b);break}e=
-this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,
-mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=this.view.getState(a[c]);if(null!=d){var e=
-mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=function(a,b,c){var d;
-null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=
-function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&(mxUtils.contains(d.text.boundingBox,
-c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,c=this.container.scrollTop/
-this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+(0==b.height?1:
-2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);d.geometry.offset=
-new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",
-[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
+this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&(this.model.isEdge(e.cell)||this.model.isVertex(e.cell))&&
+this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=
+this.view.getState(a[c]);if(null!=d){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=
+function(a,b,c){var d;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,
+arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&
+(mxUtils.contains(d.text.boundingBox,c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,
+c=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+
+(0==b.height?1:2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);
+d.geometry.offset=new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted",
+"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
d),null!=b&&mxEvent.addGestureListeners(a[c],null,null,b))}});this.model.addListener(mxEvent.CHANGE,d);d();var e=this.container.style.cursor,f=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(b)},mouseMove:function(a,b){if(g.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-b.getGraphX()),d=Math.abs(this.startY-b.getGraphY());(c>f||d>f)&&this.clear()}}else{for(c=b.getSource();null!=c&&"a"!=c.nodeName.toLowerCase();)c=
c.parentNode;null!=c?this.clear():(null==this.currentState||b.getState()!=this.currentState&&null!=b.getState()||!g.intersects(this.currentState,b.getGraphX(),b.getGraphY()))&&this.updateCurrentState(b)}},mouseUp:function(a,d){for(var e=d.getSource(),h=d.getEvent();null!=e&&"a"!=e.nodeName.toLowerCase();)e=e.parentNode;null==e&&Math.abs(this.scrollLeft-g.container.scrollLeft)<f&&Math.abs(this.scrollTop-g.container.scrollTop)<f&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(h)&&
diff --git a/src/main/webapp/js/mxgraph/Graph.js b/src/main/webapp/js/mxgraph/Graph.js
index 2f941f6e..59f9631a 100644
--- a/src/main/webapp/js/mxgraph/Graph.js
+++ b/src/main/webapp/js/mxgraph/Graph.js
@@ -4772,7 +4772,7 @@ if (typeof mxVertexHandler != 'undefined')
{
var state = this.view.getState(parents[i]);
- if (state != null && this.isCellDeletable(state.cell))
+ if (state != null && (this.model.isEdge(state.cell) || this.model.isVertex(state.cell)) && this.isCellDeletable(state.cell))
{
var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
diff --git a/src/main/webapp/js/reader.min.js b/src/main/webapp/js/reader.min.js
index dcc3f51c..fdf25871 100644
--- a/src/main/webapp/js/reader.min.js
+++ b/src/main/webapp/js/reader.min.js
@@ -184,7 +184,7 @@ f)+"\n"+u+"}":"{"+z.join(",")+"}";f=u;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.0.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.0.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
@@ -1659,16 +1659,16 @@ arguments);null!=b&&(b.width+=10,b.height+=4,this.gridEnabled&&(b.width=this.sna
h.setTerminalPoint(k,!1);h.setTerminalPoint(l,!0);b.setGeometry(e,h);var m=this.view.getState(e),n=this.view.getState(f),v=this.view.getState(g);if(null!=m){var p=null!=n?this.getConnectionConstraint(m,n,!0):null,q=null!=v?this.getConnectionConstraint(m,v,!1):null;this.setConnectionConstraint(e,f,!0,q);this.setConnectionConstraint(e,g,!1,p)}c.push(e)}}else if(b.isVertex(e)&&(h=this.getCellGeometry(e),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var r=h.width;h.width=h.height;
h.height=r;b.setGeometry(e,h);var u=this.view.getState(e);if(null!=u){var t=u.style[mxConstants.STYLE_DIRECTION]||"east";"east"==t?t="south":"south"==t?t="west":"west"==t?t="north":"north"==t&&(t="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,t,[e])}c.push(e)}}}finally{b.endUpdate()}return c};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var b=this.model.getDescendants(a.cell);
if(0<b.length)for(var c=0;c<b.length;c++)this.isReplacePlaceholders(b[c])&&this.view.invalidate(b[c],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,b,c){b=this.zapGremlins(b);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),e=a;null!=e;){if(e==this.model.getRoot()||null!=e.value&&"object"==typeof e.value&&e.hasAttribute(d)){this.setAttributeForCell(e,d,b);break}e=
-this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,
-mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=this.view.getState(a[c]);if(null!=d){var e=
-mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=function(a,b,c){var d;
-null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=
-function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&(mxUtils.contains(d.text.boundingBox,
-c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,c=this.container.scrollTop/
-this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+(0==b.height?1:
-2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);d.geometry.offset=
-new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",
-[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
+this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(var d=[],c=0;c<a.length;c++){var e=this.model.getParent(a[c]);null==e||b.get(e)||(b.put(e,!0),d.push(e))}for(c=0;c<d.length;c++)if(e=this.view.getState(d[c]),null!=e&&(this.model.isEdge(e.cell)||this.model.isVertex(e.cell))&&
+this.isCellDeletable(e.cell)){var f=mxUtils.getValue(e.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(e.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&g==mxConstants.NONE){f=!0;for(g=0;g<this.model.getChildCount(e.cell)&&f;g++)b.get(this.model.getChildAt(e.cell,g))||(f=!1);f&&a.push(e.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=
+this.view.getState(a[c]);if(null!=d){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=
+function(a,b,c){var d;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,
+arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=e||null!=d&&null!=d.text&&null!=d.text.node&&
+(mxUtils.contains(d.text.boundingBox,c.x,c.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)||(b=this.addText(c.x,c.y,d))}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,
+c=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,b=this.getGraphBounds(),c=this.getInsertPoint(),d=this.snap(Math.round(Math.max(c.x,b.x/a.scale-a.translate.x+(0==b.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(c.y,(b.y+b.height)/a.scale-a.translate.y+
+(0==b.height?1:2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);
+d.geometry.offset=new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted",
+"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=this.getAbsoluteUrl(a[c].getAttribute("href"));null!=d&&(a[c].setAttribute("href",
d),null!=b&&mxEvent.addGestureListeners(a[c],null,null,b))}});this.model.addListener(mxEvent.CHANGE,d);d();var e=this.container.style.cursor,f=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(b)},mouseMove:function(a,b){if(g.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-b.getGraphX()),d=Math.abs(this.startY-b.getGraphY());(c>f||d>f)&&this.clear()}}else{for(c=b.getSource();null!=c&&"a"!=c.nodeName.toLowerCase();)c=
c.parentNode;null!=c?this.clear():(null==this.currentState||b.getState()!=this.currentState&&null!=b.getState()||!g.intersects(this.currentState,b.getGraphX(),b.getGraphY()))&&this.updateCurrentState(b)}},mouseUp:function(a,d){for(var e=d.getSource(),h=d.getEvent();null!=e&&"a"!=e.nodeName.toLowerCase();)e=e.parentNode;null==e&&Math.abs(this.scrollLeft-g.container.scrollLeft)<f&&Math.abs(this.scrollTop-g.container.scrollTop)<f&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(h)&&
diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js
index b89d0674..895608f6 100644
--- a/src/main/webapp/js/viewer.min.js
+++ b/src/main/webapp/js/viewer.min.js
@@ -1976,14 +1976,14 @@ this.updateGraphComponents();this.fireEvent(new mxEventObject("resetGraphView"))
Editor.prototype.getGraphXml=function(a){a=(null!=a?a:1)?(new mxCodec(mxUtils.createXmlDocument())).encode(this.graph.getModel()):this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)a.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),a.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);a.setAttribute("grid",this.graph.isGridEnabled()?"1":"0");a.setAttribute("gridSize",
this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",this.graph.foldingEnabled?"1":"0");a.setAttribute("page",this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width);
a.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&a.setAttribute("background",this.graph.background);return a};Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":"hidden",this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(a){this.modified=a};Editor.prototype.setFilename=function(a){this.filename=a};
-Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(d,b){for(var e=a.getSelectionCellsForChanges(b.getProperty("edit").changes),k=a.getModel(),q=[],t=0;t<e.length;t++)(k.isVertex(e[t])||k.isEdge(e[t]))&&null!=a.view.getState(e[t])&&
-q.push(e[t]);a.setSelectionCells(q)};b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};
+Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(d,b){for(var e=a.getSelectionCellsForChanges(b.getProperty("edit").changes),k=a.getModel(),q=[],r=0;r<e.length;r++)(k.isVertex(e[r])||k.isEdge(e[r]))&&null!=a.view.getState(e[r])&&
+q.push(e[r]);a.setSelectionCells(q)};b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};
OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)};
-function Dialog(a,b,e,d,k,m,l,q){var t=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(t=80);e+=t;d+=t;var c=e,f=d,g=Math.max(document.body.clientHeight,document.documentElement.clientHeight),p=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),n=Math.max(1,Math.round((g-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);d=Math.min(d,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&
-(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var h=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=h.x+"px";this.bg.style.top=h.y+"px";p+=h.x;n+=h.y;k&&document.body.appendChild(this.bg);var x=a.createDiv("geDialog");k=this.getPosition(p,n,
-e,d);p=k.x;n=k.y;x.style.width=e+"px";x.style.height=d+"px";x.style.left=p+"px";x.style.top=n+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=n+14+"px",m.style.left=p+e+38-t+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",
-mxUtils.bind(this,function(){a.hideDialog(!0)})),document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){g=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.bg.style.height=g+"px";p=Math.max(1,Math.round((document.body.clientWidth-e-64)/2));n=Math.max(1,Math.round((g-d-a.footerHeight)/3));e=Math.min(c,document.body.scrollWidth-64);d=
-Math.min(f,g-64);var h=this.getPosition(p,n,e,d);p=h.x;n=h.y;x.style.left=p+"px";x.style.top=n+"px";x.style.width=e+"px";x.style.height=d+"px";!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=n+14+"px",this.dialogImg.style.left=p+e+38-t+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=l;this.container=x;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";
+function Dialog(a,b,e,d,k,l,p,q){var r=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(r=80);e+=r;d+=r;var c=e,f=d,h=Math.max(document.body.clientHeight,document.documentElement.clientHeight),m=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),n=Math.max(1,Math.round((h-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);d=Math.min(d,h-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&
+(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=h+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var g=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=g.x+"px";this.bg.style.top=g.y+"px";m+=g.x;n+=g.y;k&&document.body.appendChild(this.bg);var x=a.createDiv("geDialog");k=this.getPosition(m,n,
+e,d);m=k.x;n=k.y;x.style.width=e+"px";x.style.height=d+"px";x.style.left=m+"px";x.style.top=n+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");l&&(l=document.createElement("img"),l.setAttribute("src",Dialog.prototype.closeImage),l.setAttribute("title",mxResources.get("close")),l.className="geDialogClose",l.style.top=n+14+"px",l.style.left=m+e+38-r+"px",l.style.zIndex=this.zIndex,mxEvent.addListener(l,"click",
+mxUtils.bind(this,function(){a.hideDialog(!0)})),document.body.appendChild(l),this.dialogImg=l,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){h=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.bg.style.height=h+"px";m=Math.max(1,Math.round((document.body.clientWidth-e-64)/2));n=Math.max(1,Math.round((h-d-a.footerHeight)/3));e=Math.min(c,document.body.scrollWidth-64);d=
+Math.min(f,h-64);var g=this.getPosition(m,n,e,d);m=g.x;n=g.y;x.style.left=m+"px";x.style.top=n+"px";x.style.width=e+"px";x.style.height=d+"px";!q&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=n+14+"px",this.dialogImg.style.left=m+e+38-r+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=x;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";
Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1;
Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+
"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png";
@@ -1994,66 +1994,66 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA
Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+
"/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a){null!=this.onDialogClose&&(this.onDialogClose(a),this.onDialogClose=null);null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
var PrintDialog=function(a,b){this.create(a,b)};
-PrintDialog.prototype.create=function(a){function b(a){var d=q.checked||c.checked,b=parseInt(g.value)/100;isNaN(b)&&(b=1,g.value="100%");var b=.75*b,p=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=1/e.pageScale;if(d){var r=q.checked?1:parseInt(f.value);isNaN(r)||(n=mxUtils.getScaleForPageCount(r,e,p))}e.getGraphBounds();var k=r=0,p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*b);p.height=Math.ceil(p.height*b);n*=b;!d&&e.pageVisible?(b=e.getPageLayout(),r-=b.x*p.width,k-=b.y*p.height):
-d=!0;d=PrintDialog.createPrintPreview(e,n,p,0,r,k,d);d.open();a&&PrintDialog.printPreview(d)}var e=a.editor.graph,d,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var l=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var t=document.createElement("span");mxUtils.write(t," "+mxResources.get("fitPage"));
-k.appendChild(t);mxEvent.addListener(t,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});d.appendChild(k);l.appendChild(d);d=d.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);t=document.createElement("span");mxUtils.write(t," "+mxResources.get("posterPrint")+":");k.appendChild(t);mxEvent.addListener(t,
-"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});d.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);l.appendChild(d);mxEvent.addListener(c,"change",
-function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";k.appendChild(g);d.appendChild(k);l.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
-k.style.paddingTop="20px";k.setAttribute("align","right");t=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});t.className="geBtn";a.editor.cancelFirst&&k.appendChild(t);if(PrintDialog.previewEnabled){var p=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});p.className="geBtn";k.appendChild(p)}p=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});p.className="geBtn gePrimaryBtn";k.appendChild(p);a.editor.cancelFirst||
-k.appendChild(t);d.appendChild(k);l.appendChild(d);m.appendChild(l);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}};
-PrintDialog.createPrintPreview=function(a,b,e,d,k,m,l){b=new mxPrintPreview(a,b,e,d,k,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=l;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var q=b.writeHead;b.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
+PrintDialog.prototype.create=function(a){function b(a){var d=q.checked||c.checked,b=parseInt(h.value)/100;isNaN(b)&&(b=1,h.value="100%");var b=.75*b,m=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=1/e.pageScale;if(d){var t=q.checked?1:parseInt(f.value);isNaN(t)||(n=mxUtils.getScaleForPageCount(t,e,m))}e.getGraphBounds();var k=t=0,m=mxRectangle.fromRectangle(m);m.width=Math.ceil(m.width*b);m.height=Math.ceil(m.height*b);n*=b;!d&&e.pageVisible?(b=e.getPageLayout(),t-=b.x*m.width,k-=b.y*m.height):
+d=!0;d=PrintDialog.createPrintPreview(e,n,m,0,t,k,d);d.open();a&&PrintDialog.printPreview(d)}var e=a.editor.graph,d,k,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var r=document.createElement("span");mxUtils.write(r," "+mxResources.get("fitPage"));
+k.appendChild(r);mxEvent.addListener(r,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});d.appendChild(k);p.appendChild(d);d=d.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);r=document.createElement("span");mxUtils.write(r," "+mxResources.get("posterPrint")+":");k.appendChild(r);mxEvent.addListener(r,
+"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});d.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);p.appendChild(d);mxEvent.addListener(c,"change",
+function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var h=document.createElement("input");h.setAttribute("value","100 %");h.setAttribute("size","5");h.style.width="50px";k.appendChild(h);d.appendChild(k);p.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
+k.style.paddingTop="20px";k.setAttribute("align","right");r=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});r.className="geBtn";a.editor.cancelFirst&&k.appendChild(r);if(PrintDialog.previewEnabled){var m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});m.className="geBtn";k.appendChild(m)}m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});m.className="geBtn gePrimaryBtn";k.appendChild(m);a.editor.cancelFirst||
+k.appendChild(r);d.appendChild(k);p.appendChild(d);l.appendChild(p);this.container=l};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}};
+PrintDialog.createPrintPreview=function(a,b,e,d,k,l,p){b=new mxPrintPreview(a,b,e,d,k,l);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var q=b.writeHead;b.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
PrintDialog.previewEnabled=!0;
-var PageSetupDialog=function(a){function b(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==n?(p.removeAttribute("title"),p.style.fontSize="",p.innerHTML=mxResources.get("change")+"..."):(p.setAttribute("title",n.src),p.style.fontSize="11px",p.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,m,l=document.createElement("table");l.style.width=
-"100%";l.style.height="100%";var q=document.createElement("tbody");k=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");k.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var t=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",d.pageFormat);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");
-mxUtils.write(m,mxResources.get("background")+":");k.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=d.background;b();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;b()});mxEvent.consume(c)});
-m.appendChild(c);mxUtils.write(m,mxResources.get("gridSize")+":");var g=document.createElement("input");g.setAttribute("type","number");g.setAttribute("min","0");g.style.width="40px";g.style.marginLeft="6px";g.value=d.getGridSize();m.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?d.getGridSize():a)});k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+
-":");k.appendChild(m);m=document.createElement("td");var p=document.createElement("a");p.style.textDecoration="underline";p.style.cursor="pointer";p.style.color="#a0a0a0";var n=d.backgroundImage;mxEvent.addListener(p,"click",function(c){a.showBackgroundImageDialog(function(a){n=a;e()});mxEvent.consume(c)});e();m.appendChild(p);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var h=
-mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&m.appendChild(h);var x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==g.value&&d.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,n,t.get());c.ignoreColor=d.background==f;c.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=n?n.src:null);d.pageFormat.width==c.previousFormat.width&&d.pageFormat.height==c.previousFormat.height&&
-c.ignoreColor&&c.ignoreImage||d.model.execute(c)});x.className="geBtn gePrimaryBtn";m.appendChild(x);a.editor.cancelFirst||m.appendChild(h);k.appendChild(m);q.appendChild(k);l.appendChild(q);this.container=l};
-PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,b){if(b||g!=document.activeElement&&p!=document.activeElement){a=!1;for(c=0;c<h.length;c++)b=h[c],r?"custom"==b.key&&(q.value=b.key,r=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&&
-e.height==b.format.height?(q.value=b.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,l.setAttribute("checked","checked"),l.defaultChecked=!0,a=l.checked=!0));a?(t.style.display="",f.style.display="none"):(g.value=e.width/100,p.value=e.height/100,v.setAttribute("selected","selected"),
-m.setAttribute("checked","checked"),m.defaultChecked=!0,t.style.display="none",f.style.display="")}}b="format-"+b;var m=document.createElement("input");m.setAttribute("name",b);m.setAttribute("type","radio");m.setAttribute("value","portrait");var l=document.createElement("input");l.setAttribute("name",b);l.setAttribute("type","radio");l.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var t=document.createElement("div");t.style.marginLeft=
-"4px";t.style.width="210px";t.style.height="24px";m.style.marginRight="6px";t.appendChild(m);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));t.appendChild(b);l.style.marginLeft="10px";l.style.marginRight="6px";t.appendChild(l);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));t.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height=
-"24px";var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var p=document.createElement("input");p.setAttribute("size","7");p.style.textAlign="right";f.appendChild(p);mxUtils.write(f," in");t.style.display="none";f.style.display="none";for(var n={},h=PageSetupDialog.getFormats(),x=0;x<h.length;x++){var u=h[x];n[u.key]=u;var v=document.createElement("option");v.setAttribute("value",u.key);mxUtils.write(v,u.title);q.appendChild(v)}var r=
-!1;k();a.appendChild(q);mxUtils.br(a);a.appendChild(t);a.appendChild(f);var y=e,w=function(){var a=n[q.value];null!=a.format?(g.value=a.format.width/100,p.value=a.format.height/100,f.style.display="none",t.style.display=""):(t.style.display="none",f.style.display="");isNaN(parseFloat(g.value))&&(g.value=e.width/100);isNaN(parseFloat(p.value))&&(p.value=e.height/100);a=new mxRectangle(0,0,Math.floor(100*parseFloat(g.value)),Math.floor(100*parseFloat(p.value)));"custom"!=q.value&&l.checked&&(a=new mxRectangle(0,
-0,a.height,a.width));if(a.width!=y.width||a.height!=y.height)y=a,null!=d&&d(y)};mxEvent.addListener(b,"click",function(a){m.checked=!0;w();mxEvent.consume(a)});mxEvent.addListener(c,"click",function(a){l.checked=!0;w();mxEvent.consume(a)});mxEvent.addListener(g,"blur",w);mxEvent.addListener(g,"click",w);mxEvent.addListener(p,"blur",w);mxEvent.addListener(p,"click",w);mxEvent.addListener(l,"change",w);mxEvent.addListener(m,"change",w);mxEvent.addListener(q,"change",function(){r="custom"==q.value;w()});
-w();return{set:function(a){e=a;k(null,null,!0)},get:function(){return y},widthInput:g,heightInput:p}};
+var PageSetupDialog=function(a){function b(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==n?(m.removeAttribute("title"),m.style.fontSize="",m.innerHTML=mxResources.get("change")+"..."):(m.setAttribute("title",n.src),m.style.fontSize="11px",m.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,l,p=document.createElement("table");p.style.width=
+"100%";p.style.height="100%";var q=document.createElement("tbody");k=document.createElement("tr");l=document.createElement("td");l.style.verticalAlign="top";l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("paperSize")+":");k.appendChild(l);l=document.createElement("td");l.style.verticalAlign="top";l.style.fontSize="10pt";var r=PageSetupDialog.addPageFormatPanel(l,"pagesetupdialog",d.pageFormat);k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");
+mxUtils.write(l,mxResources.get("background")+":");k.appendChild(l);l=document.createElement("td");l.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=d.background;b();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;b()});mxEvent.consume(c)});
+l.appendChild(c);mxUtils.write(l,mxResources.get("gridSize")+":");var h=document.createElement("input");h.setAttribute("type","number");h.setAttribute("min","0");h.style.width="40px";h.style.marginLeft="6px";h.value=d.getGridSize();l.appendChild(h);mxEvent.addListener(h,"change",function(){var a=parseInt(h.value);h.value=Math.max(1,isNaN(a)?d.getGridSize():a)});k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");mxUtils.write(l,mxResources.get("image")+
+":");k.appendChild(l);l=document.createElement("td");var m=document.createElement("a");m.style.textDecoration="underline";m.style.cursor="pointer";m.style.color="#a0a0a0";var n=d.backgroundImage;mxEvent.addListener(m,"click",function(c){a.showBackgroundImageDialog(function(a){n=a;e()});mxEvent.consume(c)});e();l.appendChild(m);k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");l.colSpan=2;l.style.paddingTop="16px";l.setAttribute("align","right");var g=
+mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);var x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==h.value&&d.setGridSize(parseInt(h.value));var c=new ChangePageSetup(a,f,n,r.get());c.ignoreColor=d.background==f;c.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=n?n.src:null);d.pageFormat.width==c.previousFormat.width&&d.pageFormat.height==c.previousFormat.height&&
+c.ignoreColor&&c.ignoreImage||d.model.execute(c)});x.className="geBtn gePrimaryBtn";l.appendChild(x);a.editor.cancelFirst||l.appendChild(g);k.appendChild(l);q.appendChild(k);p.appendChild(q);this.container=p};
+PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,b){if(b||h!=document.activeElement&&m!=document.activeElement){a=!1;for(c=0;c<g.length;c++)b=g[c],t?"custom"==b.key&&(q.value=b.key,t=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&&
+e.height==b.format.height?(q.value=b.key,l.setAttribute("checked","checked"),l.defaultChecked=!0,l.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(r.style.display="",f.style.display="none"):(h.value=e.width/100,m.value=e.height/100,v.setAttribute("selected","selected"),
+l.setAttribute("checked","checked"),l.defaultChecked=!0,r.style.display="none",f.style.display="")}}b="format-"+b;var l=document.createElement("input");l.setAttribute("name",b);l.setAttribute("type","radio");l.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",b);p.setAttribute("type","radio");p.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var r=document.createElement("div");r.style.marginLeft=
+"4px";r.style.width="210px";r.style.height="24px";l.style.marginRight="6px";r.appendChild(l);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));r.appendChild(b);p.style.marginLeft="10px";p.style.marginRight="6px";r.appendChild(p);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));r.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height=
+"24px";var h=document.createElement("input");h.setAttribute("size","7");h.style.textAlign="right";f.appendChild(h);mxUtils.write(f," in x ");var m=document.createElement("input");m.setAttribute("size","7");m.style.textAlign="right";f.appendChild(m);mxUtils.write(f," in");r.style.display="none";f.style.display="none";for(var n={},g=PageSetupDialog.getFormats(),x=0;x<g.length;x++){var u=g[x];n[u.key]=u;var v=document.createElement("option");v.setAttribute("value",u.key);mxUtils.write(v,u.title);q.appendChild(v)}var t=
+!1;k();a.appendChild(q);mxUtils.br(a);a.appendChild(r);a.appendChild(f);var A=e,y=function(){var a=n[q.value];null!=a.format?(h.value=a.format.width/100,m.value=a.format.height/100,f.style.display="none",r.style.display=""):(r.style.display="none",f.style.display="");isNaN(parseFloat(h.value))&&(h.value=e.width/100);isNaN(parseFloat(m.value))&&(m.value=e.height/100);a=new mxRectangle(0,0,Math.floor(100*parseFloat(h.value)),Math.floor(100*parseFloat(m.value)));"custom"!=q.value&&p.checked&&(a=new mxRectangle(0,
+0,a.height,a.width));if(a.width!=A.width||a.height!=A.height)A=a,null!=d&&d(A)};mxEvent.addListener(b,"click",function(a){l.checked=!0;y();mxEvent.consume(a)});mxEvent.addListener(c,"click",function(a){p.checked=!0;y();mxEvent.consume(a)});mxEvent.addListener(h,"blur",y);mxEvent.addListener(h,"click",y);mxEvent.addListener(m,"blur",y);mxEvent.addListener(m,"click",y);mxEvent.addListener(p,"change",y);mxEvent.addListener(l,"change",y);mxEvent.addListener(q,"change",function(){t="custom"==q.value;y()});
+y();return{set:function(a){e=a;k(null,null,!0)},get:function(){return A},widthInput:h,heightInput:m}};
PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:"US-Tabloid (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",
format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]};
(function(){mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph;if(null!=a.container&&!a.transparentBackground){if(a.pageVisible){var b=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var c=a.container.firstChild;null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.nextSibling;null!=c&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=
mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),c.style.position="absolute",a.container.insertBefore(this.backgroundPageShape.node,c),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(c){a.dblClick(c)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),
mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
-null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",g="";if(a.isGridEnabled()){g=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",g=a.gridSize*this.scale*this.gridSteps):
-d="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);g=-Math.round(g-mxUtils.mod(this.translate.x*this.scale-c,g))+"px "+-Math.round(g-mxUtils.mod(this.translate.y*this.scale-e,g))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=g,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
-b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=g,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],g=1;g<this.gridSteps;g++){var e=g*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
+null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",h="";if(a.isGridEnabled()){h=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",h=a.gridSize*this.scale*this.gridSteps):
+d="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);h=-Math.round(h-mxUtils.mod(this.translate.x*this.scale-c,h))+"px "+-Math.round(h-mxUtils.mod(this.translate.y*this.scale-e,h))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=h,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
+b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=h,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],h=1;h<this.gridSteps;h++){var e=h*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var c=
-this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,n=d*this.pageScale,h=this.view.getBackgroundPageBounds();b=h.width;c=h.height;var k=
-new mxRectangle(d*g.x,d*g.y,e.width*n,e.height*n),u=(a=a&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.ceil(c/k.height)-1:0,v=a?Math.ceil(b/k.width)-1:0,r=h.x+b,q=h.y+c;null==this.horizontalPageBreaks&&0<u&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?u:v,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(b+1)*k.height)),
-new mxPoint(Math.round(r),Math.round(h.y+(b+1)*k.height))]:[new mxPoint(Math.round(h.x+(b+1)*k.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(b+1)*k.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
-var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var g=this.graph.getCellGeometry(d[f]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
-!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,g=this.graph.pageScale,e=d.width*g,d=d.height*g,g=Math.floor(Math.min(0,b)/e),n=Math.floor(Math.min(0,
-c)/d);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+n*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-n)*d)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
-a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),g=b.getParent(d);
-if(null==c||c!=d&&c!=g)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)d=g,g=this.graph.getModel().getParent(d);return d};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=l.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),g=d.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&d.isVertex(g)){c=!0;break}g=d.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed=
+this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,h=this.view.translate,e=this.pageFormat,n=d*this.pageScale,g=this.view.getBackgroundPageBounds();b=g.width;c=g.height;var k=
+new mxRectangle(d*h.x,d*h.y,e.width*n,e.height*n),u=(a=a&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.ceil(c/k.height)-1:0,v=a?Math.ceil(b/k.width)-1:0,t=g.x+b,q=g.y+c;null==this.horizontalPageBreaks&&0<u&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?u:v,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(g.x),Math.round(g.y+(b+1)*k.height)),
+new mxPoint(Math.round(t),Math.round(g.y+(b+1)*k.height))]:[new mxPoint(Math.round(g.x+(b+1)*k.width),Math.round(g.y)),new mxPoint(Math.round(g.x+(b+1)*k.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
+var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var h=this.graph.getCellGeometry(d[f]);if(null!=h&&h.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
+!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,h=this.graph.pageScale,e=d.width*h,d=d.height*h,h=Math.floor(Math.min(0,b)/e),n=Math.floor(Math.min(0,
+c)/d);return new mxRectangle(this.scale*(this.translate.x+h*e),this.scale*(this.translate.y+n*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-h)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-n)*d)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
+a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,h,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var l=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=l.apply(this,arguments),h=b.getParent(d);
+if(null==c||c!=d&&c!=h)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(h)&&b.isVertex(h)&&!this.graph.isContainer(h);)d=h,h=this.graph.getModel().getParent(d);return d};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=p.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),h=d.getParent(a);null!=h;){if(this.graph.isCellSelected(h)&&d.isVertex(h)){c=!0;break}h=d.getParent(h)}return c};mxGraphHandler.prototype.selectDelayed=
function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&&
(a=c),c=b.getParent(c);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=e;mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||d.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=
k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(b=function(a){var c=mxEvent.getSource(a);
if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}return k(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b):d.panningHandler.usePopupTrigger=!1;d.init(this.diagramContainer);this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var c=mxUtils.getOffset(this.diagramContainer);
-0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,l=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return m||l.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(m=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||
-mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog()});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var q=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return q.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&
-(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var t=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return t.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))};var c=!1,f=null,g=null,p=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=d.cellEditor.isContentEditing()){for(var a=
-this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==p)this.toolbar.createTextToolbar();else{for(var h=0;h<p.length;h++)this.toolbar.container.appendChild(p[h]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu=g}c=d.cellEditor.isContentEditing();f=a;g=e;p=b}}),h=this,x=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){x.apply(this,
-arguments);n();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=h.toolbar)){var b=c.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));h.toolbar.setFontName(b);h.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,
-"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var u=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){u.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(F){}var v=d.fireMouseEvent;d.fireMouseEvent=function(a,c,
-b){a==mxEvent.MOUSE_DOWN&&this.container.focus();v.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),
-y="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=d.view.getState(a);if(null!=c){a=a.clone();a.style="";a=d.getCellStyle(a);var b=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(b.push(c.style[g]),f.push(g));g=d.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],h=0;h<e.length;h++){var p=e[h],n=p.indexOf("=");0<=n&&(g=p.substring(0,n),p=p.substring(n+1),null!=a[g]&&"none"==p&&(b.push(p),f.push(g)))}d.getModel().isEdge(c.cell)?
-d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[c.cell]))}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var w=["fontFamily","fontSize","fontColor"],A="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),
-E=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],w,["align"],["html"]];for(a=0;a<E.length;a++)for(b=0;b<E[a].length;b++)r.push(E[a][b]);for(a=0;a<y.length;a++)0>mxUtils.indexOf(r,y[a])&&r.push(y[a]);var B=function(a,c){var b=d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(p),g=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var h=
-g[f[e]];null!=h&&d.setCellStyles(f[e],h,a)}else for(h=0;h<a.length;h++){for(var p=a[h],n=b.getStyle(p),u=null!=n?n.split(";"):[],L=r.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var x=v.substring(0,k),q=mxUtils.indexOf(L,x);0<=q&&L.splice(q,1);for(var A=0;A<E.length;A++){var w=E[A];if(0<=mxUtils.indexOf(w,x))for(var m=0;m<w.length;m++){var l=mxUtils.indexOf(L,w[m]);0<=l&&L.splice(l,1)}}}}for(var g=(f=b.isEdge(p))?d.currentEdgeStyle:d.currentVertexStyle,t=b.getStyle(p),e=0;e<L.length;e++){var x=
-L[e],F=g[x];null==F||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(y,x))||(t=mxUtils.setStyle(t,x,F))}b.setStyle(p,t)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){B(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){B(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,
-c){var b=c.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(g=d.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=c.getProperty("keys"),h=c.getProperty("values"),e=0;e<b.length;e++){var p=0<=mxUtils.indexOf(w,b[e]);if("strokeColor"!=b[e]||null!=h[e]&&"none"!=h[e])if(0<=mxUtils.indexOf(y,b[e]))g||0<=mxUtils.indexOf(A,b[e])?null==h[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=h[e]:f&&0<=mxUtils.indexOf(r,b[e])&&(null==
-h[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=h[e]);else if(0<=mxUtils.indexOf(r,b[e])){if(f||p)null==h[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=h[e];if(g||p||0<=mxUtils.indexOf(A,b[e]))null==h[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=h[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=
+0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var l=!1,p=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return l||p.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(l=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||
+mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog()});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";l=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var q=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return q.apply(this,arguments)||l||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&
+(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var r=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return r.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))};var c=!1,f=null,h=null,m=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=d.cellEditor.isContentEditing()){for(var a=
+this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==m)this.toolbar.createTextToolbar();else{for(var g=0;g<m.length;g++)this.toolbar.container.appendChild(m[g]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu=h}c=d.cellEditor.isContentEditing();f=a;h=e;m=b}}),g=this,x=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){x.apply(this,
+arguments);n();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=g.toolbar)){var b=c.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));g.toolbar.setFontName(b);g.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,
+"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var u=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){u.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(G){}var v=d.fireMouseEvent;d.fireMouseEvent=function(a,c,
+b){a==mxEvent.MOUSE_DOWN&&this.container.focus();v.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var t="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),
+A="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=d.view.getState(a);if(null!=c){a=a.clone();a.style="";a=d.getCellStyle(a);var b=[],f=[],h;for(h in c.style)a[h]!=c.style[h]&&(b.push(c.style[h]),f.push(h));h=d.getModel().getStyle(c.cell);for(var e=null!=h?h.split(";"):[],g=0;g<e.length;g++){var m=e[g],n=m.indexOf("=");0<=n&&(h=m.substring(0,n),m=m.substring(n+1),null!=a[h]&&"none"==m&&(b.push(m),f.push(h)))}d.getModel().isEdge(c.cell)?
+d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[c.cell]))}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var y=["fontFamily","fontSize","fontColor"],w="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),
+F=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],y,["align"],["html"]];for(a=0;a<F.length;a++)for(b=0;b<F[a].length;b++)t.push(F[a][b]);for(a=0;a<A.length;a++)0>mxUtils.indexOf(t,A[a])&&t.push(A[a]);var B=function(a,c){var b=d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(m),h=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var g=
+h[f[e]];null!=g&&d.setCellStyles(f[e],g,a)}else for(g=0;g<a.length;g++){for(var m=a[g],n=b.getStyle(m),u=null!=n?n.split(";"):[],K=t.slice(),e=0;e<u.length;e++){var v=u[e],k=v.indexOf("=");if(0<=k){var x=v.substring(0,k),q=mxUtils.indexOf(K,x);0<=q&&K.splice(q,1);for(var w=0;w<F.length;w++){var l=F[w];if(0<=mxUtils.indexOf(l,x))for(var p=0;p<l.length;p++){var y=mxUtils.indexOf(K,l[p]);0<=y&&K.splice(y,1)}}}}for(var h=(f=b.isEdge(m))?d.currentEdgeStyle:d.currentVertexStyle,r=b.getStyle(m),e=0;e<K.length;e++){var x=
+K[e],G=h[x];null==G||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(A,x))||(r=mxUtils.setStyle(r,x,G))}b.setStyle(m,r)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){B(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){B(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));B(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,
+c){var b=c.getProperty("cells"),f=!1,h=!1;if(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(h=d.getModel().isEdge(b[e])||h)||!f);e++);else h=f=!0;for(var b=c.getProperty("keys"),g=c.getProperty("values"),e=0;e<b.length;e++){var m=0<=mxUtils.indexOf(y,b[e]);if("strokeColor"!=b[e]||null!=g[e]&&"none"!=g[e])if(0<=mxUtils.indexOf(A,b[e]))h||0<=mxUtils.indexOf(w,b[e])?null==g[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=g[e]:f&&0<=mxUtils.indexOf(t,b[e])&&(null==
+g[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=g[e]);else if(0<=mxUtils.indexOf(t,b[e])){if(f||m)null==g[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=g[e];if(h||m||0<=mxUtils.indexOf(w,b[e]))null==g[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=g[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=
this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||null==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+
("vertical"==d.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==d.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==d.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==d.currentEdgeStyle.shape?
"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(d.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("end",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_ENDARROW],
@@ -2072,31 +2072,31 @@ a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==d?"geSprite geSprite-"+a+"block":"g
a+"ermany":"ERoneToMany"==e?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==e?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==e?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null};
EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),e=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(b.isEnabled())};
EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var d=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste",
-!1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};
+!1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var l=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){l.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};
EditorUi.prototype.initCanvas=function(){var a=this.editor.graph,a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*
-a.width*c.width,this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,b){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(c,b,d,f){if(null!=a.container){d=null!=d?d:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),h=a.view.translate,p=a.view.scale,n=mxRectangle.fromRectangle(g);
-n.x=n.x/p-h.x;n.y=n.y/p-h.y;n.width/=p;n.height/=p;var h=a.container.scrollTop,u=a.container.scrollLeft,v=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)v+=3;var r=a.container.offsetWidth-v,v=a.container.offsetHeight-v;c=c?Math.max(.3,Math.min(b||1,r/n.width)):p;b=(r-c*n.width)/2/c;var k=0==this.lightboxVerticalDivider?0:(v-c*n.height)/this.lightboxVerticalDivider/c;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||g.width<r||g.height<v)a.view.scaleAndTranslate(c,
-Math.floor(b-n.x),Math.floor(k-n.y)),a.container.scrollTop=h*c/p,a.container.scrollLeft=u*c/p;else if(0!=d||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+d/p),Math.floor(g.y+f/p))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
+a.width*c.width,this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,b){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.chromeless){this.chromelessResize=b=mxUtils.bind(this,function(c,b,d,f){if(null!=a.container){d=null!=d?d:0;f=null!=f?f:0;var h=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),g=a.view.translate,m=a.view.scale,n=mxRectangle.fromRectangle(h);
+n.x=n.x/m-g.x;n.y=n.y/m-g.y;n.width/=m;n.height/=m;var g=a.container.scrollTop,u=a.container.scrollLeft,v=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)v+=3;var t=a.container.offsetWidth-v,v=a.container.offsetHeight-v;c=c?Math.max(.3,Math.min(b||1,t/n.width)):m;b=(t-c*n.width)/2/c;var k=0==this.lightboxVerticalDivider?0:(v-c*n.height)/this.lightboxVerticalDivider/c;e&&(b=Math.max(b,0),k=Math.max(k,0));if(e||h.width<t||h.height<v)a.view.scaleAndTranslate(c,
+Math.floor(b-n.x),Math.floor(k-n.y)),a.container.scrollTop=g*c/m,a.container.scrollLeft=u*c/m;else if(0!=d||0!=f)h=a.view.translate,a.view.setTranslate(Math.floor(h.x+d/m),Math.floor(h.y+f/m))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace=
"nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var k=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]||
-0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var m=0,k=mxUtils.bind(this,function(a,c,b){m++;var d=document.createElement("span");d.style.paddingLeft="8px";d.style.paddingRight="8px";d.style.cursor="pointer";mxEvent.addListener(d,"click",a);null!=b&&d.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);d.appendChild(a);this.chromelessToolbar.appendChild(d);
-return d}),l=k(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var t=k(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),
-c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(q.innerHTML="",mxUtils.write(q,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});l.style.paddingLeft="0px";l.style.paddingRight="4px";t.style.paddingLeft="4px";t.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(t.style.display="",l.style.display="",q.style.display="inline-block"):(t.style.display="none",l.style.display=
+0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var l=0,k=mxUtils.bind(this,function(a,c,b){l++;var d=document.createElement("span");d.style.paddingLeft="8px";d.style.paddingRight="8px";d.style.cursor="pointer";mxEvent.addListener(d,"click",a);null!=b&&d.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);d.appendChild(a);this.chromelessToolbar.appendChild(d);
+return d}),p=k(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var r=k(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),
+c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(q.innerHTML="",mxUtils.write(q,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});p.style.paddingLeft="0px";p.style.paddingRight="4px";r.style.paddingLeft="4px";r.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(r.style.display="",p.style.display="",q.style.display="inline-block"):(r.style.display="none",p.style.display=
"none",q.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);k(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(c){a.lightbox?(1==a.view.scale?
-this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,p=null,n=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=p&&(window.clearTimeout(p),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;p=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";p=
-null}),600)}),a||200)}),h=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=p&&(window.clearTimeout(p),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var x=k(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,
+this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var h=null,m=null,n=mxUtils.bind(this,function(a){null!=h&&(window.clearTimeout(h),fadeThead=null);null!=m&&(window.clearTimeout(m),fadeThead2=null);h=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);h=null;m=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";m=
+null}),600)}),a||200)}),g=mxUtils.bind(this,function(a){null!=h&&(window.clearTimeout(h),fadeThead=null);null!=m&&(window.clearTimeout(m),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var x=k(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,
"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var b=x.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff";
mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=b.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=b.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),u=a.getModel();u.addListener(mxEvent.CHANGE,function(){x.style.display=1<u.getChildCount(u.root)?
"":"none"})}this.addChromelessToolbarItems(k);null!=this.editor.editButtonLink&&k(mxUtils.bind(this,function(a){"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):window.open(this.editor.editButtonLink,"editWindow");mxEvent.consume(a)}),Editor.editLargeImage,mxResources.get("openInNewWindow"));!a.lightbox||"1"!=urlParams.close&&this.container==document.body||k(mxUtils.bind(this,function(a){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,
-mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||h(30),n())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});
-mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():h(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():h(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||h(30)}));var v=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,b){this.startX=
-b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<v&&Math.abs(this.scrollTop-a.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?n():h(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var r=
-a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}r.apply(this,arguments)};var y=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),d=this.getPageSize(),f=Math.ceil(2*b.x+c.width*
-d.width),g=Math.ceil(2*b.y+c.height*d.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,f,g);f=b.x-c.x*d.width;b=b.y-c.y*d.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==b?y.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,d=a.view.translate.y,a.view.setTranslate(f,b),a.container.scrollLeft+=Math.round((f-c)*a.view.scale),a.container.scrollTop+=Math.round((b-d)*a.view.scale),
-this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var w=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=
-(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),d=0,f=0;null!=w&&(d=a.container.offsetWidth/2-w.x+c.x,f=a.container.offsetHeight/2-w.y+c.y);c=this.view.scale;
+mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||g(30),n())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});
+mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():g(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():g(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||g(30)}));var v=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,b){this.startX=
+b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<v&&Math.abs(this.scrollTop-a.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?n():g(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var t=
+a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}t.apply(this,arguments)};var A=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),d=this.getPageSize(),f=Math.ceil(2*b.x+c.width*
+d.width),h=Math.ceil(2*b.y+c.height*d.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=h)a.minimumGraphSize=new mxRectangle(0,0,f,h);f=b.x-c.x*d.width;b=b.y-c.y*d.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==b?A.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,d=a.view.translate.y,a.view.setTranslate(f,b),a.container.scrollLeft+=Math.round((f-c)*a.view.scale),a.container.scrollTop+=Math.round((b-d)*a.view.scale),
+this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var y=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=
+(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),d=0,f=0;null!=y&&(d=a.container.offsetWidth/2-y.x+c.x,f=a.container.offsetHeight/2-y.y+c.y);c=this.view.scale;
this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&e.chromelessResize(!1,null,d*(this.cumulativeZoomFactor-1),f*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==d&&0==f||(a.container.scrollLeft-=d*(this.cumulativeZoomFactor-1),a.container.scrollTop-=f*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),20)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(c,b){if((mxEvent.isAltDown(c)||mxEvent.isControlDown(c)&&!mxClient.IS_MAC||
-a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var d=mxEvent.getSource(c);null!=d;){if(d==a.container){w=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));a.lazyZoom(b);mxEvent.consume(c);break}d=d.parentNode}}))};EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};
+a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var d=mxEvent.getSource(c);null!=d;){if(d==a.container){y=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));a.lazyZoom(b);mxEvent.consume(c);break}d=d.parentNode}}))};EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};
EditorUi.prototype.createTemporaryGraph=function(a){a=new Graph(document.createElement("div"),null,null,a);a.resetViewOnRootChange=!1;a.setConnectable(!1);a.gridEnabled=!1;a.autoScroll=!1;a.setTooltips(!1);a.setEnabled(!1);a.container.style.visibility="hidden";a.container.style.position="absolute";a.container.style.overflow="hidden";a.container.style.height="1px";a.container.style.width="1px";return a};
EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};EditorUi.prototype.toggleFormatPanel=function(a){this.formatWidth=a||0<this.formatWidth?0:240;this.formatContainer.style.display=a||0<this.formatWidth?"":"none";this.refresh();this.format.refresh();this.fireEvent(new mxEventObject("formatWidthChanged"))};
EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,e=60;null!=b&&(e=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(e,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
@@ -2119,20 +2119,20 @@ this.previousFormat=b);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.e
EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};
EditorUi.prototype.setPageFormat=function(a){this.editor.graph.pageFormat=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(a){this.editor.graph.pageScale=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};
EditorUi.prototype.setGridColor=function(a){this.editor.graph.view.gridColor=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};
-EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,d);e.addListener(mxEvent.UNDO,d);e.addListener(mxEvent.REDO,d);e.addListener(mxEvent.CLEAR,d);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);d()};var m=this.editor.graph.cellEditor.stopEditing;
-this.editor.graph.cellEditor.stopEditing=function(a,b){m.apply(this,arguments);d()};d()};
-EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,d=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var l=k[m];a.getModel().isEdge(l)&&(d=!0);a.getModel().isVertex(l)&&(e=!0);if(d&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m=
-0;m<k.length;m++)this.actions.get(k[m]).setEnabled(b);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(d);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);d=e&&1==a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||
+EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,d);e.addListener(mxEvent.UNDO,d);e.addListener(mxEvent.REDO,d);e.addListener(mxEvent.CLEAR,d);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);d()};var l=this.editor.graph.cellEditor.stopEditing;
+this.editor.graph.cellEditor.stopEditing=function(a,b){l.apply(this,arguments);d()};d()};
+EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,d=!1,k=a.getSelectionCells();if(null!=k)for(var l=0;l<k.length;l++){var p=k[l];a.getModel().isEdge(p)&&(d=!0);a.getModel().isVertex(p)&&(e=!0);if(d&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(l=
+0;l<k.length;l++)this.actions.get(k[l]).setEnabled(b);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(d);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);d=e&&1==a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||
d&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||d&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(d&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(b||null!=a.view.currentRoot);this.actions.get("collapsible").setEnabled(e&&(a.isContainer(a.getSelectionCell())||
0<a.model.getChildCount(a.getSelectionCell())));this.actions.get("home").setEnabled(null!=a.view.currentRoot);this.actions.get("exitGroup").setEnabled(null!=a.view.currentRoot);this.actions.get("enterGroup").setEnabled(1==a.getSelectionCount()&&a.isValidRoot(a.getSelectionCell()));b=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(b);this.actions.get("collapse").setEnabled(b);this.actions.get("editLink").setEnabled(1==a.getSelectionCount());this.actions.get("openLink").setEnabled(1==
a.getSelectionCount()&&null!=a.getLinkForCell(a.getSelectionCell()));this.actions.get("guides").setEnabled(a.isEnabled());this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);b=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(b);this.menus.get("insert").setEnabled(b);this.menus.get("direction").setEnabled(b&&e);this.menus.get("align").setEnabled(b&&e&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(b&&e&&1<a.getSelectionCount());
this.actions.get("selectVertices").setEnabled(b);this.actions.get("selectEdges").setEnabled(b);this.actions.get("selectAll").setEnabled(b);this.actions.get("selectNone").setEnabled(b);this.updatePasteActionStates()};
EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var b=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,d=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,d=b?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var k=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&
-(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),l=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",l+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",l+=this.toolbarHeight);0<l&&!mxClient.IS_QUIRKS&&(l+=1);var q=0;if(null!=this.sidebarFooterContainer){var t=
-this.footerHeight+k,q=Math.max(0,Math.min(d-l-t,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=t+"px"}t=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=l+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=l+"px";this.formatContainer.style.width=t+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left=
-null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=m+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);b?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,
-b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-q+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-t)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,q=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom=
-this.footerHeight+k+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=t+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+k+"px",this.formatContainer.style.bottom=
+(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var l=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),p=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",p+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",p+=this.toolbarHeight);0<p&&!mxClient.IS_QUIRKS&&(p+=1);var q=0;if(null!=this.sidebarFooterContainer){var r=
+this.footerHeight+k,q=Math.max(0,Math.min(d-p-r,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=l+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=r+"px"}r=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=p+"px";this.sidebarContainer.style.width=l+"px";this.formatContainer.style.top=p+"px";this.formatContainer.style.width=r+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left=
+null!=this.hsplit.parentNode?l+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=l+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);b?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,
+b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-q+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-l-this.splitSize-r)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,q=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom=
+this.footerHeight+k+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=r+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+k+"px",this.formatContainer.style.bottom=
this.footerHeight+k+"px",this.diagramContainer.style.bottom=this.footerHeight+k+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null};
EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.footerContainer=this.createDiv("geFooterContainer");this.hsplit=this.createDiv("geHsplit");this.hsplit.setAttribute("title",mxResources.get("collapseExpand"));
this.menubarContainer.style.top="0px";this.menubarContainer.style.left="0px";this.menubarContainer.style.right="0px";this.toolbarContainer.style.left="0px";this.toolbarContainer.style.right="0px";this.sidebarContainer.style.left="0px";this.formatContainer.style.right="0px";this.formatContainer.style.zIndex="1";this.diagramContainer.style.right=(null!=this.format?this.formatWidth:0)+"px";this.footerContainer.style.left="0px";this.footerContainer.style.right="0px";this.footerContainer.style.bottom=
@@ -2142,8 +2142,8 @@ this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContaine
this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,
!0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)};
EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var b=document.createElement("div");b.className=a;return b};
-EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=l){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,q+(b?g.x-l.x:l.y-g.y)-e));mxEvent.consume(a);q!=f()&&(t=!0,c=null)}}function m(a){k(a);l=q=null}var l=null,q=null,t=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){l=new mxPoint(mxEvent.getClientX(a),
-mxEvent.getClientY(a));q=f();t=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!t){var b=null!=c?c-e:0;c=f();d(b);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})};EditorUi.prototype.showDialog=function(a,b,e,d,k,m,l){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,m,l);this.dialogs.push(this.dialog)};
+EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=p){var h=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,q+(b?h.x-p.x:p.y-h.y)-e));mxEvent.consume(a);q!=f()&&(r=!0,c=null)}}function l(a){k(a);p=q=null}var p=null,q=null,r=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a),
+mxEvent.getClientY(a));q=f();r=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!r){var b=null!=c?c-e:0;c=f();d(b);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,k,l);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,l)})};EditorUi.prototype.showDialog=function(a,b,e,d,k,l,p){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,l,p);this.dialogs.push(this.dialog)};
EditorUi.prototype.hideDialog=function(a){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(a),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),this.editor.fireEvent(new mxEventObject("hideDialog")))};
EditorUi.prototype.pickColor=function(a,b){var e=this.editor.graph,d=e.cellEditor.saveSelection(),k=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(d);b(a)},function(){e.cellEditor.restoreSelection(d)});this.showDialog(k.container,230,430,!0,!1);k.init()};
EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};
@@ -2153,17 +2153,17 @@ EditorUi.prototype.extractGraphModelFromEvent=function(a){var b=null,e=null;null
EditorUi.prototype.save=function(a){if(null!=a){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,b);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(b.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(b))).simulate(document,
"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(b);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(e){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}};
EditorUi.prototype.executeLayout=function(a,b,e){var d=this.editor.graph;if(d.isEnabled()){d.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&b&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(d),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){d.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(d.getModel().endUpdate(),null!=e&&e())}}};
-EditorUi.prototype.showImageDialog=function(a,b,e,d){d=this.editor.graph.cellEditor;var k=d.saveSelection(),m=mxUtils.prompt(a,b);d.restoreSelection(k);if(null!=m&&0<m.length){var l=new Image;l.onload=function(){e(m,l.width,l.height)};l.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};l.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,b,e){a=new LinkDialog(this,a,b,e);this.showDialog(a.container,420,90,!0,!0);a.init()};
+EditorUi.prototype.showImageDialog=function(a,b,e,d){d=this.editor.graph.cellEditor;var k=d.saveSelection(),l=mxUtils.prompt(a,b);d.restoreSelection(k);if(null!=l&&0<l.length){var p=new Image;p.onload=function(){e(l,p.width,p.height)};p.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};p.src=l}else e(null)};EditorUi.prototype.showLinkDialog=function(a,b,e){a=new LinkDialog(this,a,b,e);this.showDialog(a.container,420,90,!0,!0);a.init()};
EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=b&&0<b.length){var e=new Image;e.onload=function(){a(new mxImage(b,e.width,e.height))};e.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};e.src=b}else a(null)};
EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,b,e){mxUtils.confirm(a)?null!=b&&b():null!=e&&e()};
EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);b.border=20;mxEvent.addListener(window,"resize",function(){b.update()});this.addListener("pageFormatChanged",function(){b.update()});return b};
-EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){l.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var f=d.getSelectionCells(),g=0;g<f.length;g++)if(d.getModel().isVertex(f[g])&&d.isCellResizable(f[g])){var e=d.getCellGeometry(f[g]);null!=e&&(e=e.clone(),37==a?e.width=Math.max(0,e.width-c):38==a?e.height=Math.max(0,e.height-c):39==a?e.width+=c:40==a&&(e.height+=c),d.getModel().setGeometry(f[g],e))}}finally{d.getModel().endUpdate()}}else f=
-d.getSelectionCell(),g=d.model.getParent(f),e=null,1==d.getSelectionCount()&&d.model.isVertex(f)&&null!=d.layoutManager&&!d.isCellLocked(f)&&(e=d.layoutManager.getLayout(g)),null!=e&&e.constructor==mxStackLayout?(e=g.getIndex(f),37==a||38==a?d.model.add(g,f,Math.max(0,e-1)):39!=a&&40!=a||d.model.add(g,f,Math.min(d.model.getChildCount(g),e+1))):(g=f=0,37==a?f=-c:38==a?g=-c:39==a?f=c:40==a&&(g=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),f,g))});null!=q&&window.clearTimeout(q);q=window.setTimeout(function(){if(0<
-l.length){d.getModel().beginUpdate();try{for(var a=0;a<l.length;a++)l[a]();l=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var e=this,d=this.editor.graph,k=new mxKeyHandler(d),m=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&
-!mxClient.IS_SF)&&m.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var l=[],q=null,t={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=k.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"),80:this.actions.get("connectionPoints")};
-mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){var g=f[a.keyCode];if(null!=g)return g.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=t[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),t[a.keyCode],
+EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){p.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var f=d.getSelectionCells(),h=0;h<f.length;h++)if(d.getModel().isVertex(f[h])&&d.isCellResizable(f[h])){var e=d.getCellGeometry(f[h]);null!=e&&(e=e.clone(),37==a?e.width=Math.max(0,e.width-c):38==a?e.height=Math.max(0,e.height-c):39==a?e.width+=c:40==a&&(e.height+=c),d.getModel().setGeometry(f[h],e))}}finally{d.getModel().endUpdate()}}else f=
+d.getSelectionCell(),h=d.model.getParent(f),e=null,1==d.getSelectionCount()&&d.model.isVertex(f)&&null!=d.layoutManager&&!d.isCellLocked(f)&&(e=d.layoutManager.getLayout(h)),null!=e&&e.constructor==mxStackLayout?(e=h.getIndex(f),37==a||38==a?d.model.add(h,f,Math.max(0,e-1)):39!=a&&40!=a||d.model.add(h,f,Math.min(d.model.getChildCount(h),e+1))):(h=f=0,37==a?f=-c:38==a?h=-c:39==a?f=c:40==a&&(h=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),f,h))});null!=q&&window.clearTimeout(q);q=window.setTimeout(function(){if(0<
+p.length){d.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var e=this,d=this.editor.graph,k=new mxKeyHandler(d),l=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&
+!mxClient.IS_SF)&&l.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var p=[],q=null,r={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=k.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"),80:this.actions.get("connectionPoints")};
+mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){var h=f[a.keyCode];if(null!=h)return h.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=r[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),r[a.keyCode],
d.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&d.model.isEdge(c[0])?d.setSelectionCell(d.model.getTerminal(c[0],!1)):d.setSelectionCell(c[c.length-1]),d.scrollCellToVisible(d.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(d.view.getState(d.getSelectionCell())))}}else return this.isControlDown(a)?function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null,!0)}:function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null)}}return c.apply(this,arguments)};k.bindAction=mxUtils.bind(this,
-function(a,c,b,d){var f=this.actions.get(b);null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):d?k.bindShiftKey(a,b):k.bindKey(a,b))});var g=k.escape;k.escape=function(a){g.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){d.exitGroup()});k.bindControlShiftKey(35,function(){d.enterGroup()});k.bindKey(36,function(){d.home()});k.bindKey(35,function(){d.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");
+function(a,c,b,d){var f=this.actions.get(b);null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):d?k.bindShiftKey(a,b):k.bindKey(a,b))});var h=k.escape;k.escape=function(a){h.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){d.exitGroup()});k.bindControlShiftKey(35,function(){d.enterGroup()});k.bindKey(36,function(){d.home()});k.bindKey(35,function(){d.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");
k.bindAction(80,!0,"print");k.bindAction(79,!0,"outline",!0);k.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)k.bindControlKey(36,function(){d.isEnabled()&&d.foldCells(!0)}),k.bindControlKey(35,function(){d.isEnabled()&&d.foldCells(!1)}),k.bindControlKey(13,function(){d.isEnabled()&&d.setSelectionCells(d.duplicateCells(d.getSelectionCells(),!1))}),k.bindAction(8,!1,"delete"),k.bindAction(8,!0,"deleteAll"),k.bindAction(46,!1,"delete"),k.bindAction(46,!0,"deleteAll"),k.bindAction(72,
!0,"resetView"),k.bindAction(72,!0,"fitWindow",!0),k.bindAction(74,!0,"fitPage"),k.bindAction(74,!0,"fitTwoPages",!0),k.bindAction(48,!0,"customZoom"),k.bindAction(82,!0,"turn"),k.bindAction(82,!0,"clearDefaultStyle",!0),k.bindAction(83,!0,"save"),k.bindAction(83,!0,"saveAs",!0),k.bindAction(65,!0,"selectAll"),k.bindAction(65,!0,"selectNone",!0),k.bindAction(73,!0,"selectVertices",!0),k.bindAction(69,!0,"selectEdges",!0),k.bindAction(69,!0,"editStyle"),k.bindAction(66,!0,"bold"),k.bindAction(66,!0,
"toBack",!0),k.bindAction(70,!0,"toFront",!0),k.bindAction(68,!0,"duplicate"),k.bindAction(68,!0,"setAsDefaultStyle",!0),k.bindAction(90,!0,"undo"),k.bindAction(89,!0,"autosize",!0),k.bindAction(88,!0,"cut"),k.bindAction(67,!0,"copy"),k.bindAction(86,!0,"paste"),k.bindAction(71,!0,"group"),k.bindAction(77,!0,"editData"),k.bindAction(71,!0,"grid",!0),k.bindAction(73,!0,"italic"),k.bindAction(76,!0,"lockUnlock"),k.bindAction(76,!0,"layers",!0),k.bindAction(80,!0,"formatPanel",!0),k.bindAction(85,!0,
@@ -2174,67 +2174,67 @@ EditorUi.prototype.destroy=function(){null!=this.editor&&(this.editor.destroy(),
(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;
mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";
Graph=function(a,b,e,d,k){mxGraph.call(this,a,b,e,d);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a);
-return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var m=null,l=null,q=null,t=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")&&this.isEnabled()){var d=b.getProperty("event");if(!mxEvent.isControlDown(d.getEvent())&&!mxEvent.isShiftDown(d.getEvent())){var f=d.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(d.getGraphX(),d.getGraphY()),c=this.isCellSelected(f.cell),q=f,l=d,null!=
-f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,d.getGraphX(),d.getGraphY())?t=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(t=f.getHandleForEvent(d))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,b){var d=this.selectionCellsHandler.handlers.map,f;for(f in d)if(null!=d[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(b.getEvent())&&
-!mxEvent.isShiftDown(b.getEvent())&&!mxEvent.isAltDown(b.getEvent()))if(f=this.tolerance,null!=m&&null!=q&&null!=l){if(d=q,Math.abs(m.x-b.getGraphX())>f||Math.abs(m.y-b.getGraphY())>f){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var g=this.selectionCellsHandler.getHandler(d.cell);if(null!=g&&null!=g.bends&&0<g.bends.length){var e=g.getHandleForEvent(l),h=this.view.getEdgeStyle(d);f=h==mxEdgeStyle.EntityRelation;c||t!=mxEvent.LABEL_HANDLE||(e=t);if(f&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f||
-null==d.visibleSourceState&&null==d.visibleTargetState||(this.graphHandler.reset(),b.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=d.visibleSourceState||e==g.bends.length-1||null!=d.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=d.absolutePoints,null!=f&&(null==h&&null==e||h==mxEdgeStyle.OrthConnector)&&(e=t,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)?
-e=g.bends.length-1:null!=h&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(d,m.x,m.y),e=null==h?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(b.getGraphX(),b.getGraphX(),e),t=m=l=q=null,c=!1,b.consume(),this.graphHandler.reset()}}}else if(d=b.getState(),null!=d&&this.model.isEdge(d.cell)){g=null;f=d.absolutePoints;if(null!=f)if(e=new mxRectangle(b.getGraphX(),
-b.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,b.getGraphX(),b.getGraphY()))g="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))g="pointer";else if(null!=d.visibleSourceState||null!=d.visibleTargetState)h=this.view.getEdgeStyle(d),g="crosshair",h!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(d)&&(h=mxUtils.findNearestSegment(d,b.getGraphX(),b.getGraphY()),
-h<f.length-1&&0<=h&&(g=0==Math.round(f[h].x-f[h+1].x)?"col-resize":"row-resize"));null!=g&&d.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){t=m=l=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);
+return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var l=null,p=null,q=null,r=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")&&this.isEnabled()){var d=b.getProperty("event");if(!mxEvent.isControlDown(d.getEvent())&&!mxEvent.isShiftDown(d.getEvent())){var f=d.getState();null!=f&&this.model.isEdge(f.cell)&&(l=new mxPoint(d.getGraphX(),d.getGraphY()),c=this.isCellSelected(f.cell),q=f,p=d,null!=
+f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,d.getGraphX(),d.getGraphY())?r=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(r=f.getHandleForEvent(d))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,b){var d=this.selectionCellsHandler.handlers.map,f;for(f in d)if(null!=d[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(b.getEvent())&&
+!mxEvent.isShiftDown(b.getEvent())&&!mxEvent.isAltDown(b.getEvent()))if(f=this.tolerance,null!=l&&null!=q&&null!=p){if(d=q,Math.abs(l.x-b.getGraphX())>f||Math.abs(l.y-b.getGraphY())>f){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var h=this.selectionCellsHandler.getHandler(d.cell);if(null!=h&&null!=h.bends&&0<h.bends.length){var e=h.getHandleForEvent(p),g=this.view.getEdgeStyle(d);f=g==mxEdgeStyle.EntityRelation;c||r!=mxEvent.LABEL_HANDLE||(e=r);if(f&&0!=e&&e!=h.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f||
+null==d.visibleSourceState&&null==d.visibleTargetState||(this.graphHandler.reset(),b.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=d.visibleSourceState||e==h.bends.length-1||null!=d.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=d.absolutePoints,null!=f&&(null==g&&null==e||g==mxEdgeStyle.OrthConnector)&&(e=r,null==e&&(e=new mxRectangle(l.x,l.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)?
+e=h.bends.length-1:null!=g&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(d,l.x,l.y),e=null==g?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),h.start(b.getGraphX(),b.getGraphX(),e),r=l=p=q=null,c=!1,b.consume(),this.graphHandler.reset()}}}else if(d=b.getState(),null!=d&&this.model.isEdge(d.cell)){h=null;f=d.absolutePoints;if(null!=f)if(e=new mxRectangle(b.getGraphX(),
+b.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,b.getGraphX(),b.getGraphY()))h="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))h="pointer";else if(null!=d.visibleSourceState||null!=d.visibleTargetState)g=this.view.getEdgeStyle(d),h="crosshair",g!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(d)&&(g=mxUtils.findNearestSegment(d,b.getGraphX(),b.getGraphY()),
+g<f.length-1&&0<=g&&(h=0==Math.round(f[g].x-f[g+1].x)?"col-resize":"row-resize"));null!=h&&d.setCursor(h)}}),mouseUp:mxUtils.bind(this,function(a,c){r=l=p=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);
this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,c){return!1};this.alternateEdgeStyle="vertical";null==d&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=
-function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,g=b.width*d,b=b.height*d,d=this.graph.view.translate,e=this.graph.view.scale,h=this.graph.getPageLayout(),p=0;p<h.width;p++)c.push(new mxRectangle(((h.x+p)*g+d.x)*e,(h.y*b+d.y)*e,g*e,b*e));for(p=0;p<h.height;p++)c.push(new mxRectangle((h.x*g+d.x)*e,((h.y+p)*b+d.y)*e,g*e,b*e));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=
+function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,h=b.width*d,b=b.height*d,d=this.graph.view.translate,e=this.graph.view.scale,g=this.graph.getPageLayout(),m=0;m<g.width;m++)c.push(new mxRectangle(((g.x+m)*h+d.x)*e,(g.y*b+d.y)*e,h*e,b*e));for(m=0;m<g.height;m++)c.push(new mxRectangle((g.x*h+d.x)*e,((g.y+m)*b+d.y)*e,h*e,b*e));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=
function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),b=[],d=0;d<c.length;d++){var f=this.graph.view.getState(c[d]),f=null!=f?f.style:this.graph.getCellStyle(c[d]);
-"1"==mxUtils.getValue(f,"part","0")?(f=this.graph.model.getParent(c[d]),this.graph.model.isVertex(f)&&0>mxUtils.indexOf(c,f)&&b.push(f)):b.push(c[d])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var g=new mxRubberband(this);
-this.getRubberband=function(){return g};var p=(new Date).getTime(),n=0,h=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;h.apply(this,arguments);a!=this.currentState?(p=(new Date).getTime(),n=0):n=(new Date).getTime()-p};var x=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,
-"outlineConnect","1"))&&x.apply(this,arguments)};var u=this.isToggleEvent;this.isToggleEvent=function(a){return u.apply(this,arguments)||mxEvent.isShiftDown(a)};var v=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return v.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var r=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
-(r=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=r)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return y.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
-var w=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return w.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,g){g=null!=g?g:[];if(0<b||0<d){var e=this.getModel(),h=a+b,p=c+d;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var n=e.getChildCount(f),L=0;L<n;L++){var u=
-e.getChildAt(f,L),r=this.view.getState(u);if(null!=r&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(r.style,"locked","0")){var v=mxUtils.getValue(r.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(r=mxUtils.getBoundingBox(r,v));(e.isEdge(u)||e.isVertex(u))&&r.x>=a&&r.y+r.height<=p&&r.y>=c&&r.x+r.width<=h&&g.push(u);this.getAllCells(a,c,b,d,u,g)}}}return g};var A=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
-!1:A.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var E=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();E=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
-mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=E?this.addSelectionCells(E):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);E=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=
+"1"==mxUtils.getValue(f,"part","0")?(f=this.graph.model.getParent(c[d]),this.graph.model.isVertex(f)&&0>mxUtils.indexOf(c,f)&&b.push(f)):b.push(c[d])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var h=new mxRubberband(this);
+this.getRubberband=function(){return h};var m=(new Date).getTime(),n=0,g=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;g.apply(this,arguments);a!=this.currentState?(m=(new Date).getTime(),n=0):n=(new Date).getTime()-m};var x=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,
+"outlineConnect","1"))&&x.apply(this,arguments)};var u=this.isToggleEvent;this.isToggleEvent=function(a){return u.apply(this,arguments)||mxEvent.isShiftDown(a)};var v=h.isForceRubberbandEvent;h.isForceRubberbandEvent=function(a){return v.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var t=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
+(t=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=t)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var A=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return A.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
+var y=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return y.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,h){h=null!=h?h:[];if(0<b||0<d){var e=this.getModel(),g=a+b,m=c+d;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var n=e.getChildCount(f),K=0;K<n;K++){var u=
+e.getChildAt(f,K),t=this.view.getState(u);if(null!=t&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(t.style,"locked","0")){var v=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(t=mxUtils.getBoundingBox(t,v));(e.isEdge(u)||e.isVertex(u))&&t.x>=a&&t.y+t.height<=m&&t.y>=c&&t.x+t.width<=g&&h.push(u);this.getAllCells(a,c,b,d,u,h)}}}return h};var w=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
+!1:w.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();F=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
+mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),h.start(b.x,b.y)):null!=F?this.addSelectionCells(F):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);F=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=
function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var B=this.updateMouseEvent;this.updateMouseEvent=function(a){a=B.apply(this,arguments);this.isCellLocked(a.getCell())&&(a.state=null);return a}}};
Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;
Graph.createSvgImage=function(a,b,e){e=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+b+'px" version="1.1">'+e+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0)),a,b)};mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;
Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.defaultGraphBackground="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);
Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.absoluteUrlPattern=/^(?:[a-z]+:)?\/\//i;Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=(window!=window.top?document.referrer:document.location.toString()).split("#")[0];
-Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,k=!0,m=null,l=mxUtils.bind(this,function(a){k=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<b&&Math.abs(m.y-mxEvent.getClientY(a))<b}),t=mxUtils.bind(this,function(c){if(k)for(var b=mxEvent.getSource(c);null!=
-b&&b!=e.node;){if("a"==b.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,b,c);break}b=b.parentNode}});mxEvent.addGestureListeners(e.node,l,q,t);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};Graph.prototype.isPageLink=function(a){return!1};
+Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,k=!0,l=null,p=mxUtils.bind(this,function(a){k=!0;l=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){k=k&&null!=l&&Math.abs(l.x-mxEvent.getClientX(a))<b&&Math.abs(l.y-mxEvent.getClientY(a))<b}),r=mxUtils.bind(this,function(c){if(k)for(var b=mxEvent.getSource(c);null!=
+b&&b!=e.node;){if("a"==b.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,b,c);break}b=b.parentNode}});mxEvent.addGestureListeners(e.node,p,q,r);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};Graph.prototype.isPageLink=function(a){return!1};
Graph.prototype.labelLinkClicked=function(a,b,e){b=b.getAttribute("href");if(null!=b&&!this.isPageLink(b)){if(!this.isEnabled()){var d=a.view.graph.isBlankLink(b)?a.view.graph.linkTarget:"_top";b=a.view.graph.getAbsoluteUrl(b);"_self"==d&&window!=window.top?window.location.href=b:b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==d&&window==window.top?window.location.hash=b.split("#")[1]:(mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e))&&
window.open(b,d)}mxEvent.consume(e)}};Graph.prototype.isExternalProtocol=function(a){return"mailto:"===a.substring(0,7)};Graph.prototype.isBlankLink=function(a){return!this.isExternalProtocol(a)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(a)&&a.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(a){return null!=a&&!this.absoluteUrlPattern.test(a)&&"data:"!==a.substring(0,5)&&!this.isExternalProtocol(a)};
Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.getLayout=function(a){var b=this.graph.view.getState(a);a=null!=b?b.style:this.graph.getCellStyle(a);return"stackLayout"==a.childLayout?(b=new mxStackLayout(this.graph,!0),b.resizeParentMax="1"==mxUtils.getValue(a,"resizeParentMax","1"),b.horizontal="1"==mxUtils.getValue(a,"horizontalStack","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.resizeLast="1"==mxUtils.getValue(a,
"resizeLast","0"),b.spacing=a.stackSpacing||b.spacing,b.border=a.stackBorder||b.border,b.marginLeft=a.marginLeft||0,b.marginRight=a.marginRight||0,b.marginTop=a.marginTop||0,b.marginBottom=a.marginBottom||0,b.fill=!0,b):"treeLayout"==a.childLayout?(b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(a,"horizontalTree","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.groupPadding=mxUtils.getValue(a,"parentPadding",20),b.levelDistance=mxUtils.getValue(a,"treeLevelDistance",
30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b):"flowLayout"==a.childLayout?(b=new mxHierarchicalLayout(this.graph,mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.parentBorder=mxUtils.getValue(a,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(a,"interRankCellSpacing",
mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b):null}};Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};
-Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(d/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-m)};
+Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),l=Math.floor(d/a.height);return new mxRectangle(k,l,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-l)};
Graph.prototype.sanitizeHtml=function(a,b){return html_sanitize(a,function(a){return null!=a&&"javascript:"!==a.toString().toLowerCase().substring(0,11)?a:null},function(a){return a})};Graph.prototype.updatePlaceholders=function(){var a=!1,b;for(b in this.model.cells){var e=this.model.cells[b];this.isReplacePlaceholders(e)&&(this.view.invalidate(e,!1,!1),a=!0)}a&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")};
Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};Graph.prototype.isSplitTarget=function(a,b,e){return!this.model.isEdge(b[0])&&!mxEvent.isAltDown(e)&&!mxEvent.isShiftDown(e)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};
Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(b=this.replacePlaceholders(a,b));return b};Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(b,"labelMovable","0")))};
Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};
Graph.prototype.formatDate=function(a,b,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",
-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,l=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
-/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var q=e?"getUTC":"get",t=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),g=a[q+"FullYear"](),p=a[q+"Hours"](),n=a[q+"Minutes"](),h=a[q+"Seconds"](),q=a[q+"Milliseconds"](),x=e?0:a.getTimezoneOffset(),u={d:t,dd:l(t),ddd:d.i18n.dayNames[c],dddd:d.i18n.dayNames[c+7],m:f+1,mm:l(f+1),mmm:d.i18n.monthNames[f],mmmm:d.i18n.monthNames[f+
-12],yy:String(g).slice(2),yyyy:g,h:p%12||12,hh:l(p%12||12),H:p,HH:l(p),M:n,MM:l(n),s:h,ss:l(h),l:l(q,3),L:l(99<q?Math.round(q/10):q),t:12>p?"a":"p",tt:12>p?"am":"pm",T:12>p?"A":"P",TT:12>p?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<x?"-":"+")+l(100*Math.floor(Math.abs(x)/60)+Math.abs(x)%60,4),S:["th","st","nd","rd"][3<t%10?0:(10!=t%100-t%10)*t%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in u?u[a]:a.slice(1,
+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,l=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
+/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var q=e?"getUTC":"get",r=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),h=a[q+"FullYear"](),m=a[q+"Hours"](),n=a[q+"Minutes"](),g=a[q+"Seconds"](),q=a[q+"Milliseconds"](),x=e?0:a.getTimezoneOffset(),u={d:r,dd:p(r),ddd:d.i18n.dayNames[c],dddd:d.i18n.dayNames[c+7],m:f+1,mm:p(f+1),mmm:d.i18n.monthNames[f],mmmm:d.i18n.monthNames[f+
+12],yy:String(h).slice(2),yyyy:h,h:m%12||12,hh:p(m%12||12),H:m,HH:p(m),M:n,MM:p(n),s:g,ss:p(g),l:p(q,3),L:p(99<q?Math.round(q/10):q),t:12>m?"a":"p",tt:12>m?"am":"pm",T:12>m?"A":"P",TT:12>m?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(l,""),o:(0<x?"-":"+")+p(100*Math.floor(Math.abs(x)/60)+Math.abs(x)%60,4),S:["th","st","nd","rd"][3<r%10?0:(10!=r%100-r%10)*r%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in u?u[a]:a.slice(1,
a.length-1)})};
Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),e=b.getChildCount(b.root),d=0;d<e;d++)(function(d){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");b.isVisible(d)&&(k.setAttribute("checked","checked"),k.defaultChecked=
!0);e.appendChild(k);var q=d.value||mxResources.get("background")||"Background";e.setAttribute("title",q);mxUtils.write(e,q);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");b.setVisible(d,k.checked)})})(b.getChildAt(b.root,d));return a};
-Graph.prototype.replacePlaceholders=function(a,b){for(var e=[],d=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>d&&"%"==b.charAt(match.index-1))m=k.substring(1);else{var l=k.substring(1,k.length-1);if(0>l.indexOf("{"))for(var q=a;null==m&&null!=q;)null!=q.value&&"object"==typeof q.value&&(m=q.hasAttribute(l)?null!=q.getAttribute(l)?q.getAttribute(l):"":null),q=this.model.getParent(q);null==m&&(m=this.getGlobalVariable(l))}e.push(b.substring(d,
-match.index)+(null!=m?m:k));d=match.index+k.length}}e.push(b.substring(d));return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(b)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
-Graph.prototype.connectVertex=function(a,b,e,d,k,m){m=m?m:!1;var l=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(l.x+=a.geometry.width/2,l.y-=e):b==mxConstants.DIRECTION_SOUTH?(l.x+=a.geometry.width/2,l.y+=a.geometry.height+e):(l.x=b==mxConstants.DIRECTION_WEST?l.x-e:l.x+(a.geometry.width+e),l.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a));
-var q=this.view.scale,t=this.view.translate,c=t.x*q,t=t.y*q;this.model.isVertex(e.cell)&&(c=e.x,t=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(l.x+=a.parent.geometry.x,l.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(d)&&!k?null:this.getCellAt(c+l.x*q,t+l.y*q);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),q=this.view.getState(m),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(m=
-null));if(k=!mxEvent.isShiftDown(d)||k)b==mxConstants.DIRECTION_NORTH?l.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?l.y+=a.geometry.height/2:l.x=b==mxConstants.DIRECTION_WEST?l.x-a.geometry.width/2:l.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{q=m;if(null==q&&k){for(var c=a,f=this.getCellGeometry(a);null!=
-f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var g=this.view.getState(c),p=null!=g?g.style:this.getCellStyle(c);if(mxUtils.getValue(p,"part",!1)){var n=this.model.getParent(c);this.model.isVertex(n)&&(c=n)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=l.x-f.width/2,f.y=l.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var h=mxEvent.isControlDown(d)&&k||null==m&&null!=f&&f.constructor==mxStackLayout?
-null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=h&&this.connectionHandler.insertBeforeSource){var x=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=h.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==h.parent&&(x=d.parent.getIndex(d),this.model.add(d.parent,h,x))}null==m&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(x=a.parent.getIndex(a),this.model.add(a.parent,
-q,x));null!=h&&e.push(h);null==m&&null!=q&&e.push(q);null==q&&null!=h&&h.geometry.setTerminalPoint(l,!1);null!=h&&this.fireEvent(new mxEventObject("cellsInserted","cells",[h]))}finally{this.model.endUpdate()}return e};
+Graph.prototype.replacePlaceholders=function(a,b){for(var e=[],d=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var l=null;if(match.index>d&&"%"==b.charAt(match.index-1))l=k.substring(1);else{var p=k.substring(1,k.length-1);if(0>p.indexOf("{"))for(var q=a;null==l&&null!=q;)null!=q.value&&"object"==typeof q.value&&(l=q.hasAttribute(p)?null!=q.getAttribute(p)?q.getAttribute(p):"":null),q=this.model.getParent(q);null==l&&(l=this.getGlobalVariable(p))}e.push(b.substring(d,
+match.index)+(null!=l?l:k));d=match.index+k.length}}e.push(b.substring(d));return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(b)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
+Graph.prototype.connectVertex=function(a,b,e,d,k,l){l=l?l:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):b==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=b==mxConstants.DIRECTION_WEST?p.x-e:p.x+(a.geometry.width+e),p.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a));
+var q=this.view.scale,r=this.view.translate,c=r.x*q,r=r.y*q;this.model.isVertex(e.cell)&&(c=e.x,r=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);l=l||mxEvent.isControlDown(d)&&!k?null:this.getCellAt(c+p.x*q,r+p.y*q);this.model.isAncestor(l,a)&&(l=null);for(e=l;null!=e;){if(this.isCellLocked(e)){l=null;break}e=this.model.getParent(e)}null!=l&&(e=this.view.getState(a),q=this.view.getState(l),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(l=
+null));if(k=!mxEvent.isShiftDown(d)||k)b==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=b==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==l||this.isCellConnectable(l)||(e=this.getModel().getParent(l),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(l=e));if(l==a||this.model.isEdge(l)||!this.isCellConnectable(l))l=null;e=[];this.model.beginUpdate();try{q=l;if(null==q&&k){for(var c=a,f=this.getCellGeometry(a);null!=
+f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var h=this.view.getState(c),m=null!=h?h.style:this.getCellStyle(c);if(mxUtils.getValue(m,"part",!1)){var n=this.model.getParent(c);this.model.isVertex(n)&&(c=n)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=p.x-f.width/2,f.y=p.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var g=mxEvent.isControlDown(d)&&k||null==l&&null!=f&&f.constructor==mxStackLayout?
+null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=g&&this.connectionHandler.insertBeforeSource){var x=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=g.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==g.parent&&(x=d.parent.getIndex(d),this.model.add(d.parent,g,x))}null==l&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(x=a.parent.getIndex(a),this.model.add(a.parent,
+q,x));null!=g&&e.push(g);null==l&&null!=q&&e.push(q);null==q&&null!=g&&g.geometry.setTerminalPoint(p,!1);null!=g&&this.fireEvent(new mxEventObject("cellsInserted","cells",[g]))}finally{this.model.endUpdate()}return e};
Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],e,d;for(d in this.model.cells)if(e=this.model.cells[d],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(a.innerHTML=this.getLabel(e),e=mxUtils.extractTextWithWhitespace([a])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&b.push(e);return b.join(" ")};
Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),e=a,d=null;null==d&&null!=e;)null!=e.value&&"object"==typeof e.value&&(d=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e);return d||""}return a.value.getAttribute("label")}return mxGraph.prototype.convertValueToString.apply(this,arguments)};
Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null};
Graph.prototype.getCellStyle=function(a){var b=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var e=this.model.getParent(a);this.model.isVertex(e)&&this.isCellCollapsed(a)&&(e=this.layoutManager.getLayout(e),null!=e&&e.constructor==mxStackLayout&&(b[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))}return b};
Graph.prototype.updateAlternateBounds=function(a,b,e){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var d=this.layoutManager.getLayout(this.model.getParent(a));null!=d&&d.constructor==mxStackLayout&&(d.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
-Graph.prototype.foldCells=function(a,b,e,d,k){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var l=this.view.getState(e[m]),q=this.getCellGeometry(e[m]);if(null!=l&&null!=q){var t=Math.round(q.width-l.width/this.view.scale),c=Math.round(q.height-l.height/this.view.scale);if(0!=c||0!=t){var f=this.model.getParent(e[m]),g=this.layoutManager.getLayout(f);
-null==g?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(l,f,t,c):null!=k&&mxEvent.isAltDown(k)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(f,g,t,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
-Graph.prototype.moveSiblings=function(a,b,e,d){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var m=this.view.getState(k[b]),l=this.getCellGeometry(k[b]);null!=m&&null!=l&&(l=l.clone(),l.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[b],l))}}finally{this.model.endUpdate()}};
-Graph.prototype.resizeParentStacks=function(a,b,e,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var m=this.getCellGeometry(a),l=this.view.getState(a);null!=l&&null!=m&&(m=m.clone(),b.horizontal?m.width+=e+Math.min(0,l.width/this.view.scale-m.width):m.height+=d+Math.min(0,l.height/this.view.scale-m.height),this.model.setGeometry(a,
-m));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
+Graph.prototype.foldCells=function(a,b,e,d,k){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var l=0;l<e.length;l++){var p=this.view.getState(e[l]),q=this.getCellGeometry(e[l]);if(null!=p&&null!=q){var r=Math.round(q.width-p.width/this.view.scale),c=Math.round(q.height-p.height/this.view.scale);if(0!=c||0!=r){var f=this.model.getParent(e[l]),h=this.layoutManager.getLayout(f);
+null==h?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(p,f,r,c):null!=k&&mxEvent.isAltDown(k)||h.constructor!=mxStackLayout||h.resizeLast||this.resizeParentStacks(f,h,r,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
+Graph.prototype.moveSiblings=function(a,b,e,d){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var l=this.view.getState(k[b]),p=this.getCellGeometry(k[b]);null!=l&&null!=p&&(p=p.clone(),p.translate(Math.round(e*Math.max(0,Math.min(1,(l.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(l.y-a.y)/a.height)))),this.model.setGeometry(k[b],p))}}finally{this.model.endUpdate()}};
+Graph.prototype.resizeParentStacks=function(a,b,e,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var l=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=l&&(l=l.clone(),b.horizontal?l.width+=e+Math.min(0,p.width/this.view.scale-l.width):l.height+=d+Math.min(0,p.height/this.view.scale-l.height),this.model.setGeometry(a,
+l));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,b,e){e=e||this.getDefaultParent();this.isCellLocked(e)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,e){e=e||this.getDefaultParent();return this.isCellLocked(e)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)};
Graph.prototype.isCellFoldable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.foldingEnabled&&!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=b.collapsible||!this.isContainer(a)&&"1"==b.collapsible)};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};
Graph.prototype.zoom=function(a,b){a=Math.max(.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};
@@ -2250,7 +2250,7 @@ HoverIcons.prototype.refreshTarget=new mxImage(mxClient.IS_SVG?"data:image/png;b
HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"));this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"));this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"));this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"));this.elts=[this.arrowUp,this.arrowRight,this.arrowDown,this.arrowLeft];this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});
-var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var m=this.getState(d.getState());null==m&&mxEvent.isTouchEvent(e)||this.update(m)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&
+var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var l=this.getState(d.getState());null==l&&mxEvent.isTouchEvent(e)||this.update(l)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&
null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(d.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(d.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?b||this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),
d.getGraphY())))):mxEvent.isTouchEvent(e)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(e)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
HoverIcons.prototype.createArrow=function(a,b){var e=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",a.src),e.style.borderStyle="none"):(e=document.createElement("div"),e.style.backgroundImage="url("+a.src+")",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat"),e.style.width=a.width+4+"px",e.style.height=a.height+4+"px",e.style.display=mxClient.IS_QUIRKS?"inline":
@@ -2259,14 +2259,14 @@ this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redire
this.resetActiveArrow()}));return e};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var a=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?a=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?a=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(a=mxConstants.DIRECTION_WEST);return a};
HoverIcons.prototype.visitNodes=function(a){for(var b=0;b<this.elts.length;b++)null!=this.elts[b]&&a(this.elts[b])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(b){b.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
HoverIcons.prototype.drag=function(a,b,e){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,e),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,a=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=a&&a.setHandlesVisible(!1))};HoverIcons.prototype.getStateAt=function(a,b,e){return this.graph.view.getState(this.graph.getCellAt(b,e))};
-HoverIcons.prototype.click=function(a,b,e){var d=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(d)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):
+HoverIcons.prototype.click=function(a,b,e){var d=e.getEvent(),k=e.getGraphX(),l=e.getGraphY(),k=this.getStateAt(a,k,l);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(d)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):
this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(k.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null};
HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing);
var b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=b&&(a.x-=b.horizontalOffset/2,a.y-=b.verticalOffset/2,a.width+=b.horizontalOffset,a.height+=b.verticalOffset,null!=b.rotationShape&&null!=b.rotationShape.node&&"hidden"!=b.rotationShape.node.style.visibility&&"none"!=b.rotationShape.node.style.display&&null!=b.rotationShape.boundingBox&&a.add(b.rotationShape.boundingBox));this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance)+
"px";this.arrowUp.style.top=Math.round(a.y-this.triangleUp.height-this.tolerance)+"px";mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity);this.arrowRight.style.left=Math.round(a.x+a.width-this.tolerance)+"px";this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)+"px";mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity);this.arrowDown.style.left=this.arrowUp.style.left;this.arrowDown.style.top=Math.round(a.y+a.height-this.tolerance)+
"px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=Math.round(a.x-this.triangleLeft.width-this.tolerance)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),d=this.graph.getCellAt(this.currentState.getCenterX(),
-a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==d&&d==a&&(a=d=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==k||d.height<6*k.height&&d.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
-m(b,this.arrowRight);m(e,this.arrowLeft);m(d,this.arrowUp);m(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
+a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==d&&d==a&&(a=d=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),l=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==k||d.height<6*k.height&&d.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
+l(b,this.arrowRight);l(e,this.arrowLeft);l(d,this.arrowUp);l(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
@@ -2275,23 +2275,23 @@ this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activa
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,c){var d=this.getState(a);null!=d&&this.graph.model.isEdge(d.cell)&&null!=d.style&&1!=d.style[mxConstants.STYLE_CURVED]&&!d.invalid&&this.updateLineJumps(d)&&this.graph.cellRenderer.redraw(d,!1,this.isRendering());d=b.apply(this,arguments);null!=
d&&this.graph.model.isEdge(d.cell)&&1!=d.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(d);return d};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,c){return e.apply(this,arguments)||null!=a.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&&1!=a.style[mxConstants.STYLE_CURVED]&&
-this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var b=null!=a.routedPoints,d=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,b,f){var g=new mxPoint(b,f);g.type=c;d.push(g);g=null!=a.routedPoints?a.routedPoints[d.length-1]:null;return null==g||g.type!=c||g.x!=b||g.y!=f},n=.5*this.scale,b=!1,d=[],h=0;h<c.length-1;h++){for(var k=c[h+1],u=c[h],v=[],r=c[h+2];h<
-c.length-2&&mxUtils.ptSegDistSq(u.x,u.y,r.x,r.y,k.x,k.y)<1*this.scale*this.scale;)k=r,h++,r=c[h+2];for(var b=e(0,u.x,u.y)||b,q=0;q<this.validEdges.length;q++){var w=this.validEdges[q],m=w.absolutePoints;if(null!=m&&mxUtils.intersects(a,w))for(w=0;w<m.length-1;w++){for(var l=m[w+1],t=m[w],r=m[w+2];w<m.length-2&&mxUtils.ptSegDistSq(t.x,t.y,r.x,r.y,l.x,l.y)<1*this.scale*this.scale;)l=r,w++,r=m[w+2];r=mxUtils.intersection(u.x,u.y,k.x,k.y,t.x,t.y,l.x,l.y);if(null!=r&&(Math.abs(r.x-t.x)>n||Math.abs(r.y-
-t.y)>n)&&(Math.abs(r.x-l.x)>n||Math.abs(r.y-l.y)>n)){l=r.x-u.x;t=r.y-u.y;r={distSq:l*l+t*t,x:r.x,y:r.y};for(l=0;l<v.length;l++)if(v[l].distSq>r.distSq){v.splice(l,0,r);r=null;break}null==r||0!=v.length&&v[v.length-1].x===r.x&&v[v.length-1].y===r.y||v.push(r)}}}for(w=0;w<v.length;w++)b=e(1,v[w].x,v[w].y)||b}r=c[c.length-1];b=e(0,r.x,r.y)||b}a.routedPoints=d;return b}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,b){this.routedPoints=null!=this.state?this.state.routedPoints:
-null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),h,q=!0,u=null,v=null;h=[];var r=null;a.begin();for(var m=0;m<this.state.routedPoints.length;m++){var w=this.state.routedPoints[m],
-l=new mxPoint(w.x/this.scale,w.y/this.scale);0==m?l=c[0]:m==this.state.routedPoints.length-1&&(l=c[c.length-1]);var t=!1;if(null!=u&&1==w.type){var B=this.state.routedPoints[m+1],w=B.x/this.scale-l.x,B=B.y/this.scale-l.y,w=w*w+B*B;null==r&&(r=new mxPoint(l.x-u.x,l.y-u.y),v=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/v,r.y=r.y*f/v);w>f*f&&0<v&&(w=u.x-l.x,B=u.y-l.y,w=w*w+B*B,w>f*f&&(t=new mxPoint(l.x-r.x,l.y-r.y),w=new mxPoint(l.x+r.x,l.y+r.y),h.push(t),this.addPoints(a,h,b,d,!1,null,q),h=0>Math.round(r.x)||
-0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(t.x-r.y*h,t.y+r.x*h),a.lineTo(w.x-r.y*h,w.y+r.x*h),a.lineTo(w.x,w.y)):"arc"==e?(h*=1.3,a.curveTo(t.x-r.y*h,t.y+r.x*h,w.x-r.y*h,w.y+r.x*h,w.x,w.y)):(a.moveTo(w.x,w.y),q=!0),h=[w],t=!0))}else r=null;t||(h.push(l),u=l)}this.addPoints(a,h,b,d,!1,null,q);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,b,d){if(null==c||null==a||"1"!=c.style.snapToPoint&&
-"1"!=a.style.snapToPoint)m.apply(this,arguments);else{c=this.getTerminalPort(a,c,d);var f=this.getNextPoint(a,b,d),g=this.graph.isOrthogonal(a),e=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),k=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=e)var u=Math.cos(-e),v=Math.sin(-e),f=mxUtils.getRotatedPoint(f,u,v,k);u=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
-0);f=this.getPerimeterPoint(c,f,0==e&&g,u);0!=e&&(u=Math.cos(e),v=Math.sin(e),f=mxUtils.getRotatedPoint(f,u,v,k));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,b,d,f),d)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,b,d,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);d=b=null;for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(c,a[f]);if(null!=g){var p=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==d||p<d)b=g,d=p}}null!=b&&(e=b)}return e};var l=mxStencil.prototype.evaluateTextAttribute;
-mxStencil.prototype.evaluateTextAttribute=function(a,c,b){var d=l.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=b.state&&(d=b.state.view.graph.replacePlaceholders(b.state.cell,d));return d};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"stencil("==c.substring(0,8))try{var b=c.substring(8,c.length-1),d=mxUtils.parseXml(a.view.graph.decompress(b));
-return new mxShape(new mxStencil(d.documentElement))}catch(p){null!=window.console&&console.log("Error in shape: "+p)}}return q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
-mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var d=0;d<b.length;d++){var k=b[d];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var m=
-mxUtils.load(k);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(l){null!=window.console&&console.log("error in getStencil:",k,l)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};
+this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var b=null!=a.routedPoints,d=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,b,f){var h=new mxPoint(b,f);h.type=c;d.push(h);h=null!=a.routedPoints?a.routedPoints[d.length-1]:null;return null==h||h.type!=c||h.x!=b||h.y!=f},n=.5*this.scale,b=!1,d=[],g=0;g<c.length-1;g++){for(var k=c[g+1],u=c[g],v=[],t=c[g+2];g<
+c.length-2&&mxUtils.ptSegDistSq(u.x,u.y,t.x,t.y,k.x,k.y)<1*this.scale*this.scale;)k=t,g++,t=c[g+2];for(var b=e(0,u.x,u.y)||b,q=0;q<this.validEdges.length;q++){var l=this.validEdges[q],p=l.absolutePoints;if(null!=p&&mxUtils.intersects(a,l))for(l=0;l<p.length-1;l++){for(var r=p[l+1],B=p[l],t=p[l+2];l<p.length-2&&mxUtils.ptSegDistSq(B.x,B.y,t.x,t.y,r.x,r.y)<1*this.scale*this.scale;)r=t,l++,t=p[l+2];t=mxUtils.intersection(u.x,u.y,k.x,k.y,B.x,B.y,r.x,r.y);if(null!=t&&(Math.abs(t.x-B.x)>n||Math.abs(t.y-
+B.y)>n)&&(Math.abs(t.x-r.x)>n||Math.abs(t.y-r.y)>n)){r=t.x-u.x;B=t.y-u.y;t={distSq:r*r+B*B,x:t.x,y:t.y};for(r=0;r<v.length;r++)if(v[r].distSq>t.distSq){v.splice(r,0,t);t=null;break}null==t||0!=v.length&&v[v.length-1].x===t.x&&v[v.length-1].y===t.y||v.push(t)}}}for(l=0;l<v.length;l++)b=e(1,v[l].x,v[l].y)||b}t=c[c.length-1];b=e(0,t.x,t.y)||b}a.routedPoints=d;return b}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,b){this.routedPoints=null!=this.state?this.state.routedPoints:
+null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),g,q=!0,u=null,v=null;g=[];var t=null;a.begin();for(var l=0;l<this.state.routedPoints.length;l++){var p=this.state.routedPoints[l],
+w=new mxPoint(p.x/this.scale,p.y/this.scale);0==l?w=c[0]:l==this.state.routedPoints.length-1&&(w=c[c.length-1]);var r=!1;if(null!=u&&1==p.type){var B=this.state.routedPoints[l+1],p=B.x/this.scale-w.x,B=B.y/this.scale-w.y,p=p*p+B*B;null==t&&(t=new mxPoint(w.x-u.x,w.y-u.y),v=Math.sqrt(t.x*t.x+t.y*t.y),t.x=t.x*f/v,t.y=t.y*f/v);p>f*f&&0<v&&(p=u.x-w.x,B=u.y-w.y,p=p*p+B*B,p>f*f&&(r=new mxPoint(w.x-t.x,w.y-t.y),p=new mxPoint(w.x+t.x,w.y+t.y),g.push(r),this.addPoints(a,g,b,d,!1,null,q),g=0>Math.round(t.x)||
+0==Math.round(t.x)&&0>=Math.round(t.y)?1:-1,q=!1,"sharp"==e?(a.lineTo(r.x-t.y*g,r.y+t.x*g),a.lineTo(p.x-t.y*g,p.y+t.x*g),a.lineTo(p.x,p.y)):"arc"==e?(g*=1.3,a.curveTo(r.x-t.y*g,r.y+t.x*g,p.x-t.y*g,p.y+t.x*g,p.x,p.y)):(a.moveTo(p.x,p.y),q=!0),g=[p],r=!0))}else t=null;r||(g.push(w),u=w)}this.addPoints(a,g,b,d,!1,null,q);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,b,d){if(null==c||null==a||"1"!=c.style.snapToPoint&&
+"1"!=a.style.snapToPoint)l.apply(this,arguments);else{c=this.getTerminalPort(a,c,d);var f=this.getNextPoint(a,b,d),h=this.graph.isOrthogonal(a),e=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),k=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=e)var u=Math.cos(-e),v=Math.sin(-e),f=mxUtils.getRotatedPoint(f,u,v,k);u=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
+0);f=this.getPerimeterPoint(c,f,0==e&&h,u);0!=e&&(u=Math.cos(e),v=Math.sin(e),f=mxUtils.getRotatedPoint(f,u,v,k));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,b,d,f),d)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,b,d,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);d=b=null;for(var f=0;f<a.length;f++){var h=this.graph.getConnectionPoint(c,a[f]);if(null!=h){var m=(h.x-e.x)*(h.x-e.x)+(h.y-e.y)*(h.y-e.y);if(null==d||m<d)b=h,d=m}}null!=b&&(e=b)}return e};var p=mxStencil.prototype.evaluateTextAttribute;
+mxStencil.prototype.evaluateTextAttribute=function(a,c,b){var d=p.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=b.state&&(d=b.state.view.graph.replacePlaceholders(b.state.cell,d));return d};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"stencil("==c.substring(0,8))try{var b=c.substring(8,c.length-1),d=mxUtils.parseXml(a.view.graph.decompress(b));
+return new mxShape(new mxStencil(d.documentElement))}catch(m){null!=window.console&&console.log("Error in shape: "+m)}}return q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
+mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var d=0;d<b.length;d++){var k=b[d];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var l=
+mxUtils.load(k);null!=l&&200<=l.getStatus()&&299>=l.getStatus()&&eval.call(window,l.getText())}}catch(p){null!=window.console&&console.log("error in getStencil:",k,p)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};
mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var b=a[1],e=2;e<a.length-1;e++)b+="/"+a[e];return b};
-mxStencilRegistry.loadStencilSet=function(a,b,e,d){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,m=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,m))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;m=!0}catch(l){null!=window.console&&console.log("error in loadStencilSet:",a,l)}null!=k&&null!=
-k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,b,m)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
-mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,e),d=d.nextSibling;else{e=null!=e?e:!0;var d=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(d));if(null!=b){var l=d.getAttribute("w"),
-q=d.getAttribute("h"),l=null==l?80:parseInt(l,10),q=null==q?80:parseInt(q,10);b(k,m,a,l,q)}}d=d.nextSibling}}};
+mxStencilRegistry.loadStencilSet=function(a,b,e,d){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var l=!1;if(null==k)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,l=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,l))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;l=!0}catch(p){null!=window.console&&console.log("error in loadStencilSet:",a,p)}null!=k&&null!=
+k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,b,l)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
+mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,e),d=d.nextSibling;else{e=null!=e?e:!0;var d=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var k=k.toLowerCase(),l=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+l.toLowerCase(),new mxStencil(d));if(null!=b){var p=d.getAttribute("w"),
+q=d.getAttribute("h"),p=null==p?80:parseInt(p,10),q=null==q?80:parseInt(q,10);b(k,l,a,p,q)}}d=d.nextSibling}}};
"undefined"!=typeof mxVertexHandler&&function(){function a(){var a=document.createElement("div");a.className="geHint";a.style.whiteSpace="nowrap";a.style.position="absolute";return a}mxConstants.HANDLE_FILLCOLOR="#99ccff";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR=
"#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=8;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var b=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)||
b.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxEllipse(null,this.highlightColor,this.highlightColor,0);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(a){a=this.graph.createCurrentEdgeStyle();a=this.graph.createEdge(null,null,null,null,null,a);a=new mxCellState(this.graph.view,a,this.graph.getCellStyle(a));
@@ -2299,71 +2299,71 @@ for(var c in this.graph.currentEdgeStyle)a.style[c]=this.graph.currentEdgeStyle[
a.getCell=mxUtils.bind(this,function(a){var b=c.apply(this,arguments);this.error=null;return b});return a};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&&(a+="shape="+this.currentEdgeStyle.shape+";");null!=this.currentEdgeStyle.curved&&(a+="curved="+
this.currentEdgeStyle.curved+";");null!=this.currentEdgeStyle.rounded&&(a+="rounded="+this.currentEdgeStyle.rounded+";");null!=this.currentEdgeStyle.comic&&(a+="comic="+this.currentEdgeStyle.comic+";");null!=this.currentEdgeStyle.jumpStyle&&(a+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";");null!=this.currentEdgeStyle.jumpSize&&(a+="jumpSize="+this.currentEdgeStyle.jumpSize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(a+="elbow="+this.currentEdgeStyle.elbow+
";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())};Graph.prototype.importGraphModel=function(a,c,b,d){c=null!=c?
-c:0;b=null!=b?b:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var g={},h=0;h<a;h++){var p=e.getChildAt(e.getRoot(),h);if(1!=a||this.isCellLocked(this.getDefaultParent()))p=this.importCells([p],0,0,this.model.getRoot(),null,g)[0],n=this.model.getChildren(p),this.moveCells(n,c,b),f=f.concat(n);else var n=e.getChildren(p),f=f.concat(this.importCells(n,c,b,this.getDefaultParent(),
-null,g))}if(d){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var u=this.getBoundingBoxFromGeometry(f,!0);null!=u&&this.moveCells(f,c-u.x,b-u.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var d=[];try{for(var f=JSON.parse(b),b=0;b<f.length;b++){var e=f[b];d.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0))}}catch(Q){}return d}if(null!=
+c:0;b=null!=b?b:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var h={},g=0;g<a;g++){var m=e.getChildAt(e.getRoot(),g);if(1!=a||this.isCellLocked(this.getDefaultParent()))m=this.importCells([m],0,0,this.model.getRoot(),null,h)[0],n=this.model.getChildren(m),this.moveCells(n,c,b),f=f.concat(n);else var n=e.getChildren(m),f=f.concat(this.importCells(n,c,b,this.getDefaultParent(),
+null,h))}if(d){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var u=this.getBoundingBoxFromGeometry(f,!0);null!=u&&this.moveCells(f,c-u.x,b-u.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var d=[];try{for(var f=JSON.parse(b),b=0;b<f.length;b++){var e=f[b];d.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0))}}catch(Q){}return d}if(null!=
a.shape)if(null!=a.shape.stencil){if(null!=a.shape.stencil)return a.shape.stencil.constraints}else if(null!=a.shape.constraints)return a.shape.constraints}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);null!=c&&(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};
Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,d=0;d<c;d++){var f=this.model.getChildAt(a,d);this.model.isVertex(f)&&(f=this.getCellGeometry(f),null==f||f.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c,"dropTarget",
"1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,
-arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var d=0;d<a.length;d++){var f=a[d];if(c.isEdge(f)){var e=c.getTerminal(f,!0),g=c.getTerminal(f,!1);c.setTerminal(f,g,!0);c.setTerminal(f,e,!1);var h=c.getGeometry(f);if(null!=h){h=h.clone();null!=h.points&&h.points.reverse();var p=h.getTerminalPoint(!0),n=h.getTerminalPoint(!1);
-h.setTerminalPoint(p,!1);h.setTerminalPoint(n,!0);c.setGeometry(f,h);var u=this.view.getState(f),r=this.view.getState(e),v=this.view.getState(g);if(null!=u){var k=null!=r?this.getConnectionConstraint(u,r,!0):null,L=null!=v?this.getConnectionConstraint(u,v,!1):null;this.setConnectionConstraint(f,e,!0,L);this.setConnectionConstraint(f,g,!1,k)}b.push(f)}}else if(c.isVertex(f)&&(h=this.getCellGeometry(f),null!=h)){h=h.clone();h.x+=h.width/2-h.height/2;h.y+=h.height/2-h.width/2;var q=h.width;h.width=h.height;
-h.height=q;c.setGeometry(f,h);var z=this.view.getState(f);if(null!=z){var x=z.style[mxConstants.STYLE_DIRECTION]||"east";"east"==x?x="south":"south"==x?x="west":"west"==x?x="north":"north"==x&&(x="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,x,[f])}b.push(f)}}}finally{c.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);
+arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var d=0;d<a.length;d++){var f=a[d];if(c.isEdge(f)){var e=c.getTerminal(f,!0),h=c.getTerminal(f,!1);c.setTerminal(f,h,!0);c.setTerminal(f,e,!1);var g=c.getGeometry(f);if(null!=g){g=g.clone();null!=g.points&&g.points.reverse();var m=g.getTerminalPoint(!0),n=g.getTerminalPoint(!1);
+g.setTerminalPoint(m,!1);g.setTerminalPoint(n,!0);c.setGeometry(f,g);var u=this.view.getState(f),t=this.view.getState(e),v=this.view.getState(h);if(null!=u){var k=null!=t?this.getConnectionConstraint(u,t,!0):null,K=null!=v?this.getConnectionConstraint(u,v,!1):null;this.setConnectionConstraint(f,e,!0,K);this.setConnectionConstraint(f,h,!1,k)}b.push(f)}}else if(c.isVertex(f)&&(g=this.getCellGeometry(f),null!=g)){g=g.clone();g.x+=g.width/2-g.height/2;g.y+=g.height/2-g.width/2;var q=g.width;g.width=g.height;
+g.height=q;c.setGeometry(f,g);var x=this.view.getState(f);if(null!=x){var z=x.style[mxConstants.STYLE_DIRECTION]||"east";"east"==z?z="south":"south"==z?z="west":"west"==z?z="north":"north"==z&&(z="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,z,[f])}b.push(f)}}}finally{c.endUpdate()}return b};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);
if(0<c.length)for(var b=0;b<c.length;b++)this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,c,b){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(d)){this.setAttributeForCell(f,d,c);break}f=
-this.model.getParent(f)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,b=0;b<a.length;b++)c.put(a[b],!0);for(var d=[],b=0;b<a.length;b++){var f=this.model.getParent(a[b]);null==f||c.get(f)||(c.put(f,!0),d.push(f))}for(b=0;b<d.length;b++)if(f=this.view.getState(d[b]),null!=f&&this.isCellDeletable(f.cell)){var e=mxUtils.getValue(f.style,
-mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=!0;for(g=0;g<this.model.getChildCount(f.cell)&&e;g++)c.get(this.model.getChildAt(f.cell,g))||(e=!1);e&&a.push(f.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var d=this.view.getState(a[b]);if(null!=d){var f=
-mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&d==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.setAttributeForCell=function(a,c,b){var d;
-null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=b&&0<b.length?d.setAttribute(c,b):d.removeAttribute(c);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,c,b,d){this.getModel();if(mxEvent.isAltDown(c))return null;for(var f=0;f<a.length;f++)if(this.model.isEdge(this.model.getParent(a[f])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=
-function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var d=this.model.isEdge(c)?this.view.getState(c):null,f=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=f||null!=d&&null!=d.text&&null!=d.text.node&&(mxUtils.contains(d.text.boundingBox,
-b.x,b.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&f==this.view.getCanvas()||mxClient.IS_SVG&&f==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,d))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,b=this.container.scrollTop/
-this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),f=this.getPageSize(),c=Math.max(c,d.x*f.width),b=Math.max(b,d.y*f.height);return new mxPoint(this.snap(c+a),this.snap(b+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),d=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+(0==c.height?1:
-2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=b){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var f=this.view.getRelativePoint(b,a,c);d.geometry.x=Math.round(1E4*f.x)/1E4;d.geometry.y=Math.round(f.y);d.geometry.offset=
-new mxPoint(0,0);var f=this.view.getPoint(b,d.geometry),e=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((c-f.y)/e))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-f.x,d.geometry.y=Math.round(c/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([d],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",
-[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,c,b){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var b=0;b<a.length;b++){var d=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=d&&(a[b].setAttribute("href",
-d),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,d);d();var f=this.container.style.cursor,e=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
-mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(g.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-c.getGraphX()),d=Math.abs(this.startY-c.getGraphY());(b>e||d>e)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=
-b.parentNode;null!=b?this.clear():(null==this.currentState||c.getState()!=this.currentState&&null!=c.getState()||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c)}},mouseUp:function(a,d){for(var f=d.getSource(),h=d.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(h)&&
-!mxEvent.isPopupTrigger(h)||mxEvent.isTouchEvent(h))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(h,this.currentLink),mxEvent.isConsumed(h)||(h=f?g.linkTarget:"_top","_self"==h&&window!=window.top?window.location.href=this.currentLink:this.currentLink.substring(0,g.baseUrl.length)==g.baseUrl&&"#"==this.currentLink.charAt(g.baseUrl.length)&&"_top"==h&&window==window.top?window.location.hash=this.currentLink.split("#")[1]:window.open(this.currentLink,
-h),d.consume())):null!=b&&!d.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&Math.abs(this.startX-d.getGraphX())<e&&Math.abs(this.startY-d.getGraphY())<e&&b(d.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=
-f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}};g.click=function(a){};g.addMouseListener(h);mxEvent.addListener(document,"mouseleave",function(a){h.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),d=this.gridSize,f=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1),g=0;g<a.length;g++){var h=b.getParent(a[g]),p=this.moveCells([e[g]],d,d,!1,h)[0];
-f.push(p);if(c)b.add(h,e[g]);else{var n=h.getIndex(a[g]);b.add(h,e[g],n+1)}}}finally{b.endUpdate()}return f};Graph.prototype.insertImage=function(a,c,b){if(null!=a){for(var d=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<d.length;e++)f.push(d[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",b);break}}};
+this.model.getParent(f)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,b=0;b<a.length;b++)c.put(a[b],!0);for(var d=[],b=0;b<a.length;b++){var f=this.model.getParent(a[b]);null==f||c.get(f)||(c.put(f,!0),d.push(f))}for(b=0;b<d.length;b++)if(f=this.view.getState(d[b]),null!=f&&(this.model.isEdge(f.cell)||this.model.isVertex(f.cell))&&
+this.isCellDeletable(f.cell)){var e=mxUtils.getValue(f.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),h=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&h==mxConstants.NONE){e=!0;for(h=0;h<this.model.getChildCount(f.cell)&&e;h++)c.get(this.model.getChildAt(f.cell,h))||(e=!1);e&&a.push(f.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var d=
+this.view.getState(a[b]);if(null!=d){var f=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&d==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.setAttributeForCell=
+function(a,c,b){var d;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),d.setAttribute("label",a.value||""));null!=b&&0<b.length?d.setAttribute(c,b):d.removeAttribute(c);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,c,b,d){this.getModel();if(mxEvent.isAltDown(c))return null;for(var f=0;f<a.length;f++)if(this.model.isEdge(this.model.getParent(a[f])))return null;return mxGraph.prototype.getDropTarget.apply(this,
+arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var d=this.model.isEdge(c)?this.view.getState(c):null,f=mxEvent.getSource(a);this.firstClickState!=d||this.firstClickSource!=f||null!=d&&null!=d.text&&null!=d.text.node&&
+(mxUtils.contains(d.text.boundingBox,b.x,b.y)||mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a)))||(null!=d||this.isCellLocked(this.getDefaultParent()))&&(null==d||this.isCellLocked(d.cell))||!(null!=d||mxClient.IS_VML&&f==this.view.getCanvas()||mxClient.IS_SVG&&f==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,d))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,
+b=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),f=this.getPageSize(),c=Math.max(c,d.x*f.width),b=Math.max(b,d.y*f.height);return new mxPoint(this.snap(c+a),this.snap(b+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),d=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+
+(0==c.height?1:2)*this.gridSize)));return new mxPoint(d,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var d=new mxCell;d.value="Text";d.style="text;html=1;resizable=0;points=[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=b){d.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";d.geometry.relative=!0;d.connectable=!1;var f=this.view.getRelativePoint(b,a,c);d.geometry.x=Math.round(1E4*f.x)/1E4;d.geometry.y=Math.round(f.y);
+d.geometry.offset=new mxPoint(0,0);var f=this.view.getPoint(b,d.geometry),e=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((c-f.y)/e))}else d.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-f.x,d.geometry.y=Math.round(c/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([d],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted",
+"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler=function(a,c,b){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var b=0;b<a.length;b++){var d=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=d&&(a[b].setAttribute("href",
+d),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,d);d();var f=this.container.style.cursor,e=this.getTolerance(),h=this,g={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(h,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=h.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
+mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=h.container.scrollLeft;this.scrollTop=h.container.scrollTop;null==this.currentLink&&"auto"==h.container.style.overflow&&(h.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(h.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-c.getGraphX()),d=Math.abs(this.startY-c.getGraphY());(b>e||d>e)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=
+b.parentNode;null!=b?this.clear():(null==this.currentState||c.getState()!=this.currentState&&null!=c.getState()||!h.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c)}},mouseUp:function(a,d){for(var f=d.getSource(),g=d.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-h.container.scrollLeft)<e&&Math.abs(this.scrollTop-h.container.scrollTop)<e&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(g)&&
+!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))&&(null!=this.currentLink?(f=h.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(g,this.currentLink),mxEvent.isConsumed(g)||(g=f?h.linkTarget:"_top","_self"==g&&window!=window.top?window.location.href=this.currentLink:this.currentLink.substring(0,h.baseUrl.length)==h.baseUrl&&"#"==this.currentLink.charAt(h.baseUrl.length)&&"_top"==g&&window==window.top?window.location.hash=this.currentLink.split("#")[1]:window.open(this.currentLink,
+g),d.consume())):null!=b&&!d.isConsumed()&&Math.abs(this.scrollLeft-h.container.scrollLeft)<e&&Math.abs(this.scrollTop-h.container.scrollTop)<e&&Math.abs(this.startX-d.getGraphX())<e&&Math.abs(this.startY-d.getGraphY())<e&&b(d.getEvent()));this.clear()},activate:function(a){this.currentLink=h.getAbsoluteUrl(h.getLinkForCell(a.cell));null!=this.currentLink&&(h.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=h.container&&(h.container.style.cursor=
+f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}};h.click=function(a){};h.addMouseListener(g);mxEvent.addListener(document,"mouseleave",function(a){g.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),d=this.gridSize,f=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1),h=0;h<a.length;h++){var g=b.getParent(a[h]),m=this.moveCells([e[h]],d,d,!1,g)[0];
+f.push(m);if(c)b.add(g,e[h]);else{var n=g.getIndex(a[h]);b.add(g,e[h],n+1)}}}finally{b.endUpdate()}return f};Graph.prototype.insertImage=function(a,c,b){if(null!=a){for(var d=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<d.length;e++)f.push(d[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",b);break}}};
Graph.prototype.insertLink=function(a){0==a.length?document.execCommand("unlink",!1):document.execCommand("createlink",!1,mxUtils.trim(a))};Graph.prototype.isCellResizable=function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());
-if(null!=c&&1<c.length){for(var b=[],d=null,f=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var g=this.view.getState(c[e]);if(null!=g){var h=a?g.getCenterX():g.getCenterY(),d=null!=d?Math.max(d,h):h,f=null!=f?Math.min(f,h):h;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;h=this.view.scale;f=f/h-(a?g.x:g.y);d=d/h-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var p=(d-f)/(b.length-1),d=f,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),
-u=this.getCellGeometry(b[e].cell),d=d+p;null!=u&&null!=n&&(u=u.clone(),a?u.x=Math.round(d-u.width/2)-n.origin.x:u.y=Math.round(d-u.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,u))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),b=new mxDictionary,d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<c.length;d++){var f=
+if(null!=c&&1<c.length){for(var b=[],d=null,f=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var h=this.view.getState(c[e]);if(null!=h){var g=a?h.getCenterX():h.getCenterY(),d=null!=d?Math.max(d,g):g,f=null!=f?Math.min(f,g):g;b.push(h)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});h=this.view.translate;g=this.view.scale;f=f/g-(a?h.x:h.y);d=d/g-(a?h.x:h.y);this.getModel().beginUpdate();try{for(var m=(d-f)/(b.length-1),d=f,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),
+u=this.getCellGeometry(b[e].cell),d=d+m;null!=u&&null!=n&&(u=u.clone(),a?u.x=Math.round(d-u.width/2)-n.origin.x:u.y=Math.round(d-u.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,u))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),b=new mxDictionary,d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<c.length;d++){var f=
this.view.getState(a[d]);if(null!=f){var e=this.getCellGeometry(c[d]);null==e||!e.relative||this.model.isEdge(a[d])||b.get(this.model.getParent(a[d]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(d=0;d<a.length;d++)f.add(e,c[d]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});
-return a};Graph.prototype.getSvg=function(a,c,b,d,f,e,g){c=null!=c?c:1;b=null!=b?b:0;f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;var h=e||d?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==h)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,n=mxUtils.createXmlDocument();d=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=d.style?d.style.backgroundColor=a:d.setAttribute("style","background-color:"+
-a));null==n.createElementNS?(d.setAttribute("xmlns",mxConstants.NS_SVG),d.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/p;d.setAttribute("width",Math.max(1,Math.ceil(h.width*a)+2*b)+"px");d.setAttribute("height",Math.max(1,Math.ceil(h.height*a)+2*b)+"px");d.setAttribute("version","1.1");var u=d;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform",
-"translate(0.5,0.5)"),d.appendChild(u));n.appendChild(d);n=this.createSvgCanvas(u);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-h.x)/p),Math.floor((b/c-h.y)/p));var r=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,e,g,h,n,p,u,v,k){var q=this.state;if(null!=this.foAltText&&(0==d||0!=q.fontSize&&e.length<5*d/q.fontSize)){var x=this.createElement("text");x.setAttribute("x",Math.round(d/2));x.setAttribute("y",Math.round((f+q.fontSize)/
-2));x.setAttribute("fill",q.fontColor||"black");x.setAttribute("text-anchor","middle");x.setAttribute("font-size",Math.round(q.fontSize)+"px");x.setAttribute("font-family",q.fontFamily);(q.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&x.setAttribute("font-weight","bold");(q.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&x.setAttribute("font-style","italic");(q.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&x.setAttribute("text-decoration","underline");
-mxUtils.write(x,e);return x}return r.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(h,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=g;g=this.createSvgImageExport();var v=g.drawCellState;g.drawCellState=function(a,c){(e||a.view.graph.isCellSelected(a.cell))&&v.apply(this,arguments)};g.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
+return a};Graph.prototype.getSvg=function(a,c,b,d,f,e,h){c=null!=c?c:1;b=null!=b?b:0;f=null!=f?f:!0;e=null!=e?e:!0;h=null!=h?h:!0;var g=e||d?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==g)throw Error(mxResources.get("drawingEmpty"));var m=this.view.scale,n=mxUtils.createXmlDocument();d=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=d.style?d.style.backgroundColor=a:d.setAttribute("style","background-color:"+
+a));null==n.createElementNS?(d.setAttribute("xmlns",mxConstants.NS_SVG),d.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/m;d.setAttribute("width",Math.max(1,Math.ceil(g.width*a)+2*b)+"px");d.setAttribute("height",Math.max(1,Math.ceil(g.height*a)+2*b)+"px");d.setAttribute("version","1.1");var u=d;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform",
+"translate(0.5,0.5)"),d.appendChild(u));n.appendChild(d);n=this.createSvgCanvas(u);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-g.x)/m),Math.floor((b/c-g.y)/m));var t=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,e,h,g,n,m,u,v,k){var q=this.state;if(null!=this.foAltText&&(0==d||0!=q.fontSize&&e.length<5*d/q.fontSize)){var z=this.createElement("text");z.setAttribute("x",Math.round(d/2));z.setAttribute("y",Math.round((f+q.fontSize)/
+2));z.setAttribute("fill",q.fontColor||"black");z.setAttribute("text-anchor","middle");z.setAttribute("font-size",Math.round(q.fontSize)+"px");z.setAttribute("font-family",q.fontFamily);(q.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&z.setAttribute("font-weight","bold");(q.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&z.setAttribute("font-style","italic");(q.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&z.setAttribute("text-decoration","underline");
+mxUtils.write(z,e);return z}return t.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=m/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(g,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=h;h=this.createSvgImageExport();var v=h.drawCellState;h.drawCellState=function(a,c){(e||a.view.graph.isCellSelected(a.cell))&&v.apply(this,arguments)};h.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=
window.getSelection(),c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],d=0<b.rows.length?b.rows[0].cells.length:1,b=b.insertRow(c),f=0;f<d;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};
Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var d=0;d<b.rows.length;d++){var f=document.createElement("th");b.rows[d].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(d=0;d<b.rows.length;d++)f=b.rows[d].insertCell(c),mxUtils.br(f);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,d=0;d<b.length;d++)b[d].cells.length>c&&b[d].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;
if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){c=c.getRangeAt(0);c.deleteContents();var b=document.createElement("div");b.innerHTML=a;a=document.createDocumentFragment();for(var d;d=b.firstChild;)lastNode=a.appendChild(d);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint=function(a,c){c=null!=c?c:a;var b=document.createElement("a");b.setAttribute("href",this.getAbsoluteUrl(a));b.setAttribute("title",
a);null!=this.linkTarget&&b.setAttribute("target",this.linkTarget);40<c.length&&(c=c.substring(0,26)+"..."+c.substring(c.length-10));mxUtils.write(b,c);return b};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,c){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(c){c=a.apply(this,arguments);if(mxEvent.isTouchEvent(c.getEvent())&&
-null==c.getState()){var b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,c.graphY)||(c.state=this.view.getState(b),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return c};var c=!1,b=!1,d=!1,f=this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),
+null==c.getState()){var b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,c.graphY)||(c.state=this.view.getState(b),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return c};var c=!1,b=!1,d=!1,f=this.fireMouseEvent;this.fireMouseEvent=function(a,e,h){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),
b=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());f.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,f){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==f.getState()||!f.isSource(f.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(f.getEvent())&&(b&&null==f.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(f.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,
arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],b=0,d=a.rangeCount;b<d;++b)c.push(a.getRangeAt(b));return c}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=
-function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(S){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));k.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||
-!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var l=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){l.apply(this,arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";
+function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(S){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));k.apply(this,arguments)};var l=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||
+!mxEvent.isAltDown(a.getEvent())?l.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var p=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){p.apply(this,arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";
this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var b=this.graph.getModel().getParent(a),d=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(b)&&null!=d&&d.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border=
"")};var q=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,b){b.originalNode=a;a=a.firstChild;for(var d=b.firstChild;null!=a&&null!=d;)c(a,d),a=a.nextSibling,d=d.nextSibling;return b}function b(a,c){if(null!=a)if(c.originalNode!=a)d(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var f=a.nextSibling;null==c?d(a):(b(a,c),c=c.nextSibling);a=f}}function d(a){for(var c=a.firstChild;null!=c;){var b=c.nextSibling;d(c);c=b}1==a.nodeType&&("BR"===
a.nodeName||null!=a.firstChild)||3==a.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(a)).length?(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"),a.removeAttribute("border"))):a.parentNode.removeChild(a)}q.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||
-mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var d=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){b(this.textarea,d)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){h=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<h.length&&"\n"==h.charAt(h.length-1)&&(h=h.substring(0,
-h.length-1));h=this.graph.sanitizeHtml(c?h.replace(/\n/g,"<br/>"):h,!0);this.textarea.className="mxCellEditor geContentEditable";var d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,
+mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var d=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){b(this.textarea,d)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){g=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<g.length&&"\n"==g.charAt(g.length-1)&&(g=g.substring(0,
+g.length-1));g=this.graph.sanitizeHtml(c?g.replace(/\n/g,"<br/>"):g,!0);this.textarea.className="mxCellEditor geContentEditable";var d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,h=(mxUtils.getValue(a.style,
mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=
-g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=h&&(this.textarea.innerHTML=h,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var h=mxUtils.htmlEntities(this.textarea.innerHTML);
-mxClient.IS_QUIRKS||8==document.documentMode||(h=mxUtils.replaceTrailingNewlines(h,"<div><br></div>"));h=this.graph.sanitizeHtml(c?h.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):h,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var d=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration="";
-this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=h&&(this.textarea.innerHTML=h);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=b;this.resize()};var t=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,
+h?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=g&&(this.textarea.innerHTML=g,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var g=mxUtils.htmlEntities(this.textarea.innerHTML);
+mxClient.IS_QUIRKS||8==document.documentMode||(g=mxUtils.replaceTrailingNewlines(g,"<div><br></div>"));g=this.graph.sanitizeHtml(c?g.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):g,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var d=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration="";
+this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=g&&(this.textarea.innerHTML=g);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=b;this.resize()};var r=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,
c){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=a){var b=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*b;this.bounds.height=60*b;var d=null!=a.text?a.text.margin:null;null==d&&(d=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));
this.bounds.x+=d.x*this.bounds.width;this.bounds.y+=d.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/b)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/b)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/b)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*b);this.textarea.clientWidth<
this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/b)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*b);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxClient.IS_VML?this.textarea.style.zoom=b:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+b+","+b+")")}else this.textarea.style.height="",this.textarea.style.overflow="",
-t.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(a,c){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,c);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=
+r.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(a,c){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,c);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=
function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var c=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return c="1"==mxUtils.getValue(a.style,"nl2Br","1")?c.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var c=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();c.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=
-function(){try{this.graph.container.focus()}catch(L){}};var f=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,c){this.graph.getModel().beginUpdate();try{if(f.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],
-!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var g=mxGraphHandler.prototype.moveCells;
-mxGraphHandler.prototype.moveCells=function(a,c,b,d,f,e){mxEvent.isAltDown(e)&&(f=null);g.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var b=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-b.x);b=this.roundLength((this.bounds.y+this.currentDy)/d-b.y);this.hint.innerHTML=c+", "+b;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-
+function(){try{this.graph.container.focus()}catch(K){}};var f=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,c){this.graph.getModel().beginUpdate();try{if(f.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],
+!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var h=mxGraphHandler.prototype.moveCells;
+mxGraphHandler.prototype.moveCells=function(a,c,b,d,f,e){mxEvent.isAltDown(e)&&(f=null);h.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var b=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-b.x);b=this.roundLength((this.bounds.y+this.currentDy)/d-b.y);this.hint.innerHTML=c+", "+b;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-
this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,c){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!mxEvent.isControlDown(c.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==
-mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())};var p=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=
-new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=p.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+
+mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())};var m=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=
+new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=m.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+
"&deg;":(c=this.state.view.scale,this.hint.innerHTML=this.roundLength(this.bounds.width/c)+" x "+this.roundLength(this.bounds.height/c)),c=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),null==c&&(c=this.bounds),this.hint.style.left=c.x+Math.round((c.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=c.y+c.height+12+"px",null!=this.linkHint&&(this.linkHint.style.display="none"))};mxVertexHandler.prototype.removeHint=
function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(c,b){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var d=this.graph.view.translate,f=this.graph.view.scale,e=this.roundLength(b.x/f-d.x),d=this.roundLength(b.y/f-d.y);this.hint.innerHTML=e+", "+d;this.hint.style.visibility="visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&
null!=this.constraintHandler.currentFocus?(e=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*e.x)+"%, "+Math.round(100*e.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(c.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(c.getGraphY(),b.y)+this.state.view.graph.gridSize+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;
@@ -2376,105 +2376,105 @@ Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxClient.IS_SVG||((n
-20;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};
if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-24,mxConstraintHandler.prototype.getTolerance=function(a){return mxEvent.isMouseEvent(a.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return null==
a.getState()&&!mxEvent.isMouseEvent(c)||mxEvent.isPopupTrigger(c)&&(null==a.getState()||mxEvent.isControlDown(c)||mxEvent.isShiftDown(c))};var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){n.apply(this,arguments);mxEvent.isTouchEvent(c.getEvent())&&this.graph.isCellSelected(c.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return mxEvent.isLeftMouseButton(c)&&
-(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var b=null!=this.div&&"none"!=this.div.style.display,d=null,f=null,e=null,g=null;null!=this.first&&
-null!=this.currentX&&null!=this.currentY&&(d=this.first.x,f=this.first.y,e=(this.currentX-d)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),h=
-this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(h)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(h=this.graph.getCellsBeyond(d,f,this.graph.getDefaultParent(),!0,!0),b=0;b<h.length;b++)if(this.graph.isCellMovable(h[b])){var n=this.graph.view.getState(h[b]),p=this.graph.getCellGeometry(h[b]);null!=n&&null!=p&&(p=p.clone(),p.translate(e,g),this.graph.model.setGeometry(h[b],p))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y,
-this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),d=mxUtils.getOffset(this.graph.container);b.x-=d.x;b.y-=d.y;var d=c.getX()+b.x,b=c.getY()+b.y,f=this.first.x-d,e=this.first.y-b,g=this.graph.tolerance;if(null!=this.div||Math.abs(f)>g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,b),
+(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var b=null!=this.div&&"none"!=this.div.style.display,d=null,f=null,e=null,h=null;null!=this.first&&
+null!=this.currentX&&null!=this.currentY&&(d=this.first.x,f=this.first.y,e=(this.currentX-d)/this.graph.view.scale,h=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),h=this.graph.snap(h),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(h)<this.graph.tolerance&&(h=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),g=
+this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(g)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(g=this.graph.getCellsBeyond(d,f,this.graph.getDefaultParent(),!0,!0),b=0;b<g.length;b++)if(this.graph.isCellMovable(g[b])){var n=this.graph.view.getState(g[b]),m=this.graph.getCellGeometry(g[b]);null!=n&&null!=m&&(m=m.clone(),m.translate(e,h),this.graph.model.setGeometry(g[b],m))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y,
+this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),d=mxUtils.getOffset(this.graph.container);b.x-=d.x;b.y-=d.y;var d=c.getX()+b.x,b=c.getY()+b.y,f=this.first.x-d,e=this.first.y-b,h=this.graph.tolerance;if(null!=this.div||Math.abs(f)>h||Math.abs(e)>h)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,b),
this.isSpaceEvent(c)?(d=this.x+this.width,b=this.y+this.height,f=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/f)*f,this.height=this.graph.snap(this.height/f)*f,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=d-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=
this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=
-Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var h=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);h.apply(this,
-arguments)};var x=(new Date).getTime(),u=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,d){v.apply(this,arguments);b!=this.currentTerminalState?(x=(new Date).getTime(),u=0):u=(new Date).getTime()-x;this.currentTerminalState=b};var r=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<u||(null==this.currentTerminalState||
-"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&r.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,d=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),
-f):null)?this.fixedHandleImage:null!=f&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var y=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?
-HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return y.apply(this,arguments)};var w=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return w.apply(this,
-arguments)};var A=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):A.apply(this,arguments)};var E=mxVertexHandler.prototype.mouseDown;
-mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),d=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(d)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&E.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||
-this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var B=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){B.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var F=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=
-function(a,c){F.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var C=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){C.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=
+Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var g=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);g.apply(this,
+arguments)};var x=(new Date).getTime(),u=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,d){v.apply(this,arguments);b!=this.currentTerminalState?(x=(new Date).getTime(),u=0):u=(new Date).getTime()-x;this.currentTerminalState=b};var t=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<u||(null==this.currentTerminalState||
+"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&t.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,d=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),
+f):null)?this.fixedHandleImage:null!=f&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var A=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?
+HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return A.apply(this,arguments)};var y=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return y.apply(this,
+arguments)};var w=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):w.apply(this,arguments)};var F=mxVertexHandler.prototype.mouseDown;
+mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),d=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(d)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&F.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||
+this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var B=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){B.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var G=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=
+function(a,c){G.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var C=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){C.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=
1==this.graph.getSelectionCount()?"":"none");null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.selectionHandler=mxUtils.bind(this,function(a,b){c()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(a,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));
c()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(a,c){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var b=this.graph.getLinkForCell(this.state.cell),d=this.graph.getLinksForState(this.state);this.updateLinkHint(b,d);if(null!=b||null!=d&&0<d.length)a=!0;a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(c,b){if(null==c&&(null==b||0==b.length)||1<this.graph.getSelectionCount())null!=
this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=c||null!=b&&0<b.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.fontSize="90%",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint));this.linkHint.innerHTML="";if(null!=c&&(this.linkHint.appendChild(this.graph.createLinkForHint(c)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var d=
document.createElement("img");d.setAttribute("src",IMAGE_PATH+"/edit.gif");d.setAttribute("title",mxResources.get("editLink"));d.setAttribute("width","11");d.setAttribute("height","11");d.style.marginLeft="10px";d.style.marginBottom="-1px";d.style.cursor="pointer";this.linkHint.appendChild(d);mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)}));d=document.createElement("img");d.setAttribute("src",Dialog.prototype.clearImage);
d.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));d.setAttribute("width","13");d.setAttribute("height","10");d.style.marginLeft="4px";d.style.marginBottom="-1px";d.style.cursor="pointer";this.linkHint.appendChild(d);mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(a)}))}if(null!=b)for(d=0;d<b.length;d++){var f=document.createElement("div");f.style.marginTop=null!=c||0<d?"6px":"0px";f.appendChild(this.graph.createLinkForHint(b[d].getAttribute("href"),
-mxUtils.getTextContent(b[d])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var G=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){G.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=
+mxUtils.getTextContent(b[d])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var H=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){H.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=
this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(c,b){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(c,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE,
-this.changeHandler);var c=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=c||null!=b&&0<b.length)this.updateLinkHint(c,b),this.redrawHandles()};var z=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){z.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var H=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){H.apply(this);
+this.changeHandler);var c=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=c||null!=b&&0<b.length)this.updateLinkHint(c,b),this.redrawHandles()};var z=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){z.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var L=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){L.apply(this);
if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(c,this.state.style[mxConstants.STYLE_ROTATION]||"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,c=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;null!=c&&(b=Math.max(b,
-c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var J=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){J.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var K=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=
-function(){K.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Y=mxEdgeHandler.prototype.redrawHandles;
+c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var E=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){E.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var I=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=
+function(){I.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Y=mxEdgeHandler.prototype.redrawHandles;
mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Y.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),a.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var R=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=
function(){R.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var P=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){P.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),
-this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function l(){mxCylinder.call(this)}function q(){mxActor.call(this)}function t(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function p(){mxActor.call(this)}function n(){mxActor.call(this)}function h(a,c){this.canvas=
-a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,h.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,h.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,h.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,h.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
-this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function x(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function r(){mxActor.call(this)}function y(){mxActor.call(this)}function w(){mxRectangleShape.call(this)}function A(){mxRectangleShape.call(this)}function E(){mxCylinder.call(this)}function B(){mxShape.call(this)}function F(){mxShape.call(this)}
-function C(){mxEllipse.call(this)}function G(){mxShape.call(this)}function z(){mxShape.call(this)}function H(){mxRectangleShape.call(this)}function J(){mxShape.call(this)}function K(){mxShape.call(this)}function Y(){mxShape.call(this)}function R(){mxCylinder.call(this)}function P(){mxDoubleEllipse.call(this)}function L(){mxDoubleEllipse.call(this)}function I(){mxArrowConnector.call(this);this.spacing=0}function M(){mxArrowConnector.call(this);this.spacing=0}function S(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}
+this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function l(){mxActor.call(this)}function p(){mxCylinder.call(this)}function q(){mxActor.call(this)}function r(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function h(){mxActor.call(this)}function m(){mxActor.call(this)}function n(){mxActor.call(this)}function g(a,c){this.canvas=
+a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,g.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,g.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,g.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,g.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
+this.canvas.curveTo=mxUtils.bind(this,g.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,g.prototype.arcTo)}function x(){mxRectangleShape.call(this)}function u(){mxRectangleShape.call(this)}function v(){mxActor.call(this)}function t(){mxActor.call(this)}function A(){mxActor.call(this)}function y(){mxRectangleShape.call(this)}function w(){mxRectangleShape.call(this)}function F(){mxCylinder.call(this)}function B(){mxShape.call(this)}function G(){mxShape.call(this)}
+function C(){mxEllipse.call(this)}function H(){mxShape.call(this)}function z(){mxShape.call(this)}function L(){mxRectangleShape.call(this)}function E(){mxShape.call(this)}function I(){mxShape.call(this)}function Y(){mxShape.call(this)}function R(){mxCylinder.call(this)}function P(){mxDoubleEllipse.call(this)}function K(){mxDoubleEllipse.call(this)}function J(){mxArrowConnector.call(this);this.spacing=0}function M(){mxArrowConnector.call(this);this.spacing=0}function S(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}
function W(){mxActor.call(this)}function Q(){mxActor.call(this)}function X(){mxActor.call(this)}function U(){mxActor.call(this)}function T(){mxActor.call(this)}function O(){mxActor.call(this)}function ca(){mxActor.call(this)}function V(){mxActor.call(this)}function Z(){mxActor.call(this)}function aa(){mxActor.call(this)}function ia(){mxEllipse.call(this)}function da(){mxEllipse.call(this)}function ma(){mxEllipse.call(this)}function fa(){mxRhombus.call(this)}function ja(){mxEllipse.call(this)}function ba(){mxEllipse.call(this)}
-function qa(){mxEllipse.call(this)}function na(){mxEllipse.call(this)}function ta(){mxActor.call(this)}function oa(){mxActor.call(this)}function pa(){mxActor.call(this)}function ka(){mxConnector.call(this)}function Aa(a,c,b,d,f,e,g,h,p,n){g+=p;var ga=d.clone();d.x-=f*(2*g+p);d.y-=e*(2*g+p);f*=g+p;e*=g+p;return function(){a.ellipse(ga.x-f-g,ga.y-e-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,
+function qa(){mxEllipse.call(this)}function na(){mxEllipse.call(this)}function ta(){mxActor.call(this)}function oa(){mxActor.call(this)}function pa(){mxActor.call(this)}function ka(){mxConnector.call(this)}function Aa(a,c,b,d,f,e,h,g,m,n){h+=m;var ga=d.clone();d.x-=f*(2*h+m);d.y-=e*(2*h+m);f*=h+m;e*=h+m;return function(){a.ellipse(ga.x-f-h,ga.y-e-h,2*h,2*h);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,
Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(c,f),a.lineTo(c,c),a.lineTo(0,0),a.moveTo(c,c),a.lineTo(d,c)):(a.moveTo(0,0),a.lineTo(d-c,0),a.lineTo(d,c),a.lineTo(d,f),a.lineTo(c,f),a.lineTo(0,f-c),a.lineTo(0,0),a.close());a.end()};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube",
a);var xa=Math.tan(mxUtils.toRadians(30)),la=(.5-xa)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d,f/xa);a.translate((d-c)/2,(f-c)/2+c/4);a.moveTo(0,.25*c);a.lineTo(.5*c,c*la);a.lineTo(c,.25*c);a.lineTo(.5*c,(.5-la)*c);a.lineTo(0,.25*c);a.close();a.end()};mxCellRenderer.registerShape("isoRectangle",b);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.min(d,f/(.5+xa));e?(a.moveTo(0,.25*c),a.lineTo(.5*
c,(.5-la)*c),a.lineTo(c,.25*c),a.moveTo(.5*c,(.5-la)*c),a.lineTo(.5*c,(1-la)*c)):(a.translate((d-c)/2,(f-c)/2),a.moveTo(0,.25*c),a.lineTo(.5*c,c*la),a.lineTo(c,.25*c),a.lineTo(c,.75*c),a.lineTo(.5*c,(1-la)*c),a.lineTo(0,.75*c),a.close());a.end()};mxCellRenderer.registerShape("isoCube",e);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.min(f/2,Math.round(f/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||
(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||(a.stroke(),a.begin()),a.translate(0,-c);e||(a.moveTo(0,c),a.curveTo(0,-c/3,d,-c/3,d,c),a.lineTo(d,f-c),a.curveTo(d,f+c/3,0,f+c/3,0,f-c),a.close())};d.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1)*this.scale,0,0)};mxCellRenderer.registerShape("datastore",
-d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(d-c,0),a.lineTo(d-c,c),a.lineTo(d,c)):(a.moveTo(0,0),a.lineTo(d-c,0),a.lineTo(d,c),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d/2,.5*f,d,0);a.quadTo(.5*
-d,f/2,d,f);a.quadTo(d/2,.5*f,0,f);a.quadTo(.5*d,f/2,0,0);a.end()};mxCellRenderer.registerShape("switch",m);mxUtils.extend(l,mxCylinder);l.prototype.tabWidth=60;l.prototype.tabHeight=20;l.prototype.tabPosition="right";l.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var g=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);
-e?"left"==g?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(d-c,b),a.lineTo(d,b)):("left"==g?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(d,b)):(a.moveTo(0,b),a.lineTo(d-c,b),a.lineTo(d-c,0),a.lineTo(d,0)),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",l);mxUtils.extend(q,mxActor);q.prototype.size=30;q.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));b=mxUtils.getValue(this.style,
-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",q);mxUtils.extend(t,mxActor);t.prototype.size=.4;t.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(d/4,1.4*c,d/2,c/2);a.quadTo(3*d/4,c*(1-1.4),d,c/2);a.lineTo(d,f-c/2);a.quadTo(3*
-d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();a.end()};t.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,d=a.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=d,new mxRectangle(a.x,a.y+c,b,d-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,d)}return a};mxCellRenderer.registerShape("tape",
-t);mxUtils.extend(c,mxActor);c.prototype.size=.3;c.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};c.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(d,0);a.lineTo(d,f-c/2);a.quadTo(3*d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();
+d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(d-c,0),a.lineTo(d-c,c),a.lineTo(d,c)):(a.moveTo(0,0),a.lineTo(d-c,0),a.lineTo(d,c),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",k);mxUtils.extend(l,mxActor);l.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d/2,.5*f,d,0);a.quadTo(.5*
+d,f/2,d,f);a.quadTo(d/2,.5*f,0,f);a.quadTo(.5*d,f/2,0,0);a.end()};mxCellRenderer.registerShape("switch",l);mxUtils.extend(p,mxCylinder);p.prototype.tabWidth=60;p.prototype.tabHeight=20;p.prototype.tabPosition="right";p.prototype.redrawPath=function(a,c,b,d,f,e){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var h=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);
+e?"left"==h?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(d-c,b),a.lineTo(d,b)):("left"==h?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(d,b)):(a.moveTo(0,b),a.lineTo(d-c,b),a.lineTo(d-c,0),a.lineTo(d,0)),a.lineTo(d,f),a.lineTo(0,f),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",p);mxUtils.extend(q,mxActor);q.prototype.size=30;q.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));b=mxUtils.getValue(this.style,
+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",q);mxUtils.extend(r,mxActor);r.prototype.size=.4;r.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(d/4,1.4*c,d/2,c/2);a.quadTo(3*d/4,c*(1-1.4),d,c/2);a.lineTo(d,f-c/2);a.quadTo(3*
+d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();a.end()};r.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,d=a.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=d,new mxRectangle(a.x,a.y+c,b,d-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,d)}return a};mxCellRenderer.registerShape("tape",
+r);mxUtils.extend(c,mxActor);c.prototype.size=.3;c.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};c.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(d,0);a.lineTo(d,f-c/2);a.quadTo(3*d/4,f-1.4*c,d/2,f-c/2);a.quadTo(d/4,f-c*(1-1.4),0,f-c/2);a.lineTo(0,c/2);a.close();
a.end()};mxCellRenderer.registerShape("document",c);mxCylinder.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,Math.min(this.maxHeight*this.scale,.3*a.height),0,0):null};mxUtils.extend(f,mxActor);f.prototype.size=.2;f.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,
-[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d-c,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",f);mxUtils.extend(g,mxActor);g.prototype.size=.2;g.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,f)],this.isRounded,
-b,!0)};mxCellRenderer.registerShape("trapezoid",g);mxUtils.extend(p,mxActor);p.prototype.size=.5;p.prototype.redrawPath=function(a,c,b,d,f){a.setFillColor(null);c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,0),new mxPoint(c,0),new mxPoint(c,f/2),new mxPoint(0,f/2),new mxPoint(c,f/2),new mxPoint(c,f),new mxPoint(d,f)],this.isRounded,b,!1);a.end()};
-mxCellRenderer.registerShape("curlyBracket",p);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,c,b,d,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=d/5;a.rect(0,0,c,f);a.fillAndStroke();a.rect(2*c,0,c,f);a.fillAndStroke();a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",n);h.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};h.prototype.close=function(){null!=this.firstX&&
-null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};h.prototype.quadTo=function(a,c,b,d){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=d};h.prototype.curveTo=function(a,c,b,d,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};h.prototype.arcTo=function(a,c,b,d,f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=
-g};h.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},d=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(d*d+f*f);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),ga=this.defaultVariation;5>g&&(g=5,ga/=3);for(var h=b(a-this.lastX)*d/g,b=b(c-this.lastY)*f/g,d=d/e,f=f/e,e=0;e<g;e++){var p=(Math.random()-.5)*ga;this.originalLineTo.call(this.canvas,
-h*e+this.lastX-p*f,b*e+this.lastY-p*d)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};h.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Ea=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=
-function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new h(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ea.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Fa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Fa.apply(this,arguments)};
+[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d,0),new mxPoint(d-c,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",f);mxUtils.extend(h,mxActor);h.prototype.size=.2;h.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,f)],this.isRounded,
+b,!0)};mxCellRenderer.registerShape("trapezoid",h);mxUtils.extend(m,mxActor);m.prototype.size=.5;m.prototype.redrawPath=function(a,c,b,d,f){a.setFillColor(null);c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,0),new mxPoint(c,0),new mxPoint(c,f/2),new mxPoint(0,f/2),new mxPoint(c,f/2),new mxPoint(c,f),new mxPoint(d,f)],this.isRounded,b,!1);a.end()};
+mxCellRenderer.registerShape("curlyBracket",m);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,c,b,d,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=d/5;a.rect(0,0,c,f);a.fillAndStroke();a.rect(2*c,0,c,f);a.fillAndStroke();a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",n);g.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};g.prototype.close=function(){null!=this.firstX&&
+null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};g.prototype.quadTo=function(a,c,b,d){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=d};g.prototype.curveTo=function(a,c,b,d,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};g.prototype.arcTo=function(a,c,b,d,f,e,h){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=
+h};g.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},d=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(d*d+f*f);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var h=Math.round(e/10),ga=this.defaultVariation;5>h&&(h=5,ga/=3);for(var g=b(a-this.lastX)*d/h,b=b(c-this.lastY)*f/h,d=d/e,f=f/e,e=0;e<h;e++){var m=(Math.random()-.5)*ga;this.originalLineTo.call(this.canvas,
+g*e+this.lastX-m*f,b*e+this.lastY-m*d)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};g.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Ea=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=
+function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new g(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ea.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Fa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Fa.apply(this,arguments)};
var Ga=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,b,d,f){if(null==a.handJiggle)Ga.apply(this,arguments);else{var e=!0;null!=this.style&&(e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(e||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)e||null!=this.fill&&this.fill!=mxConstants.NONE||(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,
0)?e=Math.min(d/2,Math.min(f/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(d*e,f*e)),a.moveTo(c+e,b),a.lineTo(c+d-e,b),a.quadTo(c+d,b,c+d,b+e),a.lineTo(c+d,b+f-e),a.quadTo(c+d,b+f,c+d-e,b+f),a.lineTo(c+e,b+f),a.quadTo(c,b+f,c,b+f-e),a.lineTo(c,b+e),a.quadTo(c,b,c+e,b)):(a.moveTo(c,b),a.lineTo(c+d,b),a.lineTo(c+d,b+f),a.lineTo(c,b+f),a.lineTo(c,
b)),a.close(),a.end(),a.fillAndStroke()}};var Ha=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,b,d,f){null==a.handJiggle&&Ha.apply(this,arguments)};mxUtils.extend(x,mxRectangleShape);x.prototype.size=.1;x.prototype.isHtmlAllowed=function(){return!1};x.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var c=
-a.width,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,d=Math.max(d,Math.min(c*f,b*f));a.x+=Math.round(d);a.width-=Math.round(2*d)}return a};x.prototype.paintForeground=function(a,c,b,d,f){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=
-mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*g,f*g));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+f);a.moveTo(c+d-e,b);a.lineTo(c+d-e,b+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",x);mxUtils.extend(u,mxRectangleShape);u.prototype.paintBackground=function(a,c,b,d,f){a.setFillColor(mxConstants.NONE);a.rect(c,b,d,f);a.fill()};u.prototype.paintForeground=
+a.width,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,d=Math.max(d,Math.min(c*f,b*f));a.x+=Math.round(d);a.width-=Math.round(2*d)}return a};x.prototype.paintForeground=function(a,c,b,d,f){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var h=
+mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*h,f*h));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+f);a.moveTo(c+d-e,b);a.lineTo(c+d-e,b+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",x);mxUtils.extend(u,mxRectangleShape);u.prototype.paintBackground=function(a,c,b,d,f){a.setFillColor(mxConstants.NONE);a.rect(c,b,d,f);a.fill()};u.prototype.paintForeground=
function(a,c,b,d,f){};mxCellRenderer.registerShape("transparent",u);mxUtils.extend(v,mxHexagon);v.prototype.size=30;v.prototype.position=.5;v.prototype.position2=.5;v.prototype.base=20;v.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};v.prototype.redrawPath=function(a,c,b,d,f){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,
-"size",this.size))));var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),h=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-b),new mxPoint(Math.min(d,e+h),f-b),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-b),new mxPoint(0,f-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",
-v);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-
-c,f),new mxPoint(0,f),new mxPoint(c,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",r);mxUtils.extend(y,mxHexagon);y.prototype.size=.25;y.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],
-this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",y);mxUtils.extend(w,mxRectangleShape);w.prototype.isHtmlAllowed=function(){return!1};w.prototype.paintForeground=function(a,c,b,d,f){var e=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+e);a.lineTo(c+d/2,b+f-e);a.moveTo(c+e,b+f/2);a.lineTo(c+d-e,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",w);var Ba=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=
+"size",this.size))));var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),h=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),g=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-b),new mxPoint(Math.min(d,e+g),f-b),new mxPoint(h,f),new mxPoint(Math.max(0,e),f-b),new mxPoint(0,f-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",
+v);mxUtils.extend(t,mxActor);t.prototype.size=.2;t.prototype.fixedSize=20;t.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-
+c,f),new mxPoint(0,f),new mxPoint(c,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",t);mxUtils.extend(A,mxHexagon);A.prototype.size=.25;A.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],
+this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",A);mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.paintForeground=function(a,c,b,d,f){var e=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+e);a.lineTo(c+d/2,b+f-e);a.moveTo(c+e,b+f/2);a.lineTo(c+d-e,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",y);var Ba=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=
function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,d,f){Ba.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;b+=e;d-=2*e;f-=2*e;0<d&&0<f&&(a.setShadow(!1),Ba.apply(this,[a,c,
-b,d,f]))}};mxUtils.extend(A,mxRectangleShape);A.prototype.isHtmlAllowed=function(){return!1};A.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};A.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
-0);c+=e;b+=e;d-=2*e;f-=2*e;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+e]];if(null!=g){var h=this.style["symbol"+e+"Align"],ga=this.style["symbol"+e+"VerticalAlign"],p=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],u=this.style["symbol"+e+"Spacing"]||0,r=this.style["symbol"+e+"VSpacing"]||u,v=this.style["symbol"+e+"ArcSpacing"];null!=v&&(v*=this.getArcSize(d+this.strokewidth,
-f+this.strokewidth),u+=v,r+=v);var v=c,k=b,v=h==mxConstants.ALIGN_CENTER?v+(d-p)/2:h==mxConstants.ALIGN_RIGHT?v+(d-p-u):v+u,k=ga==mxConstants.ALIGN_MIDDLE?k+(f-n)/2:ga==mxConstants.ALIGN_BOTTOM?k+(f-n-r):k+r;a.save();h=new g;h.style=this.style;g.prototype.paintVertexShape.call(h,a,v,k,p,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",A);mxUtils.extend(E,mxCylinder);E.prototype.redrawPath=function(a,c,b,d,f,e){e?
-(a.moveTo(0,0),a.lineTo(d/2,f/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",E);mxUtils.extend(B,mxShape);B.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.ellipse(d/4,0,d/2,f/4);a.fillAndStroke();a.begin();a.moveTo(d/2,f/4);a.lineTo(d/2,2*f/3);a.moveTo(d/2,f/3);a.lineTo(0,f/3);a.moveTo(d/2,f/3);a.lineTo(d,f/3);a.moveTo(d/2,2*f/3);a.lineTo(0,f);a.moveTo(d/2,2*f/3);a.lineTo(d,f);a.end();a.stroke()};
-mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(F,mxShape);F.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};F.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(d/6,f/2);a.end();a.stroke();a.ellipse(d/6,0,5*d/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",F);mxUtils.extend(C,mxEllipse);C.prototype.paintVertexShape=function(a,c,
-b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/8,b+f);a.lineTo(c+7*d/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",C);mxUtils.extend(G,mxShape);G.prototype.paintVertexShape=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(d,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",G);mxUtils.extend(z,mxShape);z.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+
-a.height/8,a.width,7*a.height/8)};z.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,0);a.end();a.stroke();a.ellipse(0,f/8,d,7*f/8);a.fillAndStroke()};z.prototype.paintForeground=function(a,c,b,d,f){a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",z);mxUtils.extend(H,mxRectangleShape);H.prototype.size=40;H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=
-function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};H.prototype.paintBackground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,d,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=H&&(g=new g,
-g.apply(this.state),a.save(),g.paintVertexShape(a,c,b,d,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(c+d/2,b+e),a.lineTo(c+d/2,b+f),a.end(),a.stroke())};H.prototype.paintForeground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,d,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",H);mxUtils.extend(J,mxShape);J.prototype.width=60;J.prototype.height=30;J.prototype.corner=
-10;J.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};J.prototype.paintBackground=function(a,c,b,d,f){var e=this.corner,g=Math.min(d,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),h=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),p=mxUtils.getValue(this.style,
-mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);p!=mxConstants.NONE&&(a.setFillColor(p),a.rect(c,b,d,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(a,c,b,d,f),a.setGradient(this.fill,this.gradient,c,b,d,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+g,b);a.lineTo(c+g,b+Math.max(0,h-1.5*e));a.lineTo(c+Math.max(0,g-e),b+h);a.lineTo(c,b+h);a.close();a.fillAndStroke();a.begin();
-a.moveTo(c+g,b);a.lineTo(c+d,b);a.lineTo(c+d,b+f);a.lineTo(c,b+f);a.lineTo(c,b+h);a.stroke()};mxCellRenderer.registerShape("umlFrame",J);mxPerimeter.LifelinePerimeter=function(a,c,b,d){d=H.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+d,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);
+b,d,f]))}};mxUtils.extend(w,mxRectangleShape);w.prototype.isHtmlAllowed=function(){return!1};w.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};w.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
+0);c+=e;b+=e;d-=2*e;f-=2*e;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,h;do{h=mxCellRenderer.defaultShapes[this.style["symbol"+e]];if(null!=h){var g=this.style["symbol"+e+"Align"],ga=this.style["symbol"+e+"VerticalAlign"],m=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],u=this.style["symbol"+e+"Spacing"]||0,t=this.style["symbol"+e+"VSpacing"]||u,v=this.style["symbol"+e+"ArcSpacing"];null!=v&&(v*=this.getArcSize(d+this.strokewidth,
+f+this.strokewidth),u+=v,t+=v);var v=c,k=b,v=g==mxConstants.ALIGN_CENTER?v+(d-m)/2:g==mxConstants.ALIGN_RIGHT?v+(d-m-u):v+u,k=ga==mxConstants.ALIGN_MIDDLE?k+(f-n)/2:ga==mxConstants.ALIGN_BOTTOM?k+(f-n-t):k+t;a.save();g=new h;g.style=this.style;h.prototype.paintVertexShape.call(g,a,v,k,m,n);a.restore()}e++}while(null!=h)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",w);mxUtils.extend(F,mxCylinder);F.prototype.redrawPath=function(a,c,b,d,f,e){e?
+(a.moveTo(0,0),a.lineTo(d/2,f/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",F);mxUtils.extend(B,mxShape);B.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.ellipse(d/4,0,d/2,f/4);a.fillAndStroke();a.begin();a.moveTo(d/2,f/4);a.lineTo(d/2,2*f/3);a.moveTo(d/2,f/3);a.lineTo(0,f/3);a.moveTo(d/2,f/3);a.lineTo(d,f/3);a.moveTo(d/2,2*f/3);a.lineTo(0,f);a.moveTo(d/2,2*f/3);a.lineTo(d,f);a.end();a.stroke()};
+mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(G,mxShape);G.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};G.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(d/6,f/2);a.end();a.stroke();a.ellipse(d/6,0,5*d/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",G);mxUtils.extend(C,mxEllipse);C.prototype.paintVertexShape=function(a,c,
+b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/8,b+f);a.lineTo(c+7*d/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",C);mxUtils.extend(H,mxShape);H.prototype.paintVertexShape=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(d,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",H);mxUtils.extend(z,mxShape);z.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+
+a.height/8,a.width,7*a.height/8)};z.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,0);a.end();a.stroke();a.ellipse(0,f/8,d,7*f/8);a.fillAndStroke()};z.prototype.paintForeground=function(a,c,b,d,f){a.begin();a.moveTo(3*d/8,f/8*1.1);a.lineTo(5*d/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",z);mxUtils.extend(L,mxRectangleShape);L.prototype.size=40;L.prototype.isHtmlAllowed=function(){return!1};L.prototype.getLabelBounds=
+function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};L.prototype.paintBackground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),h=mxUtils.getValue(this.style,"participant");null==h||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,d,e):(h=this.state.view.graph.cellRenderer.getShape(h),null!=h&&h!=L&&(h=new h,
+h.apply(this.state),a.save(),h.paintVertexShape(a,c,b,d,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(c+d/2,b+e),a.lineTo(c+d/2,b+f),a.end(),a.stroke())};L.prototype.paintForeground=function(a,c,b,d,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,d,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",L);mxUtils.extend(E,mxShape);E.prototype.width=60;E.prototype.height=30;E.prototype.corner=
+10;E.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};E.prototype.paintBackground=function(a,c,b,d,f){var e=this.corner,h=Math.min(d,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),g=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),m=mxUtils.getValue(this.style,
+mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);m!=mxConstants.NONE&&(a.setFillColor(m),a.rect(c,b,d,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(a,c,b,d,f),a.setGradient(this.fill,this.gradient,c,b,d,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+h,b);a.lineTo(c+h,b+Math.max(0,g-1.5*e));a.lineTo(c+Math.max(0,h-e),b+g);a.lineTo(c,b+g);a.close();a.fillAndStroke();a.begin();
+a.moveTo(c+h,b);a.lineTo(c+d,b);a.lineTo(c+d,b+f);a.lineTo(c,b+f);a.lineTo(c,b+g);a.stroke()};mxCellRenderer.registerShape("umlFrame",E);mxPerimeter.LifelinePerimeter=function(a,c,b,d){d=L.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+d,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);
mxPerimeter.OrthogonalPerimeter=function(a,c,b,d){d=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(a,c,b,d){d=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(d+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return b.x<
a.getCenterX()&&(d=-1*(d+1)),new mxPoint(a.getCenterX()+d,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(d=-1*(d+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)),a.getCenterY()+d)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,b,d){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",v.prototype.size))*
-c.view.scale))),c.style),c,b,d)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,h=a.y,p=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h),new mxPoint(g+
-p,h+e),new mxPoint(g+p,h+n),new mxPoint(g,h+n-e),new mxPoint(g,h)]):(e=p*Math.max(0,Math.min(1,e)),h=[new mxPoint(g+e,h),new mxPoint(g+p,h),new mxPoint(g+p-e,h+n),new mxPoint(g,h+n),new mxPoint(g+e,h)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<g||b.x>g+p?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(h,a,b)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var f=g.prototype.size;null!=c&&(f=
-mxUtils.getValue(c.style,"size",f));var e=a.x,h=a.y,p=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=p*Math.max(0,Math.min(1,f)),h=[new mxPoint(e+f,h),new mxPoint(e+p-f,h),new mxPoint(e+p,h+n),new mxPoint(e,h+n),new mxPoint(e+f,h)]):c==mxConstants.DIRECTION_WEST?(f=p*Math.max(0,Math.min(1,f)),h=[new mxPoint(e,h),new mxPoint(e+p,h),new mxPoint(e+p-f,h+n),new mxPoint(e+f,h+n),new mxPoint(e,
-h)]):c==mxConstants.DIRECTION_NORTH?(f=n*Math.max(0,Math.min(1,f)),h=[new mxPoint(e,h+f),new mxPoint(e+p,h),new mxPoint(e+p,h+n),new mxPoint(e,h+n-f),new mxPoint(e,h+f)]):(f=n*Math.max(0,Math.min(1,f)),h=[new mxPoint(e,h),new mxPoint(e+p,h+f),new mxPoint(e+p,h+n-f),new mxPoint(e,h+n),new mxPoint(e,h)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<e||b.x>e+p?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(h,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);
-mxPerimeter.StepPerimeter=function(a,c,b,d){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?r.prototype.fixedSize:r.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,h=a.y,p=a.width,n=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(p,e)):p*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h),new mxPoint(g+p-
-f,h),new mxPoint(g+p,a),new mxPoint(g+p-f,h+n),new mxPoint(g,h+n),new mxPoint(g+f,a),new mxPoint(g,h)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(p,e)):p*Math.max(0,Math.min(1,e)),h=[new mxPoint(g+f,h),new mxPoint(g+p,h),new mxPoint(g+p-f,a),new mxPoint(g+p,h+n),new mxPoint(g+f,h+n),new mxPoint(g,a),new mxPoint(g+f,h)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h+f),new mxPoint(u,h),new mxPoint(g+p,h+f),new mxPoint(g+p,
-h+n),new mxPoint(u,h+n-f),new mxPoint(g,h+n),new mxPoint(g,h+f)]):(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),h=[new mxPoint(g,h),new mxPoint(u,h+f),new mxPoint(g+p,h),new mxPoint(g+p,h+n-f),new mxPoint(u,h+n),new mxPoint(g,h+n-f),new mxPoint(g,h)]);u=new mxPoint(u,a);d&&(b.x<g||b.x>g+p?u.y=b.y:u.x=b.x);return mxUtils.getPerimeterPoint(h,u,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,d){var f=y.prototype.size;null!=
-c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,h=a.width,p=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=p*Math.max(0,Math.min(1,f)),g=[new mxPoint(n,g),new mxPoint(e+h,g+f),new mxPoint(e+h,g+p-f),new mxPoint(n,g+p),new mxPoint(e,g+p-f),new mxPoint(e,g+f),new mxPoint(n,g)]):(f=h*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+
-f,g),new mxPoint(e+h-f,g),new mxPoint(e+h,a),new mxPoint(e+h-f,g+p),new mxPoint(e+f,g+p),new mxPoint(e,a),new mxPoint(e+f,g)]);n=new mxPoint(n,a);d&&(b.x<e||b.x>e+h?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(g,n,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(K,mxShape);K.prototype.size=10;K.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((d-e)/2,0,e,e);a.fillAndStroke();
-a.begin();a.moveTo(d/2,e);a.lineTo(d/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",K);mxUtils.extend(Y,mxShape);Y.prototype.size=10;Y.prototype.inset=2;Y.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(d/2,e+g);a.lineTo(d/2,f);a.end();a.stroke();a.begin();a.moveTo((d-e)/2-g,e/2);a.quadTo((d-e)/2-g,e+g,d/
-2,e+g);a.quadTo((d+e)/2+g,e+g,(d+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",Y);mxUtils.extend(R,mxCylinder);R.prototype.jettyWidth=32;R.prototype.jettyHeight=12;R.prototype.redrawPath=function(a,c,b,d,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=g/2;var g=b+g/2,h=.3*f-c/2,p=.7*f-c/2;e?(a.moveTo(b,h),a.lineTo(g,h),a.lineTo(g,h+c),a.lineTo(b,h+c),a.moveTo(b,p),
-a.lineTo(g,p),a.lineTo(g,p+c),a.lineTo(b,p+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,p+c),a.lineTo(0,p+c),a.lineTo(0,p),a.lineTo(b,p),a.lineTo(b,h+c),a.lineTo(0,h+c),a.lineTo(0,h),a.lineTo(b,h),a.close());a.end()};mxCellRenderer.registerShape("component",R);mxUtils.extend(P,mxDoubleEllipse);P.prototype.outerStroke=!0;P.prototype.paintVertexShape=function(a,c,b,d,f){var e=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+e,b+e,d-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);
-this.outerStroke&&(a.ellipse(c,b,d,f),a.stroke())};mxCellRenderer.registerShape("endState",P);mxUtils.extend(L,P);L.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",L);mxUtils.extend(I,mxArrowConnector);I.prototype.defaultWidth=4;I.prototype.isOpenEnded=function(){return!0};I.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};I.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",
-I);mxUtils.extend(M,mxArrowConnector);M.prototype.defaultWidth=10;M.prototype.defaultArrowWidth=20;M.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};M.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};M.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",
+c.view.scale))),c.style),c,b,d)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var h=a.x,g=a.y,m=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g),new mxPoint(h+
+m,g+e),new mxPoint(h+m,g+n),new mxPoint(h,g+n-e),new mxPoint(h,g)]):(e=m*Math.max(0,Math.min(1,e)),g=[new mxPoint(h+e,g),new mxPoint(h+m,g),new mxPoint(h+m-e,g+n),new mxPoint(h,g+n),new mxPoint(h+e,g)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<h||b.x>h+m?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(g,a,b)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var f=h.prototype.size;null!=c&&(f=
+mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,m=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=m*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+m-f,g),new mxPoint(e+m,g+n),new mxPoint(e,g+n),new mxPoint(e+f,g)]):c==mxConstants.DIRECTION_WEST?(f=m*Math.max(0,Math.min(1,f)),g=[new mxPoint(e,g),new mxPoint(e+m,g),new mxPoint(e+m-f,g+n),new mxPoint(e+f,g+n),new mxPoint(e,
+g)]):c==mxConstants.DIRECTION_NORTH?(f=n*Math.max(0,Math.min(1,f)),g=[new mxPoint(e,g+f),new mxPoint(e+m,g),new mxPoint(e+m,g+n),new mxPoint(e,g+n-f),new mxPoint(e,g+f)]):(f=n*Math.max(0,Math.min(1,f)),g=[new mxPoint(e,g),new mxPoint(e+m,g+f),new mxPoint(e+m,g+n-f),new mxPoint(e,g+n),new mxPoint(e,g)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<e||b.x>e+m?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(g,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);
+mxPerimeter.StepPerimeter=function(a,c,b,d){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?t.prototype.fixedSize:t.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var h=a.x,g=a.y,m=a.width,n=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(m,e)):m*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g),new mxPoint(h+m-
+f,g),new mxPoint(h+m,a),new mxPoint(h+m-f,g+n),new mxPoint(h,g+n),new mxPoint(h+f,a),new mxPoint(h,g)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(m,e)):m*Math.max(0,Math.min(1,e)),g=[new mxPoint(h+f,g),new mxPoint(h+m,g),new mxPoint(h+m-f,a),new mxPoint(h+m,g+n),new mxPoint(h+f,g+n),new mxPoint(h,a),new mxPoint(h+f,g)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g+f),new mxPoint(u,g),new mxPoint(h+m,g+f),new mxPoint(h+m,
+g+n),new mxPoint(u,g+n-f),new mxPoint(h,g+n),new mxPoint(h,g+f)]):(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),g=[new mxPoint(h,g),new mxPoint(u,g+f),new mxPoint(h+m,g),new mxPoint(h+m,g+n-f),new mxPoint(u,g+n),new mxPoint(h,g+n-f),new mxPoint(h,g)]);u=new mxPoint(u,a);d&&(b.x<h||b.x>h+m?u.y=b.y:u.x=b.x);return mxUtils.getPerimeterPoint(g,u,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,d){var f=A.prototype.size;null!=
+c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,h=a.y,g=a.width,m=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=m*Math.max(0,Math.min(1,f)),h=[new mxPoint(n,h),new mxPoint(e+g,h+f),new mxPoint(e+g,h+m-f),new mxPoint(n,h+m),new mxPoint(e,h+m-f),new mxPoint(e,h+f),new mxPoint(n,h)]):(f=g*Math.max(0,Math.min(1,f)),h=[new mxPoint(e+
+f,h),new mxPoint(e+g-f,h),new mxPoint(e+g,a),new mxPoint(e+g-f,h+m),new mxPoint(e+f,h+m),new mxPoint(e,a),new mxPoint(e+f,h)]);n=new mxPoint(n,a);d&&(b.x<e||b.x>e+g?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(h,n,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(I,mxShape);I.prototype.size=10;I.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((d-e)/2,0,e,e);a.fillAndStroke();
+a.begin();a.moveTo(d/2,e);a.lineTo(d/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",I);mxUtils.extend(Y,mxShape);Y.prototype.size=10;Y.prototype.inset=2;Y.prototype.paintBackground=function(a,c,b,d,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),h=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(d/2,e+h);a.lineTo(d/2,f);a.end();a.stroke();a.begin();a.moveTo((d-e)/2-h,e/2);a.quadTo((d-e)/2-h,e+h,d/
+2,e+h);a.quadTo((d+e)/2+h,e+h,(d+e)/2+h,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",Y);mxUtils.extend(R,mxCylinder);R.prototype.jettyWidth=32;R.prototype.jettyHeight=12;R.prototype.redrawPath=function(a,c,b,d,f,e){var h=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=h/2;var h=b+h/2,g=.3*f-c/2,m=.7*f-c/2;e?(a.moveTo(b,g),a.lineTo(h,g),a.lineTo(h,g+c),a.lineTo(b,g+c),a.moveTo(b,m),
+a.lineTo(h,m),a.lineTo(h,m+c),a.lineTo(b,m+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,m+c),a.lineTo(0,m+c),a.lineTo(0,m),a.lineTo(b,m),a.lineTo(b,g+c),a.lineTo(0,g+c),a.lineTo(0,g),a.lineTo(b,g),a.close());a.end()};mxCellRenderer.registerShape("component",R);mxUtils.extend(P,mxDoubleEllipse);P.prototype.outerStroke=!0;P.prototype.paintVertexShape=function(a,c,b,d,f){var e=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+e,b+e,d-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);
+this.outerStroke&&(a.ellipse(c,b,d,f),a.stroke())};mxCellRenderer.registerShape("endState",P);mxUtils.extend(K,P);K.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",K);mxUtils.extend(J,mxArrowConnector);J.prototype.defaultWidth=4;J.prototype.isOpenEnded=function(){return!0};J.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};J.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",
+J);mxUtils.extend(M,mxArrowConnector);M.prototype.defaultWidth=10;M.prototype.defaultArrowWidth=20;M.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};M.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};M.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",
M);mxUtils.extend(S,mxActor);S.prototype.size=30;S.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(0,c),new mxPoint(d,0),new mxPoint(d,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",S);mxUtils.extend(D,mxRectangleShape);D.prototype.dx=20;D.prototype.dy=20;D.prototype.isHtmlAllowed=
-function(){return!1};D.prototype.paintForeground=function(a,c,b,d,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*g,f*g));g=Math.max(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,b+e);a.lineTo(c+d,b+e);
-a.end();a.stroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+g,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",D);mxUtils.extend(W,mxActor);W.prototype.dx=20;W.prototype.dy=20;W.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
+function(){return!1};D.prototype.paintForeground=function(a,c,b,d,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(d*h,f*h));h=Math.max(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,b+e);a.lineTo(c+d,b+e);
+a.end();a.stroke();a.begin();a.moveTo(c+h,b);a.lineTo(c+h,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",D);mxUtils.extend(W,mxActor);W.prototype.dx=20;W.prototype.dy=20;W.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,b),new mxPoint(c,b),new mxPoint(c,f),new mxPoint(0,f)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("corner",W);mxUtils.extend(Q,mxActor);Q.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.lineTo(0,f);a.end();a.moveTo(d,0);a.lineTo(d,f);a.end();a.moveTo(0,f/2);a.lineTo(d,f/2);a.end()};mxCellRenderer.registerShape("crossbar",Q);mxUtils.extend(X,mxActor);X.prototype.dx=20;X.prototype.dy=
20;X.prototype.redrawPath=function(a,c,b,d,f){c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,b),new mxPoint((d+c)/2,b),new mxPoint((d+c)/2,f),new mxPoint((d-c)/2,f),new mxPoint((d-
-c)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",X);mxUtils.extend(U,mxActor);U.prototype.arrowWidth=.3;U.prototype.arrowSize=.2;U.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
-2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(0,e)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("singleArrow",U);mxUtils.extend(T,mxActor);T.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",U.prototype.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",U.prototype.arrowSize))));
-b=(f-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(c,e),new mxPoint(c,f)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",T);mxUtils.extend(O,mxActor);O.prototype.size=.1;O.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
+c)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",X);mxUtils.extend(U,mxActor);U.prototype.arrowWidth=.3;U.prototype.arrowSize=.2;U.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-e)/2;var e=b+e,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
+2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(0,e)],this.isRounded,h,!0);a.end()};mxCellRenderer.registerShape("singleArrow",U);mxUtils.extend(T,mxActor);T.prototype.redrawPath=function(a,c,b,d,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",U.prototype.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",U.prototype.arrowSize))));
+b=(f-e)/2;var e=b+e,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,e),new mxPoint(c,e),new mxPoint(c,f)],this.isRounded,h,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",T);mxUtils.extend(O,mxActor);O.prototype.size=.1;O.prototype.redrawPath=function(a,c,b,d,f){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));a.moveTo(c,0);a.lineTo(d,0);a.quadTo(d-2*c,f/2,d,f);a.lineTo(c,f);a.quadTo(c-2*c,f/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",O);mxUtils.extend(ca,mxActor);ca.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",ca);mxUtils.extend(V,mxActor);V.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.quadTo(d/2,f/2,0,0);a.close();
a.end()};mxCellRenderer.registerShape("xor",V);mxUtils.extend(Z,mxActor);Z.prototype.size=20;Z.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d/2,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.8*c),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",
Z);mxUtils.extend(aa,mxActor);aa.prototype.size=.375;aa.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-c),new mxPoint(d/2,f),new mxPoint(0,f-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",aa);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=
@@ -2484,33 +2484,33 @@ arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+f/2);a.lineTo(c+d,b+f/2);a.end
function(a,c,b,d,f){var e=b+f-5;a.begin();a.moveTo(c,b);a.lineTo(c,b+f);a.moveTo(c,e);a.lineTo(c+10,e-5);a.moveTo(c,e);a.lineTo(c+10,e+5);a.moveTo(c,e);a.lineTo(c+d,e);a.moveTo(c+d,b);a.lineTo(c+d,b+f);a.moveTo(c+d,e);a.lineTo(c+d-10,e-5);a.moveTo(c+d,e);a.lineTo(c+d-10,e+5);a.end();a.stroke()};mxCellRenderer.registerShape("dimension",ba);mxUtils.extend(qa,mxEllipse);qa.prototype.paintVertexShape=function(a,c,b,d,f){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,
arguments);null!=this.style&&(a.setStrokeColor(this.stroke),a.rect(c,b,d,f),a.fill(),a.begin(),a.moveTo(c,b),"1"==mxUtils.getValue(this.style,"top","1")?a.lineTo(c+d,b):a.moveTo(c+d,b),"1"==mxUtils.getValue(this.style,"right","1")?a.lineTo(c+d,b+f):a.moveTo(c+d,b+f),"1"==mxUtils.getValue(this.style,"bottom","1")?a.lineTo(c,b+f):a.moveTo(c,b+f),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(c,b-this.strokewidth/2),a.end(),a.stroke())};mxCellRenderer.registerShape("partialRectangle",qa);mxUtils.extend(na,
mxEllipse);na.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+d/2,b),a.lineTo(c+d/2,b+f)):(a.moveTo(c,b+f/2),a.lineTo(c+d,b+f/2));a.end();a.stroke()};mxCellRenderer.registerShape("lineEllipse",na);mxUtils.extend(ta,mxActor);ta.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d,f/2);a.moveTo(0,0);a.lineTo(d-c,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,d-c,f);a.lineTo(0,
-f);a.close();a.end()};mxCellRenderer.registerShape("delay",ta);mxUtils.extend(oa,mxActor);oa.prototype.size=.2;oa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,d);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(f-e)/2;b=c+e;var g=(d-e)/2,e=g+e;a.moveTo(0,c);a.lineTo(g,c);a.lineTo(g,0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(d,c);a.lineTo(d,b);a.lineTo(e,b);a.lineTo(e,f);a.lineTo(g,f);a.lineTo(g,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",
+f);a.close();a.end()};mxCellRenderer.registerShape("delay",ta);mxUtils.extend(oa,mxActor);oa.prototype.size=.2;oa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,d);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(f-e)/2;b=c+e;var h=(d-e)/2,e=h+e;a.moveTo(0,c);a.lineTo(h,c);a.lineTo(h,0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(d,c);a.lineTo(d,b);a.lineTo(e,b);a.lineTo(e,f);a.lineTo(h,f);a.lineTo(h,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",
oa);mxUtils.extend(pa,mxActor);pa.prototype.size=.25;pa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d,f/2);b=Math.min(d-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*d);a.moveTo(0,f/2);a.lineTo(b,0);a.lineTo(d-c,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,d-c,f);a.lineTo(b,f);a.close();a.end()};mxCellRenderer.registerShape("display",pa);mxUtils.extend(ka,mxConnector);ka.prototype.origPaintEdgeShape=ka.prototype.paintEdgeShape;ka.prototype.paintEdgeShape=function(a,c,b){for(var d=
[],f=0;f<c.length;f++)d.push(mxUtils.clone(c[f]));var f=a.state.dashed,e=a.state.fixDash;ka.prototype.origPaintEdgeShape.apply(this,[a,d,b]);3<=a.state.strokeWidth&&(d=mxUtils.getValue(this.style,"fillColor",null),null!=d&&(a.setStrokeColor(d),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(f,e),ka.prototype.origPaintEdgeShape.apply(this,[a,c,b])))};mxCellRenderer.registerShape("filledEdge",ka);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;
-StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,d,f,e,g,h,p,n){var u=f*(g+p+1),r=e*(g+p+1);return function(){a.begin();a.moveTo(d.x-u/2-r/2,d.y-r/2+u/2);a.lineTo(d.x+r/2-3*u/2,d.y-3*r/2-u/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,d,f,e,g,h,p,
-n){var u=f*(g+p+1),r=e*(g+p+1);return function(){a.begin();a.moveTo(d.x-u/2-r/2,d.y-r/2+u/2);a.lineTo(d.x+r/2-3*u/2,d.y-3*r/2-u/2);a.moveTo(d.x-u/2+r/2,d.y-r/2-u/2);a.lineTo(d.x-r/2-3*u/2,d.y-3*r/2+u/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,g,h,p,n){var u=d.clone(),r=Aa.apply(this,arguments),v=f*(g+2*p),k=e*(g+2*p);return function(){r.apply(this,arguments);a.begin();a.moveTo(u.x-f*p,u.y-e*p);a.lineTo(u.x-2*v+f*p,u.y-2*k+e*p);a.moveTo(u.x-
-v-k+e*p,u.y-k+v-f*p);a.lineTo(u.x+k-v-e*p,u.y-k-v+f*p);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,g,h,p,n){c=f*p*1.118;b=e*p*1.118;f*=g+p;e*=g+p;var u=d.clone();u.x-=c;u.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(u.x,u.y);h?a.lineTo(u.x-f-e/2,u.y-e+f/2):a.lineTo(u.x+e/2-f,u.y-e-f/2);a.lineTo(u.x-f,u.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,d,f,e,g,h,p,n,u){e*=h+n;g*=h+n;var r=
-f.clone();return function(){c.begin();c.moveTo(r.x,r.y);p?c.lineTo(r.x-e-g/a,r.y-g+e/a):c.lineTo(r.x+g/a-e,r.y-g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ca=function(a,c,b){return ra(a,["width"],c,function(c,d,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+d*c/4+f*g/2,e.y+f*c/4-d*g/2)},function(c,d,f,e,g,h){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ra=function(a,c,b,d,f){return N(a,c,
-function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var g=a.view.scale,h=b?f[0]:f[e],f=b?f[1]:f[e-1],e=f.x-h.x,p=f.y-h.y,n=Math.sqrt(e*e+p*p),h=d.call(this,n,e/n,p/n,h,f);return new mxPoint(h.x/g-c.x,h.y/g-c.y)},function(c,d,e){var g=a.absolutePoints,h=g.length-1;c=a.view.translate;var p=a.view.scale,n=b?g[0]:g[h],g=b?g[1]:g[h-1],h=g.x-n.x,u=g.y-n.y,r=Math.sqrt(h*h+u*u);d.x=(d.x+c.x)*p;d.y=(d.y+c.y)*p;f.call(this,r,h/r,u/r,n,g,d,e)})},ha=function(a){return function(c){return[N(c,["arrowWidth",
+StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,d,f,e,h,g,m,n){var u=f*(h+m+1),t=e*(h+m+1);return function(){a.begin();a.moveTo(d.x-u/2-t/2,d.y-t/2+u/2);a.lineTo(d.x+t/2-3*u/2,d.y-3*t/2-u/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,d,f,e,h,g,m,
+n){var u=f*(h+m+1),t=e*(h+m+1);return function(){a.begin();a.moveTo(d.x-u/2-t/2,d.y-t/2+u/2);a.lineTo(d.x+t/2-3*u/2,d.y-3*t/2-u/2);a.moveTo(d.x-u/2+t/2,d.y-t/2-u/2);a.lineTo(d.x-t/2-3*u/2,d.y-3*t/2+u/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,h,g,m,n){var u=d.clone(),t=Aa.apply(this,arguments),v=f*(h+2*m),k=e*(h+2*m);return function(){t.apply(this,arguments);a.begin();a.moveTo(u.x-f*m,u.y-e*m);a.lineTo(u.x-2*v+f*m,u.y-2*k+e*m);a.moveTo(u.x-
+v-k+e*m,u.y-k+v-f*m);a.lineTo(u.x+k-v-e*m,u.y-k-v+f*m);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,h,g,m,n){c=f*m*1.118;b=e*m*1.118;f*=h+m;e*=h+m;var u=d.clone();u.x-=c;u.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(u.x,u.y);g?a.lineTo(u.x-f-e/2,u.y-e+f/2):a.lineTo(u.x+e/2-f,u.y-e-f/2);a.lineTo(u.x-f,u.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,d,f,e,h,g,m,n,u){e*=g+n;h*=g+n;var t=
+f.clone();return function(){c.begin();c.moveTo(t.x,t.y);m?c.lineTo(t.x-e-h/a,t.y-h+e/a):c.lineTo(t.x+h/a-e,t.y-h-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ca=function(a,c,b){return ra(a,["width"],c,function(c,d,f,e,h){h=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+d*c/4+f*h/2,e.y+f*c/4-d*h/2)},function(c,d,f,e,h,g){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ra=function(a,c,b,d,f){return N(a,c,
+function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var h=a.view.scale,g=b?f[0]:f[e],f=b?f[1]:f[e-1],e=f.x-g.x,m=f.y-g.y,n=Math.sqrt(e*e+m*m),g=d.call(this,n,e/n,m/n,g,f);return new mxPoint(g.x/h-c.x,g.y/h-c.y)},function(c,d,e){var h=a.absolutePoints,g=h.length-1;c=a.view.translate;var m=a.view.scale,n=b?h[0]:h[g],h=b?h[1]:h[g-1],g=h.x-n.x,u=h.y-n.y,t=Math.sqrt(g*g+u*u);d.x=(d.x+c.x)*m;d.y=(d.y+c.y)*m;f.call(this,t,g/t,u/t,n,h,d,e)})},ha=function(a){return function(c){return[N(c,["arrowWidth",
"arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",U.prototype.arrowWidth))),d=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",U.prototype.arrowSize)));return new mxPoint(c.x+(1-d)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(c.y+c.height/2-b.y)/c.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(c.x+c.width-b.x)/c.width))})]}},ya=function(a,c,b){return function(d){var f=
-[N(d,["size"],function(b){var d=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a;return new mxPoint(b.x+d,b.y+d)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&f.push(ea(d));return f}},ua=function(a,c,b,d,f){b=null!=b?b:1;return function(e){var g=[N(e,["size"],function(c){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,
-"fixedSize","0"):null,d=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(c.x+Math.max(0,Math.min(c.width,d*(b?1:c.width))),c.getCenterY())},function(a,c,d){var g=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));g&&!mxEvent.isAltDown(d.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,d)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(ea(e));return g}},Da=function(a){return function(c){var b=
-[N(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",g.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ea(c));return b}},sa=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c}},ea=function(a,c){return N(a,
+[N(d,["size"],function(b){var d=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a;return new mxPoint(b.x+d,b.y+d)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&f.push(ea(d));return f}},ua=function(a,c,b,d,f){b=null!=b?b:1;return function(e){var h=[N(e,["size"],function(c){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,
+"fixedSize","0"):null,d=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(c.x+Math.max(0,Math.min(c.width,d*(b?1:c.width))),c.getCenterY())},function(a,c,d){var h=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=h?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));h&&!mxEvent.isAltDown(d.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,d)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&h.push(ea(e));return h}},Da=function(a){return function(c){var b=
+[N(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",h.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ea(c));return b}},sa=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c}},ea=function(a,c){return N(a,
[mxConstants.STYLE_ARCSIZE],function(b){var d=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,f),b.y+d)}f=Math.max(0,parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*
-f),b.y+d)},function(c,b,d){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},N=function(a,c,b,d,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};
-g.getPosition=b;g.setPosition=d;g.ignoreGrid=null!=f?f:!0;if(e){var h=g.positionChanged;g.positionChanged=function(){h.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},za={link:function(a){return[Ca(a,!0,10),Ca(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ra(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,
-b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,h,p){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;
-a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(p.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-
-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,h,p){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,
-Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(p.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=
+f),b.y+d)},function(c,b,d){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},N=function(a,c,b,d,f,e){var h=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);h.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};
+h.getPosition=b;h.setPosition=d;h.ignoreGrid=null!=f?f:!0;if(e){var g=h.positionChanged;h.positionChanged=function(){g.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return h},za={link:function(a){return[Ca(a,!0,10),Ca(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ra(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,
+b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,h,g,m){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;
+a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(m.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-
+a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,h,g,m){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,
+Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(m.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=
a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ra(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,
-e,g,h,p){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(p.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<
-c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,h,p){b=
-Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,h.x,h.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(p.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(p.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-
+e,h,g,m){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(m.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<
+c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ra(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,h,g,m){b=
+Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,g.x,g.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,g.x,g.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(m.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(m.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-
parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)-parseFloat(a.style.startWidth))<c&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var c=[N(a,[mxConstants.STYLE_STARTSIZE],function(c){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(c.getCenterX(),
c.y+Math.max(0,Math.min(c.height,b))):new mxPoint(c.x+Math.max(0,Math.min(c.width,b)),c.getCenterY())},function(c,b){a.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(c.height,b.y-c.y))):Math.round(Math.max(0,Math.min(c.width,b.x-c.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));c.push(ea(a,b/2))}return c},
-label:sa(),ext:sa(),rectangle:sa(),triangle:sa(),rhombus:sa(),umlLifeline:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",H.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[N(a,["width","height"],function(a){var c=Math.max(J.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,
-"width",J.prototype.width))),b=Math.max(1.5*J.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",J.prototype.height)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(J.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*J.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[N(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,
+label:sa(),ext:sa(),rectangle:sa(),triangle:sa(),rhombus:sa(),umlLifeline:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[N(a,["width","height"],function(a){var c=Math.max(E.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,
+"width",E.prototype.width))),b=Math.max(1.5*E.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",E.prototype.height)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(E.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*E.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[N(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,
"size",x.prototype.size))));return new mxPoint(a.x+a.width*c,a.y+a.height/4)},function(a,c){this.state.style.size=Math.max(0,Math.min(.5,(c.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},cross:function(a){return[N(a,["size"],function(a){var c=Math.min(a.width,a.height),c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",oa.prototype.size)))*c/2;return new mxPoint(a.getCenterX()-c,a.getCenterY()-c)},function(a,c){var b=Math.min(a.width,
a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,a.getCenterY()-c.y)/b*2,Math.max(0,a.getCenterX()-c.x)/b*2)))})]},note:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=
[N(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",S.prototype.size)));return new mxPoint(a.x+a.width/4,a.y+3*c/4)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(c.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},dataStorage:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",O.prototype.size))));return new mxPoint(a.x+
@@ -2520,40 +2520,40 @@ Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",v.prototyp
c.x-a.x-b*a.width)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},internalStorage:function(a){var c=[N(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",D.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",D.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,
Math.min(a.height,c.y-a.y)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ea(a));return c},corner:function(a){return[N(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",W.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",W.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,
Math.min(a.height,c.y-a.y)))})]},tee:function(a){return[N(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",X.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",X.prototype.dy)));return new mxPoint(a.x+(a.width+c)/2,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,2*Math.min(a.width/2,c.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},singleArrow:ha(1),doubleArrow:ha(.5),
-folder:function(a){return[N(a,["tabWidth","tabHeight"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",l.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",l.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",l.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,
-"tabPosition",l.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[N(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",c.prototype.size))));return new mxPoint(a.x+3*a.width/4,a.y+(1-b)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},
-tape:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",t.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",aa.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},
-function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},step:ua(r.prototype.size,!0,null,!0,r.prototype.fixedSize),hexagon:ua(y.prototype.size,!0,.5,!0),curlyBracket:ua(p.prototype.size,!1),display:ua(pa.prototype.size,!1),cube:ya(1,a.prototype.size,!1),card:ya(.5,q.prototype.size,!0),loopLimit:ya(.5,Z.prototype.size,!0),trapezoid:Da(.5),parallelogram:Da(1)};Graph.createHandle=N;Graph.handleFactory=za;mxVertexHandler.prototype.createCustomHandles=function(){if(1==
+folder:function(a){return[N(a,["tabWidth","tabHeight"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",p.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",p.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",p.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,
+"tabPosition",p.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[N(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",c.prototype.size))));return new mxPoint(a.x+3*a.width/4,a.y+(1-b)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},
+tape:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",r.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[N(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",aa.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},
+function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},step:ua(t.prototype.size,!0,null,!0,t.prototype.fixedSize),hexagon:ua(A.prototype.size,!0,.5,!0),curlyBracket:ua(m.prototype.size,!1),display:ua(pa.prototype.size,!1),cube:ya(1,a.prototype.size,!1),card:ya(.5,q.prototype.size,!0),loopLimit:ya(.5,Z.prototype.size,!0),trapezoid:Da(.5),parallelogram:Da(1)};Graph.createHandle=N;Graph.handleFactory=za;mxVertexHandler.prototype.createCustomHandles=function(){if(1==
this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=za[a];if(null!=a)return a(this.state)}return null};mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_CONNECTOR);
-a=za[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),ha=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(ha),Math.sin(ha)),ha=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(ha),Math.sin(ha));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,h=g[0],g=g[g.length-1];null!=d&&(d=e.transformControlPoint(a,
-d));null==h&&null!=c&&(h=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var p=va.x,n=va.y,u=wa.x,r=wa.y,v="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=h){a=function(a,c,b){a-=k.x;var d=c-k.y;c=(r*a-u*d)/(p*r-n*u);a=(n*a-p*d)/(n*u-p*r);v?(b&&(k=new mxPoint(k.x+p*c,k.y+n*c),f.push(k)),k=new mxPoint(k.x+u*a,k.y+r*a)):(b&&(k=new mxPoint(k.x+u*a,k.y+r*a),f.push(k)),k=new mxPoint(k.x+p*c,k.y+n*c));f.push(k)};
-var k=h;null==d&&(d=new mxPoint(h.x+(g.x-h.x)/2,h.y+(g.y-h.y)/2));a(d.x,d.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ia=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Ia.apply(this,arguments)};b.prototype.constraints=[];e.prototype.constraints=[];v.prototype.constraints=[];mxRectangleShape.prototype.constraints=
+a=za[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),ha=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(ha),Math.sin(ha)),ha=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(ha),Math.sin(ha));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var h=a.absolutePoints,g=h[0],h=h[h.length-1];null!=d&&(d=e.transformControlPoint(a,
+d));null==g&&null!=c&&(g=new mxPoint(c.getCenterX(),c.getCenterY()));null==h&&null!=b&&(h=new mxPoint(b.getCenterX(),b.getCenterY()));var m=va.x,n=va.y,u=wa.x,t=wa.y,v="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=h&&null!=g){a=function(a,c,b){a-=k.x;var d=c-k.y;c=(t*a-u*d)/(m*t-n*u);a=(n*a-m*d)/(n*u-m*t);v?(b&&(k=new mxPoint(k.x+m*c,k.y+n*c),f.push(k)),k=new mxPoint(k.x+u*a,k.y+t*a)):(b&&(k=new mxPoint(k.x+u*a,k.y+t*a),f.push(k)),k=new mxPoint(k.x+m*c,k.y+n*c));f.push(k)};
+var k=g;null==d&&(d=new mxPoint(g.x+(h.x-g.x)/2,g.y+(h.y-g.y)/2));a(d.x,d.y,!0);a(h.x,h.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ia=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Ia.apply(this,arguments)};b.prototype.constraints=[];e.prototype.constraints=[];v.prototype.constraints=[];mxRectangleShape.prototype.constraints=
[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,
1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];mxLabel.prototype.constraints=
-mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;w.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;l.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=
+mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;y.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;p.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=
mxRectangleShape.prototype.constraints;O.prototype.constraints=mxRectangleShape.prototype.constraints;ia.prototype.constraints=mxEllipse.prototype.constraints;da.prototype.constraints=mxEllipse.prototype.constraints;ma.prototype.constraints=mxEllipse.prototype.constraints;na.prototype.constraints=mxEllipse.prototype.constraints;S.prototype.constraints=mxRectangleShape.prototype.constraints;ta.prototype.constraints=mxRectangleShape.prototype.constraints;pa.prototype.constraints=mxRectangleShape.prototype.constraints;
Z.prototype.constraints=mxRectangleShape.prototype.constraints;aa.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,
.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,
1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,
.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,
-.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];m.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,
-1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];t.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,
-0),!1)];r.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,
-.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];K.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=
+.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];l.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,
+1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];r.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,
+0),!1)];t.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,
+.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];I.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=
mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,
0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(.125,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(.125,.75),!0),new mxConnectionConstraint(new mxPoint(.875,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(.875,.75),!0),new mxConnectionConstraint(new mxPoint(.375,
1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,
-.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];f.prototype.constraints=mxRectangleShape.prototype.constraints;g.prototype.constraints=mxRectangleShape.prototype.constraints;c.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,
+.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];f.prototype.constraints=mxRectangleShape.prototype.constraints;h.prototype.constraints=mxRectangleShape.prototype.constraints;c.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,
0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;X.prototype.constraints=null;W.prototype.constraints=null;Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,
.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];U.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];T.prototype.constraints=
-[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];H.prototype.constraints=null;ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
+[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];L.prototype.constraints=null;ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];V.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}
Actions.prototype.init=function(){function a(a){d.escape();var b=d.getDeletableCells(d.getSelectionCells());if(null!=b&&0<b.length){var c=d.model.getParents(b);d.removeCells(b,a);if(null!=c){a=[];for(b=0;b<c.length;b++)d.model.contains(c[b])&&(d.model.isVertex(c[b])||d.model.isEdge(c[b]))&&a.push(c[b]);d.setSelectionCells(a)}}}var b=this.editorUi,e=b.editor,d=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){window.open(b.getUrl())});
this.addAction("open...",function(){window.openNew=!0;window.openKey="open";b.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){b.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var c=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));b.showDialog((new OpenDialog(this)).container,
320,220,!0,!0,function(){window.openFile=null})}).isEnabled=k;this.addAction("save",function(){b.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=k;this.addAction("saveAs...",function(){b.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=k;this.addAction("export...",function(){b.showDialog((new ExportDialog(b)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(b);b.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...",
function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(d,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",
function(){mxClipboard.cut(d)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&mxClipboard.paste(d)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){d.getModel().beginUpdate();try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var c=0;c<b.length&&
-a;c++)a=a&&d.model.isEdge(b[c]);var f=d.view.translate,e=d.view.scale,p=f.x,n=f.y,f=null;if(1==b.length&&a){var h=d.getCellGeometry(b[0]);null!=h&&(f=h.getTerminalPoint(!0))}f=null!=f?f:d.getBoundingBoxFromGeometry(b,a);if(null!=f){var k=Math.round(d.snap(d.popupMenuHandler.triggerX/e-p)),u=Math.round(d.snap(d.popupMenuHandler.triggerY/e-n));d.cellsMoved(b,k-f.x,u-f.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");
+a;c++)a=a&&d.model.isEdge(b[c]);var f=d.view.translate,e=d.view.scale,m=f.x,n=f.y,f=null;if(1==b.length&&a){var g=d.getCellGeometry(b[0]);null!=g&&(f=g.getTerminalPoint(!0))}f=null!=f?f:d.getBoundingBoxFromGeometry(b,a);if(null!=f){var k=Math.round(d.snap(d.popupMenuHandler.triggerX/e-m)),u=Math.round(d.snap(d.popupMenuHandler.triggerY/e-n));d.cellsMoved(b,k-f.x,u-f.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");
this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){d.setSelectionCells(d.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){d.turnShapes(d.getSelectionCells())},null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices",function(){d.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){d.selectEdges()},
null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){d.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){d.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{var a=d.isCellMovable(d.getSelectionCell())?1:0;d.toggleCellStyles(mxConstants.STYLE_MOVABLE,a);d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);d.toggleCellStyles(mxConstants.STYLE_ROTATABLE,
a);d.toggleCellStyles(mxConstants.STYLE_DELETABLE,a);d.toggleCellStyles(mxConstants.STYLE_EDITABLE,a);d.toggleCellStyles("connectable",a)}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("home",function(){d.home()},null,null,"Home");this.addAction("exitGroup",function(){d.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){d.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){d.foldCells(!0)},
@@ -2561,7 +2561,7 @@ null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){d.foldCells
d.getSelectionCount()&&0==d.getModel().getChildCount(d.getSelectionCell())?d.setCellStyles("container","0"):d.setSelectionCells(d.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){d.removeCellsFromParent()});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();null!=a&&(a=new EditDataDialog(b,a),b.showDialog(a.container,
320,320,!0,!1,null,!1),a.init())},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c="";if(mxUtils.isNode(d.value)){var f=d.value.getAttribute("tooltip");null!=f&&(c=f)}c=new TextareaDialog(b,mxResources.get("editTooltip")+":",c,function(c){a.setTooltipForCell(d,c)});b.showDialog(c.container,320,200,!0,!0);c.init()}});this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());
null!=a&&window.open(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c=a.getLinkForCell(d)||"";b.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}});this.addAction("insertLink...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,e){a=mxUtils.trim(a);if(0<a.length){var c=null,f=a.substring(a.lastIndexOf("/")+
-1);if(d.isPageLink(a)){var g=a.indexOf(",");0<g&&(f=b.getPageById(a.substring(g+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}null!=e&&0<e.length&&(c=e[0].iconUrl,f=e[0].name||e[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));g=d.getFreeInsertPoint();c=new mxCell(f,new mxGeometry(g.x,g.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:
+1);if(d.isPageLink(a)){var h=a.indexOf(",");0<h&&(f=b.getPageById(a.substring(h+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}null!=e&&0<e.length&&(c=e[0].iconUrl,f=e[0].name||e[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));h=d.getFreeInsertPoint();c=new mxCell(f,new mxGeometry(h.x,h.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:
"spacing=10;"));c.vertex=!0;d.setLinkForCell(c,a);d.cellSizeUpdated(c,!0);d.getModel().beginUpdate();try{c=d.addCell(c),d.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{d.getModel().endUpdate()}d.setSelectionCell(c);d.scrollCellToVisible(d.getSelectionCell())}})}).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getParentByName(a.getSelectedElement(),"A",a.cellEditor.textarea),c="";
null!=d&&(c=d.getAttribute("href")||"");var f=a.cellEditor.saveSelection();b.showLinkDialog(c,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(f);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().getChildCount(c))d.updateGroupBounds([c],
20);else{var f=d.view.getState(c),e=d.getCellGeometry(c);d.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&d.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(c,e)):d.updateCellSize(c)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var e=
@@ -2572,13 +2572,13 @@ a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxCo
(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=
Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+
"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,
-function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.isGridEnabled()});m.setEnabled(!1);m=this.addAction("guides",function(){d.graphHandler.guidesEnabled=
-!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});m.setEnabled(!1);m=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=
-!d.foldingEnabled;d.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return d.pageVisible});m=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=
-!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionArrowsEnabled});m=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});m=this.addAction("copyConnect",
-function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});m.isEnabled=k;m=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&
-(a="_"+mxClient.language);window.open(RESOURCES_PATH+"/help"+a+".html")});var l=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){l||(b.showDialog((new AboutDialog(b)).container,320,280,!0,!0,function(){l=!1}),l=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){null!=c&&d.cellEditor.isContentEditing()?c():(d.stopEditing(!1),d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b))},null,null,f)});m("bold",mxConstants.FONT_BOLD,
-function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");m("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");m("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",
+function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var l=null,l=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.isGridEnabled()});l.setEnabled(!1);l=this.addAction("guides",function(){d.graphHandler.guidesEnabled=
+!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});l.setEnabled(!1);l=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});l=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=
+!d.foldingEnabled;d.model.execute(a)});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.foldingEnabled});l.isEnabled=k;l=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.scrollbars});l=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return d.pageVisible});l=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=
+!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionArrowsEnabled});l=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});l=this.addAction("copyConnect",
+function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});l.isEnabled=k;l=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.autosave});l.isEnabled=k;l.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&
+(a="_"+mxClient.language);window.open(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));l=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){null!=c&&d.cellEditor.isContentEditing()?c():(d.stopEditing(!1),d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b))},null,null,f)});l("bold",mxConstants.FONT_BOLD,
+function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",
function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});
this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,
null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],
@@ -2587,21 +2587,21 @@ null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DAS
"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,f);d.setCellStyles(mxConstants.STYLE_CURVED,null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",
[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();
if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&
-b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,g=c.x,c=c.y,a=d.getModel().getParent(a),p=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=p;)g+=p.x,c+=p.y,a=d.getModel().getParent(a),p=d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g));
-f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,
-f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=
-mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;d.getModel().beginUpdate();try{if(0==e.length){var p=d.getFreeInsertPoint(),g=e=[d.insertVertex(d.getDefaultParent(),
-null,"",p.x,p.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var n=d.view.getState(e[0]),r=null!=n?n.style:d.getCellStyle(e[0]);"image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&
-null!=c&&null!=b){var k=e[0],m=d.getModel().getGeometry(k);null!=m&&(m=m.clone(),m.width=c,m.height=b,d.getModel().setGeometry(k,m))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())}).isEnabled=k;m=this.addAction("layers",
+b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,h=c.x,c=c.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=m;)h+=m.x,c+=m.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);h=Math.round(d.snap(d.popupMenuHandler.triggerX/f-h));
+f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,h,f)}}});this.addAction("removeWaypoint",function(){var a=b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,
+f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=
+mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var h=null;d.getModel().beginUpdate();try{if(0==e.length){var m=d.getFreeInsertPoint(),h=e=[d.insertVertex(d.getDefaultParent(),
+null,"",m.x,m.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",h))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var n=d.view.getState(e[0]),t=null!=n?n.style:d.getCellStyle(e[0]);"image"!=t[mxConstants.STYLE_SHAPE]&&"label"!=t[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&
+null!=c&&null!=b){var k=e[0],l=d.getModel().getGeometry(k);null!=l&&(l=l.clone(),l.width=c,l.height=b,d.getModel().setGeometry(k,l))}}finally{d.getModel().endUpdate()}null!=h&&(d.setSelectionCells(h),d.scrollCellToVisible(h[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())}).isEnabled=k;l=this.addAction("layers",
mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+
-"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));m=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-
-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=
-this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
+"+Shift+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));l=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-
+260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=
+this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};
Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.data=b||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};
-DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,b,e,d){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData())};DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};
-DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};
-DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
+DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,b,e,d){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};
+DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};
+DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.chromeless||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
DrawioFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,b){var e=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||(this.setModified(!0),this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||
this.isModified()||this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))}),mxUtils.bind(this,function(a){this.ui.getCurrentFile()==this&&this.addUnsavedStatus(a)}))):this.addUnsavedStatus())});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener);this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener);this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener);this.ui.addListener("pageFormatChanged",this.changeListener);
this.ui.addListener("pageScaleChanged",this.changeListener);this.ui.addListener("backgroundColorChanged",this.changeListener);this.ui.addListener("backgroundImageChanged",this.changeListener);this.ui.addListener("foldingEnabledChanged",this.changeListener);this.ui.addListener("mathEnabledChanged",this.changeListener);this.ui.addListener("gridEnabledChanged",this.changeListener);this.ui.addListener("guidesEnabledChanged",this.changeListener);this.ui.addListener("pageViewChanged",this.changeListener)};
@@ -2611,8 +2611,8 @@ DrawioFile.prototype.autosave=function(a,b,e,d){null==this.lastAutosave&&(this.l
mxUtils.bind(this,function(a){null!=d&&d(a)}))}else null!=e&&e(null)}),a)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};
DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,b){if(null!=a&&null!=b){var e=a.lastIndexOf("."),d=0<e?a.substring(e):"",e=b.lastIndexOf(".");return d===(0<e?b.substring(e):"")}return a==b};
DrawioFile.prototype.destroy=function(){this.clearAutosave();null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};LocalFile=function(a,b,e,d){DrawioFile.call(this,a,b);this.title=e;this.mode=d?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,b,e){this.saveAs(this.title,b,e)};LocalFile.prototype.saveAs=function(a,b,e){this.saveFile(a,!1,b,e)};
-LocalFile.prototype.saveFile=function(a,b,e,d){this.title=a;this.updateFileData();b=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
-(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):m(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
+LocalFile.prototype.saveFile=function(a,b,e,d){this.title=a;this.updateFileData();b=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),l=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
+(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){l(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):l(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,b){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
@@ -2627,7 +2627,7 @@ b.parentNode.insertBefore(c,b),Editor.prototype.fontCss=a.fontCss);if(null!=a.pl
null!=d&&0<d.length&&(b=d[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==c.nodeName){b=c.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(d=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=d&&(f=new mxCodec(d.ownerDocument),f.decode(d,this.graph.getStylesheet())));else if(d=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),
null!=d){var f=new mxCodec(d.ownerDocument);f.decode(d,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==c.getAttribute("math");b=c.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;this.graph.setShadowVisible("1"==c.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||
"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=b.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?
-"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(y){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==
+"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(A){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==
typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),d=[];if(null!=b&&0<b.length)for(var f=0;f<b.length;f++)if("mxgraph"==b[f].getAttribute("class")){d.push(b[f]);break}0<d.length&&(b=d[0].getAttribute("data-mxgraph"),null!=b?(d=JSON.parse(b),null!=d&&null!=d.xml&&(d=mxUtils.parseXml(d.xml),a=d.documentElement)):(d=d[0].getElementsByTagName("div"),0<d.length&&(b=mxUtils.getTextContent(d[0]),b=this.graph.decompress(b),0<b.length&&(d=mxUtils.parseXml(b),a=d.documentElement))))}if(null!=a&&
"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||c||(d=null,"diagram"==a.nodeName?d=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(d=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=d&&
(b=this.graph.decompress(mxUtils.getTextContent(d)),null!=b&&0<b.length&&(a=mxUtils.parseXml(b).documentElement)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);return a};var e=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;e.apply(this,arguments)};Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
@@ -2635,24 +2635,24 @@ var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphCompone
messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(c||{jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};
Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,c){this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var d=document.getElementsByTagName("script");if(null!=d&&0<d.length){var f=
document.createElement("script");f.type="text/javascript";f.src=a;d[0].parentNode.appendChild(f)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;var c=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,
-function(a,b,d,f){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
-mxSettings.save()}}if(null!=window.StyleFormatPanel){var l=Format.prototype.init;Format.prototype.init=function(){l.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?q.apply(this,arguments):this.clear()};var t=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=t.apply(this,
+function(a,b,d,f){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var l=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){l.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
+mxSettings.save()}}if(null!=window.StyleFormatPanel){var p=Format.prototype.init;Format.prototype.init=function(){p.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?q.apply(this,arguments):this.clear()};var r=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=r.apply(this,
arguments);if(mxClient.IS_SVG){var c=this.editorUi,b=c.editor.graph;a.appendChild(this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var d=new ChangePageSetup(c);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;b.model.execute(d)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}}))}return a};var c=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=c.apply(this,arguments);var b=this.editorUi;if(b.editor.graph.isEnabled()){var d=b.getCurrentFile();null!=d&&d.isAutosaveOptional()&&(d=this.createOption(mxResources.get("autosave"),function(){return b.editor.autosave},function(a){b.editor.setAutosave(a)},{install:function(a){this.listener=function(){a(b.editor.autosave)};b.editor.addListener("autosaveChanged",this.listener)},destroy:function(){b.editor.removeListener(this.listener)}}),a.appendChild(d))}return a};
StyleFormatPanel.prototype.defaultColorSchemes=[[null,{fill:"#f5f5f5",stroke:"#666666"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[null,{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},
{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){"image"!=this.format.createSelectionState().style.shape&&
-this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments)};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);
-c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return g.apply(this,arguments)};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){d.getModel().beginUpdate();try{var b=
-d.getSelectionCells();for(c=0;c<b.length;c++){for(var f=d.getModel().getStyle(b[c]),g=0;g<e.length;g++)f=mxUtils.removeStylename(f,e[g]);null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,"#ffffff"),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,"#000000"),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,
+this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments)};var h=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);
+c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return h.apply(this,arguments)};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){d.getModel().beginUpdate();try{var b=
+d.getSelectionCells();for(c=0;c<b.length;c++){for(var f=d.getModel().getStyle(b[c]),h=0;h<e.length;h++)f=mxUtils.removeStylename(f,e[h]);null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient)):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,"#ffffff"),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,"#000000"),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,
null));d.getModel().setStyle(b[c],f)}}finally{d.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";null!=a?(null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?c.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":c.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":c.style.backgroundColor=
a.fill,c.style.border="1px solid "+a.stroke):(c.style.backgroundColor="#ffffff",c.style.border="1px solid #000000");f.appendChild(c)}f.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(f),c(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var d=this.editorUi.editor.graph,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.paddingLeft="24px";f.style.paddingRight=
-"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var g=document.createElement("div");g.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
-mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var h=document.createElement("div");h.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
-1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(h));mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(h);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
+"20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var h=document.createElement("div");h.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
+mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var g=document.createElement("div");g.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
+1<this.defaultColorSchemes.length&&(a.appendChild(h),a.appendChild(g));mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(h);b(g);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
(b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var d=this.editorUi.editor.graph,f=d.view.getState(d.getSelectionCell());1==d.getSelectionCount()&&null!=f&&null!=f.shape&&null!=f.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px":
(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize=
-"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var p=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}p.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
+"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var m=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}m.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,
c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}return d.apply(this,arguments)}};var n=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){n.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.highlightCell=function(a,
c,b){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),f=new mxCellHighlight(this,c,d,!1);f.highlight(a);window.setTimeout(function(){null!=f.shape&&(mxUtils.setPrefixedStyle(f.shape.node.style,"transition","all 1200ms ease-in-out"),f.shape.node.style.opacity=0);window.setTimeout(function(){f.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;
@@ -2667,86 +2667,86 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist
[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=
[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",
STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
-[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var h=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,g,p,n,k){if(null!=b&&null==mxMarker.markers[b]){var u=this.getPackageForType(b);null!=u&&mxStencilRegistry.getStencil(u)}return h.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){m.value=Math.max(1,
-Math.min(h,Math.max(parseInt(m.value),parseInt(x.value))));x.value=Math.max(1,Math.min(h,Math.min(parseInt(m.value),parseInt(x.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),g=0,h=0,p=ca.get(),n=1/c.pageScale,k=t.checked;if(k)var n=parseInt(T.value),r=parseInt(O.value),n=Math.min(p.height*r/(e.height/c.view.scale),p.width*n/(e.width/c.view.scale));else n=parseInt(q.value)/(100*c.pageScale),isNaN(n)&&(d=1/c.pageScale,q.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*
-d);p.height=Math.ceil(p.height*d);n*=d;!k&&c.pageVisible?(e=c.getPageLayout(),g-=e.x*p.width,h-=e.y*p.height):k=!0;if(null==b){b=PrintDialog.createPrintPreview(c,n,p,0,g,h,k);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var u=b.writeHead;b.writeHead=function(c){u.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var x=b.renderPage;b.renderPage=
-function(a,c,b,d,f,e){var g=x.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:g.className="geDisableMathJax";return g}}b.open(null,null,f,!0)}else{p=c.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";b.backgroundColor=p;b.autoOrigin=k;b.appendGraph(c,n,g,h,f,!0)}return b}var d=parseInt(V.value)/100;isNaN(d)&&(d=1,V.value="100 %");var d=.75*d,e=x.value,g=m.value,h=!k.checked,n=null;h&&(h=e==p&&g==p);if(!h&&null!=a.pages&&a.pages.length){var r=0,h=a.pages.length-1;k.checked||
-(r=parseInt(e)-1,h=parseInt(g)-1);for(var u=r;u<=h;u++){var v=a.pages[u],e=v==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),g=!0,r=!1,z=null,l=null;null==v.viewState&&null==v.mapping&&null==v.root&&a.updatePageRoot(v);null!=v.viewState?(g=v.viewState.pageVisible,r=v.viewState.mathEnabled,z=v.viewState.background,l=v.viewState.backgroundImage):null!=v.mapping&&null!=v.mapping.diagramMap&&(r="0"!=v.mapping.diagramMap.get("mathEnabled"),z=v.mapping.diagramMap.get("background"),
-l=v.mapping.diagramMap.get("backgroundImage"),l=null!=l&&0<l.length?JSON.parse(l):null);e.background=z;e.backgroundImage=null!=l?new mxImage(l.src,l.width,l.height):null;e.pageVisible=g;e.mathEnabled=r;var w=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?v.getName():"pagenumber"==a?u+1:w.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(v);e.model.setRoot(v.root)}n=b(e,n,u!=h);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);n.mathEnabled&&
-(h=n.wnd.document,h.writeln('<script type="text/x-mathjax-config">'),h.writeln("MathJax.Hub.Config({"),h.writeln('messageStyle: "none",'),h.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),h.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),h.writeln("TeX: {"),h.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),h.writeln("},"),h.writeln("tex2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("},"),
-h.writeln("asciimath2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("}"),h.writeln("});"),c&&(h.writeln("MathJax.Hub.Queue(function () {"),h.writeln("window.print();"),h.writeln("});")),h.writeln("\x3c/script>"),h.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));n.closeDocument();!n.mathEnabled&&c&&PrintDialog.printPreview(n)}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");
-g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var h=1,p=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio");k.setAttribute("name","pages-printdialog");n.appendChild(k);g=document.createElement("span");
-mxUtils.write(g,mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var u=k.cloneNode(!0);k.setAttribute("checked","checked");u.setAttribute("value","range");n.appendChild(u);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");n.appendChild(g);var x=document.createElement("input");x.style.cssText="margin:0 8px 0 8px;";x.setAttribute("value","1");x.setAttribute("type","number");x.setAttribute("min","1");x.style.width="50px";n.appendChild(x);g=document.createElement("span");
-mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var m=x.cloneNode(!0);n.appendChild(m);mxEvent.addListener(x,"focus",function(){u.checked=!0});mxEvent.addListener(m,"focus",function(){u.checked=!0});mxEvent.addListener(x,"change",b);mxEvent.addListener(m,"change",b);if(null!=a.pages&&(h=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){p=g+1;x.value=p;m.value=p;break}x.setAttribute("max",h);m.setAttribute("max",h);1<h&&e.appendChild(n);var v=document.createElement("div");
-v.style.marginBottom="10px";var l=document.createElement("input");l.style.marginRight="8px";l.setAttribute("value","adjust");l.setAttribute("type","radio");l.setAttribute("name","printZoom");v.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));v.appendChild(g);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";v.appendChild(q);mxEvent.addListener(q,"focus",function(){l.checked=!0});
-e.appendChild(v);var n=n.cloneNode(!1),t=l.cloneNode(!0);t.setAttribute("value","fit");l.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(t);n.appendChild(g);v=document.createElement("table");v.style.display="inline-block";var L=document.createElement("tbody"),I=document.createElement("tr"),M=I.cloneNode(!0),S=document.createElement("td"),D=S.cloneNode(!0),W=S.cloneNode(!0),Q=S.cloneNode(!0),
-X=S.cloneNode(!0),U=S.cloneNode(!0);S.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(S,mxResources.get("fitTo"));var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","1");T.setAttribute("min","1");T.setAttribute("type","number");T.style.width="40px";D.appendChild(T);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));W.appendChild(g);mxUtils.write(Q,mxResources.get("fitToBy"));var O=T.cloneNode(!0);X.appendChild(O);
-mxEvent.addListener(T,"focus",function(){t.checked=!0});mxEvent.addListener(O,"focus",function(){t.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));U.appendChild(g);I.appendChild(S);I.appendChild(D);I.appendChild(W);M.appendChild(Q);M.appendChild(X);M.appendChild(U);L.appendChild(I);L.appendChild(M);v.appendChild(L);n.appendChild(v);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom=
-"12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ca=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var V=document.createElement("input");V.style.cssText="margin:0 8px 0 8px;";V.setAttribute("value","100 %");V.style.width="60px";n.appendChild(V);
-e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&g.appendChild(n);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",g.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
-d(!1)}),v.className="geBtn",g.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});v.className="geBtn gePrimaryBtn";g.appendChild(v);a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var x=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
+[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var g=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,h,m,n,k){if(null!=b&&null==mxMarker.markers[b]){var u=this.getPackageForType(b);null!=u&&mxStencilRegistry.getStencil(u)}return g.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){x.value=Math.max(1,
+Math.min(g,Math.max(parseInt(x.value),parseInt(l.value))));l.value=Math.max(1,Math.min(g,Math.min(parseInt(x.value),parseInt(l.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),h=0,g=0,m=ca.get(),n=1/c.pageScale,k=r.checked;if(k)var n=parseInt(T.value),t=parseInt(O.value),n=Math.min(m.height*t/(e.height/c.view.scale),m.width*n/(e.width/c.view.scale));else n=parseInt(q.value)/(100*c.pageScale),isNaN(n)&&(d=1/c.pageScale,q.value="100 %");m=mxRectangle.fromRectangle(m);m.width=Math.ceil(m.width*
+d);m.height=Math.ceil(m.height*d);n*=d;!k&&c.pageVisible?(e=c.getPageLayout(),h-=e.x*m.width,g-=e.y*m.height):k=!0;if(null==b){b=PrintDialog.createPrintPreview(c,n,m,0,h,g,k);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var u=b.writeHead;b.writeHead=function(c){u.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var v=b.renderPage;b.renderPage=
+function(a,c,b,d,f,e){var h=v.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:h.className="geDisableMathJax";return h}}b.open(null,null,f,!0)}else{m=c.background;if(null==m||""==m||m==mxConstants.NONE)m="#ffffff";b.backgroundColor=m;b.autoOrigin=k;b.appendGraph(c,n,h,g,f,!0)}return b}var d=parseInt(V.value)/100;isNaN(d)&&(d=1,V.value="100 %");var d=.75*d,e=l.value,h=x.value,g=!k.checked,n=null;g&&(g=e==m&&h==m);if(!g&&null!=a.pages&&a.pages.length){var t=0,g=a.pages.length-1;k.checked||
+(t=parseInt(e)-1,g=parseInt(h)-1);for(var u=t;u<=g;u++){var v=a.pages[u],e=v==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),h=!0,t=!1,z=null,p=null;null==v.viewState&&null==v.mapping&&null==v.root&&a.updatePageRoot(v);null!=v.viewState?(h=v.viewState.pageVisible,t=v.viewState.mathEnabled,z=v.viewState.background,p=v.viewState.backgroundImage):null!=v.mapping&&null!=v.mapping.diagramMap&&(t="0"!=v.mapping.diagramMap.get("mathEnabled"),z=v.mapping.diagramMap.get("background"),
+p=v.mapping.diagramMap.get("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null);e.background=z;e.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height):null;e.pageVisible=h;e.mathEnabled=t;var A=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?v.getName():"pagenumber"==a?u+1:A.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(v);e.model.setRoot(v.root)}n=b(e,n,u!=g);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);n.mathEnabled&&
+(g=n.wnd.document,g.writeln('<script type="text/x-mathjax-config">'),g.writeln("MathJax.Hub.Config({"),g.writeln('messageStyle: "none",'),g.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),g.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),g.writeln("TeX: {"),g.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),g.writeln("},"),g.writeln("tex2jax: {"),g.writeln('\tignoreClass: "geDisableMathJax"'),g.writeln("},"),
+g.writeln("asciimath2jax: {"),g.writeln('\tignoreClass: "geDisableMathJax"'),g.writeln("}"),g.writeln("});"),c&&(g.writeln("MathJax.Hub.Queue(function () {"),g.writeln("window.print();"),g.writeln("});")),g.writeln("\x3c/script>"),g.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));n.closeDocument();!n.mathEnabled&&c&&PrintDialog.printPreview(n)}var f=a.editor.graph,e=document.createElement("div"),h=document.createElement("h3");
+h.style.width="100%";h.style.textAlign="center";h.style.marginTop="0px";mxUtils.write(h,c||mxResources.get("print"));e.appendChild(h);var g=1,m=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio");k.setAttribute("name","pages-printdialog");n.appendChild(k);h=document.createElement("span");
+mxUtils.write(h,mxResources.get("printAllPages"));n.appendChild(h);mxUtils.br(n);var u=k.cloneNode(!0);k.setAttribute("checked","checked");u.setAttribute("value","range");n.appendChild(u);h=document.createElement("span");mxUtils.write(h,mxResources.get("pages")+":");n.appendChild(h);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;";l.setAttribute("value","1");l.setAttribute("type","number");l.setAttribute("min","1");l.style.width="50px";n.appendChild(l);h=document.createElement("span");
+mxUtils.write(h,mxResources.get("to"));n.appendChild(h);var x=l.cloneNode(!0);n.appendChild(x);mxEvent.addListener(l,"focus",function(){u.checked=!0});mxEvent.addListener(x,"focus",function(){u.checked=!0});mxEvent.addListener(l,"change",b);mxEvent.addListener(x,"change",b);if(null!=a.pages&&(g=a.pages.length,null!=a.currentPage))for(h=0;h<a.pages.length;h++)if(a.currentPage==a.pages[h]){m=h+1;l.value=m;x.value=m;break}l.setAttribute("max",g);x.setAttribute("max",g);1<g&&e.appendChild(n);var v=document.createElement("div");
+v.style.marginBottom="10px";var p=document.createElement("input");p.style.marginRight="8px";p.setAttribute("value","adjust");p.setAttribute("type","radio");p.setAttribute("name","printZoom");v.appendChild(p);h=document.createElement("span");mxUtils.write(h,mxResources.get("adjustTo"));v.appendChild(h);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";v.appendChild(q);mxEvent.addListener(q,"focus",function(){p.checked=!0});
+e.appendChild(v);var n=n.cloneNode(!1),r=p.cloneNode(!0);r.setAttribute("value","fit");p.setAttribute("checked","checked");h=document.createElement("div");h.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";h.appendChild(r);n.appendChild(h);v=document.createElement("table");v.style.display="inline-block";var K=document.createElement("tbody"),J=document.createElement("tr"),M=J.cloneNode(!0),S=document.createElement("td"),D=S.cloneNode(!0),W=S.cloneNode(!0),Q=S.cloneNode(!0),
+X=S.cloneNode(!0),U=S.cloneNode(!0);S.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(S,mxResources.get("fitTo"));var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","1");T.setAttribute("min","1");T.setAttribute("type","number");T.style.width="40px";D.appendChild(T);h=document.createElement("span");mxUtils.write(h,mxResources.get("fitToSheetsAcross"));W.appendChild(h);mxUtils.write(Q,mxResources.get("fitToBy"));var O=T.cloneNode(!0);X.appendChild(O);
+mxEvent.addListener(T,"focus",function(){r.checked=!0});mxEvent.addListener(O,"focus",function(){r.checked=!0});h=document.createElement("span");mxUtils.write(h,mxResources.get("fitToSheetsDown"));U.appendChild(h);J.appendChild(S);J.appendChild(D);J.appendChild(W);M.appendChild(Q);M.appendChild(X);M.appendChild(U);K.appendChild(J);K.appendChild(M);v.appendChild(K);n.appendChild(v);e.appendChild(n);n=document.createElement("div");h=document.createElement("div");h.style.fontWeight="bold";h.style.marginBottom=
+"12px";mxUtils.write(h,mxResources.get("paperSize"));n.appendChild(h);h=document.createElement("div");h.style.marginBottom="12px";var ca=PageSetupDialog.addPageFormatPanel(h,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(h);h=document.createElement("span");mxUtils.write(h,mxResources.get("pageScale"));n.appendChild(h);var V=document.createElement("input");V.style.cssText="margin:0 8px 0 8px;";V.setAttribute("value","100 %");V.style.width="60px";n.appendChild(V);
+e.appendChild(n);h=document.createElement("div");h.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&h.appendChild(n);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",h.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
+d(!1)}),v.className="geBtn",h.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});v.className="geBtn gePrimaryBtn";h.appendChild(v);a.editor.cancelFirst||h.appendChild(n);e.appendChild(h);this.container=e};var x=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(x.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=
this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=
-!(!a.getContext||!a.getContext("2d"))}catch(n){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}try{b=
+!(!a.getContext||!a.getContext("2d"))}catch(n){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(g){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}try{b=
document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(n){}})();EditorUi.prototype.openLink=function(a){return window.open(a)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};
EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||
-!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color=
-"white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight="10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),g.innerHTML=e+"...",d.appendChild(g),c.status=g,mxClient.IS_VML&&
-(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};
-return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=
-mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(p){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>d&&(b=c.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var n=
-mxUtils.parseXml(c),h=this.editor.extractGraphModel(n.documentElement,null!=this.pages),b=null!=h?mxUtils.getXml(h):""}catch(x){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,
-!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=
+!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var h=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(h=document.createElement("div"),h.style.position="absolute",h.style.whiteSpace="nowrap",h.style.background="#4B4243",h.style.color=
+"white",h.style.fontFamily="Helvetica, Arial",h.style.fontSize="9pt",h.style.padding="6px",h.style.paddingLeft="10px",h.style.paddingRight="10px",h.style.zIndex=2E9,h.style.left=Math.max(0,a)+"px",h.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(h.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(h.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(h.style,"boxShadow","2px 2px 3px 0px #ddd"),h.innerHTML=e+"...",d.appendChild(h),c.status=h,mxClient.IS_VML&&
+(null==document.documentMode||8>=document.documentMode)&&(h.style.left=Math.round(Math.max(0,a-h.offsetWidth/2))+"px",h.style.top=Math.round(Math.max(0,b+70-h.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),h=!0);return h};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};
+return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var h=c(a,4);if(null!=b&&b(e-8,h,d))break;value=c(a,d);c(a,4);if("IEND"==h)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=
+mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(m){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>d&&(b=c.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var n=
+mxUtils.parseXml(c),g=this.editor.extractGraphModel(n.documentElement,null!=this.pages),b=null!=g?mxUtils.getXml(g):""}catch(x){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,
+!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var g=this.updatePageRoot(new DiagramPage(d[e]));null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,g,0==e?g:null,0))}}else"0"!=
urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};
-EditorUi.prototype.createFileData=function(a,b,d,e,n,h,k,u,m,r){b=null!=b?b:this.editor.graph;n=null!=n?n:!1;m=null!=m?m:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var p=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(p);if(b.decompress(g)!=p)return p;p=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(p,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(p)}r?
-(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.setAttribute("userAgent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!h&&!n&&(k||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(h||!n&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==
-d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,u,m,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=
-0;f<this.pages.length;f++){var e=this.pages[f].mapping;this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,n,h,k,u){n=null!=n?n:!0;k=null!=k?k:this.getXmlFileData(n,null!=
-h?h:!1);h=this.editor.graph;var c=this.getCurrentFile();if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=c&&/(\.svg)$/i.test(c.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var f=h.getGlobalVariable,g=this.pages[0];h.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(g.root)}a=this.createFileData(k,h,c,window.location.href,a,b,d,e,n,u);h!=this.editor.graph&&h.container.parentNode.removeChild(h.container);
-return a};EditorUi.prototype.getHtml=function(a,b,d,e,n,h){h=null!=h?h:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=h?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;h=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==n&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",h);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom",
-"1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=n&&(n=n.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':
-">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+"</head>\n<body"+(null==n&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+"</div>\n</div>\n"+(null==n?'<script type="text/javascript" src="'+f+'">\x3c/script>':
-'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,n){null!=n&&(n=n.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,
-this.currentPage));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
+EditorUi.prototype.createFileData=function(a,b,d,e,n,g,k,u,l,t){b=null!=b?b:this.editor.graph;n=null!=n?n:!1;l=null!=l?l:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var h=a;if("mxfile"!=h.nodeName.toLowerCase()){var m=b.zapGremlins(mxUtils.getXml(a)),h=b.compress(m);if(b.decompress(h)!=m)return m;m=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(m,h);h=a.ownerDocument.createElement("mxfile");h.appendChild(m)}t?
+(h=h.cloneNode(!0),h.removeAttribute("userAgent"),h.removeAttribute("version"),h.removeAttribute("editor"),h.removeAttribute("type")):(h.setAttribute("userAgent",navigator.userAgent),h.setAttribute("version",EditorUi.VERSION),h.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&h.setAttribute("type",a));a=mxUtils.getXml(h);if(!g&&!n&&(k||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(h),b,null!=d?d.getTitle():null,c,f);else if(g||!n&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==
+d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,u,l,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=
+0;f<this.pages.length;f++){var e=this.pages[f].mapping;this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,n,g,k,u,l){n=null!=n?n:!0;k=null!=k?k:this.getXmlFileData(n,null!=
+g?g:!1);l=null!=l?l:this.getCurrentFile();g=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=l&&/(\.svg)$/i.test(l.getTitle()))){g=this.createTemporaryGraph(g.getStylesheet());var c=g.getGlobalVariable,f=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(f.root)}a=this.createFileData(k,g,l,window.location.href,a,b,d,e,n,u);g!=this.editor.graph&&
+g.container.parentNode.removeChild(g.container);return a};EditorUi.prototype.getHtml=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=g?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),h=b.view.scale;g=Math.floor(c.x/h-b.view.translate.x);h=Math.floor(c.y/h-b.view.translate.y);c=b.background;null==n&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",g);a.setAttribute("y0",
+h)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=n&&(n=n.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+"</head>\n<body"+(null==n&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+
+"</div>\n</div>\n"+(null==n?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,n){null!=n&&(n=n.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};
+null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==n?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;var c=null!=a&&0<a.length?
mxUtils.parseXml(a).documentElement:null;a=null!=c?this.editor.extractGraphModel(c,!0):null;null!=a&&(c=a);if(null!=c&&"mxfile"==c.nodeName&&(a=c.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<a.length||1==a.length&&a[0].hasAttribute("name"))){this.fileNode=c;this.pages=[];for(c=0;c<a.length;c++){var b=new DiagramPage(a[c]);null==b.getName()&&b.setName(mxResources.get("pageWithNumber",[c+1]));this.pages.push(b)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||
0))];c=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=c&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(c);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(){var a=this.getCurrentFile(),a=null!=a&&null!=
-a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,d,e,n,h){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(),f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,n));this.saveData(f,a,g,"text/xml")}else if("html"==
-a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,g,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var d=this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var f=this.createDownloadRequest(c,a,e,b);this.editor.graph.pageVisible=d;return f}catch(G){this.handleError(G)}}));else{var p=null,k=
-mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);var l=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(l);this.convertImages(l,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();k('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
-mxUtils.getXml(a))})))}else f=c+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();k(a)}),e)}}catch(E){this.handleError(E)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var g=
-0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){f="&from="+g;break}return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();
+a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,d,e,n,g){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(),f=c+"."+a;if("xml"==a){var h='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,n));this.saveData(f,a,h,"text/xml")}else if("html"==
+a)h=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,h,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var d=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var f=this.createDownloadRequest(c,a,e,b);this.editor.graph.pageVisible=d;return f}catch(H){this.handleError(H)}}));else{var m=null,k=
+mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(m)}))});if("svg"==a){var l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);var p=this.editor.graph.getSvg(l,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(p);this.convertImages(p,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();k('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
+mxUtils.getXml(a))})))}else f=c+".svg",m=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();k(a)}),e)}}catch(F){this.handleError(F)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var h=
+0;h<this.pages.length;h++)if(this.pages[h]==this.currentPage){f="&from="+h;break}return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);
a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>"));!this.editor.chromeless||this.editor.editable?
(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.lightbox&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));c=!0;this.isOffline()||null==a.getMode()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),
mode:a.getMode()})}catch(n){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(n){}}catch(n){null!=window.console&&console.log("error in fileLoaded:",a,n);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=n&&null!=n.message?":err:"+encodeURIComponent(n.message):"")+(null!=
-n&&null!=n.stack?"&stack="+encodeURIComponent(n.stack):"")}catch(h){}this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
-"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,n,h,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
+n&&null!=n.stack?"&stack="+encodeURIComponent(n.stack):"")}catch(g){}this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:
+"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(h){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,n,g,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,
function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),
".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;
var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=
this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){if(0==c.length&&a.isEditable())null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding=
-"8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],g=e.data;if(null!=g){var g=this.convertDataUri(g),h="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(h+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(h+"image="+g,e.w,e.h,"",e.title||"",!1,!1,!0))}else null!=e.xml&&(g=this.stringToCells(this.editor.graph.decompress(e.xml)),0<g.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(g,
-e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
-mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var m=k.parentNode.previousSibling;d=m.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&m.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);
-var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");m.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("align","top");l.setAttribute("border","0");l.className="geButton";l.style.marginRight="1px";l.style.marginTop="-1px";r.appendChild(l);var w=
-null;mxEvent.addListener(l,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=w?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q=this.editor.graph,t=null,B=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),F=mxUtils.bind(this,function(c){a.setModified(!0);
-a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=l.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",r.insertBefore(t,r.firstChild),m.style.paddingRight=18*r.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),m.style.paddingRight=18*r.childNodes.length+
-"px")})):null==w&&(w=l.cloneNode(!1),w.setAttribute("src",IMAGE_PATH+"/download.png"),w.setAttribute("title",mxResources.get("save")),r.insertBefore(w,r.firstChild),mxEvent.addListener(w,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==w||a.isModified()||(m.style.paddingRight=18*r.childNodes.length+"px",w.parentNode.removeChild(w),w=null)});mxEvent.consume(c)})),m.style.paddingRight=18*r.childNodes.length+"px")}),C=
-mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);null!=h&&h.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);F(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),
-G=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x;b.y-=q.view.translate.y;C(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},
-mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&
-null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,G(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor=
-"",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
-mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,p,n,r,u,m){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,n),c)],c[0].vertex=
-!0,C(c,new mxRectangle(0,0,p,n),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var l=!1,x=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);F(a);this.spinner.stop();l=!0}catch(V){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=
-g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var h=mxUtils.getTextContent(p[g]),n=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(n);C(n,new mxRectangle(0,0,r.width,r.height),a)}l=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}l||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});!this.isOffline()&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=m?this.parseFile(m,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border=
-"3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",IMAGE_PATH+"/edit.gif");l.setAttribute("title",mxResources.get("edit"));r.insertBefore(l,r.firstChild);mxEvent.addListener(l,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});d=l.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));r.insertBefore(d,r.firstChild);mxEvent.addListener(d,"click",
-G);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:gray;text-decoration:none;",d.className="geButton",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(d,r.firstChild))}m.appendChild(r);m.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||
+"8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],h=e.data;if(null!=h){var h=this.convertDataUri(h),g="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(g+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(g+"image="+h,e.w,e.h,"",e.title||"",!1,!1,!0))}else null!=e.xml&&(h=this.stringToCells(this.editor.graph.decompress(e.xml)),0<h.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(h,
+e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var h=0;h<b.length;h++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,
+mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[h]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var l=k.parentNode.previousSibling;d=l.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);
+var t=document.createElement("div");t.style.position="absolute";t.style.right="0px";t.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(t.style.backgroundColor="inherit");l.style.position="relative";var p=document.createElement("img");p.setAttribute("src",Dialog.prototype.closeImage);p.setAttribute("title",mxResources.get("close"));p.setAttribute("align","top");p.setAttribute("border","0");p.className="geButton";p.style.marginRight="1px";p.style.marginTop="-1px";t.appendChild(p);var q=
+null;mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var w=this.editor.graph,r=null,B=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),G=mxUtils.bind(this,function(c){a.setModified(!0);
+a.isAutosave()?(null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r),r=p.cloneNode(!1),r.setAttribute("src",Editor.spinImage),r.setAttribute("title",mxResources.get("saving")),r.style.cursor="default",r.style.marginRight="2px",r.style.marginTop="-2px",t.insertBefore(r,t.firstChild),l.style.paddingRight=18*t.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=r&&null!=r.parentNode&&(r.parentNode.removeChild(r),l.style.paddingRight=18*t.childNodes.length+
+"px")})):null==q&&(q=p.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title",mxResources.get("save")),t.insertBefore(q,t.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(l.style.paddingRight=18*t.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(c)})),l.style.paddingRight=18*t.childNodes.length+"px")}),C=
+mxUtils.bind(this,function(a,c,d,e){a=w.cloneCells(mxUtils.sortCells(w.model.getTopmostCells(a)));for(var h=0;h<a.length;h++){var g=w.getCellGeometry(a[h]);null!=g&&g.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);G(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),
+H=mxUtils.bind(this,function(a){if(w.isSelectionEmpty())w.getRubberband().isActive()?(w.getRubberband().execute(a),w.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=w.getSelectionCells(),b=w.view.getBounds(c),d=w.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=w.view.translate.x;b.y-=w.view.translate.y;C(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},
+mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.panningManager&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",w.panningManager.stop(),w.autoScroll=!1,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!1),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){w.isMouseDown&&
+null!=w.panningManager&&null!=w.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,w.panningManager.stop(),w.graphHandler.reset(),w.isMouseDown=!1,w.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor=
+"",w.autoScroll=!0,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!0),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),
+mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,h,g,m,n,t,l,p){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=
+!0,C(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var u=!1,x=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var h=mxUtils.parseXml(c);if("mxlibrary"==h.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(h.documentElement));e(g,k);b=b.concat(g);G(a);this.spinner.stop();u=!0}catch(V){}else if("mxfile"==h.documentElement.nodeName)try{for(var m=
+h.documentElement.getElementsByTagName("diagram"),h=0;h<m.length;h++){var g=mxUtils.getTextContent(m[h]),n=this.stringToCells(this.editor.graph.decompress(g)),t=this.editor.graph.getBoundingBoxFromGeometry(n);C(n,new mxRectangle(0,0,t.width,t.height),a)}u=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});!this.isOffline()&&
+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,t)&&null!=p?this.parseFile(p,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border=
+"3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));p=p.cloneNode(!1);p.setAttribute("src",IMAGE_PATH+"/edit.gif");p.setAttribute("title",mxResources.get("edit"));t.insertBefore(p,t.firstChild);mxEvent.addListener(p,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});d=p.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));t.insertBefore(d,t.firstChild);mxEvent.addListener(d,"click",
+H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:gray;text-decoration:none;",d.className="geButton",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),t.insertBefore(d,t.firstChild))}l.appendChild(t);l.style.paddingRight=18*t.childNodes.length+"px"}};"1"==urlParams.offline||
EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));
a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet","styles/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",
Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet","styles/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",
@@ -2755,135 +2755,135 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM
"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,e,n){a=new ImageDialog(this,a,b,d,e,n);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
!0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,n){a=new LibraryDialog(this,a,b,d,e,n);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");
a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d){var c=null!=this.spinner&&null!=
-this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
+this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),h=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),h=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a=
-mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,g)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,n,h,k){a=new ErrorDialog(this,a,b,d,e,n,h,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
+mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,h)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,n,g,k){a=new ErrorDialog(this,a,b,d,e,n,g,k);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,n){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,n)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};
EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};
EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,n){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height=
"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&"undefined"!==typeof c.download;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(u){}}else this.createEchoRequest(a,
-b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var m=1024*k,l=Math.min(m+1024,d),r=Array(l-m),q=0;m<l;++q,++m)r[q]=
-c[m].charCodeAt(0);e[k]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,
-!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(w){this.handleError(w)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,h,k,null,null,4<n?3:4,a,d,e);this.showDialog(b.container,380,n==(mxClient.IS_IOS?0:1)?160:4<n?390:270,!0,!0);b.init()};
+b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var l=1024*k,p=Math.min(l+1024,d),t=Array(p-l),q=0;l<p;++q,++l)t[q]=
+c[l].charCodeAt(0);e[k]=new Uint8Array(t)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,g,k){g=null!=g?g:!1;k=null!=k?k:"vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,
+!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(y){this.handleError(y)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,null,4<n?3:4,a,d,e);this.showDialog(b.container,380,n==(mxClient.IS_IOS?0:1)?160:4<n?390:270,!0,!0);b.init()};
EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,
!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");
var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=
d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height=
"auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,
-n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,h,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,
-a,h,!0,c,d)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,c,d)}catch(A){this.handleError(A)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
-!1,!1,k,null,null,4<c?3:4,e,h,n);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,n,h){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,h,k,m,l){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;
-c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,m,null,d);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,l));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,
-this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==
-this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,h){h=null!=h?h:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");h&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,
+n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,g,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,
+a,g,!0,c,d)}catch(w){this.handleError(w)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,c,d)}catch(w){this.handleError(w)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
+!1,!1,k,null,null,4<c?3:4,e,g,n);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,n,g){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,g,k,l,p){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;
+c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,l,null,d);e&&this.editor.graph.addSvgShadow(f);var h=this.getBaseFilename()+".svg",m=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,p));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,
+this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==
+this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,m,this.thumbImageCache)):m(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,
b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));f.appendChild(d);d=document.createElement("option");
d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");f.appendChild(d);a.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"==f.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||
b.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+
Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");
f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=
-mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,n,h,k,m){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
-a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=n&&0<n.length&&f.push("edit="+encodeURIComponent(n)),h&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),m||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?
+mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,n,g,k,l){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=n&&0<n.length&&f.push("edit="+encodeURIComponent(n)),g&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),l||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,
-b,d,e,n,h,k,m,l,r,q){this.getBasenames();var c={};""!=n&&n!=mxConstants.NONE&&(c.highlight=n);"auto"!==e&&(c.target=e);l||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];k&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);m&&d.push("layers");0<d.length&&(l&&d.push("lightbox"),c.toolbar=d.join(" "));null!=r&&0<r.length&&(c.edit=r);null!=
-a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
-'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
-p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","type-embedhtmldialog");f=p.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(p);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));g.appendChild(k);var r=this.getCurrentFile();null==d&&null!=r&&r.constructor==window.DriveFile&&(k=
-document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==d&&p.setAttribute("disabled","disabled");c.appendChild(g);var m=this.addLinkSection(c),l=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
-":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value="100%";c.appendChild(q);var t=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(c,mxResources.get("allPages"),g,!g),F=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),G=this.addEditButton(c,C),z=G.getEditInput();
-z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&C.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(p.checked?d:null,l.checked,q.value,m.getTarget(),m.getColor(),t.checked,B.checked,F.checked,C.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
-EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,k,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
-p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");
-n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
-this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,l=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",c.appendChild(m),mxUtils.write(c,mxResources.get("height")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.width="50px",
-l.style.marginLeft="6px",l.style.marginBottom="10px",l.value=e+"px",c.appendChild(l),mxUtils.br(c);var q=this.addLinkSection(c,h);d=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var F=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,F),G=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=G.style.marginLeft;z.style.marginBottom="16px";
-z.style.marginTop="8px";mxEvent.addListener(F,"change",function(){F.checked?(z.removeAttribute("disabled"),G.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"));G.checked&&F.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){k(q.getTarget(),q.getColor(),null==t?!0:t.checked,F.checked,C.getLink(),z.checked,null!=m?m.value:null,null!=
-l?l.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
-c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!g.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,k,h,m,l){m=null!=m?m:!0;var c=document.createElement("div");c.style.whiteSpace=
-"nowrap";var f=this.editor.graph,g="jpeg"==l?170:280,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(n);mxUtils.write(c,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value=this.lastExportZoom||"100%";c.appendChild(p);mxUtils.write(c,mxResources.get("borderWidth")+
-":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var q=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),x=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),t=document.createElement("input");t.style.marginTop="16px";t.style.marginRight=
-"8px";t.style.marginLeft="24px";t.setAttribute("disabled","disabled");t.setAttribute("type","checkbox");h&&(c.appendChild(t),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(x,"change",function(){x.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(t.setAttribute("checked","checked"),t.defaultChecked=!0);var G=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop=
-"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var H=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),m,null,null,"jpeg"!=l),J=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=l);K.style.marginLeft="24px";K.style.marginBottom="16px";J||(K.style.visibility=
-"hidden");mxEvent.addListener(H,"change",function(){H.checked&&J?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});m&&J||K.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=p.value;k(p.value,q.checked,!x.checked,G.checked,H.checked,z.checked,u.value,t.checked,!K.checked)}),null,d,e);this.showDialog(a.container,320,g,!0,!0);p.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
-mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var p=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,
-!e),m=this.addCheckbox(c,d),l=this.addCheckbox(c,mxResources.get("lightbox"),!0),q=this.addEditButton(c,l),t=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),F=this.addCheckbox(c,mxResources.get("layers"),B,!B);F.style.marginLeft=t.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(l,"change",function(){l.checked?(B&&F.removeAttribute("disabled"),t.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));
-t.checked&&l.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(p.checked,n.checked,m.checked,l.checked,q.getLink(),F.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,k,h,m,l){function c(c){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var p="";d&&(p=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');m('<img src="'+c+'"'+p+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}),
-null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?c("data:image/png;base64,"+p.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,d,e,k,h,m){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",l="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");a&&(l+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=l?' style="'+l+'"':"")+n+"/>")}))}else l="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
-(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}}})(this);"),l+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),l+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=l&&c.setAttribute("style",l),m(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+
+b,d,e,n,g,k,l,p,t,q){this.getBasenames();var c={};""!=n&&n!=mxConstants.NONE&&(c.highlight=n);"auto"!==e&&(c.target=e);p||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];k&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);l&&d.push("layers");0<d.length&&(p&&d.push("lightbox"),c.toolbar=d.join(" "));null!=t&&0<t.length&&(c.edit=t);null!=
+a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";q(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
+m.setAttribute("value","url");m.setAttribute("type","radio");m.setAttribute("name","type-embedhtmldialog");f=m.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(k);mxUtils.br(h);h.appendChild(m);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));h.appendChild(k);var l=this.getCurrentFile();null==d&&null!=l&&l.constructor==window.DriveFile&&(k=
+document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),h.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));f.setAttribute("checked","checked");null==d&&m.setAttribute("disabled","disabled");c.appendChild(h);var p=this.addLinkSection(c),q=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
+":");var w=document.createElement("input");w.setAttribute("type","text");w.style.marginRight="16px";w.style.width="60px";w.style.marginLeft="4px";w.style.marginRight="12px";w.value="100%";c.appendChild(w);var r=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,B=B=this.addCheckbox(c,mxResources.get("allPages"),h,!h),G=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,C),z=H.getEditInput();
+z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&C.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(m.checked?d:null,q.checked,w.value,p.getTarget(),p.getColor(),r.checked,B.checked,G.checked,C.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
+EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,k,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
+m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));m.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";m.appendChild(n);c.appendChild(m);n=document.createElement("a");
+n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));m.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
+this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,p=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",c.appendChild(l),mxUtils.write(c,mxResources.get("height")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.width="50px",
+p.style.marginLeft="6px",p.style.marginBottom="10px",p.value=e+"px",c.appendChild(p),mxUtils.br(c);var q=this.addLinkSection(c,g);d=null!=this.pages&&1<this.pages.length;var r=null;if(null==h||h.constructor!=window.DriveFile||b)r=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var G=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,G),H=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=H.style.marginLeft;z.style.marginBottom="16px";
+z.style.marginTop="8px";mxEvent.addListener(G,"change",function(){G.checked?(z.removeAttribute("disabled"),H.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&G.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){k(q.getTarget(),q.getColor(),null==r?!0:r.checked,G.checked,C.getLink(),z.checked,null!=l?l.value:null,null!=
+p?p.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=l?(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
+c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,k,g,l,p){l=null!=l?l:!0;var c=document.createElement("div");c.style.whiteSpace=
+"nowrap";var f=this.editor.graph,h="jpeg"==p?170:280,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(n);mxUtils.write(c,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";c.appendChild(m);mxUtils.write(c,mxResources.get("borderWidth")+
+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";c.appendChild(u);mxUtils.br(c);var q=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=p),x=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),r=document.createElement("input");r.style.marginTop="16px";r.style.marginRight=
+"8px";r.style.marginLeft="24px";r.setAttribute("disabled","disabled");r.setAttribute("type","checkbox");g&&(c.appendChild(r),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(x,"change",function(){x.checked?r.removeAttribute("disabled"):r.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(r.setAttribute("checked","checked"),r.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop=
+"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),h+=26);var L=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=p),E=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(c,E?mxResources.get("allPages"):"",E,!E,null,"jpeg"!=p);I.style.marginLeft="24px";I.style.marginBottom="16px";E||(I.style.visibility=
+"hidden");mxEvent.addListener(L,"change",function(){L.checked&&E?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});l&&E||I.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;k(m.value,q.checked,!x.checked,H.checked,L.checked,z.checked,u.value,r.checked,!I.checked)}),null,d,e);this.showDialog(a.container,320,h,!0,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
+mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var m=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,
+!e),l=this.addCheckbox(c,d),p=this.addCheckbox(c,mxResources.get("lightbox"),!0),q=this.addEditButton(c,p),r=q.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),G=this.addCheckbox(c,mxResources.get("layers"),B,!B);G.style.marginLeft=r.style.marginLeft;G.style.marginBottom="12px";G.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(B&&G.removeAttribute("disabled"),r.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),r.setAttribute("disabled","disabled"));
+r.checked&&p.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(m.checked,n.checked,l.checked,p.checked,q.getLink(),G.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,k,g,l,p){function c(c){var b=" ",h="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(k?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",h+="cursor:pointer;");a&&(h+="max-width:100%;");var m="";d&&(m=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');l('<img src="'+c+'"'+m+(""!=h?' style="'+h+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){p({message:mxResources.get("unknownError")})}),
+null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var h="";d&&(h="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+h+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?c("data:image/png;base64,"+m.getText()):p({message:mxResources.get("unknownError")})}))}else p({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,d,e,k,g,l){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var h=0;h<f.length;h++){var m=f[h].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==f[h].getAttribute("target")&&f[h].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",p="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(k?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){l('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=p?' style="'+p+'"':"")+n+"/>")}))}else p="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
+(k?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),p+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),p+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=p&&c.setAttribute("style",p),l(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+
" "+mxResources.get("months");c=Math.floor(a/86400);if(1<c)return c+" "+mxResources.get("days");c=Math.floor(a/3600);if(1<c)return c+" "+mxResources.get("hours");c=Math.floor(a/60);return 1<c?c+" "+mxResources.get("minutes"):1==c?c+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0<
-d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(h){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph,
-e=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),e=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),f=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);
-c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==e&&(e=this.getFileData(!0));var f=d.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(r){null!=b&&b(r)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg=
-function(a,b,d,e,k,h,l){l=b.background;l==mxConstants.NONE&&(l=null);b=b.getSvg(l,null,null,null,null,h);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=k)this.convertImages(b,mxUtils.bind(this,function(a){k((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
-mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,k,h,l,m,q){q=null!=q?q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,k?this.getFileData(!0,null,null,null,d,m):null,q)}catch(w){"Invalid image"==w.message?this.downloadFile(q):this.handleError(w)}}),null,
-this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,h,l)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var h=
-b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,h))]);f.push('"'+b[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var l=b[k].indexOf(")"),m=null,r=b[k].indexOf("format(",l);0<r&&(m=c(b[k].substring(r+7,b[k].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))c=
-"application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;h()}),mxUtils.bind(this,
-function(a){d--;h()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[k].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,h,m,l,q,r,t,w,A,E){h=null!=h?h:!0;w=null!=w?w:this.editor.graph;A=null!=A?A:0;var c=q?null:w.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==q&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(w.getSvg(c,null,null,E,null,null!=m?m:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this,
-function(){try{var f=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=h?Math.min(1,Math.min(3*b/(4*n),b/g)):b/g);g=Math.ceil(l*g)+2*A;n=Math.ceil(l*n)+2*A;f.setAttribute("width",g);f.setAttribute("height",n);var p=f.getContext("2d");null!=c&&(p.beginPath(),p.rect(0,0,g,n),p.fillStyle=c,p.fill());p.scale(l,l);p.drawImage(e,A/l,A/l);a(f)}catch(Y){null!=k&&k(Y)}});e.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(d);
-var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(w,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(z){null!=k&&k(z)}}),d,t)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
-a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var h=a.getElementsByTagName(d),k=0;k<h.length;k++)mxUtils.bind(this,function(d){var h=
-e.convert(d.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var k=f[h];null==k?(c++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,k)}})(h[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,k,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
-a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}h=null!=h?h:"data:image/png;base64,";e=h+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,
+d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(g){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph,
+e=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),e=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),f=c.getGlobalVariable,h=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?h.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);
+c.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==e&&(e=this.getFileData(!0));var f=d.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(t){null!=b&&b(t)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg=
+function(a,b,d,e,k,g,l){l=b.background;l==mxConstants.NONE&&(l=null);b=b.getSvg(l,null,null,null,null,g);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=k)this.convertImages(b,mxUtils.bind(this,function(a){k((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
+mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,k,g,l,p,q){q=null!=q?q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,k?this.getFileData(!0,null,null,null,d,p):null,q)}catch(y){"Invalid image"==y.message?this.downloadFile(q):this.handleError(y)}}),null,
+this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,g,l)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},g=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],h=1;h<b.length;h++){var g=
+b[h].indexOf(")");f.push('url("');f.push(e[c(b[h].substring(0,g))]);f.push('"'+b[h].substring(g))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var l=b[k].indexOf(")"),p=null,t=b[k].indexOf("format(",l);0<t&&(p=c(b[k].substring(t+7,b[k].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==p||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))c=
+"application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;g()}),mxUtils.bind(this,
+function(a){d--;g()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[k].substring(0,l)),p)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,g,l,p,q,t,r,y,w,F){g=null!=g?g:!0;y=null!=y?y:this.editor.graph;w=null!=w?w:0;var c=q?null:y.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==q&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(y.getSvg(c,null,null,F,null,null!=l?l:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this,
+function(){try{var f=document.createElement("canvas"),h=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=g?Math.min(1,Math.min(3*b/(4*n),b/h)):b/h);h=Math.ceil(p*h)+2*w;n=Math.ceil(p*n)+2*w;f.setAttribute("width",h);f.setAttribute("height",n);var m=f.getContext("2d");null!=c&&(m.beginPath(),m.rect(0,0,h,n),m.fillStyle=c,m.fill());m.scale(p,p);m.drawImage(e,w/p,w/p);a(f)}catch(Y){null!=k&&k(Y)}});e.onerror=function(a){null!=k&&k(a)};try{t&&this.editor.graph.addSvgShadow(d);
+var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(y,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(z){null!=k&&k(z)}}),d,r)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;
+a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,h){for(var g=a.getElementsByTagName(d),k=0;k<g.length;k++)mxUtils.bind(this,function(d){var g=
+e.convert(d.getAttribute(h));if(null!=g&&"data:"!=g.substring(0,5)){var k=f[g];null==k?(c++,this.convertImageToDataUri(g,function(e){null!=e&&(f[g]=e,d.setAttribute(h,e));c--;0==c&&b(a)})):d.setAttribute(h,k)}})(g[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,k,g){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=
+a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}g=null!=g?g:"data:image/png;base64,";e=g+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,
function(){k&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(v){null!=d&&d(v)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=
-function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,k){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),n=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var p=n.getElementsByTagName("diagram");
-if(1==p.length)n=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){f.model.beginUpdate();try{for(a=0;a<p.length;a++){var l=this.updatePageRoot(new DiagramPage(p[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=n&&"mxGraphModel"===n.nodeName&&(c=f.importGraphModel(n,b,d,e))}}catch(A){throw k||this.handleError(A,mxResources.get("invalidOrMissingFile")),
-A;}return c};EditorUi.prototype.importLucidChart=function(a,b,d,e,k){var c=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,k)}catch(x){this.handleError(x)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,k){k=JSON.parse(a);a=
+function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,k){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var h=mxUtils.parseXml(a),n=this.editor.extractGraphModel(h.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var m=n.getElementsByTagName("diagram");
+if(1==m.length)n=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(m[0]))).documentElement;else if(1<m.length){f.model.beginUpdate();try{for(a=0;a<m.length;a++){var l=this.updatePageRoot(new DiagramPage(m[a])),p=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[p+1]));f.model.execute(new ChangePage(this,l,l,p))}}finally{f.model.endUpdate()}}}null!=n&&"mxGraphModel"===n.nodeName&&(c=f.importGraphModel(n,b,d,e))}}catch(w){throw k||this.handleError(w,mxResources.get("invalidOrMissingFile")),
+w;}return c};EditorUi.prototype.importLucidChart=function(a,b,d,e,k){var c=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,k)}catch(x){this.handleError(x)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,k){k=JSON.parse(a);a=
[];if(null!=k.state){k=JSON.parse(k.state);for(var c in k.Pages)a.push(k.Pages[c]);a.sort(function(a,c){return a.Properties.Order<c.Properties.Order?-1:a.Properties.Order>c.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=
-function(a,b,d,e,k,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=
-this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,h,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,
-function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),g=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,
-null,"",c.snap(b),c.snap(d),g,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
-if(this.isCompatibleString(a))return this.importXml(a,b,d,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,h);else{c=this.editor.graph;k=null;c.getModel().beginUpdate();try{k=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,c.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(k.value)&&
+function(a,b,d,e,k,g,l){g=null!=g?g:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=
+this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),h=this.importXml(f,b,d,g,!0);if(0<h.length)return h}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),h=this.importXml(f,b,d,g,!0),0<h.length)return h}catch(A){}this.loadImage(a,mxUtils.bind(this,
+function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),h=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,
+null,"",c.snap(b),c.snap(d),h,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
+if(this.isCompatibleString(a))return this.importXml(a,b,d,g);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,g);else{c=this.editor.graph;k=null;c.getModel().beginUpdate();try{k=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value=a,c.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(k.value)&&
c.setLinkForCell(k,k.value),k.geometry.width+=c.gridSize,k.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[k]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=
-function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,d,e,k,h,l,m,q,r,t){r=null!=r?r:!0;var c=!1,f=null;"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,r),q=!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
-1))),r&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,r);null!=m&&m(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(c=!0,this.parseFile(null!=
-q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,l))):b=this.importXml(a,d,e,r));null!=m&&m(b)}}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,r));c||null==m||m(f);return f};
-EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,h,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}h=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&
-240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};
-EditorUi.prototype.importFiles=function(a,b,d,e,k,h,l,m,q,r,t,w){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=t||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>p){g=!0;break}var u=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,e,f,g,h,k,p){return null!=a&&"<mxlibrary"==a.substring(0,
-10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,d,e,f,g,h,k,p,c,w)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,q=n,u=[],x=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(u);else{var c=[];g.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{g.getModel().endUpdate()}}h(c)}}),
-v=0;v<n;v++)mxUtils.bind(this,function(c){var h=a[c],n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var n=a.target.result,m=n.indexOf(","),q=decodeURIComponent(escape(atob(n.substring(m+1)))),z=mxUtils.parseXml(q),q=z.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=w?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));
-null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?x(c,mxUtils.bind(this,function(){try{if(n.substring(0,m+1),null!=z){var a=z.getElementsByTagName("svg");if(0<a.length){var f=a[0],l=parseFloat(f.getAttribute("width")),r=parseFloat(f.getAttribute("height")),q=f.getAttribute("viewBox");if(null==q||0==q.length)f.setAttribute("viewBox","0 0 "+l+" "+r);else if(isNaN(l)||isNaN(r)){var u=q.split(" ");3<u.length&&(l=parseFloat(u[2]),
-r=parseFloat(u[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var t=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,r)),x=k(n,h.type,b+c*p,d+c*p,Math.max(1,Math.round(l*t)),Math.max(1,Math.round(r*t)),h.name);if(isNaN(l)||isNaN(r)){var H=new Image;H.onload=mxUtils.bind(this,function(){l=Math.max(1,H.width);r=Math.max(1,H.height);x[0].geometry.width=l;x[0].geometry.height=r;f.setAttribute("viewBox","0 0 "+l+" "+r);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,
-a)+n.substring(n.indexOf(",",a+1)));g.setCellStyles("image",n,[x[0]])});H.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(ba){}return null})):x(c,mxUtils.bind(this,function(){return k(u,"text/xml",b+c*p,d+c*p,0,0,h.name)}))}}else{q=!1;if("image/png"==h.type){var H=w?null:this.extractGraphModelFromPng(a.target.result);if(null!=H&&0<H.length){var v=new Image;v.src=a.target.result;x(c,mxUtils.bind(this,function(){return k(H,"text/xml",b+c*p,d+c*p,v.width,v.height,h.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?
-(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,n,l){x(c,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var m=f&&this.isResampleImage(a.target.result,t)?Math.min(1,
-Math.min(e/n,e/l)):1;return k(g,h.type,b+c*p,d+c*p,Math.round(n*m),Math.round(l*m),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,t)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+c*p,d+c*p,240,160,h.name,function(a){x(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(h.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(h,
-mxUtils.bind(this,function(a){x(c,mxUtils.bind(this,function(){var b=h.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(h,mxUtils.bind(this,function(a){x(c,mxUtils.bind(this,function(){return this.importXml(a,b+c*p,d+c*p)}))})):k(null,h.type,b+c*p,d+c*p,240,160,h.name,function(a){x(c,function(){return a})},h):"image"==h.type.substring(0,5)?n.readAsDataURL(h):
-n.readAsText(h)})(v)});g?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},
+function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,d,e,k,g,l,p,q,t,r){t=null!=t?t:!0;var c=!1,f=null;"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=r?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,t),q=!0)),q||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+
+1))),t&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,k,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,t);null!=p&&p(a)})):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(c=!0,this.parseFile(null!=
+q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,l))):b=this.importXml(a,d,e,t));null!=p&&p(b)}}),l)):/(\.vsd)($|\?)/i.test(l)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,t));c||null==p||p(f);return f};
+EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,g,k;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&
+240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};
+EditorUi.prototype.importFiles=function(a,b,d,e,k,g,l,p,q,t,r,y){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,h=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var m=r||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>m){h=!0;break}var u=mxUtils.bind(this,function(){var h=this.editor.graph,m=h.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,e,f,h,g,k,m){return null!=a&&"<mxlibrary"==a.substring(0,
+10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,d,e,f,h,g,k,m,c,y)});g=null!=g?g:mxUtils.bind(this,function(a){h.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,q=n,u=[],v=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=p)p(u);else{var c=[];h.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{h.getModel().endUpdate()}}g(c)}}),
+x=0;x<n;x++)mxUtils.bind(this,function(c){var g=a[c],n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==l||l(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,p=n.indexOf(","),q=decodeURIComponent(escape(atob(n.substring(p+1)))),z=mxUtils.parseXml(q),q=z.getElementsByTagName("svg");if(0<q.length){var q=q[0],u=y?null:q.getAttribute("content");null!=u&&"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));
+null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?v(c,mxUtils.bind(this,function(){try{if(n.substring(0,p+1),null!=z){var a=z.getElementsByTagName("svg");if(0<a.length){var f=a[0],l=parseFloat(f.getAttribute("width")),t=parseFloat(f.getAttribute("height")),q=f.getAttribute("viewBox");if(null==q||0==q.length)f.setAttribute("viewBox","0 0 "+l+" "+t);else if(isNaN(l)||isNaN(t)){var u=q.split(" ");3<u.length&&(l=parseFloat(u[2]),
+t=parseFloat(u[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var r=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,t)),v=k(n,g.type,b+c*m,d+c*m,Math.max(1,Math.round(l*r)),Math.max(1,Math.round(t*r)),g.name);if(isNaN(l)||isNaN(t)){var E=new Image;E.onload=mxUtils.bind(this,function(){l=Math.max(1,E.width);t=Math.max(1,E.height);v[0].geometry.width=l;v[0].geometry.height=t;f.setAttribute("viewBox","0 0 "+l+" "+t);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,
+a)+n.substring(n.indexOf(",",a+1)));h.setCellStyles("image",n,[v[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(f))}return v}}}catch(ba){}return null})):v(c,mxUtils.bind(this,function(){return k(u,"text/xml",b+c*m,d+c*m,0,0,g.name)}))}}else{q=!1;if("image/png"==g.type){var E=y?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var x=new Image;x.src=a.target.result;v(c,mxUtils.bind(this,function(){return k(E,"text/xml",b+c*m,d+c*m,x.width,x.height,g.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?
+(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,n,l){v(c,mxUtils.bind(this,function(){if(null!=h&&h.length<t){var p=f&&this.isResampleImage(a.target.result,r)?Math.min(1,
+Math.min(e/n,e/l)):1;return k(h,g.type,b+c*m,d+c*m,Math.round(n*p),Math.round(l*p),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,r)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,g.type,b+c*m,d+c*m,240,160,g.name,function(a){v(c,function(){return a})})});/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?"1"==urlParams.dev?/(\.vssx)($|\?)/i.test(g.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(g,
+mxUtils.bind(this,function(a){v(c,mxUtils.bind(this,function(){var b=g.name;null!=b&&".vssx"==b.toLowerCase().substring(b.length-5)&&(b=b.substring(0,b.length-5)+".xml");this.loadLibrary(new LocalLibrary(this,a,b))}))})):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(g,mxUtils.bind(this,function(a){v(c,mxUtils.bind(this,function(){return this.importXml(a,b+c*m,d+c*m)}))})):k(null,g.type,b+c*m,d+c*m,240,160,g.name,function(a){v(c,function(){return a})},g):"image"==g.type.substring(0,5)?n.readAsDataURL(g):
+n.readAsText(g)})(x)});h?this.confirmImageResize(function(a){f=a;u()},q):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},
function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=
-function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,h){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(c/k,f/k);if(1<g){var p=Math.round(c/g),n=Math.round(f/g),l=document.createElement("canvas");l.width=p;l.height=n;l.getContext("2d").drawImage(a,0,0,p,n);var m=l.toDataURL();if(m.length<b.length){var q=
-document.createElement("canvas");q.width=p;q.height=n;var t=q.toDataURL();m!==t&&(b=m,c=p,f=n)}}}catch(F){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var d=e,k=0;8>k;k++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[e]=d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,b){var c=p;p+=b;return a.substring(c,p)}
-function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,p);do{var n=f(a);if("IDAT"==c(a,4)){k=a.substring(0,p-8);d=d+String.fromCharCode(0)+
-("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);k+=g(d.length)+b+d+g(e^4294967295);k+=a.substring(p-8,a.length);break}k+=a.substring(p-8,p-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
+function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,g){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,g))try{var h=Math.max(c/k,f/k);if(1<h){var m=Math.round(c/h),n=Math.round(f/h),l=document.createElement("canvas");l.width=m;l.height=n;l.getContext("2d").drawImage(a,0,0,m,n);var p=l.toDataURL();if(p.length<b.length){var q=
+document.createElement("canvas");q.width=m;q.height=n;var r=q.toDataURL();p!==r&&(b=p,c=m,f=n)}}}catch(G){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var d=e,k=0;8>k;k++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[e]=d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,b){var c=m;m+=b;return a.substring(c,m)}
+function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function h(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var m=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,m);do{var n=f(a);if("IDAT"==c(a,4)){k=a.substring(0,m-8);d=d+String.fromCharCode(0)+
+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);k+=h(d.length)+b+d+h(e^4294967295);k+=a.substring(m-8,a.length);break}k+=a.substring(m-8,m-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,
function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(n){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=
-function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var m=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph,e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
-b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var k=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};k.call(this,b,c,e)};m.apply(this,arguments);
-mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,
-arguments)};var l=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var g=c.indexOf(",");0<g&&(g=b.getPageById(c.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=l.call(this,c,e);f&&mxEvent.addListener(g,"click",function(b){a(c);mxEvent.consume(b)});return g};var q=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");null==f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?q.apply(this,arguments):
-(d.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var r=function(){window.setTimeout(function(){y.innerHTML="&nbsp;";y.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
+function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,d=this.editor.graph,e=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==
+b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var k=d.addClickHandler;d.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!d.isPageLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(c),mxEvent.consume(b));null!=f&&f(b,c)};k.call(this,b,c,e)};l.apply(this,arguments);
+mxClient.IS_SVG&&this.editor.graph.addSvgShadow(d.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var g=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:g.apply(this,
+arguments)};var p=d.createLinkForHint;d.createLinkForHint=function(c,e){var f=d.isPageLink(c);if(f){var h=c.indexOf(",");0<h&&(h=b.getPageById(c.substring(h+1)),e=null!=h?h.getName():mxResources.get("pageNotFound"))}h=p.call(this,c,e);f&&mxEvent.addListener(h,"click",function(b){a(c);mxEvent.consume(b)});return h};var q=d.labelLinkClicked;d.labelLinkClicked=function(b,c,e){var f=c.getAttribute("href");null==f||!d.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?q.apply(this,arguments):
+(d.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var r=this.actions.get("print");r.setEnabled(!mxClient.IS_IOS||!navigator.standalone);r.visible=r.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=function(){window.setTimeout(function(){A.innerHTML="&nbsp;";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,
!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||d.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,
-d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(L){}}),
-!1);var y=document.createElement("div");y.style.position="absolute";y.style.whiteSpace="nowrap";y.style.overflow="hidden";y.style.display="block";y.contentEditable=!0;mxUtils.setOpacity(y,0);y.style.width="1px";y.style.height="1px";y.innerHTML="&nbsp;";var w=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||
-d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||w||(y.style.left=d.container.scrollLeft+10+"px",y.style.top=d.container.scrollTop+10+"px",d.container.appendChild(y),w=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){y.focus();document.execCommand("selectAll",!1,null)},0):(y.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
-function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!w||224!=b&&17!=b&&91!=b||(w=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),y.parentNode.removeChild(y))}),0)}));mxEvent.addListener(y,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(y),r())}));mxEvent.addListener(y,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(y,!0),r())}));mxEvent.addListener(y,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&
-!d.isCellLocked(d.getDefaultParent())&&(y.innerHTML="&nbsp;",y.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,y);y.innerHTML="&nbsp;"}),0))}),!0);var A=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==y?!0:A.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
+d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var h=f[index];if("file"===h.kind){if(b.isEditing())this.importFiles([h.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var g=this.editor.graph.getInsertPoint();this.importFiles([h.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(K){}}),
+!1);var A=document.createElement("div");A.style.position="absolute";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML="&nbsp;";var y=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==d.container||!d.isEnabled()||
+d.isMouseDown||d.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||y||(A.style.left=d.container.scrollLeft+10+"px",A.style.top=d.container.scrollTop+10+"px",d.container.appendChild(A),y=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll",!1,null)},0):(A.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,
+function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!y||224!=b&&17!=b&&91!=b||(y=!1,d.isEditing()||null!=this.dialog||null==d.container||d.container.focus(),A.parentNode.removeChild(A))}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){d.isEnabled()&&(mxClipboard.copy(d),this.copyCells(A),t())}));mxEvent.addListener(A,"cut",mxUtils.bind(this,function(a){d.isEnabled()&&(this.copyCells(A,!0),t())}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){d.isEnabled()&&
+!d.isCellLocked(d.getDefaultParent())&&(A.innerHTML="&nbsp;",A.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML="&nbsp;"}),0))}),!0);var w=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:w.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,
mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),
-d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=
+d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=
Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));
-a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var E=document.createElement("div");E.style.position="absolute";E.style.top="125px";E.style.left="220px";E.style.width="30px";E.style.height="1000px";E.style.background="whiteSmoke";document.body.appendChild(E);
-var B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,E,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.test){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
-this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
-this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(d.container,
+a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){r=document.createElement("div");r.style.position="absolute";r.style.top="95px";r.style.left="250px";r.style.width="2000px";r.style.height="30px";r.style.background="whiteSmoke";document.body.appendChild(r);var F=document.createElement("div");F.style.position="absolute";F.style.top="125px";F.style.left="220px";F.style.width="30px";F.style.height="1000px";F.style.background="whiteSmoke";document.body.appendChild(F);
+var B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="220px";B.style.width="30px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);this.vRuler=new mxRuler(this.editor.graph,F,!0);this.hRuler=new mxRuler(this.editor.graph,r,!1)}if("1"==urlParams.test){r=document.getElementById("geFooter");null!=r&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",
+this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),r.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=
+this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var G=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:G.apply(this,arguments)}}r=document.getElementById("geInfo");null!=r&&r.parentNode.removeChild(r);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(d.container,
"dragleave",function(a){d.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(d.container,"dragover",mxUtils.bind(this,function(a){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=this.highlightElement(d.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d.container,"drop",mxUtils.bind(this,function(a){null!=C&&(C.parentNode.removeChild(C),C=null);if(d.isEnabled()){var b=
-mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,g=b.y/e-c.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
-if(null!=b)d.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var p=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(k=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(k,
-f,g,!0,p,null,n))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,g,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-h+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
+mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=d.view.translate,e=d.view.scale,f=b.x/e-c.x,h=b.y/e-c.y;mxEvent.isAltDown(a)&&(h=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,h,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var g=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);
+if(null!=b)d.setSelectionCells(this.importXml(b,f,h,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=k;var m=null,c=b.getElementsByTagName("img");null!=c&&1==c.length?(k=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(k=b[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){d.setSelectionCells(this.insertTextAt(k,
+f,h,!0,m,null,n))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,b)),c/Math.max(1,a));d.setSelectionCell(d.insertVertex(null,null,"",f,h,b*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+g+";"))}),mxUtils.bind(this,function(a){d.setSelectionCells(this.insertTextAt(g,f,h,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&d.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,h,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};
EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);
mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
@@ -2895,11 +2895,11 @@ EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b
mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:
a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==
c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":
-"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+
-2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
+"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var g=document.documentElement;d=(e.clientWidth||g.clientWidth)-3;e=Math.max(e.clientHeight||0,g.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+
+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=b+"px";g.style.left=c+"px";g.style.width=Math.max(0,d-3)+"px";g.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length)if(!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml"),Graph.fileSupport&&
!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml",this.parseFile(a,mxUtils.bind(this,function(a){if(4==a.readyState)if(this.spinner.stop(),200<=a.status&&299>=a.status)if(a=a.responseText,"<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);null!=e&&".vssx"==e.toLowerCase().substring(e.length-5)&&(e=e.substring(0,
-filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
+filename.length-5)+".xml");try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b);else this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile"))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,
0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),
this.openLocalFile(d,e,b)});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),
this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),
@@ -2908,41 +2908,42 @@ b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.
function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden")};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
-this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
-h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(J){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
-JSON.parse(h)}catch(H){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
-value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
-function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(H){k.postMessage(JSON.stringify({event:"draft",
-error:H.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
-return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
-null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var m=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(m);k.postMessage(JSON.stringify(b),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
-h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),u=n.getGlobalVariable,x=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?x.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(n.container);n.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,
-function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");
-if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=h.format;else if("html"==h.format)m=this.editor.getGraphXml(),p.data=this.getHtml(m,this.editor.graph),p.xml=mxUtils.getXml(m),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";
-if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
-this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
-(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
-l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(H){this.handleError(H)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var z=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
-e=z();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=z();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
-b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=
-function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
-"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
-mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
-(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,q=40,t=0,w=this.editor.graph;w.getGraphBounds();for(var A=function(){w.setSelectionCells(T);
-w.scrollCellToVisible(w.getSelectionCell())},E=w.getFreeInsertPoint(),B=E.x,F=E.y,E=F,C=null,G="auto",z=[],H=null,J=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var R=mxUtils.trim(a.substring(1,Y)),P=mxUtils.trim(a.substring(Y+1));"label"==R?C=w.sanitizeHtml(P):"style"==R?e=P:"identity"==R&&0<P.length&&"-"!=P?h=
-P:"width"==R?k=P:"height"==R?l=P:"ignore"==R?J=P.split(","):"connect"==R?z.push(JSON.parse(P)):"link"==R?H=P:"padding"==R?t=parseFloat(P):"edgespacing"==R?m=parseFloat(P):"nodespacing"==R?q=parseFloat(P):"layout"==R&&(G=P)}}}var L=this.editor.csvToArray(b[K]);a=null;if(null!=h)for(var I=0;I<L.length;I++)if(h==L[I]){a=I;break}null==C&&(C="%"+L[0]+"%");if(null!=z)for(var M=0;M<z.length;M++)null==d[z[M].to]&&(d[z[M].to]={});w.model.beginUpdate();try{for(I=K+1;I<b.length;I++){var S=this.editor.csvToArray(b[I]);
-if(S.length==L.length){var D=null,W=null!=a?S[a]:null;null!=W&&(D=w.model.getCell(W));null==D&&(D=new mxCell(C,new mxGeometry(B,E,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var Q=0;Q<S.length;Q++)w.setAttributeForCell(D,L[Q],S[Q]);w.setAttributeForCell(D,"placeholders","1");D.style=w.replacePlaceholders(D,D.style);for(M=0;M<z.length;M++)d[z[M].to][D.getAttribute(z[M].to)]=D;null!=H&&"link"!=H&&(w.setLinkForCell(D,D.getAttribute(H)),w.setAttributeForCell(D,H,null));w.fireEvent(new mxEventObject("cellsInserted",
-"cells",[D]));var X=this.editor.graph.getPreferredSizeForCell(D);D.geometry.width="auto"==k?X.width+t:parseFloat(k);D.geometry.height="auto"==l?X.height+t:parseFloat(l);E+=D.geometry.height+q;c.push(w.addCell(D))}}for(var U=c.slice(),T=c.slice(),M=0;M<z.length;M++)for(var O=z[M],I=0;I<c.length;I++){var D=c[I],ca=D.getAttribute(O.from);if(null!=ca){w.setAttributeForCell(D,O.from,null);for(var V=ca.split(","),Q=0;Q<V.length;Q++){var Z=d[O.to][V[Q]];null!=Z&&(C=O.label,null!=O.fromlabel&&(C=(D.getAttribute(O.fromlabel)||
-"")+(C||"")),null!=O.tolabel&&(C=(C||"")+(Z.getAttribute(O.tolabel)||"")),T.push(w.insertEdge(null,null,C||"",O.invert?Z:D,O.invert?D:Z,O.style||w.createCurrentEdgeStyle())),mxUtils.remove(O.invert?D:Z,U))}}}if(null!=J)for(I=0;I<c.length;I++)for(D=c[I],Q=0;Q<J.length;Q++)w.setAttributeForCell(D,mxUtils.trim(J[Q]),null);var aa=new mxParallelEdgeLayout(w);aa.spacing=m;var ia=function(){aa.execute(w.getDefaultParent());for(var a=0;a<c.length;a++){var b=w.getCellGeometry(c[a]);b.x=Math.round(w.snap(b.x));
-b.y=Math.round(w.snap(b.y));"auto"==k&&(b.width=Math.round(w.snap(b.width)));"auto"==l&&(b.height=Math.round(w.snap(b.height)))}};if("circle"==G){var da=new mxCircleLayout(w);da.resetEdges=!1;var ma=da.isVertexIgnored;da.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(w.getDefaultParent());ia()},!0,A);A=null}else if("horizontaltree"==G||"verticaltree"==G||"auto"==G&&T.length==2*c.length-1&&1==U.length){w.view.validate();
-var fa=new mxCompactTreeLayout(w,"horizontaltree"==G);fa.levelDistance=q;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(w.getDefaultParent(),0<U.length?U[0]:null)},!0,A);A=null}else if("horizontalflow"==G||"verticalflow"==G||"auto"==G&&1==U.length){w.view.validate();var ja=new mxHierarchicalLayout(w,"horizontalflow"==G?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=q;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(w.getDefaultParent(),
-T);w.moveCells(T,B,F)},!0,A);A=null}else if("organic"==G||"auto"==G&&T.length>c.length){w.view.validate();var ba=new mxFastOrganicLayout(w);ba.forceConstant=3*q;ba.resetEdges=!1;var qa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(w);aa.spacing=m;this.executeLayout(function(){ba.execute(w.getDefaultParent());ia()},!0,A);A=null}this.hideDialog()}finally{w.model.endUpdate()}null!=A&&A()}}catch(na){this.handleError(na)}};
-EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
-d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
+this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,g=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
+g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var g=f.data;if("json"==urlParams.proto){try{g=
+JSON.parse(g)}catch(E){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();var l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
+value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){l=null;l="data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):h(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(E){k.postMessage(JSON.stringify({event:"draft",
+error:E.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var l=1==g.enableRecent,p=1==g.enableSearch,l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=
+a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,p?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==g.action)this.searchReadyCallback(g.list,g.errorMsg);else if("recentDocsList"==
+g.action)this.recentReadyCallback(g.list,g.errorMsg);else{if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var m=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==g.action){if("png"==
+g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,r=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(n);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==
+a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);r(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),x=q.getGlobalVariable,z=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(q.container);
+q.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?r("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=
+g.xml&&0<g.xml.length&&this.setFileData(g.xml);m=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
+l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),
+mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=
+g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
+this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}}g=h(g);c=!0;try{a(g,f)}catch(E){this.handleError(E)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var L=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
+1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=L();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=L();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
+b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):
+urlParams.ready||"ready";k.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
+"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
+a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
+function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,k="auto",l="auto",p=40,q=40,r=0,y=this.editor.graph;y.getGraphBounds();
+for(var w=function(){y.setSelectionCells(T);y.scrollCellToVisible(y.getSelectionCell())},F=y.getFreeInsertPoint(),B=F.x,G=F.y,F=G,C=null,H="auto",z=[],L=null,E=null,I=0;I<b.length&&"#"==b[I].charAt(0);){a=b[I];for(I++;I<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[I].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[I].substring(1)),I++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var R=mxUtils.trim(a.substring(1,Y)),P=mxUtils.trim(a.substring(Y+1));"label"==R?C=y.sanitizeHtml(P):"style"==
+R?e=P:"identity"==R&&0<P.length&&"-"!=P?g=P:"width"==R?k=P:"height"==R?l=P:"ignore"==R?E=P.split(","):"connect"==R?z.push(JSON.parse(P)):"link"==R?L=P:"padding"==R?r=parseFloat(P):"edgespacing"==R?p=parseFloat(P):"nodespacing"==R?q=parseFloat(P):"layout"==R&&(H=P)}}}var K=this.editor.csvToArray(b[I]);a=null;if(null!=g)for(var J=0;J<K.length;J++)if(g==K[J]){a=J;break}null==C&&(C="%"+K[0]+"%");if(null!=z)for(var M=0;M<z.length;M++)null==d[z[M].to]&&(d[z[M].to]={});y.model.beginUpdate();try{for(J=I+
+1;J<b.length;J++){var S=this.editor.csvToArray(b[J]);if(S.length==K.length){var D=null,W=null!=a?S[a]:null;null!=W&&(D=y.model.getCell(W));null==D&&(D=new mxCell(C,new mxGeometry(B,F,0,0),e||"whiteSpace=wrap;html=1;"),D.vertex=!0,D.id=W);for(var Q=0;Q<S.length;Q++)y.setAttributeForCell(D,K[Q],S[Q]);y.setAttributeForCell(D,"placeholders","1");D.style=y.replacePlaceholders(D,D.style);for(M=0;M<z.length;M++)d[z[M].to][D.getAttribute(z[M].to)]=D;null!=L&&"link"!=L&&(y.setLinkForCell(D,D.getAttribute(L)),
+y.setAttributeForCell(D,L,null));y.fireEvent(new mxEventObject("cellsInserted","cells",[D]));var X=this.editor.graph.getPreferredSizeForCell(D);D.geometry.width="auto"==k?X.width+r:parseFloat(k);D.geometry.height="auto"==l?X.height+r:parseFloat(l);F+=D.geometry.height+q;c.push(y.addCell(D))}}for(var U=c.slice(),T=c.slice(),M=0;M<z.length;M++)for(var O=z[M],J=0;J<c.length;J++){var D=c[J],ca=D.getAttribute(O.from);if(null!=ca){y.setAttributeForCell(D,O.from,null);for(var V=ca.split(","),Q=0;Q<V.length;Q++){var Z=
+d[O.to][V[Q]];null!=Z&&(C=O.label,null!=O.fromlabel&&(C=(D.getAttribute(O.fromlabel)||"")+(C||"")),null!=O.tolabel&&(C=(C||"")+(Z.getAttribute(O.tolabel)||"")),T.push(y.insertEdge(null,null,C||"",O.invert?Z:D,O.invert?D:Z,O.style||y.createCurrentEdgeStyle())),mxUtils.remove(O.invert?D:Z,U))}}}if(null!=E)for(J=0;J<c.length;J++)for(D=c[J],Q=0;Q<E.length;Q++)y.setAttributeForCell(D,mxUtils.trim(E[Q]),null);var aa=new mxParallelEdgeLayout(y);aa.spacing=p;var ia=function(){aa.execute(y.getDefaultParent());
+for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==k&&(b.width=Math.round(y.snap(b.width)));"auto"==l&&(b.height=Math.round(y.snap(b.height)))}};if("circle"==H){var da=new mxCircleLayout(y);da.resetEdges=!1;var ma=da.isVertexIgnored;da.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ia()},!0,w);w=null}else if("horizontaltree"==H||
+"verticaltree"==H||"auto"==H&&T.length==2*c.length-1&&1==U.length){y.view.validate();var fa=new mxCompactTreeLayout(y,"horizontaltree"==H);fa.levelDistance=q;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(y.getDefaultParent(),0<U.length?U[0]:null)},!0,w);w=null}else if("horizontalflow"==H||"verticalflow"==H||"auto"==H&&1==U.length){y.view.validate();var ja=new mxHierarchicalLayout(y,"horizontalflow"==H?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=
+q;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(y.getDefaultParent(),T);y.moveCells(T,B,G)},!0,w);w=null}else if("organic"==H||"auto"==H&&T.length>c.length){y.view.validate();var ba=new mxFastOrganicLayout(y);ba.forceConstant=3*q;ba.resetEdges=!1;var qa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(y);aa.spacing=p;this.executeLayout(function(){ba.execute(y.getDefaultParent());ia()},!0,w);w=null}this.hideDialog()}finally{y.model.endUpdate()}null!=
+w&&w()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
+d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,440,130,!0,!0);a.init()};var p=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=p.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
-e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||
+a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
+e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||
c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
@@ -2953,9 +2954,9 @@ IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.
EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("rename").setEnabled(null!=d&&d.isRenamable());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());
-a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,h){var c=a.editor.graph;if("xml"==
-d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),l=Math.floor(g.width*k/c.view.scale),m=Math.floor(g.height*k/c.view.scale);f.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+
-encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+m+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
+a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var r=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);r.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,g){var c=a.editor.graph;if("xml"==
+d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,k,g)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),h=c.getGraphBounds(),l=Math.floor(h.width*k/c.view.scale),p=Math.floor(h.height*k/c.view.scale);f.length<=MAX_REQUEST_SIZE&&l*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+
+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+p+"&border="+g+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
@@ -2967,8 +2968,8 @@ EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mx
null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";d!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var e=!1,d=null,k=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=d&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.lightbox&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=
a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),d=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?e||(1!=MathJax.Hub.queue.pending||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})),MathJax.Hub.Queue(mxUtils.bind(this,function(){e=!0}))):"undefined"===typeof Editor.MathJaxClear||
this.editor.graph.mathEnabled||(e=!0,Editor.MathJaxClear())});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var d=b.getProperty("edit").changes,e=0;e<d.length;e++)if(d[e]instanceof SelectPage||d[e]instanceof RenamePage||d[e]instanceof MovePage||d[e]instanceof mxRootChange){k();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
-Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=a.getAttribute("pageScale"),d=a.getAttribute("pageWidth"),k=a.getAttribute("pageHeight"),m=a.getAttribute("background"),l=a.getAttribute("backgroundImage"),l=null!=l&&0<l.length?JSON.parse(l):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
-a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=m&&0<m.length?m:this.defaultGraphBackground,backgroundImage:null!=l?new mxImage(l.src,l.width,l.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=d&&null!=k?new mxRectangle(0,0,parseFloat(d),parseFloat(k)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
+Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=a.getAttribute("pageScale"),d=a.getAttribute("pageWidth"),k=a.getAttribute("pageHeight"),l=a.getAttribute("background"),p=a.getAttribute("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==
+a.getAttribute("shadow"),pageVisible:this.lightbox?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=l&&0<l.length?l:this.defaultGraphBackground,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=d&&null!=k?new mxRectangle(0,0,parseFloat(d),parseFloat(k)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"0"!=a.getAttribute("math"),
selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}};
Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),
arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled}};
@@ -2984,11 +2985,11 @@ EditorUi.prototype.duplicatePage=function(a,b){var e=this.editor.graph,d=null;e.
EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var b=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&this.editor.graph.model.execute(new RenamePage(this,a,b))}),mxResources.get("rename"));this.showDialog(b.container,300,80,!0,!0);b.init()}return a};EditorUi.prototype.movePage=function(a,b){this.editor.graph.model.execute(new MovePage(this,a,b))};
EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#dcdcdc";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a};
EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="12px";b.style.marginLeft="30px";for(var e=this.editor.chromeless?29:59,d=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-e)/this.pages.length)+1),k=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(c,d){this.pages[c]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",d.style.fontWeight="bold",d.style.borderTopStyle="none"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=c):mxEvent.consume(b)}));mxEvent.addListener(d,
-"dragend",mxUtils.bind(this,function(a){k=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=k&&c!=k&&this.movePage(k,c);a.stopPropagation();a.preventDefault()}));b.appendChild(d)})(m,this.createTabForPage(this.pages[m],d,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);
-d=this.createPageMenuTab();this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var l=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");l.style.position="absolute";l.style.right=this.editor.chromeless?"29px":"55px";l.style.fontSize="13pt";this.tabContainer.appendChild(l);var q=this.createControlTab(4,
-"&nbsp;&#10095;");q.style.position="absolute";q.style.right=this.editor.chromeless?"0px":"29px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var t=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=t+"px";mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,t-20);mxUtils.setOpacity(l,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(l,
-0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,t-20);mxUtils.setOpacity(l,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
+e)/this.pages.length)+1),k=null,l=0;l<this.pages.length;l++)mxUtils.bind(this,function(c,d){this.pages[c]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",d.style.fontWeight="bold",d.style.borderTopStyle="none"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=c):mxEvent.consume(b)}));mxEvent.addListener(d,
+"dragend",mxUtils.bind(this,function(a){k=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=k&&c!=k&&this.movePage(k,c);a.stopPropagation();a.preventDefault()}));b.appendChild(d)})(l,this.createTabForPage(this.pages[l],d,this.pages[l]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);
+d=this.createPageMenuTab();this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var p=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");p.style.position="absolute";p.style.right=this.editor.chromeless?"29px":"55px";p.style.fontSize="13pt";this.tabContainer.appendChild(p);var q=this.createControlTab(4,
+"&nbsp;&#10095;");q.style.position="absolute";q.style.right=this.editor.chromeless?"0px":"29px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var r=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=r+"px";mxEvent.addListener(p,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,r-20);mxUtils.setOpacity(p,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(p,
+0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,r-20);mxUtils.setOpacity(p,0<b.scrollLeft?100:50);mxUtils.setOpacity(q,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(a){var b=document.createElement("div");b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.whiteSpace="nowrap";b.style.boxSizing="border-box";b.style.position="relative";b.style.overflow="hidden";b.style.marginLeft="-1px";b.style.height=this.tabContainer.clientHeight+"px";b.style.padding="8px 4px 8px 4px";b.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #c0c0c0";b.style.borderBottomStyle="solid";b.style.backgroundColor=this.tabContainer.style.backgroundColor;
b.style.cursor="default";b.style.color="gray";a&&(mxEvent.addListener(b,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(b.style.backgroundColor="dark"==uiTheme?"black":"#d3d3d3",mxEvent.consume(a))})),mxEvent.addListener(b,"mouseleave",mxUtils.bind(this,function(a){b.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return b};
EditorUi.prototype.createControlTab=function(a,b){var e=this.createTab(!0);e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.style.lineHeight="30px";e.innerHTML=b;null!=e.firstChild&&null!=e.firstChild.style&&mxUtils.setOpacity(e.firstChild,40);return e};
@@ -2997,51 +2998,51 @@ function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,funct
null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var d=mxEvent.getClientX(a),k=mxEvent.getClientY(a);b.popup(d,k,null,a);this.setCurrentMenu(b);
mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a};
EditorUi.prototype.createTabForPage=function(a,b,e){e=this.createTab(e);var d=a.getName();e.setAttribute("title",d);mxUtils.write(e,d);e.style.maxWidth=b+"px";e.style.width=b+"px";this.addTabListeners(a,e);42<b&&(e.style.textOverflow="ellipsis");return e};
-EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&k||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!d){var l=new mxPopupMenu(this.createPageMenu(a));l.div.className+=" geMenubarMenu";l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);this.resetCurrentMenu();l.destroy()});var q=mxEvent.getClientX(m),t=mxEvent.getClientY(m);l.popup(q,t,null,m);this.setCurrentMenu(l,b)}mxEvent.consume(m)}}))};
+EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(l){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(l)&&k||mxEvent.isPopupTrigger(l))){e.popupMenuHandler.hideMenu();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(l)||!d){var p=new mxPopupMenu(this.createPageMenu(a));p.div.className+=" geMenubarMenu";p.smartSeparators=!0;p.showDisabled=!0;p.autoExpand=!0;p.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(p,arguments);this.resetCurrentMenu();p.destroy()});var q=mxEvent.getClientX(l),r=mxEvent.getClientY(l);p.popup(q,r,null,l);this.setCurrentMenu(p,b)}mxEvent.consume(l)}}))};
EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(e,d){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),d);e.addSeparator(d);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,e,d){d.setAttribute("page",e.page.getId());return d};a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){d.page=a.ui.getPageById(e.getAttribute("page"));d.previous=d.name;return d};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","neverShown"]);a.afterEncode=function(a,e,d){d.setAttribute("relatedPage",e.relatedPage.getId());null==e.index&&(d.setAttribute("name",e.relatedPage.getName()),null!=e.relatedPage.root&&a.encodeCell(e.relatedPage.root,d));return d};a.beforeDecode=function(a,e,d){d.ui=a.ui;d.relatedPage=d.ui.getPageById(e.getAttribute("relatedPage"));if(null==d.relatedPage){var b=document.createElement("diagram");b.setAttribute("id",e.getAttribute("relatedPage"));
-b.setAttribute("name",e.getAttribute("name"));d.relatedPage=new DiagramPage(b);e=e.cloneNode(!0);b=e.firstChild;if(null!=b)for(d.relatedPage.root=a.decodeCell(b,!1),d=b.nextSibling,b.parentNode.removeChild(b),b=d;null!=b;){d=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var m=b.getAttribute("id");null==a.lookup(m)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=d}}return e};a.afterDecode=function(a,e,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",b=Graph.prototype.foldCells;
-Graph.prototype.foldCells=function(a,d,e,q,t){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var k=this.view.getState(e[g]),l=null!=k?k.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(l,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g],
-a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=b.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return x.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=x.getParent(a),b=h.view.getState(a),h.view.getState(a),b="tree"==(null!=b?b.style:h.getCellStyle(a)).containerType);
-return b}function e(a){var b=!1;null!=a&&(a=x.getParent(a),b=h.view.getState(a),h.view.getState(a),b=null!=(null!=b?b.style:h.getCellStyle(a)).childLayout);return b}function q(a){a=h.view.getState(a);if(null!=a){var b=h.getIncomingEdges(a.cell);if(0<b.length&&(b=h.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
-a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function t(a,b){b=null!=b?b:!0;h.model.beginUpdate();try{var d=h.model.getParent(a),c=h.getIncomingEdges(a),e=h.cloneCells([c[0],a]);h.model.setTerminal(e[0],h.model.getTerminal(c[0],!0),!0);var f=q(a),g=d.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
-10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);h.view.currentRoot!=d&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=h.view.getState(a),l=h.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var n=h.getOutgoingEdges(h.model.getTerminal(c[0],
-!0));if(null!=n){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=c=0;t<n.length;t++){var r=h.model.getTerminal(n[t],!1);if(f==q(r)){var u=h.view.getState(r);r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,u)&&(c=10+Math.max(c,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/l),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/l))}}p?g=0:c=0;for(t=0;t<n.length;t++)if(r=h.model.getTerminal(n[t],
-!1),f==q(r)&&(u=h.view.getState(r),r!=a&&null!=u&&(p&&b!=u.getCenterX()<k.getCenterX()||!p&&b!=u.getCenterY()<k.getCenterY()))){var z=[];h.traverse(u.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});h.moveCells(z,(b?1:-1)*c,(b?1:-1)*g)}}}return h.addCells(e,d)}finally{h.model.endUpdate()}}function c(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1);
-var e=h.model.getParent(a),f=e.geometry,g=[];h.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);h.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-40):b==mxConstants.DIRECTION_WEST?(k=-40,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);h.moveCells(g,k,l);return h.addCells(d,e)}finally{h.model.endUpdate()}}function f(a){h.model.beginUpdate();try{var b=
-h.model.getParent(a),d=h.getIncomingEdges(a),c=h.cloneCells([d[0],a]);h.model.setTerminal(c[0],a,!0);var d=h.getOutgoingEdges(a),e=b.geometry,f=[];h.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<d.length;g++){var k=h.model.getTerminal(d[g],!1);null!=k&&f.push(k)}var l=h.view.getBounds(f),m=q(a),n=h.view.translate,p=h.view.scale;m==mxConstants.DIRECTION_SOUTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/p-n.x-e.x+10,c[1].geometry.y+=a.geometry.height-
-e.y+40):m==mxConstants.DIRECTION_NORTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/p-n.x+-e.x+10,c[1].geometry.y-=c[1].geometry.height-e.y+40):(c[1].geometry.x=m==mxConstants.DIRECTION_WEST?c[1].geometry.x-(c[1].geometry.width-e.x+40):c[1].geometry.x+(a.geometry.width-e.x+40),c[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-c[1].geometry.height)/2:(l.y+l.height)/p-n.y+-e.y+10);return h.addCells(c,b)}finally{h.model.endUpdate()}}function g(a,
-b,c){a=h.getOutgoingEdges(a);c=h.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=h.view.getState(h.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function p(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
-c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():c==b?(d=h.getOutgoingEdges(a),null!=d&&0<d.length&&h.setSelectionCell(h.model.getTerminal(d[0],!1))):(c=h.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(h.model.getTerminal(c[0],!0),d,a),c=h.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&h.setSelectionCell(d[c].cell)))))}var n=this,h=n.editor.graph,x=h.getModel();mxResources.parse("selectChildren=Select Children");
-mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var u=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){u.apply(this,arguments);if(1==h.getSelectionCount()){c=h.getSelectionCell();var e=h.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(h.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(h.getSelectionCell())&&
-(a.addSeparator(),0<h.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),
-a=h.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=h.getOutgoingEdges(h.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+S");n.actions.addAction("selectParent",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getIncomingEdges(a);null!=a&&0<a.length&&h.setSelectionCell(h.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",
-function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),b=[];h.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});h.setSelectionCells(b)}},null,null,"Alt+Shift+T");var v=h.removeCells;h.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];x.isEdge(g)&&d(g)&&(e.push(g),g=x.getTerminal(g,!1));b(g)?(h.traverse(g,!0,
-function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=h.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return v.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var r=h.duplicateCells;h.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=h.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=h.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
-a)}this.model.beginUpdate();try{var k=r.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=h.getIncomingEdges(k[e]),g=h.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var m=this.cloneCells([g[0]])[0];this.addEdge(m,h.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var y=h.moveCells;h.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);
-if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||h.model.isEdge(a[q])&&null==h.model.getTerminal(a[q],!0)){f=h.model.getParent(a[q]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var t=h.getIncomingEdges(a[0]);if(0<t.length){var r=h.view.getState(h.model.getTerminal(t[0],!0));if(null!=r){var u=h.view.getState(m);null!=u&&(c=(u.getCenterX()-r.getCenterX())/h.view.scale,d=(u.getCenterY()-r.getCenterY())/h.view.scale)}}}}l=y.apply(this,arguments);
-if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],m,!0);else if(b(a[q])&&(t=h.getIncomingEdges(a[q]),0<t.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],m,!0);else if(0==h.getIncomingEdges(l[q]).length){n=m;if(null==n||n==h.model.getParent(a[q]))n=h.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e,
-h.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=n.sidebar){var w=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=w.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=h.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:n.actions.get("selectChildren"),
-84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},E=n.onKeyDown;n.onKeyDown=function(a){try{if(h.isEnabled()&&!h.isEditing()&&b(h.getSelectionCell())&&1==h.getSelectionCount()){var d=null;0<h.getIncomingEdges(h.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(h.getSelectionCell()):f(h.getSelectionCell()):13==a.which&&(d=t(h.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&h.model.isEdge(d[0])?h.setSelectionCell(h.model.getTerminal(d[0],
-!1)):h.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=A[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(h.getSelectionCell(),
-mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(h.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(K){console.log("error",K)}mxEvent.isConsumed(a)||E.apply(this,arguments)};var B=h.connectVertex;h.connectVertex=function(a,d,e,g,k,l){var m=h.getIncomingEdges(a);return b(a)&&0<m.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==k?c(a):t(a,d!=mxConstants.DIRECTION_NORTH&&
-d!=mxConstants.DIRECTION_WEST)):B.call(this,a,d,e,g,k,l)};h.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&h.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
+b.setAttribute("name",e.getAttribute("name"));d.relatedPage=new DiagramPage(b);e=e.cloneNode(!0);b=e.firstChild;if(null!=b)for(d.relatedPage.root=a.decodeCell(b,!1),d=b.nextSibling,b.parentNode.removeChild(b),b=d;null!=b;){d=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var l=b.getAttribute("id");null==a.lookup(l)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=d}}return e};a.afterDecode=function(a,e,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",b=Graph.prototype.foldCells;
+Graph.prototype.foldCells=function(a,d,e,q,r){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],h=0;h<e.length;h++){var k=this.view.getState(e[h]),l=null!=k?k.style:this.getCellStyle(e[h]);"1"==mxUtils.getValue(l,"treeFolding","0")&&(this.traverse(e[h],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[h]&&f.push(a);return a==e[h]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[h],
+a))}for(h=0;h<f.length;h++)this.model.setVisible(f[h],!a);e=c;e=b.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.chromeless&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return x.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=x.getParent(a),b=g.view.getState(a),g.view.getState(a),b="tree"==(null!=b?b.style:g.getCellStyle(a)).containerType);
+return b}function e(a){var b=!1;null!=a&&(a=x.getParent(a),b=g.view.getState(a),g.view.getState(a),b=null!=(null!=b?b.style:g.getCellStyle(a)).childLayout);return b}function q(a){a=g.view.getState(a);if(null!=a){var b=g.getIncomingEdges(a.cell);if(0<b.length&&(b=g.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
+a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function r(a,b){b=null!=b?b:!0;g.model.beginUpdate();try{var d=g.model.getParent(a),c=g.getIncomingEdges(a),e=g.cloneCells([c[0],a]);g.model.setTerminal(e[0],g.model.getTerminal(c[0],!0),!0);var f=q(a),h=d.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
+10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);g.view.currentRoot!=d&&(e[1].geometry.x-=h.x,e[1].geometry.y-=h.y);var k=g.view.getState(a),l=g.view.scale;if(null!=k){var p=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?p.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:p.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var m=g.getOutgoingEdges(g.model.getTerminal(c[0],
+!0));if(null!=m){for(var n=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,r=h=c=0;r<m.length;r++){var t=g.model.getTerminal(m[r],!1);if(f==q(t)){var u=g.view.getState(t);t!=a&&null!=u&&(n&&b!=u.getCenterX()<k.getCenterX()||!n&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(p,u)&&(c=10+Math.max(c,(Math.min(p.x+p.width,u.x+u.width)-Math.max(p.x,u.x))/l),h=10+Math.max(h,(Math.min(p.y+p.height,u.y+u.height)-Math.max(p.y,u.y))/l))}}n?h=0:c=0;for(r=0;r<m.length;r++)if(t=g.model.getTerminal(m[r],
+!1),f==q(t)&&(u=g.view.getState(t),t!=a&&null!=u&&(n&&b!=u.getCenterX()<k.getCenterX()||!n&&b!=u.getCenterY()<k.getCenterY()))){var z=[];g.traverse(u.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});g.moveCells(z,(b?1:-1)*c,(b?1:-1)*h)}}}return g.addCells(e,d)}finally{g.model.endUpdate()}}function c(a){g.model.beginUpdate();try{var b=q(a),c=g.getIncomingEdges(a),d=g.cloneCells([c[0],a]);g.model.setTerminal(c[0],d[1],!1);g.model.setTerminal(d[0],d[1],!0);g.model.setTerminal(d[0],a,!1);
+var e=g.model.getParent(a),f=e.geometry,h=[];g.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);g.traverse(a,!0,function(a,b){null!=b&&h.push(b);h.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-40):b==mxConstants.DIRECTION_WEST?(k=-40,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);g.moveCells(h,k,l);return g.addCells(d,e)}finally{g.model.endUpdate()}}function f(a){g.model.beginUpdate();try{var b=
+g.model.getParent(a),d=g.getIncomingEdges(a),c=g.cloneCells([d[0],a]);g.model.setTerminal(c[0],a,!0);var d=g.getOutgoingEdges(a),e=b.geometry,f=[];g.view.currentRoot==b&&(e=new mxRectangle);for(var h=0;h<d.length;h++){var k=g.model.getTerminal(d[h],!1);null!=k&&f.push(k)}var l=g.view.getBounds(f),p=q(a),m=g.view.translate,n=g.view.scale;p==mxConstants.DIRECTION_SOUTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/n-m.x-e.x+10,c[1].geometry.y+=a.geometry.height-
+e.y+40):p==mxConstants.DIRECTION_NORTH?(c[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(l.x+l.width)/n-m.x+-e.x+10,c[1].geometry.y-=c[1].geometry.height-e.y+40):(c[1].geometry.x=p==mxConstants.DIRECTION_WEST?c[1].geometry.x-(c[1].geometry.width-e.x+40):c[1].geometry.x+(a.geometry.width-e.x+40),c[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-c[1].geometry.height)/2:(l.y+l.height)/n-m.y+-e.y+10);return g.addCells(c,b)}finally{g.model.endUpdate()}}function h(a,
+b,c){a=g.getOutgoingEdges(a);c=g.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=g.view.getState(g.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function m(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
+c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():c==b?(d=g.getOutgoingEdges(a),null!=d&&0<d.length&&g.setSelectionCell(g.model.getTerminal(d[0],!1))):(c=g.getIncomingEdges(a),null!=c&&0<c.length&&(d=h(g.model.getTerminal(c[0],!0),d,a),c=g.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&g.setSelectionCell(d[c].cell)))))}var n=this,g=n.editor.graph,x=g.getModel();mxResources.parse("selectChildren=Select Children");
+mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var u=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){u.apply(this,arguments);if(1==g.getSelectionCount()){c=g.getSelectionCell();var e=g.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(g.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(g.getSelectionCell())&&
+(a.addSeparator(),0<g.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(g.model.getTerminal(a[c],!1));g.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),
+a=g.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=g.getOutgoingEdges(g.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(g.model.getTerminal(a[c],!1));g.setSelectionCells(b)}}},null,null,"Alt+Shift+S");n.actions.addAction("selectParent",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getIncomingEdges(a);null!=a&&0<a.length&&g.setSelectionCell(g.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",
+function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),b=[];g.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});g.setSelectionCells(b)}},null,null,"Alt+Shift+T");var v=g.removeCells;g.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var h=a[f];x.isEdge(h)&&d(h)&&(e.push(h),h=x.getTerminal(h,!1));b(h)?(g.traverse(h,!0,
+function(a,b){null!=b&&e.push(b);e.push(a);return!0}),h=g.getIncomingEdges(a[f]),a=a.concat(h)):e.push(a[f])}a=e;return v.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var t=g.duplicateCells;g.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=g.view.getState(d[e]);if(null!=f&&b(f.cell))for(var h=g.getIncomingEdges(f.cell),f=0;f<h.length;f++)mxUtils.remove(h[f],
+a)}this.model.beginUpdate();try{var k=t.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=g.getIncomingEdges(k[e]),h=g.getIncomingEdges(a[e]);if(0==l.length&&0<h.length){var p=this.cloneCells([h[0]])[0];this.addEdge(p,g.getDefaultParent(),this.model.getTerminal(h[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var A=g.moveCells;g.moveCells=function(a,c,d,e,f,h,k){var l=null;this.model.beginUpdate();try{var p=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
+if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||g.model.isEdge(a[q])&&null==g.model.getTerminal(a[q],!0)){f=g.model.getParent(a[q]);break}if(null!=p&&f!=p&&null!=this.view.getState(a[0])){var r=g.getIncomingEdges(a[0]);if(0<r.length){var t=g.view.getState(g.model.getTerminal(r[0],!0));if(null!=t){var u=g.view.getState(p);null!=u&&(c=(u.getCenterX()-t.getCenterX())/g.view.scale,d=(u.getCenterY()-t.getCenterY())/g.view.scale)}}}}l=A.apply(this,arguments);
+if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(p)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],p,!0);else if(b(a[q])&&(r=g.getIncomingEdges(a[q]),0<r.length))if(!e)b(p)&&0>mxUtils.indexOf(a,this.model.getTerminal(r[0],!0))&&this.model.setTerminal(r[0],p,!0);else if(0==g.getIncomingEdges(l[q]).length){m=p;if(null==m||m==g.model.getParent(a[q]))m=g.model.getTerminal(r[0],!0);e=this.cloneCells([r[0]])[0];this.addEdge(e,
+g.getDefaultParent(),m,l[q])}}finally{this.model.endUpdate()}return l};if(null!=n.sidebar){var y=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=g.model,h=null;f.beginUpdate();try{if(h=y.apply(this,arguments),b(a))for(var k=0;k<h.length;k++)if(f.isEdge(h[k])&&null==f.getTerminal(h[k],!0)){f.setTerminal(h[k],a,!0);var l=g.getCellGeometry(h[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return h}}var w={88:n.actions.get("selectChildren"),
+84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},F=n.onKeyDown;n.onKeyDown=function(a){try{if(g.isEnabled()&&!g.isEditing()&&b(g.getSelectionCell())&&1==g.getSelectionCount()){var d=null;0<g.getIncomingEdges(g.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(g.getSelectionCell()):f(g.getSelectionCell()):13==a.which&&(d=r(g.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&g.model.isEdge(d[0])?g.setSelectionCell(g.model.getTerminal(d[0],
+!1)):g.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(g.view.getState(g.getSelectionCell())),g.startEditingAtCell(g.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=w[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(m(g.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(m(g.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(m(g.getSelectionCell(),
+mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(m(g.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(I){console.log("error",I)}mxEvent.isConsumed(a)||F.apply(this,arguments)};var B=g.connectVertex;g.connectVertex=function(a,d,e,h,k,l){var p=g.getIncomingEdges(a);return b(a)&&0<p.length?(e=q(a),h=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):h==k?c(a):r(a,d!=mxConstants.DIRECTION_NORTH&&
+d!=mxConstants.DIRECTION_WEST)):B.call(this,a,d,e,h,k,l)};g.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&g.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var G=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){G.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);
this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var C=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){C.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
-this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
+this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");
b.vertex=!0;var d=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");c.geometry.relative=!0;c.edge=!0;b.insertEdge(c,!0);d.insertEdge(c,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
-e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var k=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");k.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);k.insertEdge(m,!1);var h=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");h.vertex=!0;var x=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-x.geometry.relative=!0;x.edge=!0;b.insertEdge(x,!0);h.insertEdge(x,!1);a.insert(c);a.insert(g);a.insert(m);a.insert(x);a.insert(b);a.insert(d);a.insert(e);a.insert(k);a.insert(h);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
+e.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");h.geometry.relative=!0;h.edge=!0;b.insertEdge(h,!0);e.insertEdge(h,!1);var k=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");k.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+l.geometry.relative=!0;l.edge=!0;b.insertEdge(l,!0);k.insertEdge(l,!1);var g=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");g.vertex=!0;var x=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+x.geometry.relative=!0;x.edge=!0;b.insertEdge(x,!0);g.insertEdge(x,!1);a.insert(c);a.insert(h);a.insert(l);a.insert(x);a.insert(b);a.insert(d);a.insert(e);a.insert(k);a.insert(g);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var d=new mxCell("Organization",
new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(d,"treeRoot","1");d.vertex=!0;var e=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");e.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");c.geometry.relative=!0;c.edge=!0;
-d.insertEdge(c,!0);e.insertEdge(c,!1);var f=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");f.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");g.geometry.relative=!0;g.edge=!0;d.insertEdge(g,!0);f.insertEdge(g,!1);a.insert(c);a.insert(g);a.insert(d);a.insert(e);a.insert(f);return sb.createVertexTemplateFromCells([a],
+d.insertEdge(c,!0);e.insertEdge(c,!1);var f=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");f.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");h.geometry.relative=!0;h.edge=!0;d.insertEdge(h,!0);f.insertEdge(h,!1);a.insert(c);a.insert(h);a.insert(d);a.insert(e);a.insert(f);return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree root",function(){var a=new mxCell("Organization",new mxGeometry(0,0,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(a,"treeRoot","1");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree division",function(){var a=new mxCell("Division",new mxGeometry(20,40,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");b.geometry.setTerminalPoint(new mxPoint(0,0),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree sub sections",function(){var a=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var d=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,
@@ -3055,33 +3056,33 @@ mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGE
this.updateGraphXml(mxUtils.parseXml(this.graph.decompress(mxUtils.getTextContent(this.diagrams[this.currentPage]))).documentElement)};this.selectPageById=function(a){for(var b=0;b<this.diagrams.length;b++)if(this.diagrams[b].getAttribute("id")==a){this.selectPage(b);break}};var f=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});this.addListener("xmlNodeChanged",
f);f();urlParams.page=d.currentPage;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8,this.graph.view.scale=this.graphConfig.zoom||1}finally{this.graph.getModel().endUpdate()}this.graph.panningHandler.useLeftButtonForPanning=!0;this.graph.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())&&"auto"==this.graph.container.style.overflow};
this.graph.panningHandler.usePopupTrigger=!1;this.graph.panningHandler.pinchEnabled=!1;this.graph.panningHandler.ignoreCell=!0;this.graph.setPanning(!1);this.addSizeHandler();this.showLayers(this.graph);this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",
-this.graphConfig.title)});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(b){0<a.offsetWidth&&(m.disconnect(),d())}));m.observe(k,{attributes:!0})}else d()}};
+this.graphConfig.title)});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),l=new e(mxUtils.bind(this,function(b){0<a.offsetWidth&&(l.disconnect(),d())}));l.observe(k,{attributes:!0})}else d()}};
GraphViewer.prototype.getObservableParent=function(a){for(a=a.parentNode;a!=document.body&&null!=a.parentNode&&"none"!==mxUtils.getCurrentStyle(a).display;)a=a.parentNode;return a};GraphViewer.prototype.getImageUrl=function(a){null!=a&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a=this.imageBaseUrl+a);return a};
GraphViewer.prototype.setXmlNode=function(a){this.xmlDocument=a.ownerDocument;this.xml=mxUtils.getXml(a);this.xmlNode=a;this.updateGraphXml(a);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(a){null==this.xmlNode&&(this.xmlDocument=a.ownerDocument,this.xml=mxUtils.getXml(a),this.xmlNode=a);this.setGraphXml(a)};GraphViewer.prototype.updateGraphXml=function(a){this.setGraphXml(a);this.fireEvent(new mxEventObject("graphChanged"))};
GraphViewer.prototype.setGraphXml=function(a){null!=this.graph&&(this.graph.view.translate=new mxPoint,this.graph.view.scale=1,this.graph.getModel().clear(),this.editor.setGraphXml(a),this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph(),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale})};
GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,b=this.graph.getGraphBounds(),e=!1;a.style.overflow="hidden";var d=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=a.offsetWidth<b.width+this.graph.border?"auto":"hidden";if(null!=this.toolbar){var b=a.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},b={left:b.left-
-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||m||(m=!0,this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||
-(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){m=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,
-d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,this.toolbarHeight),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,b.width+2*this.graph.border),this.updateContainerHeight(a,b.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var l=k=null,d=mxUtils.bind(this,function(){window.clearTimeout(l);m||(l=window.setTimeout(mxUtils.bind(this,this.fitGraph),
+c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,l=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||l||(l=!0,this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||
+(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){l=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,
+d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,this.toolbarHeight),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,b.width+2*this.graph.border),this.updateContainerHeight(a,b.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var p=k=null,d=mxUtils.bind(this,function(){window.clearTimeout(p);l||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),
100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",d):new ResizeSensor(this.graph.container,d))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",d);var q=mxUtils.bind(this,function(){var d=a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");if(0<a.offsetWidth&&(this.allowZoomIn||b.width+2*this.graph.border>a.offsetWidth||b.height+2*this.graph.border>this.graphConfig["max-height"])){var c=
null;null!=this.graphConfig["max-height"]&&(c=this.graphConfig["max-height"]/(b.height+2*this.graph.border));this.fitGraph(c)}else this.graph.view.setTranslate(Math.floor((this.graph.border-b.x)/this.graph.view.scale),Math.floor((this.graph.border-b.y)/this.graph.view.scale)),k=a.offsetWidth;a.style.minWidth=d});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(q,0):q();this.positionGraph=function(){b=this.graph.getGraphBounds();k=null;q()}};
GraphViewer.prototype.updateContainerWidth=function(a,b){a.style.width=b+"px"};GraphViewer.prototype.updateContainerHeight=function(a,b){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=b+"px"};
-GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers;if(null!=e||null!=b)if(e=null!=e?e.split(" "):null,null!=b||0<e.length){var d=null!=b?b.getModel():null,k=a.getModel();k.beginUpdate();try{for(var m=k.getChildCount(k.root),l=0;l<m;l++)k.setVisible(k.getChildAt(k.root,l),null!=b?d.isVisible(d.getChildAt(d.root,l)):!1);if(null==d)for(l=0;l<e.length;l++)k.setVisible(k.getChildAt(k.root,parseInt(e[l])),!0)}finally{k.endUpdate()}}};
-GraphViewer.prototype.addToolbar=function(){function a(a,b,c,d){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=c&&g.setAttribute("title",c);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==d||d?(mxEvent.addListener(g,"mouseenter",function(){g.style.backgroundColor="#ddd"}),mxEvent.addListener(g,"mouseleave",
-function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cursor="pointer"):mxUtils.setOpacity(g,30);g.appendChild(a);e.appendChild(g);f++;return g}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
-e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var d=null,k=null,m=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,
-0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),l=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(l(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":
-"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){l(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){l(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||l(30)}));var q=this.graph,t=q.getTolerance();q.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=
-q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<t&&Math.abs(this.scrollTop-q.container.scrollTop)<t&&Math.abs(this.startX-b.getGraphX())<t&&Math.abs(this.startY-b.getGraphY())<t&&(0<parseFloat(e.style.opacity||0)?m():l(30))}})}for(var c=this.toolbarItems,f=0,g=null,p=null,n=0;n<c.length;n++){var h=c[n];if("pages"==h){p=b.ownerDocument.createElement("div");
-p.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(p,70);var x=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");x.style.borderRightStyle="none";x.style.paddingLeft="0px";x.style.paddingRight="0px";e.appendChild(p);var u=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
-1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");u.style.paddingLeft="0px";u.style.paddingRight="0px";h=mxUtils.bind(this,function(){p.innerHTML="";mxUtils.write(p,this.currentPage+1+" / "+this.diagrams.length);p.style.display=1<this.diagrams.length?"inline-block":"none";x.style.display=p.style.display;u.style.display=p.style.display});this.addListener("graphChanged",h);h()}else if("zoom"==h)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
-mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==h){if(this.layersEnabled){var v=this.graph.getModel(),r=a(mxUtils.bind(this,function(a){if(null!=g)g.parentNode.removeChild(g),
-g=null;else{g=this.graph.createLayersDialog();mxEvent.addListener(g,"mouseleave",function(){g.parentNode.removeChild(g);g=null});a=r.getBoundingClientRect();g.style.width="140px";g.style.padding="2px 0px 2px 0px";g.style.border="1px solid #d0d0d0";g.style.backgroundColor="#eee";g.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";g.style.fontSize="11px";g.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(g,80);var b=mxUtils.getDocumentScrollOrigin(document);g.style.left=b.x+a.left+
-"px";g.style.top=b.y+a.bottom+"px";document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");v.addListener(mxEvent.CHANGE,function(){r.style.display=1<v.getChildCount(v.root)?"inline-block":"none"});r.style.display=1<v.getChildCount(v.root)?"inline-block":"none"}}else"lightbox"==h?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(h=this.graphConfig["toolbar-buttons"][h],
-null!=h&&a(null==h.enabled||h.enabled?h.handler:function(){},h.image,h.title,h.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=b.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c,
-70),e.appendChild(c));this.minToolbarWidth=34*f;var y=b.style.border,c=mxUtils.bind(this,function(){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-c.top,bottom:a.bottom-c.top,right:a.right-c.left};e.style.left=a.left+"px";e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";
-e.style.border="1px solid #d0d0d0";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==y&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var d=mxUtils.bind(this,function(){1!=this.graphConfig["toolbar-nohide"]&&(null!=e.parentNode&&e.parentNode.removeChild(e),null!=g&&(g.parentNode.removeChild(g),
-g=null),b.style.border=y)});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==e||a==g)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})});mxEvent.addListener(b,"mouseenter",c)};
+GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers;if(null!=e||null!=b)if(e=null!=e?e.split(" "):null,null!=b||0<e.length){var d=null!=b?b.getModel():null,k=a.getModel();k.beginUpdate();try{for(var l=k.getChildCount(k.root),p=0;p<l;p++)k.setVisible(k.getChildAt(k.root,p),null!=b?d.isVisible(d.getChildAt(d.root,p)):!1);if(null==d)for(p=0;p<e.length;p++)k.setVisible(k.getChildAt(k.root,parseInt(e[p])),!0)}finally{k.endUpdate()}}};
+GraphViewer.prototype.addToolbar=function(){function a(a,b,c,d){var h=document.createElement("div");h.style.borderRight="1px solid #d0d0d0";h.style.padding="3px 6px 3px 6px";mxEvent.addListener(h,"click",a);null!=c&&h.setAttribute("title",c);h.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==d||d?(mxEvent.addListener(h,"mouseenter",function(){h.style.backgroundColor="#ddd"}),mxEvent.addListener(h,"mouseleave",
+function(){h.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),h.style.cursor="pointer"):mxUtils.setOpacity(h,30);h.appendChild(a);e.appendChild(h);f++;return h}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
+e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var d=null,k=null,l=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,
+0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),l())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":
+"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){p(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){p(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var q=this.graph,r=q.getTolerance();q.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=
+q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<r&&Math.abs(this.scrollTop-q.container.scrollTop)<r&&Math.abs(this.startX-b.getGraphX())<r&&Math.abs(this.startY-b.getGraphY())<r&&(0<parseFloat(e.style.opacity||0)?l():p(30))}})}for(var c=this.toolbarItems,f=0,h=null,m=null,n=0;n<c.length;n++){var g=c[n];if("pages"==g){m=b.ownerDocument.createElement("div");
+m.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(m,70);var x=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");x.style.borderRightStyle="none";x.style.paddingLeft="0px";x.style.paddingRight="0px";e.appendChild(m);var u=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
+1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");u.style.paddingLeft="0px";u.style.paddingRight="0px";g=mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,this.currentPage+1+" / "+this.diagrams.length);m.style.display=1<this.diagrams.length?"inline-block":"none";x.style.display=m.style.display;u.style.display=m.style.display});this.addListener("graphChanged",g);g()}else if("zoom"==g)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
+mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==g){if(this.layersEnabled){var v=this.graph.getModel(),t=a(mxUtils.bind(this,function(a){if(null!=h)h.parentNode.removeChild(h),
+h=null;else{h=this.graph.createLayersDialog();mxEvent.addListener(h,"mouseleave",function(){h.parentNode.removeChild(h);h=null});a=t.getBoundingClientRect();h.style.width="140px";h.style.padding="2px 0px 2px 0px";h.style.border="1px solid #d0d0d0";h.style.backgroundColor="#eee";h.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";h.style.fontSize="11px";h.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(h,80);var b=mxUtils.getDocumentScrollOrigin(document);h.style.left=b.x+a.left+
+"px";h.style.top=b.y+a.bottom+"px";document.body.appendChild(h)}}),Editor.layersImage,mxResources.get("layers")||"Layers");v.addListener(mxEvent.CHANGE,function(){t.style.display=1<v.getChildCount(v.root)?"inline-block":"none"});t.style.display=1<v.getChildCount(v.root)?"inline-block":"none"}}else"lightbox"==g?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(g=this.graphConfig["toolbar-buttons"][g],
+null!=g&&a(null==g.enabled||g.enabled?g.handler:function(){},g.image,g.title,g.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=b.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c,
+70),e.appendChild(c));this.minToolbarWidth=34*f;var A=b.style.border,c=mxUtils.bind(this,function(){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-c.top,bottom:a.bottom-c.top,right:a.right-c.left};e.style.left=a.left+"px";e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";
+e.style.border="1px solid #d0d0d0";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==A&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var d=mxUtils.bind(this,function(){1!=this.graphConfig["toolbar-nohide"]&&(null!=e.parentNode&&e.parentNode.removeChild(e),null!=h&&(h.parentNode.removeChild(h),
+h=null),b.style.border=A)});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==e||a==h)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})});mxEvent.addListener(b,"mouseenter",c)};
GraphViewer.prototype.addClickHandler=function(a,b){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,d){if(null==d){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(d=k.getAttribute("href"))}null!=b?null==d||a.isExternalProtocol(d)||a.isBlankLink(d)||window.setTimeout(function(){b.destroy()},0):null==d||!a.isPageLink(d)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)||(k=d.indexOf(","),0<k&&(k=d.substring(k+
1),this.selectPageById(k),mxEvent.consume(e)))}),mxUtils.bind(this,function(a){null!=b||!this.lightboxClickEnabled||mxEvent.isTouchEvent(a)&&0!=this.toolbarItems.length||this.showLightbox()}))};
GraphViewer.prototype.showLightbox=function(a,b,e){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){a=null!=a?a:null!=this.graphConfig.editable?this.graphConfig.editable:!0;e={client:1,lightbox:1,target:null!=e?e:"blank"};a&&(e.edit=this.graphConfig.edit||"_blank");if(null!=b?b:1)e.close=1;this.layersEnabled&&(e.layers=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(e.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&
@@ -3090,18 +3091,18 @@ GraphViewer.prototype.showLightbox=function(a,b,e){if("open"==this.graphConfig.l
GraphViewer.prototype.showLocalLightbox=function(){var a=mxUtils.getDocumentScrollOrigin(document),b=document.createElement("div");mxClient.IS_QUIRKS?(b.style.position="absolute",b.style.left=a.x+"px",b.style.top=a.y+"px",b.style.width=document.body.offsetWidth+"px",b.style.height=document.body.offsetHeight+"px"):b.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";b.style.zIndex=this.lightboxZIndex;b.style.backgroundColor="#000000";mxUtils.setOpacity(b,70);document.body.appendChild(b);
var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(e.style.position="absolute",e.style.right="32px",e.style.top=a.y+32+"px"):e.style.cssText="position:fixed;top:32px;right:32px;";e.style.cursor="pointer";mxEvent.addListener(e,"click",function(){d.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";if(null==document.documentMode||
10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var d=new EditorUi(new Editor(!0),document.createElement("div"),!0);d.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";d.refresh=function(){};mxEvent.addListener(b,"click",function(){d.destroy()});
-var k=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),m=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var l=d.editor.graph,q=l.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",
-k)):(b.style.display="none",e.style.display="none");var t=this;l.getImageFromBundles=function(a){return t.getImageUrl(a)};var c=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=c.apply(this,arguments);a.getImageFromBundles=function(a){return t.getImageUrl(a)};return a};this.graphConfig.move&&(l.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(q.style,"border-radius","4px"),q.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
-"hidden";mxClient.IS_SF||(mxUtils.setPrefixedStyle(q.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(q.style,"transition","all .25s ease-in-out"));this.addClickHandler(l,d);window.setTimeout(mxUtils.bind(this,function(){q.style.outline="none";q.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(q);document.body.appendChild(e);d.setFileData(this.xml);mxUtils.setPrefixedStyle(q.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
+var k=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),l=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;l.apply(this,arguments)};var p=d.editor.graph,q=p.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",
+k)):(b.style.display="none",e.style.display="none");var r=this;p.getImageFromBundles=function(a){return r.getImageUrl(a)};var c=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=c.apply(this,arguments);a.getImageFromBundles=function(a){return r.getImageUrl(a)};return a};this.graphConfig.move&&(p.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(q.style,"border-radius","4px"),q.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
+"hidden";mxClient.IS_SF||(mxUtils.setPrefixedStyle(q.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(q.style,"transition","all .25s ease-in-out"));this.addClickHandler(p,d);window.setTimeout(mxUtils.bind(this,function(){q.style.outline="none";q.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(q);document.body.appendChild(e);d.setFileData(this.xml);mxUtils.setPrefixedStyle(q.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
"60px";d.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(d.chromelessToolbar);d.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(q.style.position="absolute",q.style.display="block",q.style.left=a.x+"px",q.style.top=a.y+"px",q.style.width=document.body.clientWidth-80+"px",q.style.height=document.body.clientHeight-80+"px",q.style.backgroundColor="white",d.chromelessToolbar.style.display="block",d.chromelessToolbar.style.position="absolute",
-d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(l,this.graph)}),0);return d};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})};
+d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(p,this.graph)}),0);return d};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})};
GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var b=document.getElementsByClassName(a);a=[];for(var e=0;e<b.length;e++)a.push(b[e]);return a}for(var d=document.getElementsByTagName("*"),b=[],e=0;e<d.length;e++){var k=d[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&b.push(d[e]))}return b};
GraphViewer.createViewerForElement=function(a,b){var e=a.getAttribute("data-mxgraph");if(null!=e){var d=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,d);null!=b&&b(e)};null!=d.url?GraphViewer.getUrl(d.url,function(a){k(a)}):k(d.xml)}};
GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type="text/css";a.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}\ntd.mxPopupMenuIcon div {\nwidth:16px;\nheight:16px;}\nhtml div.mxPopupMenu {\n-webkit-box-shadow:2px 2px 3px #d5d5d5;\n-moz-box-shadow:2px 2px 3px #d5d5d5;\nbox-shadow:2px 2px 3px #d5d5d5;\n_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d0d0d0',Positive='true');\nbackground:white;\nposition:absolute;\nborder:3px solid #e7e7e7;\npadding:3px;}\nhtml table.mxPopupMenu {\nborder-collapse:collapse;\nmargin:0px;}\nhtml td.mxPopupMenuItem {\npadding:7px 30px 7px 30px;\nfont-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;}\nhtml td.mxPopupMenuIcon {\nbackground-color:white;\npadding:0px;}\ntd.mxPopupMenuIcon .geIcon {\npadding:2px;\npadding-bottom:4px;\nmargin:2px;\nborder:1px solid transparent;\nopacity:0.5;\n_width:26px;\n_height:26px;}\ntd.mxPopupMenuIcon .geIcon:hover {\nborder:1px solid gray;\nborder-radius:2px;\nopacity:1;}\nhtml tr.mxPopupMenuItemHover {\nbackground-color: #eeeeee;\ncolor: black;}\ntable.mxPopupMenu hr {\ncolor:#cccccc;\nbackground-color:#cccccc;\nborder:none;\nheight:1px;}\ntable.mxPopupMenu tr {\tfont-size:4pt;}\n.geDialog { font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;\nborder:none;\nmargin:0px;}\n.geDialog {\tposition:absolute;\tbackground:white;\toverflow:hidden;\tpadding:30px;\tborder:1px solid #acacac;\t-webkit-box-shadow:0px 0px 2px 2px #d5d5d5;\t-moz-box-shadow:0px 0px 2px 2px #d5d5d5;\tbox-shadow:0px 0px 2px 2px #d5d5d5;\t_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d5d5d5', Positive='true');\tz-index: 2;}.geDialogClose {\tposition:absolute;\twidth:9px;\theight:9px;\topacity:0.5;\tcursor:pointer;\t_filter:alpha(opacity=50);}.geDialogClose:hover {\topacity:1;}.geDialogTitle {\tbox-sizing:border-box;\twhite-space:nowrap;\tbackground:rgb(229, 229, 229);\tborder-bottom:1px solid rgb(192, 192, 192);\tfont-size:15px;\tfont-weight:bold;\ttext-align:center;\tcolor:rgb(35, 86, 149);}.geDialogFooter {\tbackground:whiteSmoke;\twhite-space:nowrap;\ttext-align:right;\tbox-sizing:border-box;\tborder-top:1px solid #e5e5e5;\tcolor:darkGray;}\n.geBtn {\tbackground-color: #f5f5f5;\tborder-radius: 2px;\tborder: 1px solid #d8d8d8;\tcolor: #333;\tcursor: default;\tfont-size: 11px;\tfont-weight: bold;\theight: 29px;\tline-height: 27px;\tmargin: 0 0 0 8px;\tmin-width: 72px;\toutline: 0;\tpadding: 0 8px;\tcursor: pointer;}.geBtn:hover, .geBtn:focus {\t-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\t-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tbox-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tborder: 1px solid #c6c6c6;\tbackground-color: #f8f8f8;\tbackground-image: linear-gradient(#f8f8f8 0px,#f1f1f1 100%);\tcolor: #111;}.geBtn:disabled {\topacity: .5;}.gePrimaryBtn {\tbackground-color: #4d90fe;\tbackground-image: linear-gradient(#4d90fe 0px,#4787ed 100%);\tborder: 1px solid #3079ed;\tcolor: #fff;}.gePrimaryBtn:hover, .gePrimaryBtn:focus {\tbackground-color: #357ae8;\tbackground-image: linear-gradient(#4d90fe 0px,#357ae8 100%);\tborder: 1px solid #2f5bb7;\tcolor: #fff;}.gePrimaryBtn:disabled {\topacity: .5;}";document.getElementsByTagName("head")[0].appendChild(a)}catch(b){}};
GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=e;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
-(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function l(b,c){if(!b.resizedAttached)b.resizedAttached=
+(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function l(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached=
new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
-b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var l=!1,p=function(){b.resizedAttached&&(l&&(b.resizedAttached.call(),l=!1),a(p))};a(p);var q,t,A,E,B=function(){if((A=b.offsetWidth)!=q||(E=b.offsetHeight)!=t)l=!0,q=A,t=E;g()},F=function(a,b,c){a.attachEvent?
-a.attachEvent("on"+b,c):a.addEventListener(b,c)};F(d,"scroll",B);F(f,"scroll",B)}var q=function(){GraphViewer.resizeSensorEnabled&&d()},t=Object.prototype.toString.call(e),c="[object Array]"===t||"[object NodeList]"===t||"[object HTMLCollection]"===t||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(c)for(var t=0,f=e.length;t<f;t++)l(e[t],q);else l(e,q);this.detach=function(){if(c)for(var a=0,d=e.length;a<d;a++)b.detach(e[a]);else b.detach(e)}};
+b.appendChild(b.resizeSensor);"static"==l(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],h=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};h();var m=!1,p=function(){b.resizedAttached&&(m&&(b.resizedAttached.call(),m=!1),a(p))};a(p);var q,r,w,F,B=function(){if((w=b.offsetWidth)!=q||(F=b.offsetHeight)!=r)m=!0,q=w,r=F;h()},G=function(a,b,c){a.attachEvent?
+a.attachEvent("on"+b,c):a.addEventListener(b,c)};G(d,"scroll",B);G(f,"scroll",B)}var q=function(){GraphViewer.resizeSensorEnabled&&d()},r=Object.prototype.toString.call(e),c="[object Array]"===r||"[object NodeList]"===r||"[object HTMLCollection]"===r||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(c)for(var r=0,f=e.length;r<f;r++)p(e[r],q);else p(e,q);this.detach=function(){if(c)for(var a=0,d=e.length;a<d;a++)b.detach(e[a]);else b.detach(e)}};
b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})();
(function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();
diff --git a/src/main/webapp/open.html b/src/main/webapp/open.html
index f001de3f..04ec63b1 100644
--- a/src/main/webapp/open.html
+++ b/src/main/webapp/open.html
@@ -61,8 +61,8 @@
var value = localStorage.getItem(key);
if (key.length > 0 && key.charAt(0) != '.' && value.length > 0 &&
- (value.substring(0, 8) === '<mxfile ' ||
- value.substring(0, 11) === '<mxlibrary>'))
+ (value.substring(0, 8) === '<mxfile ' || value.substring(0, 11) === '<mxlibrary>' ||
+ value.substring(0, 5) === '<?xml') || value.substring(0, 12) === '<!--[if IE]>')
{
keys.push(key);
}
diff --git a/src/main/webapp/styles/dark.css b/src/main/webapp/styles/dark.css
index 4818fbe7..5894b52a 100644
--- a/src/main/webapp/styles/dark.css
+++ b/src/main/webapp/styles/dark.css
@@ -1,9 +1,9 @@
html body .geDiagramContainer, html body div.geMenubarContainer, html body .geFooterContainer>div>img, html body div.mxPopupMenu, html body td.mxPopupMenuIcon, html body .geFormatContainer {
- background-color: #2a2a2a;
+ background-color:#2a2a2a;
}
-html body .geFooterContainer, html body .geFooterContainer a, html body #geFooterItem1, html body textarea, html body .mxWindowTitle, html body .geDialogTitle, html body .geDialogFooter {
+html body .geFooterContainer, html body #geFooterItem1, html body textarea, html body .mxWindowTitle, html body .geDialogTitle, html body .geDialogFooter {
background:#2a2a2a;
- color: #cccccc;
+ color:#cccccc;
}
html body div.mxRubberband {
border:1px dashed #ffffff !important; background:#505759 !important;
@@ -12,19 +12,19 @@ html body .geToolbarContainer, html body .geSidebar, html body .geSidebarContain
background:#2a2a2a;
border-color:#505759;
box-shadow:none;
- color: #cccccc;
+ color:#cccccc;
}
html body .geSprite, html body .geSocialFooter img, html body .mxPopupMenuItem>img {
filter:invert(100%);
}
html body .geFormatContainer {
- border-left: 1px solid #505759;
+ border-left:1px solid #505759;
}
html body .geDiagramContainer {
- border-bottom: 1px solid #505759;
+ border-bottom:1px solid #505759;
}
html body .geSidebarContainer a, html body .geMenubarContainer a, html body .geToolbar a {
- color: #cccccc;
+ color:#cccccc;
}
html body .geMenubarMenu {
border-color:#505759 !important;
@@ -32,6 +32,12 @@ html body .geMenubarMenu {
html body .geToolbarMenu, html body .geFooterContainer, html body .geFooterContainer td {
border-color:#505759;
}
+html body .geFooterContainer a {
+ background-color:none;
+}
+html body .geFooterContainer td:hover, html body #geFooterItem1:hover {
+ background-color:#000000;
+}
html body div.mxPopupMenu {
border-color:#505759 !important;
box-shadow:none;
@@ -51,17 +57,17 @@ html body .geBtn {
html body .gePrimaryBtn {
background:#505759 !important;
border-color:#cccccc !important;
- color: #cccccc !important;
+ color:#cccccc !important;
}
html body .geBtn:hover {
background:#000000 !important;
}
html body tr.mxPopupMenuItem {
- color: #cccccc;
+ color:#cccccc;
}
html body tr.mxPopupMenuItemHover {
background:#000000;
- color: #cccccc;
+ color:#cccccc;
}
html body .geSidebarContainer .geTitle:hover, html body .geMenubarContainer .geItem:hover, html body .geBaseButton:hover {
background:#000000;
@@ -77,5 +83,5 @@ html body .geDialog, html body div.mxWindow {
background:#2a2a2a;
border-color:#c0c0c0;
box-shadow:none;
- color: #cccccc;
+ color:#cccccc;
}
diff --git a/src/main/webapp/templates/business/accd.xml b/src/main/webapp/templates/business/accd.xml
index 6f6d51ae..d3d13628 100644
--- a/src/main/webapp/templates/business/accd.xml
+++ b/src/main/webapp/templates/business/accd.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<mxfile userAgent="Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" version="@DRAWIO-VERSION@" editor="www.draw.io" type="google"><diagram name="Page-1" id="12e1b939-464a-85fe-373e-61e167be1490">7ZtRc6o4FMc/jY/tkAQRHhWxt7Pt9U51731OIWKmgThIq91Pv4kGBYIt3VGhq76UnIQEzv8k5HegHeRG67sEL+aPPCCsA41g3UHDDoTARKb4Iy3vW4vpOFtDmNBANdobJvQfooyGsr7SgCwLDVPOWUoXRaPP45j4acGGk4Svis1mnBVHXeCQaIaJj1lmve3u7X9okM6VHVjOvuIHoeFcDW5Da1vxjP2XMOGvsRqxA9Fs89tWRzjrS93qco4DvsqZkNdBbsJ5uj2K1i5h0ruZ47Lz0vfsajtoME8jJgpAHG6qRwdOBnVOFjeXkDjND3eoP8sIsP3szExomWaA8A3c9vCG2Ws2QHnE1ZymZLLAviyvRAAVL2HjOxKo0s49hiykCX/Z6WELy4zHqQofKFtgRsNYFHxx/SSRDShjLmc82YyNRt4Qgt6uq3zN5lfpAuW0N5KkZJ0zKZfcER6RNHkXTVQtAioYsvA3VDit9qEEbSXkPBdFJlJGrAI43PW9F0EcKB1qaoI0TfrT6VPfnWrSiPtLi2oU/RTzmJScqkya46W3qJhRfVUR0SCQwwyq5N9rbpQ1zyvcU+Uq2Tbt1J2AU2gIa2ponUJCU5NwwHjYgRaTegX0TRyG8vAv8r7iSbDMqsRIudqKEybcp1iO/UgCig+d9q3iBJgfxMkJQqNXNzScU4SG9fmKy+jG98Xls7Tyf2EKfrjIKp1Pu76i0ty0KwQwKwQApxCgdxWgV/WAO5sAtibARDzeft55TxNNCdGV2EQeWl/qyVGU0apYfD7bhgxGA7PvfKjSCdcv2HUK6nVNXT0AuhXqZcajyud8Pn/yD5q8EgFeznca1X+0iD4WsudoHUp+ud0iA7yVI9IlCfqyLLuXDjJupcIbtjHlMDFPfekk4QuhEhH7eTmYaGbqUVMIFFAxkz99bG7xAfr+caQ3jeLE7faQLr1xrl0NqLF0NkoLI9cw9N3Nkadj12kVLQB9OXXHP397T1dc+IqIjeIC0NfUEU+iZcX+38WMLW9SftP3U8rj2tzwgOOAxgJBjF84JAd541tFzKnBoRwkzYJDlkm6pI2rVab6Rslhd/0XrECz6JA5PKfA7/vJ/XTcWnRATm/Y7zeFDl3UKnSAempTk+3KDkdiB8tuEztAPSWqSd8sOwzOwA52r1XskO1n8uzwMJ5432wfeFZy0CRslBygnk72IkxZ1ZsD4W/M6r9p+MOTlxmT72avrPD1sGiYFS4wyW2Xkb5ZVtDTMhenQMOsoCdVHrz+sK2g4I0c1EVNgYINWgUKqEau4woKRwIFx2oTKKAaSZZmP0lyHMP4cJ4eQRMxrVpFCkhPvAy9h/u7H9e3DF9SsVFYQHr6xXsTd1f1nmH3ndF9/MzX9T9PinCSirNc4Unptys6/IcoaZYdUI1Mzf9t5wpAmeobhQek52UuT4Jm6QHpiRX378l0/Njer5Qse2B33aYIAhhOuxCiRgrkihBHQggAzVYxhJ58+fU0fhxP2zt5ByMLOY29JwSod8bJK4r7f5jZ1OX+Lwl5/wI=</diagram></mxfile> \ No newline at end of file
+<mxfile userAgent="Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" version="@DRAWIO-VERSION@" editor="www.draw.io" type="google"><diagram name="Page-1" id="12e1b939-464a-85fe-373e-61e167be1490">7ZtRc6I6FMc/jY/tkAQRHhWx29l23anu7nMKETMF4iCt9n76m2hQMFjpvWroqi8lJyEx538S8jvYFnLj5V2KZ9NHFpCoBY1g2UL9FoTARCb/Iyzva4vpOGtDmNJANtoaRvQfIo2GtL7SgMxLDTPGoozOykafJQnxs5INpylblJtNWFQedYZDohhGPo5y6217a/9Dg2wq7cBythXfCA2ncnAbWuuKZ+y/hCl7TeSILYgmq8+6OsZ5X3Kq8ykO2KJgQl4LuSlj2foqXrokEt7NHbe+b7CndjOflCRZnRssI8D2szMxoWWaAcI3cN3DG45eST6F1RfN3nP3LKY0I6MZ9kV5wUOghXrTLI54CfDL1exJIEubCRqikKXsZeNRm1smLMlkAEDRAkc0THjB59+fpKIBjSKXRSxdjY0GXh+CzqarYs3qw2tUF0ivvJE0I8uCSbrkjrCYZOk7byJrEZBy5gFsyIBYbIMB2lLCaSEOTCSNWIZguOl7KwK/kDrU1AQpmnTH46euO1ak4fPLymqU/ZSwhOw4VZoUxwtvUb4murIipkEghulVyb/V3NjVvKhwR5arZFu1kzOpCOP/ryGsqaF1CglNRcJexMIWtCKhV0Df+GUoLr+T9wVLg3lexUcq1FbcMGI+xWLsRxJQvO+2LxUnwPwgTk4QGp26oeGcIjSswztuRFe+L2+fcN+2e3AJfrjJSp1Pu7+inbVpVwhgVggATiFA5ypAp+oBdzYBbEWAEX+8/bjznkaKErwrfgzct7/Uk6Mso1Wx+Rw6hvQGPbPrfKjSCfcv2HZK6rVNVT0A2hXq5cajyuccXj/FB01RiQDPpxuN6j9aeB8z0XO8DAWB3K4P/fBWjEjnJOiKsuheOMi4FQqv6MQUwyQs84WTuC+4SoSfyMVgvJmpRk0pUEDFSj742FwDAPT940hvGuWF2+4gVXrjXKcaUGPr1EoLA9cw1NPNkZdj22kULQB1O3WHP357T1dc+IyIWnEBqHvqgKXxvOL87+Iomt9k7KbrZ5QltbnhAScBTTiCGD9xSPbyxpeKmFODw26Q6AWHPId0SQdXa5fqtZLD5vtfsAJ60SF3eEGB3/ej+/GwseiAnE6/29WFDm3UKHSAampTke3KDkdiB8tuEjtANSWqSK+XHXpnYAe70yh2yM8zRXZ4GI68L3YOPCs5KBJqJQeoppO9GNOo6s0B9zeO6r9p+MPSl0kk3q5eWeHzYaGZFS4wyW3vIr1eVlDTMhengGZWUJMqD16331RQ8AYOaiNdoGCDRoECqpHruILCkUDBsZoECqhGkkXvT5IcxzA+XKdH0IQvq0aRAlITL33v4f7u2/Utw6dU1AoLSE2/eG98dlXvGTa/M7pPntmy/s+TYpxm/C6Xe1L47YoO/yFK9LIDqpGp+dtOrgDsUr1WeEBqXubyJNBLD0hNrLi/RuPhY3N/pWTZPbvt6iIIYDjNQogaKZArQhwJIQA0G8UQavLl59PwcThu7uLtDSzkaHtPCFDnjIuXF7f/8rKqK/xnEfL+BQ==</diagram></mxfile> \ No newline at end of file