From 7a1ee7aa44f53fd4311d95699438ba6389ff730e Mon Sep 17 00:00:00 2001
From: Gaudenz Alder <gaudenz@jgraph.com>
Date: Wed, 13 Mar 2019 13:43:02 +0100
Subject: [PATCH] 10.4.5 release

---
 ChangeLog                                    |    6 +
 VERSION                                      |    2 +-
 src/main/webapp/cache.manifest               |    2 +-
 src/main/webapp/js/app.min.js                | 1390 +++++++++---------
 src/main/webapp/js/diagramly/App.js          |  103 +-
 src/main/webapp/js/diagramly/DrawioFile.js   |   59 +-
 src/main/webapp/js/diagramly/DriveClient.js  |   52 +-
 src/main/webapp/js/diagramly/DriveFile.js    |    7 +-
 src/main/webapp/js/diagramly/OneDriveFile.js |    7 +-
 src/main/webapp/js/viewer.min.js             |   20 +-
 src/main/webapp/plugins/explore.js           |    3 +-
 11 files changed, 856 insertions(+), 795 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d2d4574cd..c312f533f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+13-MAR-2019: 10.4.5
+
+- Fixes bug in Confluence cloud
+- Fixes error handling
+- Improves logging
+
 12-MAR-2019: 10.4.4
 
 - Adds blob.core.windows.net to known CORS urls
diff --git a/VERSION b/VERSION
index 69068409e..9dd5407ec 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-10.4.4
\ No newline at end of file
+10.4.5
\ No newline at end of file
diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest
index 0e4449b7b..4ea359946 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!
-# 03/12/2019 02:49 PM
+# 03/13/2019 01:31 PM
 
 app.html
 index.html?offline=1
diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js
index 6a65bedd6..f3ee19b3e 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -7704,34 +7704,34 @@ this.getTagsForStencil("mxgraph.weblogos","xanga","web logos logo").join(" ")),t
 "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,c){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=c||"";this.shadowPages=null;this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";
-DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=0;DrawioFile.prototype.inConflictState=!1;
+DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;
 DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,c){this.savingFile?null!=c&&c({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,c):this.updateFile(a,c)};
-DrawioFile.prototype.updateFile=function(a,c,b,d){null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():this.getLatestVersion(mxUtils.bind(this,function(e){try{null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():null!=e?this.mergeFile(e,a,c,d):this.reloadFile(a,c))}catch(g){null!=c&&c(g)}}),c))};
-DrawioFile.prototype.mergeFile=function(a,c,b,d){var e=!0;try{this.stats.fileMerged++;var g=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),l=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=l&&0<l.length){this.shadowPages=l;this.backupPatch=this.isModified()?this.ui.diffPages(g,this.ui.pages):null;var m=[this.ui.diffPages(null!=d?d:g,this.shadowPages)];if(!this.ignorePatches(m)){var n=this.ui.patchPages(g,
-m[0]);d={};var q=this.ui.getHashValueForPages(n,d),g={},f=this.ui.getHashValueForPages(this.shadowPages,g);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",m,"checksum",f==q,q);if(null!=q&&q!=f){var k=this.compressReportData(this.getAnonymizedXmlForPages(l)),p=this.compressReportData(this.getAnonymizedXmlForPages(n)),t=this.ui.hashValue(a.getCurrentEtag()),u=this.ui.hashValue(this.getCurrentEtag());this.checksumError(b,m,"Shadow Details: "+JSON.stringify(d)+
-"\nChecksum: "+q+"\nCurrent: "+f+"\nCurrent Details: "+JSON.stringify(g)+"\nFrom: "+t+"\nTo: "+u+"\n\nFile Data:\n"+k+"\nPatched Shadow:\n"+p,null,"mergeFile");return}this.patch(m,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw e=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(v){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
-null!=b&&b(v);try{if(e)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,v);else{var y=this.getCurrentUser(),z=null!=y?y.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,v)}}catch(x){}}};
-DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),b=c.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var e=c.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(e=this.ui.anonymizeNode(e,!0));e.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,e,!0);b.appendChild(e)}return mxUtils.getPrettyXml(b)};
+DrawioFile.prototype.updateFile=function(a,c,b,d){null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():this.getLatestVersion(mxUtils.bind(this,function(g){try{null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():null!=g?this.mergeFile(g,a,c,d):this.reloadFile(a,c))}catch(e){null!=c&&c(e)}}),c))};
+DrawioFile.prototype.mergeFile=function(a,c,b,d){var g=!0;try{this.stats.fileMerged++;var e=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),l=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=l&&0<l.length){this.shadowPages=l;this.backupPatch=this.isModified()?this.ui.diffPages(e,this.ui.pages):null;var m=[this.ui.diffPages(null!=d?d:e,this.shadowPages)];if(!this.ignorePatches(m)){var n=this.ui.patchPages(e,
+m[0]);d={};var q=this.ui.getHashValueForPages(n,d),e={},f=this.ui.getHashValueForPages(this.shadowPages,e);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",m,"checksum",f==q,q);if(null!=q&&q!=f){var k=this.compressReportData(this.getAnonymizedXmlForPages(l)),p=this.compressReportData(this.getAnonymizedXmlForPages(n)),t=this.ui.hashValue(a.getCurrentEtag()),u=this.ui.hashValue(this.getCurrentEtag());this.checksumError(b,m,"Shadow Details: "+JSON.stringify(d)+
+"\nChecksum: "+q+"\nCurrent: "+f+"\nCurrent Details: "+JSON.stringify(e)+"\nFrom: "+t+"\nTo: "+u+"\n\nFile Data:\n"+k+"\nPatched Shadow:\n"+p,null,"mergeFile");return}this.patch(m,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw g=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(v){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
+null!=b&&b(v);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,v);else{var y=this.getCurrentUser(),z=null!=y?y.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,v)}}catch(x){}}};
+DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),b=c.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var g=c.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(g=this.ui.anonymizeNode(g,!0));g.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,g,!0);b.appendChild(g)}return mxUtils.getPrettyXml(b)};
 DrawioFile.prototype.compressReportData=function(a,c,b){c=null!=c?c:1E4;null!=b&&null!=a&&a.length>b?a=a.substring(0,b)+"[...]":null!=a&&a.length>c&&(a=Graph.compress(a)+"\n");return a};
-DrawioFile.prototype.checksumError=function(a,c,b,d,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var g=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
-25E3):"n/a";this.sendErrorReport("Checksum Error in "+e,(null!=b?b:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?g(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?g(a):g(null)}),function(){})}else{var l=this.getCurrentUser(),m=null!=l?l.id:"unknown";EditorUi.logError("Checksum Error in "+e,null,this.getMode()+"."+this.getId(),m)}}catch(n){}};
-DrawioFile.prototype.sendErrorReport=function(a,c,b,d){try{var e=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),g=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),l=this.getCurrentUser(),m=null!=l?this.ui.hashValue(l.id):"unknown",n=null!=this.sync?this.sync.clientId:"no sync",q=this.getTitle(),f=q.lastIndexOf("."),l="xml";0<f&&(l=q.substring(f));var k=null!=b?b.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+
+DrawioFile.prototype.checksumError=function(a,c,b,d,g){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var e=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
+25E3):"n/a";this.sendErrorReport("Checksum Error in "+g+" "+this.getId(),(null!=b?b:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?e(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?e(a):e(null)}),function(){})}else{var l=this.getCurrentUser(),m=null!=l?l.id:"unknown";EditorUi.logError("Checksum Error in "+g,null,this.getMode()+"."+this.getId(),m)}}catch(n){}};
+DrawioFile.prototype.sendErrorReport=function(a,c,b,d){try{var g=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),e=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),l=this.getCurrentUser(),m=null!=l?this.ui.hashValue(l.id):"unknown",n=null!=this.sync?this.sync.clientId:"no sync",q=this.getTitle(),f=q.lastIndexOf("."),l="xml";0<f&&(l=q.substring(f));var k=null!=b?b.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+
 navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+l+")\nUser="+m+" ("+n+")\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=c?"\n\n"+c:"")+(null!=b?"\n\nError: "+
-b.message:"")+"\n\nStack:\n"+k+"\n\nShadow:\n"+e+"\n\nData:\n"+g,d)}catch(p){}};
-DrawioFile.prototype.reloadFile=function(a,c){try{this.ui.spinner.stop();var b=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),c=this.ui.editor.graph.getSelectionCells(),g=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(g,b,c);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
+b.message:"")+"\n\nStack:\n"+k+"\n\nShadow:\n"+g+"\n\nData:\n"+e,d)}catch(p){}};
+DrawioFile.prototype.reloadFile=function(a,c){try{this.ui.spinner.stop();var b=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),c=this.ui.editor.graph.getSelectionCells(),e=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(e,b,c);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
 this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}catch(d){null!=c&&c(d)}};DrawioFile.prototype.copyFile=function(a,c){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};
 DrawioFile.prototype.ignorePatches=function(a){for(var c=!0,b=0;b<a.length&&c;b++)c=c&&0==Object.keys(a[b]).length;return c};
-DrawioFile.prototype.patch=function(a,c){var b=this.ui.editor.undoManager,d=b.history.slice(),e=b.indexOfNextAdd,g=this.ui.editor.graph;g.container.style.visibility="hidden";var l=this.changeListenerEnabled;this.changeListenerEnabled=!1;var m=g.foldingEnabled,n=g.mathEnabled,q=g.cellRenderer.redraw;g.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());q.apply(this,arguments)};g.model.beginUpdate();try{for(var f=
-0;f<a.length;f++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[f],!0,c,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{g.container.style.visibility="";g.model.endUpdate();g.cellRenderer.redraw=q;this.changeListenerEnabled=l;b.history=d;b.indexOfNextAdd=e;b.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)n!=
-g.mathEnabled?(this.ui.editor.updateGraphComponents(),g.refresh()):(m!=g.foldingEnabled?g.view.revalidate():g.view.validate(),g.sizeDidChange());this.ui.updateTabContainer()}};
-DrawioFile.prototype.save=function(a,c,b,d,e,g){if(this.isEditable())if(!e&&this.invalidChecksum)if(null!=b)b({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave();else if(null!=b)b({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};
-DrawioFile.prototype.saveAs=function(a,c,b){};DrawioFile.prototype.saveFile=function(a,c,b,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.inConflictState&&this.ui.editor.autosave};
-DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,c,b){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,c,b){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||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.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};
-DrawioFile.prototype.getRevisions=function(a,c){a(null)};DrawioFile.prototype.loadDescriptor=function(a,c){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,c){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),c)};DrawioFile.prototype.patchDescriptor=function(a,c){this.setDescriptorEtag(a,this.getDescriptorEtag(c))};
-DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};
-DrawioFile.prototype.getLatestVersion=function(a,c){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,c){};
-DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
+DrawioFile.prototype.patch=function(a,c){var b=this.ui.editor.undoManager,d=b.history.slice(),g=b.indexOfNextAdd,e=this.ui.editor.graph;e.container.style.visibility="hidden";var l=this.changeListenerEnabled;this.changeListenerEnabled=!1;var m=e.foldingEnabled,n=e.mathEnabled,q=e.cellRenderer.redraw;e.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());q.apply(this,arguments)};e.model.beginUpdate();try{for(var f=
+0;f<a.length;f++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[f],!0,c,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{e.container.style.visibility="";e.model.endUpdate();e.cellRenderer.redraw=q;this.changeListenerEnabled=l;b.history=d;b.indexOfNextAdd=g;b.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)n!=
+e.mathEnabled?(this.ui.editor.updateGraphComponents(),e.refresh()):(m!=e.foldingEnabled?e.view.revalidate():e.view.validate(),e.sizeDidChange());this.ui.updateTabContainer()}};
+DrawioFile.prototype.save=function(a,c,b,d,g,e){try{if(this.isEditable())if(!g&&this.invalidChecksum)if(null!=b)b({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=c&&c();else if(null!=b)b({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(l){if(null!=b)b(l);else throw l;}};
+DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,c,b){};DrawioFile.prototype.saveFile=function(a,c,b,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.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,c,b){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,c,b){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};
+DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||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.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,c){a(null)};
+DrawioFile.prototype.loadDescriptor=function(a,c){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,c){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),c)};DrawioFile.prototype.patchDescriptor=function(a,c){this.setDescriptorEtag(a,this.getDescriptorEtag(c))};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};
+DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,c){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};
+DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,c){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
 DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,c){var b=null!=c?c.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=b&&b.ignoreEdit||this.fileChanged()}),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.addAllSavedStatus=function(a){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(a=null!=a?a:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+a+'">'+a+"</div>"),a=this.ui.statusContainer.getElementsByTagName("div"),0<a.length&&this.isRevisionHistorySupported()&&(a[0].style.cursor="pointer",a[0].style.textDecoration="underline",mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))};
@@ -7749,25 +7749,25 @@ mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),b,mxResources.get("
 b)}};DrawioFile.prototype.handleFileSuccess=function(a){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.isModified()?this.fileChanged():a?(this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))};
 DrawioFile.prototype.handleFileError=function(a,c){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,c);else if(this.isModified()&&this.addUnsavedStatus(a),c)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var b=null!=a?null!=a.error?a.error.message:a.message:null;null!=b&&60<b.length&&(b=b.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+
 mxUtils.htmlEntities(mxResources.get("error"))+(null!=b?" ("+mxUtils.htmlEntities(b)+")":"")+"</div>")}};
-DrawioFile.prototype.handleConflictError=function(a,c){var b=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),e=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,b,d,null,!0,this.constructor==GitHubFile&&null!=a?a.commitMessage:null))}),g=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.synchronizeFile(mxUtils.bind(this,
-function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,b,d,null,null,this.constructor==GitHubFile&&null!=a?a.commitMessage:null)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(b,d,e):this.invalidChecksum?this.showRefreshDialog(b,d,this.getErrorMessage(a)):c?this.showConflictDialog(e,g):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(b,
+DrawioFile.prototype.handleConflictError=function(a,c){var b=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),g=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,b,d,null,!0,this.constructor==GitHubFile&&null!=a?a.commitMessage:null))}),e=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.synchronizeFile(mxUtils.bind(this,
+function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,b,d,null,null,this.constructor==GitHubFile&&null!=a?a.commitMessage:null)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(b,d,g):this.invalidChecksum?this.showRefreshDialog(b,d,this.getErrorMessage(a)):c?this.showConflictDialog(g,e):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(b,
 d)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};
 DrawioFile.prototype.fileChanged=function(){this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null==this.autosaveThread&&this.handleFileSuccess(!0)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus()};
-DrawioFile.prototype.fileSaved=function(a,c,b,d){this.lastSaved=new Date;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=b&&b()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),c,b,d,a)}catch(l){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(l);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,l);else{var e=this.getCurrentUser(),
-g=null!=e?e.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),g,l)}}catch(m){}}};
-DrawioFile.prototype.autosave=function(a,c,b,d){null==this.lastAutosave&&(this.lastAutosave=(new Date).getTime());a=(new Date).getTime()-this.lastAutosave<c?a:0;this.clearAutosave();var e=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==e&&(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!=b&&b(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=b&&b(null)}),a);this.autosaveThread=e};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.fileSaved=function(a,c,b,d){this.lastSaved=new Date;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=b&&b()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),c,b,d,a)}catch(l){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(l);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,l);else{var g=this.getCurrentUser(),
+e=null!=g?g.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),e,l)}}catch(m){}}};
+DrawioFile.prototype.autosave=function(a,c,b,d){null==this.lastAutosave&&(this.lastAutosave=(new Date).getTime());a=(new Date).getTime()-this.lastAutosave<c?a:0;this.clearAutosave();var g=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==g&&(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!=b&&b(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=b&&b(null)}),a);this.autosaveThread=g};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.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};
 DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,c){if(null!=a&&null!=c){var b=a.lastIndexOf("."),d=0<b?a.substring(b):"",b=c.lastIndexOf(".");return d===(0<b?c.substring(b):"")}return a==c};
 DrawioFile.prototype.removeListeners=function(){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)};
 DrawioFile.prototype.destroy=function(){this.stats.destroyed++;try{if(!this.ui.isOffline()&&this.reportEnabled&&("auto"==DrawioFile.SYNC||"manual"==DrawioFile.SYNC)){var a=this.getCurrentUser(),c=null!=a?a.id:"unknown";EditorUi.logEvent({category:"RT-END-"+DrawioFile.SYNC,action:"file-"+this.getId()+"-mode-"+this.getMode()+"-size-"+this.getSize()+"-user-"+c+(null!=this.sync?"-client-"+this.sync.clientId:""),label:this.stats})}}catch(b){}this.clearAutosave();this.removeListeners();null!=this.sync&&
 (this.sync.destroy(),this.sync=null)};LocalFile=function(a,c,b,d){DrawioFile.call(this,a,c);this.title=b;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,c,b){this.saveAs(this.title,c,b)};LocalFile.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};
-LocalFile.prototype.saveFile=function(a,c,b,d){this.title=a;this.updateFileData();c=this.getData();var e=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),g=mxUtils.bind(this,function(c){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,a,e?"image/png":"text/xml",e);else if(c.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(a)+
-(e?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));this.setModified(!1);this.contentChanged();null!=b&&b()});e?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){g(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):g(c)};LocalFile.prototype.rename=function(a,c,b){this.title=a;this.descriptorChanged();null!=c&&c()};
+LocalFile.prototype.saveFile=function(a,c,b,d){this.title=a;this.updateFileData();c=this.getData();var g=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),e=mxUtils.bind(this,function(c){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,a,g?"image/png":"text/xml",g);else if(c.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(a)+
+(g?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));this.setModified(!1);this.contentChanged();null!=b&&b()});g?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):e(c)};LocalFile.prototype.rename=function(a,c,b){this.title=a;this.descriptorChanged();null!=c&&c()};
 LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};LocalLibrary=function(a,c,b){LocalFile.call(this,a,c,b)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,c,b){DrawioFile.call(this,a,c);this.title=b};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,c,b){this.saveAs(this.getTitle(),c,b)};StorageFile.prototype.saveAs=function(a,c,b){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,c,b)};
-StorageFile.prototype.saveFile=function(a,c,b,d){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!=b&&b()}))}catch(g){null!=d&&d(g)}});this.isRenamable()&&"."==a.charAt(0)&&null!=d?d({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,d):e()}))}else null!=b&&b()};StorageFile.prototype.rename=function(a,c,b){var d=this.getTitle();d!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(e){var g=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(d,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,c)}),b)});null!=e?this.ui.confirm(mxResources.get("replaceIt",[a]),g,b):g()})):c()};
+StorageFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable()){var g=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!=b&&b()}))}catch(e){null!=d&&d(e)}});this.isRenamable()&&"."==a.charAt(0)&&null!=d?d({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]),g,d):g()}))}else null!=b&&b()};StorageFile.prototype.rename=function(a,c,b){var d=this.getTitle();d!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(g){var e=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(d,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,c)}),b)});null!=g?this.ui.confirm(mxResources.get("replaceIt",[a]),e,b):e()})):c()};
 StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.getLatestVersion=function(a,c){this.ui.getLocalData(this.title,mxUtils.bind(this,function(b){a(new StorageFile(this.ui,b,this.title))}))};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,c,b){StorageFile.call(this,a,c,b)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};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,c,b){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(a,c,b){DrawioFile.call(this,a,c);this.title=b;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(a,c,b){RemoteFile.call(this,a,c,b.title);this.libObj=b};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(a,c,b){};
 RemoteLibrary.prototype.saveAs=function(a,c,b){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(a,c,b){StorageFile.call(this,a,c,b);a=b;c=a.lastIndexOf("/");0<=c&&(a=a.substring(c+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,c,b){return!1};UrlLibrary.prototype.saveAs=function(a,c,b){};UrlLibrary.prototype.open=function(){};/*
@@ -7775,286 +7775,286 @@ RemoteLibrary.prototype.saveAs=function(a,c,b){};RemoteLibrary.prototype.updateF
 var StorageDialog=function(a,c,b){function d(d,p,v,x,e,g){function u(){mxEvent.addListener(t,"click",null!=g?g:function(){v!=App.MODE_GOOGLE||a.isDriveDomain()?v==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(v,q.checked);c()})):v==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(v,q.checked);
 c()})):(a.setMode(v,q.checked),c()):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",p);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!=d){var l=document.createElement("img");l.setAttribute("src",d);l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.width="60px";l.style.height="60px";l.style.paddingBottom="6px";t.appendChild(l)}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,p);if(null!=e)for(d=0;d<e.length;d++)mxUtils.br(y),mxUtils.write(y,e[d]);if(null!=x&&null==a[x]){l.style.visibility="hidden";mxUtils.setOpacity(y,10);var m=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});m.spin(t);var D=window.setTimeout(function(){null==a[x]&&(m.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",
-mxUtils.bind(this,function(b,c){null!=a[x]&&c.getProperty("client")==a[x]&&(window.clearTimeout(D),mxUtils.setOpacity(y,100),l.style.visibility="",m.stop(),u(),"drive"==x&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else u();n.appendChild(t);++f>=b&&(mxUtils.br(n),f=0)}b=null!=b?b:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var g=a.addLanguageMenu(e,!0);null!=g&&(g.style.bottom=parseInt("28px")-
-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){g=document.createElement("a");g.setAttribute("href","https://about.draw.io/support/");g.setAttribute("title",mxResources.get("help"));g.setAttribute("target","_blank");g.style.position="absolute";g.style.textDecoration="none";g.style.cursor="pointer";g.style.fontSize="12px";g.style.bottom="28px";g.style.left="26px";g.style.color="gray";var l=document.createElement("img");mxUtils.setOpacity(l,50);l.style.height="16px";l.style.width="16px";l.setAttribute("border",
-"0");l.setAttribute("valign","bottom");l.setAttribute("src",Editor.helpImage);l.style.marginRight="2px";g.appendChild(l);mxUtils.write(g,mxResources.get("help"));e.appendChild(g)}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"};e.appendChild(m);mxEvent.addListener(m,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});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 q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;var f=0,k=document.createElement("p"),g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.paddingTop="4px";g.style.paddingBottom="16px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("saveDiagramsTo")+":");e.appendChild(g);"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",
-mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);e.appendChild(n);g=document.createElement("p");g.style.marginTop="12px";g.style.marginBottom=
-"6px";g.appendChild(q);l=document.createElement("span");l.style.color="gray";l.style.fontSize="12px";mxUtils.write(l," "+mxResources.get("rememberThisSetting"));g.appendChild(l);mxUtils.br(g);var p=a.getRecent();if(null!=p&&0<p.length){var t=document.createElement("select");t.style.marginTop="8px";t.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")+"...");
-t.appendChild(u);for(u=0;u<p.length;u++)(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)})(p[u]);g.appendChild(t);mxEvent.addListener(t,"change",function(b){""!=t.value&&a.loadFile(t.value)})}else g.style.marginTop="20px",n.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(p=
+(y.style.paddingTop="0px",y.style.marginTop="-2px");t.appendChild(y);mxUtils.write(y,p);if(null!=e)for(d=0;d<e.length;d++)mxUtils.br(y),mxUtils.write(y,e[d]);if(null!=x&&null==a[x]){l.style.visibility="hidden";mxUtils.setOpacity(y,10);var m=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});m.spin(t);var E=window.setTimeout(function(){null==a[x]&&(m.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",
+mxUtils.bind(this,function(b,c){null!=a[x]&&c.getProperty("client")==a[x]&&(window.clearTimeout(E),mxUtils.setOpacity(y,100),l.style.visibility="",m.stop(),u(),"drive"==x&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else u();n.appendChild(t);++f>=b&&(mxUtils.br(n),f=0)}b=null!=b?b:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var e=a.addLanguageMenu(g,!0);null!=e&&(e.style.bottom=parseInt("28px")-
+3+"px");if(!a.isOffline()&&1<a.getServiceCount()){e=document.createElement("a");e.setAttribute("href","https://about.draw.io/support/");e.setAttribute("title",mxResources.get("help"));e.setAttribute("target","_blank");e.style.position="absolute";e.style.textDecoration="none";e.style.cursor="pointer";e.style.fontSize="12px";e.style.bottom="28px";e.style.left="26px";e.style.color="gray";var l=document.createElement("img");mxUtils.setOpacity(l,50);l.style.height="16px";l.style.width="16px";l.setAttribute("border",
+"0");l.setAttribute("valign","bottom");l.setAttribute("src",Editor.helpImage);l.style.marginRight="2px";e.appendChild(l);mxUtils.write(e,mxResources.get("help"));g.appendChild(e)}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"};g.appendChild(m);mxEvent.addListener(m,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});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 q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;var f=0,k=document.createElement("p"),e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.paddingTop="4px";e.style.paddingBottom="16px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("saveDiagramsTo")+":");g.appendChild(e);"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",
+mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);g.appendChild(n);e=document.createElement("p");e.style.marginTop="12px";e.style.marginBottom=
+"6px";e.appendChild(q);l=document.createElement("span");l.style.color="gray";l.style.fontSize="12px";mxUtils.write(l," "+mxResources.get("rememberThisSetting"));e.appendChild(l);mxUtils.br(e);var p=a.getRecent();if(null!=p&&0<p.length){var t=document.createElement("select");t.style.marginTop="8px";t.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")+"...");
+t.appendChild(u);for(u=0;u<p.length;u++)(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)})(p[u]);e.appendChild(t);mxEvent.addListener(t,"change",function(b){""!=t.value&&a.loadFile(t.value)})}else e.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 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()}),g.appendChild(p),n.style.paddingBottom="4px");n.appendChild(g);mxEvent.addListener(l,"click",function(a){q.checked=!q.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(k.style.padding="8px",k.style.fontSize="9pt",k.style.marginTop="-14px",k.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(k))},5E3);this.container=e},SplashDialog=function(a){var c=document.createElement("div");c.style.textAlign="center";var b=a.addLanguageMenu(c,!0);null!=b&&(b.style.bottom="19px");b=null;b=a.getServiceCount();if(!a.isOffline()&&1<b){b=document.createElement("a");b.setAttribute("href","https://about.draw.io/support/");b.setAttribute("title",mxResources.get("help"));b.setAttribute("target",
+a.openFiles(b.files,!0))});b.click()}),e.appendChild(p),n.style.paddingBottom="4px");n.appendChild(e);mxEvent.addListener(l,"click",function(a){q.checked=!q.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(k.style.padding="8px",k.style.fontSize="9pt",k.style.marginTop="-14px",k.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>",g.appendChild(k))},5E3);this.container=g},SplashDialog=function(a){var c=document.createElement("div");c.style.textAlign="center";var b=a.addLanguageMenu(c,!0);null!=b&&(b.style.bottom="19px");b=null;b=a.getServiceCount();if(!a.isOffline()&&1<b){b=document.createElement("a");b.setAttribute("href","https://about.draw.io/support/");b.setAttribute("title",mxResources.get("help"));b.setAttribute("target",
 "_blank");b.style.position="absolute";b.style.fontSize="12px";b.style.textDecoration="none";b.style.cursor="pointer";b.style.bottom="22px";b.style.left="26px";b.style.color="gray";var d=document.createElement("img");mxUtils.setOpacity(d,50);d.style.height="16px";d.style.width="16px";d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);d.style.marginRight="2px";b.appendChild(d);mxUtils.write(b,mxResources.get("help"));c.appendChild(b)}b=document.createElement("p");
-b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="40px";d.style.height="40px";d.style.marginRight="12px";d.style.paddingBottom="4px";var e="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",e=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",e=mxResources.get("dropbox")):
-a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",e=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",e=mxResources.get("github")):a.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",e=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",e=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",e=mxResources.get("device"));var g=document.createElement("div");g.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?(g.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,e),c.appendChild(b),g.style.border="1px solid #d3d3d3",g.style.borderWidth="1px 0px 1px 0px",g.style.padding="18px 0px 24px 0px",l.style.marginBottom="8px");mxClient.IS_QUIRKS&&(g.style.whiteSpace="nowrap",g.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()});g.appendChild(l);mxUtils.br(g);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()});
-g.appendChild(l);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(d=function(b){l.style.marginBottom="24px";var c=document.createElement("a");
-c.setAttribute("href","javascript:void(0)");c.style.display="inline-block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));l.style.marginBottom="16px";g.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});g.appendChild(c)},b=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=b?(l.style.marginBottom="24px",d=document.createElement("a"),d.setAttribute("href","javascript:void(0)"),d.style.display=
-"inline-block",d.style.marginTop="6px",mxUtils.write(d,mxResources.get("changeUser")+" ("+b.displayName+")"),l.style.marginBottom="16px",g.style.paddingBottom="18px",mxEvent.addListener(d,"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()})}))}),g.appendChild(d)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?d(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?d(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&d(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&d(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")}),mxUtils.br(g),d=document.createElement("a"),d.setAttribute("href",
-"javascript:void(0)"),d.style.display="inline-block",d.style.marginTop="8px",mxUtils.write(d,mxResources.get("changeStorage")),mxEvent.addListener(d,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),g.appendChild(d));c.appendChild(g);this.container=c},ConfirmDialog=function(a,c,b,d,e,g,l,m,n,q){var f=document.createElement("div");f.style.textAlign="center";var k=document.createElement("div");k.style.padding="6px";k.style.overflow="auto";k.style.maxHeight="44px";
-k.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(k.style.height="60px");mxUtils.write(k,c);f.appendChild(k);null!=q&&(k=document.createElement("div"),k.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",q),k.appendChild(c),f.appendChild(k));q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";var p=document.createElement("input");p.setAttribute("type","checkbox");g=mxUtils.button(g||mxResources.get("cancel"),function(){a.hideDialog();
-null!=d&&d(p.checked)});g.className="geBtn";null!=m&&(g.innerHTML=m+"<br>"+g.innerHTML,g.style.paddingBottom="8px",g.style.paddingTop="8px",g.style.height="auto",g.style.width="40%");a.editor.cancelFirst&&q.appendChild(g);var t=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b(p.checked)});q.appendChild(t);null!=l?(t.innerHTML=l+"<br>"+t.innerHTML+"<br>",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className=
-"geBtn gePrimaryBtn";a.editor.cancelFirst||q.appendChild(g);f.appendChild(q);n?(q.style.marginTop="10px",k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(p),e=document.createElement("span"),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),k.appendChild(e),f.appendChild(k),mxEvent.addListener(e,"click",function(a){p.checked=!p.checked;mxEvent.consume(a)})):q.style.marginTop="12px";this.init=function(){t.focus()};this.container=f},EmbedDialog=function(a,c,b,d,e,g){d=document.createElement("div");
-var l=/^https?:\/\//.test(c)||/^mailto:\/\//.test(c);null!=g?mxUtils.write(d,g):mxUtils.write(d,mxResources.get(5E5>c.length?l?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);g=document.createElement("div");g.style.position="absolute";g.style.top="30px";g.style.right="30px";g.style.color="gray";mxUtils.write(g,a.formatFileSize(c.length));d.appendChild(g);var m=document.createElement("textarea");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("autocapitalize",
+b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="40px";d.style.height="40px";d.style.marginRight="12px";d.style.paddingBottom="4px";var g="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",g=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",g=mxResources.get("dropbox")):
+a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",g=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",g=mxResources.get("github")):a.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",g=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",g=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",g=mxResources.get("device"));var e=document.createElement("div");e.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?(e.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,g),c.appendChild(b),e.style.border="1px solid #d3d3d3",e.style.borderWidth="1px 0px 1px 0px",e.style.padding="18px 0px 24px 0px",l.style.marginBottom="8px");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.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()});e.appendChild(l);mxUtils.br(e);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()});
+e.appendChild(l);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(d=function(b){l.style.marginBottom="24px";var c=document.createElement("a");
+c.setAttribute("href","javascript:void(0)");c.style.display="inline-block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));l.style.marginBottom="16px";e.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});e.appendChild(c)},b=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=b?(l.style.marginBottom="24px",d=document.createElement("a"),d.setAttribute("href","javascript:void(0)"),d.style.display=
+"inline-block",d.style.marginTop="6px",mxUtils.write(d,mxResources.get("changeUser")+" ("+b.displayName+")"),l.style.marginBottom="16px",e.style.paddingBottom="18px",mxEvent.addListener(d,"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()})}))}),e.appendChild(d)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?d(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?d(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&d(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&d(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")}),mxUtils.br(e),d=document.createElement("a"),d.setAttribute("href",
+"javascript:void(0)"),d.style.display="inline-block",d.style.marginTop="8px",mxUtils.write(d,mxResources.get("changeStorage")),mxEvent.addListener(d,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),e.appendChild(d));c.appendChild(e);this.container=c},ConfirmDialog=function(a,c,b,d,g,e,l,m,n,q){var f=document.createElement("div");f.style.textAlign="center";var k=document.createElement("div");k.style.padding="6px";k.style.overflow="auto";k.style.maxHeight="44px";
+k.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(k.style.height="60px");mxUtils.write(k,c);f.appendChild(k);null!=q&&(k=document.createElement("div"),k.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",q),k.appendChild(c),f.appendChild(k));q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";var p=document.createElement("input");p.setAttribute("type","checkbox");e=mxUtils.button(e||mxResources.get("cancel"),function(){a.hideDialog();
+null!=d&&d(p.checked)});e.className="geBtn";null!=m&&(e.innerHTML=m+"<br>"+e.innerHTML,e.style.paddingBottom="8px",e.style.paddingTop="8px",e.style.height="auto",e.style.width="40%");a.editor.cancelFirst&&q.appendChild(e);var t=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b(p.checked)});q.appendChild(t);null!=l?(t.innerHTML=l+"<br>"+t.innerHTML+"<br>",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className=
+"geBtn gePrimaryBtn";a.editor.cancelFirst||q.appendChild(e);f.appendChild(q);n?(q.style.marginTop="10px",k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(p),g=document.createElement("span"),mxUtils.write(g," "+mxResources.get("rememberThisSetting")),k.appendChild(g),f.appendChild(k),mxEvent.addListener(g,"click",function(a){p.checked=!p.checked;mxEvent.consume(a)})):q.style.marginTop="12px";this.init=function(){t.focus()};this.container=f},EmbedDialog=function(a,c,b,d,g,e){d=document.createElement("div");
+var l=/^https?:\/\//.test(c)||/^mailto:\/\//.test(c);null!=e?mxUtils.write(d,e):mxUtils.write(d,mxResources.get(5E5>c.length?l?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);e=document.createElement("div");e.style.position="absolute";e.style.top="30px";e.style.right="30px";e.style.color="gray";mxUtils.write(e,a.formatFileSize(c.length));d.appendChild(e);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");d.appendChild(m);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>c.length?(m.value=c,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=
-c.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};g=document.createElement("div");g.style.position="absolute";g.style.bottom="36px";g.style.right="32px";var n=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!l||navigator.standalone||!(l||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(n=mxUtils.button(mxResources.get(5E5>c.length?"preview":"openInNewWindow"),function(){var f=5E5>c.length?m.value:c;if(null!=e)e(f);else if(l)try{var d=a.openLink(f);
-null!=d&&(null==b||0<b)&&window.setTimeout(mxUtils.bind(this,function(){null!=d&&null!=d.location.href&&d.location.href.substring(0,8)!=f.substring(0,8)&&(d.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),b||500)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}else{var g=window.open(),g=null!=g?g.document:null;null!=g?(g.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+
-c+"</body></html>"),g.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),n.className="geBtn",g.appendChild(n));if(!l||7500<c.length){var q=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",c,"text/plain")});q.className="geBtn";g.appendChild(q)}if(l&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>c.length){var f=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(m.value);
-a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img");q.setAttribute("src",Editor.facebookImage);q.setAttribute("width","18");q.setAttribute("height","18");q.setAttribute("border","0");f.appendChild(q);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";g.appendChild(f)}7168>c.length&&(f=
+c.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};e=document.createElement("div");e.style.position="absolute";e.style.bottom="36px";e.style.right="32px";var n=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!l||navigator.standalone||!(l||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(n=mxUtils.button(mxResources.get(5E5>c.length?"preview":"openInNewWindow"),function(){var f=5E5>c.length?m.value:c;if(null!=g)g(f);else if(l)try{var d=a.openLink(f);
+null!=d&&(null==b||0<b)&&window.setTimeout(mxUtils.bind(this,function(){null!=d&&null!=d.location.href&&d.location.href.substring(0,8)!=f.substring(0,8)&&(d.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),b||500)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}else{var e=window.open(),e=null!=e?e.document:null;null!=e?(e.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+
+c+"</body></html>"),e.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),n.className="geBtn",e.appendChild(n));if(!l||7500<c.length){var q=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",c,"text/plain")});q.className="geBtn";e.appendChild(q)}if(l&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>c.length){var f=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(m.value);
+a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img");q.setAttribute("src",Editor.facebookImage);q.setAttribute("width","18");q.setAttribute("height","18");q.setAttribute("border","0");f.appendChild(q);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";e.appendChild(f)}7168>c.length&&(f=
 mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img"),q.setAttribute("src",Editor.tweetImage),q.setAttribute("width","18"),q.setAttribute("height","18"),q.setAttribute("border","0"),q.style.marginBottom="5px",f.appendChild(q),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",g.appendChild(f))}q=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.appendChild(q);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>c.length?mxClient.IS_SF||null!=document.documentMode?q.className="geBtn gePrimaryBtn":(g.appendChild(f),f.className="geBtn gePrimaryBtn",q.className="geBtn"):(g.appendChild(n),q.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(g);this.container=d};EmbedDialog.showPreviewOption=!0;
-var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(J.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<F.length&&(b+="&s="+F);""!=t.value&&"0"!=t.value&&(b+="&border="+t.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(u.checked?"1":"0");b+="&zoom="+(y.checked?"1":"0");b+="&fit="+(D.checked?"1":"0");
-b+="&resize="+(x.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;e.mathEnabled&&(b+="&math=1");v.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));q.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)),""!=k.value&&(a=parseInt(k.value)+parseInt(f.value),b+="&height="+a),q.value=b):q.value=""}var d=document.createElement("div"),e=a.editor.graph,g=e.getGraphBounds(),l=e.view.scale,m=Math.floor(g.x/l-e.view.translate.x),n=Math.floor(g.y/l-e.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";
+mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",e.appendChild(f))}q=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.appendChild(q);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>c.length?mxClient.IS_SF||null!=document.documentMode?q.className="geBtn gePrimaryBtn":(e.appendChild(f),f.className="geBtn gePrimaryBtn",q.className="geBtn"):(e.appendChild(n),q.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(e);this.container=d};EmbedDialog.showPreviewOption=!0;
+var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(J.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<G.length&&(b+="&s="+G);""!=t.value&&"0"!=t.value&&(b+="&border="+t.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(u.checked?"1":"0");b+="&zoom="+(y.checked?"1":"0");b+="&fit="+(E.checked?"1":"0");
+b+="&resize="+(x.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;g.mathEnabled&&(b+="&math=1");v.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));q.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)),""!=k.value&&(a=parseInt(k.value)+parseInt(f.value),b+="&height="+a),q.value=b):q.value=""}var d=document.createElement("div"),g=a.editor.graph,e=g.getGraphBounds(),l=g.view.scale,m=Math.floor(e.x/l-g.view.translate.x),n=Math.floor(e.y/l-g.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";
 d.appendChild(q);mxUtils.br(d);this.init=function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,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;d.appendChild(f);mxUtils.write(d,mxResources.get("height")+":");var k=document.createElement("input");k.setAttribute("type",
-"text");k.setAttribute("size","4");k.style.marginLeft="4px";k.value=Math.ceil(g.height/l);d.appendChild(k);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);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=c||"";
+"text");k.setAttribute("size","4");k.style.marginLeft="4px";k.value=Math.ceil(e.height/l);d.appendChild(k);mxUtils.br(d);e=document.createElement("hr");e.setAttribute("size","1");e.style.marginBottom="16px";e.style.marginTop="16px";d.appendChild(e);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);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=c||"";
 d.appendChild(p);mxUtils.br(d);mxUtils.write(d,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";d.appendChild(t);mxUtils.br(d);var u=document.createElement("input");u.setAttribute("type","checkbox");u.setAttribute("checked","checked");u.defaultChecked=!0;u.style.marginLeft="16px";d.appendChild(u);mxUtils.write(d,mxResources.get("pan")+" ");var y=document.createElement("input");
 y.setAttribute("type","checkbox");y.setAttribute("checked","checked");y.defaultChecked=!0;y.style.marginLeft="8px";d.appendChild(y);mxUtils.write(d,mxResources.get("zoom")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";z.setAttribute("title",window.location.href);d.appendChild(z);mxUtils.write(d,mxResources.get("edit")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.style.marginLeft="8px";d.appendChild(v);mxUtils.write(d,
-mxResources.get("asNew")+" ");mxUtils.br(d);var x=document.createElement("input");x.setAttribute("type","checkbox");x.setAttribute("checked","checked");x.defaultChecked=!0;x.style.marginLeft="16px";d.appendChild(x);mxUtils.write(d,mxResources.get("resize")+" ");var D=document.createElement("input");D.setAttribute("type","checkbox");D.style.marginLeft="8px";d.appendChild(D);mxUtils.write(d,mxResources.get("fit")+" ");var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginLeft=
-"8px";d.appendChild(J);mxUtils.write(d,mxResources.get("embed")+" ");var F=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(u,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(D,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(J,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(t,"change",b);mxEvent.addListener(p,"change",b);b();
-mxEvent.addListener(q,"click",function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)});g=document.createElement("div");g.style.paddingTop="12px";g.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";g.appendChild(l);d.appendChild(g);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign=
-"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var g=new Graph(c);g.setCellsCloneable(!0);g.setPanning(!0);g.setAllowDanglingEdges(!1);g.connectionHandler.select=!1;g.view.setTranslate(20,20);g.border=20;g.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";g.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))})};g.getAllConnectionConstraints=function(){return null};g.connectionHandler.marker.highlight.keepOnTop=
-!1;g.connectionHandler.createEdgeState=function(a){a=g.createEdge(null,null,null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var m=g.getDefaultParent(),n=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){g.connectionHandler.reset();g.clearSelection();var f=g.getCellGeometry(a),d;k(function(){d=g.insertVertex(m,null,"Entry",f.x,f.y,80,30,"rounded=1;");n(d);g.view.refresh(d);
-g.insertEdge(m,null,"",a,d,l)},function(){g.scrollCellToVisible(d)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),f=b.getProperty("state");g.popupMenuHandler.hideMenu();g.stopEditing(!1);var d=mxUtils.convertPoint(g.container,mxEvent.getClientX(c),mxEvent.getClientY(c));g.connectionHandler.start(f,d.x,d.y);g.isMouseDown=!0;g.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});g.addCellOverlay(a,b)});g.getModel().beginUpdate();var q;try{q=g.insertVertex(m,null,"Start",
-0,0,80,30,"ellipse"),n(q)}finally{g.getModel().endUpdate()}var f;"horizontalTree"==b?(f=new mxCompactTreeLayout(g),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==b?(f=new mxCompactTreeLayout(g,!1),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==b?(f=new mxRadialTreeLayout(g,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==b?f=new mxHierarchicalLayout(g,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
-b?f=new mxHierarchicalLayout(g,mxConstants.DIRECTION_WEST):"organic"==b?(f=new mxFastOrganicLayout(g,!1),f.forceConstant=80):"circle"==b&&(f=new mxCircleLayout(g));if(null!=f){var k=function(a,b){g.getModel().beginUpdate();try{null!=a&&a(),f.execute(g.getDefaultParent(),q)}catch(x){throw x;}finally{var c=new mxMorphing(g);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){g.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
-function(a,b,c,f,d){p.apply(this,arguments);k()};g.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);k()};g.connectionHandler.addListener(mxEvent.CONNECT,function(){k()})}var t=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(g.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});t.className="geBtn";a.editor.cancelFirst&&d.appendChild(t);var u=mxUtils.button(mxResources.get("insert"),function(){g.clearCellOverlays();
-var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,d=f.getBounds(b);d.x-=f.translate.x;d.y-=f.translate.y;a.editor.graph.scrollRectToVisible(d);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(g.destroy(),c.parentNode.removeChild(c));a.hideDialog()});d.appendChild(u);u.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(t)};this.container=d};
+mxResources.get("asNew")+" ");mxUtils.br(d);var x=document.createElement("input");x.setAttribute("type","checkbox");x.setAttribute("checked","checked");x.defaultChecked=!0;x.style.marginLeft="16px";d.appendChild(x);mxUtils.write(d,mxResources.get("resize")+" ");var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginLeft="8px";d.appendChild(E);mxUtils.write(d,mxResources.get("fit")+" ");var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginLeft=
+"8px";d.appendChild(J);mxUtils.write(d,mxResources.get("embed")+" ");var G=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(u,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(E,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(J,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(t,"change",b);mxEvent.addListener(p,"change",b);b();
+mxEvent.addListener(q,"click",function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";e.appendChild(l);d.appendChild(e);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign=
+"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var e=new Graph(c);e.setCellsCloneable(!0);e.setPanning(!0);e.setAllowDanglingEdges(!1);e.connectionHandler.select=!1;e.view.setTranslate(20,20);e.border=20;e.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";e.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))})};e.getAllConnectionConstraints=function(){return null};e.connectionHandler.marker.highlight.keepOnTop=
+!1;e.connectionHandler.createEdgeState=function(a){a=e.createEdge(null,null,null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var m=e.getDefaultParent(),n=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){e.connectionHandler.reset();e.clearSelection();var f=e.getCellGeometry(a),d;k(function(){d=e.insertVertex(m,null,"Entry",f.x,f.y,80,30,"rounded=1;");n(d);e.view.refresh(d);
+e.insertEdge(m,null,"",a,d,l)},function(){e.scrollCellToVisible(d)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),f=b.getProperty("state");e.popupMenuHandler.hideMenu();e.stopEditing(!1);var k=mxUtils.convertPoint(e.container,mxEvent.getClientX(c),mxEvent.getClientY(c));e.connectionHandler.start(f,k.x,k.y);e.isMouseDown=!0;e.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});e.addCellOverlay(a,b)});e.getModel().beginUpdate();var q;try{q=e.insertVertex(m,null,"Start",
+0,0,80,30,"ellipse"),n(q)}finally{e.getModel().endUpdate()}var f;"horizontalTree"==b?(f=new mxCompactTreeLayout(e),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==b?(f=new mxCompactTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==b?(f=new mxRadialTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==b?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
+b?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_WEST):"organic"==b?(f=new mxFastOrganicLayout(e,!1),f.forceConstant=80):"circle"==b&&(f=new mxCircleLayout(e));if(null!=f){var k=function(a,b){e.getModel().beginUpdate();try{null!=a&&a(),f.execute(e.getDefaultParent(),q)}catch(x){throw x;}finally{var c=new mxMorphing(e);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){e.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
+function(a,b,c,f,d){p.apply(this,arguments);k()};e.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);k()};e.connectionHandler.addListener(mxEvent.CONNECT,function(){k()})}var t=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(e.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});t.className="geBtn";a.editor.cancelFirst&&d.appendChild(t);var u=mxUtils.button(mxResources.get("insert"),function(){e.clearCellOverlays();
+var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,k=f.getBounds(b);k.x-=f.translate.x;k.y-=f.translate.y;a.editor.graph.scrollRectToVisible(k);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(e.destroy(),c.parentNode.removeChild(c));a.hideDialog()});d.appendChild(u);u.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(t)};this.container=d};
 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,c){var b=document.createElement("div");b.style.whiteSpace="nowrap";var d=document.createElement("h2");mxUtils.write(d,mxResources.get("backgroundImage"));d.style.marginTop="0px";b.appendChild(d);mxUtils.write(b,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(b);var d=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!=d?d.src:"";var g=!1,l=function(){g||""==e.value||a.isOffline()?(m.value="",n.value=""):a.loadImage(mxUtils.trim(e.value),function(a){m.value=a.width;n.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));e.value="";m.value="";n.value=""})};this.init=function(){e.focus();if(Graph.fileSupport){e.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=b.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(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,f,d,k){e.value=a;l()},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 c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&(e.value=decodeURIComponent(c),l())}b.stopPropagation();b.preventDefault()}),!1)}};b.appendChild(e);mxUtils.br(b);mxUtils.br(b);mxUtils.write(b,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!=d?d.width:"";b.appendChild(m);mxUtils.write(b,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!=d?d.height:"";b.appendChild(n);d=mxUtils.button(mxResources.get("reset"),function(){e.value="";m.value="";n.value="";g=!1});mxEvent.addListener(d,"mousedown",
-function(){g=!0});mxEvent.addListener(d,"touchstart",function(){g=!0});d.className="geBtn";d.width="100";b.appendChild(d);mxUtils.br(b);mxEvent.addListener(e,"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&&(e.value=a.url,l()));e.focus()};d=document.createElement("div");d.style.marginTop="40px";d.style.textAlign="right";var q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
+var BackgroundImageDialog=function(a,c){var b=document.createElement("div");b.style.whiteSpace="nowrap";var d=document.createElement("h2");mxUtils.write(d,mxResources.get("backgroundImage"));d.style.marginTop="0px";b.appendChild(d);mxUtils.write(b,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(b);var d=a.editor.graph.backgroundImage,g=document.createElement("input");g.setAttribute("type","text");g.style.marginTop="4px";g.style.marginBottom="4px";g.style.width="350px";g.value=
+null!=d?d.src:"";var e=!1,l=function(){e||""==g.value||a.isOffline()?(m.value="",n.value=""):a.loadImage(mxUtils.trim(g.value),function(a){m.value=a.width;n.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));g.value="";m.value="";n.value=""})};this.init=function(){g.focus();if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=b.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(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,f,k,d){g.value=a;l()},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 c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&(g.value=decodeURIComponent(c),l())}b.stopPropagation();b.preventDefault()}),!1)}};b.appendChild(g);mxUtils.br(b);mxUtils.br(b);mxUtils.write(b,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!=d?d.width:"";b.appendChild(m);mxUtils.write(b,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!=d?d.height:"";b.appendChild(n);d=mxUtils.button(mxResources.get("reset"),function(){g.value="";m.value="";n.value="";e=!1});mxEvent.addListener(d,"mousedown",
+function(){e=!0});mxEvent.addListener(d,"touchstart",function(){e=!0});d.className="geBtn";d.width="100";b.appendChild(d);mxUtils.br(b);mxEvent.addListener(g,"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&&(g.value=a.url,l()));g.focus()};d=document.createElement("div");d.style.marginTop="40px";d.style.textAlign="right";var q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
 q.className="geBtn";a.editor.cancelFirst&&d.appendChild(q);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 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)});
 f.className="geBtn";d.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 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)}))}),f.className="geBtn",d.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c(""!=e.value?new mxImage(mxUtils.trim(e.value),m.value,n.value):null)});f.className="geBtn gePrimaryBtn";d.appendChild(f);a.editor.cancelFirst||d.appendChild(q);b.appendChild(d);this.container=b},ParseDialog=function(a,c,b){function d(b,c){var f=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==
-c||"plantUmlTxt"==c){var f="plantUmlTxt"==c?PLANT_URL+"/txt/":"plantUmlPng"==c?PLANT_URL+"/png/":PLANT_URL+"/svg/",d=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?"_":"?"},p=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)},x=new XMLHttpRequest;x.open("GET",f+function(a){r="";for(A=0;A<a.length;A+=3)r=A+2==a.length?r+p(a.charCodeAt(A),a.charCodeAt(A+1),0):A+1==a.length?r+p(a.charCodeAt(A),0,0):r+p(a.charCodeAt(A),a.charCodeAt(A+1),a.charCodeAt(A+2));return r}(Graph.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);"plantUmlTxt"!=c&&(x.responseType="blob");x.onload=function(f){if(200<=this.status&&300>this.status)if("plantUmlTxt"==c)a.spinner.stop(),d.setSelectionCell(a.insertAsPreText(this.response,
-g.x,g.y)),d.scrollCellToVisible(d.getSelectionCell());else{var k=new FileReader;k.readAsDataURL(this.response);k.onloadend=function(c){var f=new Image;f.onload=function(){a.spinner.stop();var c=f.width,p=f.height;if(0==c&&0==p){var v=k.result,e=v.indexOf(","),v=decodeURIComponent(escape(atob(v.substring(e+1)))),v=mxUtils.parseXml(v).getElementsByTagName("svg");0<v.length&&(c=parseFloat(v[0].getAttribute("width")),p=parseFloat(v[0].getAttribute("height")))}d.getModel().beginUpdate();try{cell=d.insertVertex(null,
-null,b,g.x,g.y,c,p,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(k.result)+";")}finally{d.getModel().endUpdate()}d.setSelectionCell(cell);d.scrollCellToVisible(d.getSelectionCell())};f.src=k.result};k.onerror=function(b){a.handleError(b)}}else a.spinner.stop(),a.handleError(f)};x.onerror=function(b){a.handleError(b)};x.send()}}else if("table"==c){for(var e=null,t=[],l=0,A=0;A<f.length;A++)if(x=mxUtils.trim(f[A]),"create table"==x.substring(0,12).toLowerCase())x=
-mxUtils.trim(x.substring(12)),"("==x.charAt(x.length-1)&&(x=x.substring(0,x.lastIndexOf(" "))),e=new mxCell(x,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;"),e.vertex=!0,t.push(e),x=a.editor.graph.getPreferredSizeForCell(n),null!=x&&(e.geometry.width=x.width+10);else if(null!=e&&")"==x.charAt(0))l+=e.geometry.width+
-40,e=null;else if("("!=x&&null!=e&&(x=x.substring(0,","==x.charAt(x.length-1)?x.length-1:x.length),"primary key"!=x.substring(0,11).toLowerCase())){var m=x.toLowerCase().indexOf("primary key"),x=x.replace(/primary key/i,""),n=new mxCell(x,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;");n.vertex=
-!0;x=sb.cloneCell(n,0<m?"PK":"");x.connectable=!1;x.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;";x.geometry.width=30;x.geometry.height=26;n.insert(x);x=a.editor.graph.getPreferredSizeForCell(n);null!=x&&e.geometry.width<x.width+10&&(e.geometry.width=Math.min(220,x.width+10));e.insert(n);e.geometry.height+=26}0<t.length&&(d=a.editor.graph,f=d.view,
-x=d.getGraphBounds(),d.setSelectionCells(d.importCells(t,Math.ceil(Math.max(0,x.x/f.scale-f.translate.x)+4*d.gridSize),Math.ceil(Math.max(0,(x.y+x.height)/f.scale-f.translate.y)+4*d.gridSize))),d.scrollCellToVisible(d.getSelectionCell()))}else if("list"==c){if(0<f.length){d=a.editor.graph;e=new mxCell(f[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;");
-e.vertex=!0;x=d.getPreferredSizeForCell(e);null!=x&&e.geometry.width<x.width+10&&(e.geometry.width=x.width+10);n=[e];if(1<f.length)for(A=1;A<f.length;A++)"--"==f[A]?(x=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;"),x.vertex=!0,e.geometry.height+=x.geometry.height,e.insert(x),n.push(x)):0<f[A].length&&";"!=f[A].charAt(0)&&(l=new mxCell(f[A],
-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,x=d.getPreferredSizeForCell(l),null!=x&&l.geometry.width<x.width&&(l.geometry.width=x.width),e.geometry.width=Math.max(e.geometry.width,l.geometry.width),e.geometry.height+=l.geometry.height,e.insert(l),n.push(l));d.getModel().beginUpdate();try{e=d.importCells([e],g.x,g.y)[0],d.fireEvent(new mxEventObject("cellsInserted",
-"cells",[e].concat(e.children)))}finally{d.getModel().endUpdate()}d.setSelectionCell(e);d.scrollCellToVisible(d.getSelectionCell())}}else{for(var n=function(a){var b=q[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,q[a]=b,t.push(b));return b},q={},t=[],A=0;A<f.length;A++)if(";"!=f[A].charAt(0)){var G=f[A].split("->");if(2<=G.length){var m=n(G[0]),H=n(G[G.length-1]),G=new mxCell(2<G.length?G[1]:"",new mxGeometry);G.edge=!0;m.insertEdge(G,!0);H.insertEdge(G,
-!1);t.push(G)}}if(0<t.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);d=new Graph(f);d.getModel().beginUpdate();try{t=d.importCells(t);for(A=0;A<t.length;A++)d.getModel().isVertex(t[A])&&(x=d.getPreferredSizeForCell(t[A]),t[A].geometry.width=Math.max(t[A].geometry.width,x.width),t[A].geometry.height=Math.max(t[A].geometry.height,x.height));e=new mxFastOrganicLayout(d);e.disableEdgeStyle=!1;e.forceConstant=120;e.execute(d.getDefaultParent());l=new mxParallelEdgeLayout(d);
-l.spacing=20;l.execute(d.getDefaultParent())}finally{d.getModel().endUpdate()}d.clearCellOverlays();n=[];a.editor.graph.getModel().beginUpdate();try{n=a.editor.graph.importCells(d.getModel().getChildren(d.getDefaultParent()),g.x,g.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",n))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(n);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());d.destroy();f.parentNode.removeChild(f)}}}function e(){return"list"==
+a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),f.className="geBtn",d.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c(""!=g.value?new mxImage(mxUtils.trim(g.value),m.value,n.value):null)});f.className="geBtn gePrimaryBtn";d.appendChild(f);a.editor.cancelFirst||d.appendChild(q);b.appendChild(d);this.container=b},ParseDialog=function(a,c,b){function d(b,c){var f=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==
+c||"plantUmlTxt"==c){var f="plantUmlTxt"==c?PLANT_URL+"/txt/":"plantUmlPng"==c?PLANT_URL+"/png/":PLANT_URL+"/svg/",k=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?"_":"?"},p=function(a,b,c){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|c>>6;c4=c&63;r="";r+=d(c1&63);r+=d(c2&63);r+=d(c3&63);return r+=
+d(c4&63)},x=new XMLHttpRequest;x.open("GET",f+function(a){r="";for(A=0;A<a.length;A+=3)r=A+2==a.length?r+p(a.charCodeAt(A),a.charCodeAt(A+1),0):A+1==a.length?r+p(a.charCodeAt(A),0,0):r+p(a.charCodeAt(A),a.charCodeAt(A+1),a.charCodeAt(A+2));return r}(Graph.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);"plantUmlTxt"!=c&&(x.responseType="blob");x.onload=function(f){if(200<=this.status&&300>this.status)if("plantUmlTxt"==c)a.spinner.stop(),k.setSelectionCell(a.insertAsPreText(this.response,
+e.x,e.y)),k.scrollCellToVisible(k.getSelectionCell());else{var d=new FileReader;d.readAsDataURL(this.response);d.onloadend=function(c){var f=new Image;f.onload=function(){a.spinner.stop();var c=f.width,p=f.height;if(0==c&&0==p){var v=d.result,g=v.indexOf(","),v=decodeURIComponent(escape(atob(v.substring(g+1)))),v=mxUtils.parseXml(v).getElementsByTagName("svg");0<v.length&&(c=parseFloat(v[0].getAttribute("width")),p=parseFloat(v[0].getAttribute("height")))}k.getModel().beginUpdate();try{cell=k.insertVertex(null,
+null,b,e.x,e.y,c,p,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(d.result)+";")}finally{k.getModel().endUpdate()}k.setSelectionCell(cell);k.scrollCellToVisible(k.getSelectionCell())};f.src=d.result};d.onerror=function(b){a.handleError(b)}}else a.spinner.stop(),a.handleError(f)};x.onerror=function(b){a.handleError(b)};x.send()}}else if("table"==c){for(var g=null,t=[],l=0,A=0;A<f.length;A++)if(x=mxUtils.trim(f[A]),"create table"==x.substring(0,12).toLowerCase())x=
+mxUtils.trim(x.substring(12)),"("==x.charAt(x.length-1)&&(x=x.substring(0,x.lastIndexOf(" "))),g=new mxCell(x,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;"),g.vertex=!0,t.push(g),x=a.editor.graph.getPreferredSizeForCell(n),null!=x&&(g.geometry.width=x.width+10);else if(null!=g&&")"==x.charAt(0))l+=g.geometry.width+
+40,g=null;else if("("!=x&&null!=g&&(x=x.substring(0,","==x.charAt(x.length-1)?x.length-1:x.length),"primary key"!=x.substring(0,11).toLowerCase())){var m=x.toLowerCase().indexOf("primary key"),x=x.replace(/primary key/i,""),n=new mxCell(x,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;");n.vertex=
+!0;x=sb.cloneCell(n,0<m?"PK":"");x.connectable=!1;x.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;";x.geometry.width=30;x.geometry.height=26;n.insert(x);x=a.editor.graph.getPreferredSizeForCell(n);null!=x&&g.geometry.width<x.width+10&&(g.geometry.width=Math.min(220,x.width+10));g.insert(n);g.geometry.height+=26}0<t.length&&(k=a.editor.graph,f=k.view,
+x=k.getGraphBounds(),k.setSelectionCells(k.importCells(t,Math.ceil(Math.max(0,x.x/f.scale-f.translate.x)+4*k.gridSize),Math.ceil(Math.max(0,(x.y+x.height)/f.scale-f.translate.y)+4*k.gridSize))),k.scrollCellToVisible(k.getSelectionCell()))}else if("list"==c){if(0<f.length){k=a.editor.graph;g=new mxCell(f[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;");
+g.vertex=!0;x=k.getPreferredSizeForCell(g);null!=x&&g.geometry.width<x.width+10&&(g.geometry.width=x.width+10);n=[g];if(1<f.length)for(A=1;A<f.length;A++)"--"==f[A]?(x=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;"),x.vertex=!0,g.geometry.height+=x.geometry.height,g.insert(x),n.push(x)):0<f[A].length&&";"!=f[A].charAt(0)&&(l=new mxCell(f[A],
+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,x=k.getPreferredSizeForCell(l),null!=x&&l.geometry.width<x.width&&(l.geometry.width=x.width),g.geometry.width=Math.max(g.geometry.width,l.geometry.width),g.geometry.height+=l.geometry.height,g.insert(l),n.push(l));k.getModel().beginUpdate();try{g=k.importCells([g],e.x,e.y)[0],k.fireEvent(new mxEventObject("cellsInserted",
+"cells",[g].concat(g.children)))}finally{k.getModel().endUpdate()}k.setSelectionCell(g);k.scrollCellToVisible(k.getSelectionCell())}}else{for(var n=function(a){var b=q[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,q[a]=b,t.push(b));return b},q={},t=[],A=0;A<f.length;A++)if(";"!=f[A].charAt(0)){var F=f[A].split("->");if(2<=F.length){var m=n(F[0]),H=n(F[F.length-1]),F=new mxCell(2<F.length?F[1]:"",new mxGeometry);F.edge=!0;m.insertEdge(F,!0);H.insertEdge(F,
+!1);t.push(F)}}if(0<t.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);k=new Graph(f);k.getModel().beginUpdate();try{t=k.importCells(t);for(A=0;A<t.length;A++)k.getModel().isVertex(t[A])&&(x=k.getPreferredSizeForCell(t[A]),t[A].geometry.width=Math.max(t[A].geometry.width,x.width),t[A].geometry.height=Math.max(t[A].geometry.height,x.height));g=new mxFastOrganicLayout(k);g.disableEdgeStyle=!1;g.forceConstant=120;g.execute(k.getDefaultParent());l=new mxParallelEdgeLayout(k);
+l.spacing=20;l.execute(k.getDefaultParent())}finally{k.getModel().endUpdate()}k.clearCellOverlays();n=[];a.editor.graph.getModel().beginUpdate();try{n=a.editor.graph.importCells(k.getModel().getChildren(k.getDefaultParent()),e.x,e.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",n))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(n);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());k.destroy();f.parentNode.removeChild(f)}}}function g(){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 Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\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||"plantUmlTxt"==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 g=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var l=document.createElement("textarea");l.style.resize="none";l.style.width="100%";l.style.height=
+"plantUmlSvg"==m.value||"plantUmlTxt"==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 e=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.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 m=document.createElement("select");"formatSql"==b&&(m.style.display="none");var n=document.createElement("option");n.setAttribute("value","list");mxUtils.write(n,mxResources.get("list"));"plantUml"!=b&&m.appendChild(n);null!=b&&"fromText"!=b||n.setAttribute("selected","selected");n=document.createElement("option");n.setAttribute("value","table");mxUtils.write(n,mxResources.get("formatSql"));"formatSql"==b&&(m.appendChild(n),n.setAttribute("selected","selected"));
 n=document.createElement("option");n.setAttribute("value","diagram");mxUtils.write(n,mxResources.get("diagram"));"plantUml"!=b&&m.appendChild(n);n=document.createElement("option");n.setAttribute("value","plantUmlSvg");mxUtils.write(n,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==b&&n.setAttribute("selected","selected");var q=document.createElement("option");q.setAttribute("value","plantUmlPng");mxUtils.write(q,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
-")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(m.appendChild(n),m.appendChild(q),m.appendChild(f));var k=e();l.value=k;c.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 b=new FileReader;b.onload=function(a){l.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(m);mxEvent.addListener(m,"change",function(){var a=e();if(0==l.value.length||l.value==k)k=a,l.value=k});b=mxUtils.button(mxResources.get("close"),function(){l.value==k?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("insert"),
-function(){a.hideDialog();d(l.value,m.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,e,g,l,m,n,q,f,k,p,t,u,y){function z(){var a=!0;if(null!=S)for(;C<S.length&&(a||0!=mxUtils.mod(C,30));)a=S[C++],D(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview),a=!1}function v(){if(Y)b||a.hideDialog(),t(Y,fa,I.value);else if(d)b||a.hideDialog(),d(U,I.value);else{var c=I.value;
-null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,U,null!=T&&0<T.length?T:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function x(a,b,c,f,d){null!=W&&(W.style.backgroundColor="transparent",W.style.border="1px solid transparent");H.removeAttribute("disabled");U=b;T=c;W=a;Y=f;fa=d;W.style.backgroundColor=m;W.style.border=n}function D(b,c,f,d,k,p,e,g,t){var u=document.createElement("div");u.className="geTemplate";
-u.style.height=P+"px";u.style.width=R+"px";null!=d&&0<d.length&&u.setAttribute("title",d);if(null!=p)u.style.backgroundImage="url("+p+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){x(u,null,null,b,e)}),mxEvent.addListener(u,"dblclick",function(a){v()});else if(null!=b&&0<b.length){f=t||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";u.style.backgroundImage="url("+f+")";u.style.backgroundPosition=
-"center center";u.style.backgroundRepeat="no-repeat";var A=!1;mxEvent.addListener(u,"click",function(f){H.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;G.spin(N);mxUtils.get(f,mxUtils.bind(this,function(a){G.stop();200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),c),A&&v())}))});mxEvent.addListener(u,"dblclick",
-function(a){A=!0})}else u.innerHTML='<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",k&&x(u),null!=g?mxEvent.addListener(u,"click",g):(mxEvent.addListener(u,"click",function(a){x(u)}),mxEvent.addListener(u,"dblclick",function(a){v()}));N.appendChild(u)}function J(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(z(),mxEvent.consume(a))});var a=null,b;for(b in aa){var c=
-document.createElement("div"),f=mxResources.get(b),d=aa[b];null==f&&(f=b.substring(0,1).toUpperCase()+b.substring(1));18<f.length&&(f=f.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",f+" ("+d.length+")");mxUtils.write(c,c.getAttribute("title"));null!=q&&(c.style.padding=q);Z.appendChild(c);null==a&&(a=c,a.style.backgroundColor=l);(function(b,f){mxEvent.addListener(c,
-"click",function(){a!=f&&(a.style.backgroundColor="",a=f,a.style.backgroundColor=l,N.scrollTop=0,N.innerHTML="",C=0,S=aa[b],K=null,z())})})(b,c)}z()}b=null!=b?b:!0;e=null!=e?e:!1;l=null!=l?l:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var F=document.createElement("div");F.style.height="100%";var A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.height="46px";b&&F.appendChild(A);var E=document.createElement("img");E.setAttribute("border",
-"0");E.setAttribute("align","absmiddle");E.style.width="40px";E.style.height="40px";E.style.marginRight="10px";E.style.paddingBottom="4px";E.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";
-!c&&b&&A.appendChild(E);b&&mxUtils.write(A,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");E=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?E=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?E=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?E=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?E=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(E=a.trello.extension);var I=
-document.createElement("input");I.setAttribute("value",a.defaultFilename+E);I.style.marginLeft="10px";I.style.width=c?"220px":"430px";this.init=function(){b&&(I.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?I.select():document.execCommand("selectAll",!1,null))};b&&(A.appendChild(I),null!=a.editor.fileExtensions&&(E=FilenameDialog.createTypeHint(a,I,a.editor.fileExtensions),E.style.marginTop="12px",A.appendChild(E)));var A=!1,C=0,G=new Spinner({lines:12,length:10,
+")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(m.appendChild(n),m.appendChild(q),m.appendChild(f));var k=g();l.value=k;c.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 b=new FileReader;b.onload=function(a){l.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(m);mxEvent.addListener(m,"change",function(){var a=g();if(0==l.value.length||l.value==k)k=a,l.value=k});b=mxUtils.button(mxResources.get("close"),function(){l.value==k?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("insert"),
+function(){a.hideDialog();d(l.value,m.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,g,e,l,m,n,q,f,k,p,t,u,y){function z(){var a=!0;if(null!=S)for(;C<S.length&&(a||0!=mxUtils.mod(C,30));)a=S[C++],E(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview),a=!1}function v(){if(Y)b||a.hideDialog(),t(Y,fa,I.value);else if(d)b||a.hideDialog(),d(U,I.value);else{var c=I.value;
+null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,U,null!=T&&0<T.length?T:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function x(a,b,c,f,k){null!=W&&(W.style.backgroundColor="transparent",W.style.border="1px solid transparent");H.removeAttribute("disabled");U=b;T=c;W=a;Y=f;fa=k;W.style.backgroundColor=m;W.style.border=n}function E(b,c,f,k,d,p,e,g,t){var u=document.createElement("div");u.className="geTemplate";
+u.style.height=P+"px";u.style.width=R+"px";null!=k&&0<k.length&&u.setAttribute("title",k);if(null!=p)u.style.backgroundImage="url("+p+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){x(u,null,null,b,e)}),mxEvent.addListener(u,"dblclick",function(a){v()});else if(null!=b&&0<b.length){f=t||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";u.style.backgroundImage="url("+f+")";u.style.backgroundPosition=
+"center center";u.style.backgroundRepeat="no-repeat";var A=!1;mxEvent.addListener(u,"click",function(f){H.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;F.spin(N);mxUtils.get(f,mxUtils.bind(this,function(a){F.stop();200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),c),A&&v())}))});mxEvent.addListener(u,"dblclick",
+function(a){A=!0})}else u.innerHTML='<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",d&&x(u),null!=g?mxEvent.addListener(u,"click",g):(mxEvent.addListener(u,"click",function(a){x(u)}),mxEvent.addListener(u,"dblclick",function(a){v()}));N.appendChild(u)}function J(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(z(),mxEvent.consume(a))});var a=null,b;for(b in aa){var c=
+document.createElement("div"),f=mxResources.get(b),k=aa[b];null==f&&(f=b.substring(0,1).toUpperCase()+b.substring(1));18<f.length&&(f=f.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",f+" ("+k.length+")");mxUtils.write(c,c.getAttribute("title"));null!=q&&(c.style.padding=q);Z.appendChild(c);null==a&&(a=c,a.style.backgroundColor=l);(function(b,f){mxEvent.addListener(c,
+"click",function(){a!=f&&(a.style.backgroundColor="",a=f,a.style.backgroundColor=l,N.scrollTop=0,N.innerHTML="",C=0,S=aa[b],K=null,z())})})(b,c)}z()}b=null!=b?b:!0;g=null!=g?g:!1;l=null!=l?l:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var G=document.createElement("div");G.style.height="100%";var A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.height="46px";b&&G.appendChild(A);var D=document.createElement("img");D.setAttribute("border",
+"0");D.setAttribute("align","absmiddle");D.style.width="40px";D.style.height="40px";D.style.marginRight="10px";D.style.paddingBottom="4px";D.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";
+!c&&b&&A.appendChild(D);b&&mxUtils.write(A,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");D=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?D=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?D=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?D=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?D=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(D=a.trello.extension);var I=
+document.createElement("input");I.setAttribute("value",a.defaultFilename+D);I.style.marginLeft="10px";I.style.width=c?"220px":"430px";this.init=function(){b&&(I.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?I.select():document.execCommand("selectAll",!1,null))};b&&(A.appendChild(I),null!=a.editor.fileExtensions&&(D=FilenameDialog.createTypeHint(a,I,a.editor.fileExtensions),D.style.marginTop="12px",A.appendChild(D)));var A=!1,C=0,F=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}),H=mxUtils.button(y||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");v();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";if(k||p){var B=[],K=null,M=function(a){H.setAttribute("disabled","disabled");for(var b=0;b<B.length;b++)B[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},A=!0;y=document.createElement("div");y.style.whiteSpace="nowrap";y.style.height=
-"30px";F.appendChild(y);E=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";N.style.left="160px";M(0);N.scrollTop=0;N.innerHTML="";C=0;K!=S&&(S=K,z(),K=null)});B.push(E);y.appendChild(E);var Q=function(a){Z.style.display="none";N.style.left="30px";M(a?-1:1);null==K&&(K=S);N.scrollTop=0;N.innerHTML="";G.spin(N);C=0;var b=function(a,b){G.stop();S=a;b?N.innerHTML=b:0==a.length?N.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
-(N.innerHTML="",z())};a?p(O.value,b):k(b)};k&&(E=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){Q()}),y.appendChild(E),B.push(E));if(p){E=document.createElement("span");E.style.marginLeft="10px";E.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");y.appendChild(E);var O=document.createElement("input");O.style.marginRight="10px";O.style.marginLeft="10px";O.style.width="220px";mxEvent.addListener(O,"keypress",function(a){13==a.keyCode&&Q(!0)});y.appendChild(O);E=mxUtils.button(mxResources.get("search"),
-function(){Q(!0)});E.className="geBtn";y.appendChild(E)}M(0)}var T=null,U=null,W=null,Y=null,fa=null,N=document.createElement("div");N.style.border="1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";A=(b?72:40)+(A?30:0);N.style.top=A+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+A+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
-var P=140,R=140,aa={},V=1;aa.basic=[{title:"blankDiagram",select:!0}];var S=aa.basic;if(!c){F.appendChild(Z);F.appendChild(N);var ba=!1;/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)&&(f=PROXY_URL+"?url="+encodeURIComponent(f));mxUtils.get(f,function(a){if(!ba){ba=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=aa[c];null==
-b&&(V++,b=[],aa[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview")})}}a=a.nextSibling}J()}})}mxEvent.addListener(I,"keypress",function(b){a.dialog.container.firstChild==F&&13==b.keyCode&&v()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";A=mxUtils.button(mxResources.get("cancel"),
-function(){null!=g&&g();a.hideDialog(!0)});A.className="geBtn";!a.editor.cancelFirst||e&&null==g||f.appendChild(A);c||a.isOffline()||!b||null!=d||e||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",f.appendChild(y));c||"1"==urlParams.embed||e||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=
+"30px";G.appendChild(y);D=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";N.style.left="160px";M(0);N.scrollTop=0;N.innerHTML="";C=0;K!=S&&(S=K,z(),K=null)});B.push(D);y.appendChild(D);var O=function(a){Z.style.display="none";N.style.left="30px";M(a?-1:1);null==K&&(K=S);N.scrollTop=0;N.innerHTML="";F.spin(N);C=0;var b=function(a,b){F.stop();S=a;b?N.innerHTML=b:0==a.length?N.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
+(N.innerHTML="",z())};a?p(Q.value,b):k(b)};k&&(D=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){O()}),y.appendChild(D),B.push(D));if(p){D=document.createElement("span");D.style.marginLeft="10px";D.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");y.appendChild(D);var Q=document.createElement("input");Q.style.marginRight="10px";Q.style.marginLeft="10px";Q.style.width="220px";mxEvent.addListener(Q,"keypress",function(a){13==a.keyCode&&O(!0)});y.appendChild(Q);D=mxUtils.button(mxResources.get("search"),
+function(){O(!0)});D.className="geBtn";y.appendChild(D)}M(0)}var T=null,U=null,W=null,Y=null,fa=null,N=document.createElement("div");N.style.border="1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";A=(b?72:40)+(A?30:0);N.style.top=A+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+A+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
+var P=140,R=140,aa={},V=1;aa.basic=[{title:"blankDiagram",select:!0}];var S=aa.basic;if(!c){G.appendChild(Z);G.appendChild(N);var ba=!1;/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)&&(f=PROXY_URL+"?url="+encodeURIComponent(f));mxUtils.get(f,function(a){if(!ba){ba=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=aa[c];null==
+b&&(V++,b=[],aa[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview")})}}a=a.nextSibling}J()}})}mxEvent.addListener(I,"keypress",function(b){a.dialog.container.firstChild==G&&13==b.keyCode&&v()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";A=mxUtils.button(mxResources.get("cancel"),
+function(){null!=e&&e();a.hideDialog(!0)});A.className="geBtn";!a.editor.cancelFirst||g&&null==e||f.appendChild(A);c||a.isOffline()||!b||null!=d||g||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",f.appendChild(y));c||"1"==urlParams.embed||g||(c=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(I.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()}),c.className="geBtn",f.appendChild(c));Graph.fileSupport&&u&&(u=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,
-"change",function(c){a.openFiles(b.files,!0)});b.click()}),u.className="geBtn",f.appendChild(u));f.appendChild(H);a.editor.cancelFirst||null!=d||e&&null==g||f.appendChild(A);F.appendChild(f);this.container=F},CreateDialog=function(a,c,b,d,e,g,l,m,n,q,f,k,p,t,u,y){function z(b,f,d,p){function e(){mxEvent.addListener(x,"click",function(){var b=d;if(l){var f=D.value,k=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?
-p=a.gitHub.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".xml");0<=k&&(f=f.substring(0,k));D.value=f+p}}v(d)})}var x=document.createElement("a");x.style.overflow="hidden";var g=document.createElement("img");g.src=b;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";x.style.display=mxClient.IS_QUIRKS?"inline":
-"inline-block";x.className="geBaseButton";x.style.position="relative";x.style.margin="4px";x.style.padding="8px 8px 10px 8px";x.style.whiteSpace="nowrap";x.appendChild(g);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");x.style.color="gray";x.style.fontSize="11px";var t=document.createElement("div");x.appendChild(t);mxUtils.write(t,f);if(null!=p&&null==a[p]){g.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=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});u.spin(x);var y=window.setTimeout(function(){null==a[p]&&(u.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(y),mxUtils.setOpacity(t,100),g.style.visibility="",u.stop(),e())}))}else e();J.appendChild(x);++F==k&&(mxUtils.br(J),F=0)}function v(c){var f=D.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}l=null!=l?l:!0;m=null!=m?m:!0;k=null!=k?k:4;g=
-document.createElement("div");null==d&&a.addLanguageMenu(g);var x=document.createElement("h2");mxUtils.write(x,e||mxResources.get("create"));x.style.marginTop="0px";x.style.marginBottom="24px";g.appendChild(x);mxUtils.write(g,mxResources.get("filename")+":");var D=document.createElement("input");D.setAttribute("value",c);D.style.width="280px";D.style.marginLeft="10px";D.style.marginBottom="20px";this.init=function(){D.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
-D.select():document.execCommand("selectAll",!1,null)};g.appendChild(D);null!=y&&g.appendChild(FilenameDialog.createTypeHint(a,D,y));null!=p&&null!=t&&"image/"==t.substring(0,6)&&(D.style.width="160px",e=null,"image/svg+xml"==t&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],t=parseInt(p.getAttribute("width")),u=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+t+" "+u),p.setAttribute("width","120px"),p.setAttribute("height",
-"80px")):(e=document.createElement("img"),e.setAttribute("src","data:"+t+(u?";base64,":";utf8,")+p)),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%)"),g.appendChild(e),n&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){v("_blank")})));mxUtils.br(g);var J=document.createElement("div");J.style.textAlign="center";var F=0;J.style.marginTop=
-"6px";g.appendChild(J);var A=document.createElement("select");A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),A.appendChild(p),z(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),
+"change",function(c){a.openFiles(b.files,!0)});b.click()}),u.className="geBtn",f.appendChild(u));f.appendChild(H);a.editor.cancelFirst||null!=d||g&&null==e||f.appendChild(A);G.appendChild(f);this.container=G},CreateDialog=function(a,c,b,d,g,e,l,m,n,q,f,k,p,t,u,y){function z(b,f,d,p){function g(){mxEvent.addListener(e,"click",function(){var b=d;if(l){var f=E.value,k=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?
+p=a.gitHub.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".xml");0<=k&&(f=f.substring(0,k));E.value=f+p}}v(d)})}var e=document.createElement("a");e.style.overflow="hidden";var x=document.createElement("img");x.src=b;x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.style.width="60px";x.style.height="60px";x.style.paddingBottom="6px";e.style.display=mxClient.IS_QUIRKS?"inline":
+"inline-block";e.className="geBaseButton";e.style.position="relative";e.style.margin="4px";e.style.padding="8px 8px 10px 8px";e.style.whiteSpace="nowrap";e.appendChild(x);mxClient.IS_QUIRKS&&(e.style.cssFloat="left",e.style.zoom="1");e.style.color="gray";e.style.fontSize="11px";var t=document.createElement("div");e.appendChild(t);mxUtils.write(t,f);if(null!=p&&null==a[p]){x.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=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});u.spin(e);var y=window.setTimeout(function(){null==a[p]&&(u.stop(),e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(y),mxUtils.setOpacity(t,100),x.style.visibility="",u.stop(),g())}))}else g();J.appendChild(e);++G==k&&(mxUtils.br(J),G=0)}function v(c){var f=E.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}l=null!=l?l:!0;m=null!=m?m:!0;k=null!=k?k:4;e=
+document.createElement("div");null==d&&a.addLanguageMenu(e);var x=document.createElement("h2");mxUtils.write(x,g||mxResources.get("create"));x.style.marginTop="0px";x.style.marginBottom="24px";e.appendChild(x);mxUtils.write(e,mxResources.get("filename")+":");var E=document.createElement("input");E.setAttribute("value",c);E.style.width="280px";E.style.marginLeft="10px";E.style.marginBottom="20px";this.init=function(){E.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
+E.select():document.execCommand("selectAll",!1,null)};e.appendChild(E);null!=y&&e.appendChild(FilenameDialog.createTypeHint(a,E,y));null!=p&&null!=t&&"image/"==t.substring(0,6)&&(E.style.width="160px",g=null,"image/svg+xml"==t&&mxClient.IS_SVG?(g=document.createElement("div"),g.innerHTML=mxUtils.trim(p),p=g.getElementsByTagName("svg")[0],t=parseInt(p.getAttribute("width")),u=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+t+" "+u),p.setAttribute("width","120px"),p.setAttribute("height",
+"80px")):(g=document.createElement("img"),g.setAttribute("src","data:"+t+(u?";base64,":";utf8,")+p)),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px",mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),e.appendChild(g),n&&Editor.popupsAllowed&&(g.style.cursor="pointer",mxEvent.addListener(g,"click",function(){v("_blank")})));mxUtils.br(e);var J=document.createElement("div");J.style.textAlign="center";var G=0;J.style.marginTop=
+"6px";e.appendChild(J);var A=document.createElement("select");A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),A.appendChild(p),z(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),
 mxUtils.write(p,mxResources.get("oneDrive")),A.appendChild(p),a.mode==App.MODE_ONEDRIVE&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(p,mxResources.get("dropbox")),A.appendChild(p),a.mode==App.MODE_DROPBOX&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),
 App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITHUB),mxUtils.write(p,mxResources.get("github")),A.appendChild(p),z(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.TrelloClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_TRELLO),mxUtils.write(p,mxResources.get("trello")),A.appendChild(p),z(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),
 App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(p=document.createElement("option"),p.setAttribute("value",App.MODE_DEVICE),mxUtils.write(p,mxResources.get("device")),A.appendChild(p),a.mode!=App.MODE_DEVICE&&m||p.setAttribute("selected","selected"),f&&z(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"),z(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));m=document.createElement("div");m.style.marginTop="26px";m.style.textAlign="center";null!=q&&(f=mxUtils.button(mxResources.get("help"),function(){a.openLink(q)}),f.className="geBtn",m.appendChild(f));f=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),
 window.close(),window.location.href=a.getUrl())});f.className="geBtn";a.editor.cancelFirst&&m.appendChild(f);null==d&&(p=mxUtils.button(mxResources.get("decideLater"),function(){v(null)}),p.className="geBtn",m.appendChild(p));n&&Editor.popupsAllowed&&(n=mxUtils.button(mxResources.get("openInNewWindow"),function(){v("_blank")}),n.className="geBtn",m.appendChild(n));CreateDialog.showDownloadButton&&(n=mxUtils.button(mxResources.get("download"),function(){v("download")}),n.className="geBtn",m.appendChild(n));
-a.editor.cancelFirst||m.appendChild(f);mxEvent.addListener(D,"keypress",function(b){13==b.keyCode?v(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});g.appendChild(m);this.container=g};CreateDialog.showDownloadButton=!0;
-var PopupDialog=function(a,c,b,d,e){e=null!=e?e:!0;var g=document.createElement("div");g.style.textAlign="left";mxUtils.write(g,mxResources.get("fileOpenLocation"));mxUtils.br(g);mxUtils.br(g);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=d&&d()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";g.appendChild(l);mxUtils.br(g);var m=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=b&&b();a.openLink(c,
-null,!0)});m.className="geBtn gePrimaryBtn";m.style.width=l.style.width;g.appendChild(m);mxUtils.br(g);mxUtils.br(g);mxUtils.write(g,mxResources.get("allowPopups"));this.container=g},ImageDialog=function(a,c,b,d,e,g){g=null!=g?g:!0;var l=a.editor.graph,m=document.createElement("div");mxUtils.write(m,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor=
+a.editor.cancelFirst||m.appendChild(f);mxEvent.addListener(E,"keypress",function(b){13==b.keyCode?v(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});e.appendChild(m);this.container=e};CreateDialog.showDownloadButton=!0;
+var PopupDialog=function(a,c,b,d,g){g=null!=g?g:!0;var e=document.createElement("div");e.style.textAlign="left";mxUtils.write(e,mxResources.get("fileOpenLocation"));mxUtils.br(e);mxUtils.br(e);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){g&&a.hideDialog();null!=d&&d()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";e.appendChild(l);mxUtils.br(e);var m=mxUtils.button(mxResources.get("openInNewWindow"),function(){g&&a.hideDialog();null!=b&&b();a.openLink(c,
+null,!0)});m.className="geBtn gePrimaryBtn";m.style.width=l.style.width;e.appendChild(m);mxUtils.br(e);mxUtils.br(e);mxUtils.write(e,mxResources.get("allowPopups"));this.container=e},ImageDialog=function(a,c,b,d,g,e){e=null!=e?e:!0;var l=a.editor.graph,m=document.createElement("div");mxUtils.write(m,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor=
 "default";mxClient.IS_VML||(c.style.paddingRight="20px");var n=document.createElement("input");n.setAttribute("value",b);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";b=document.createElement("div");b.setAttribute("title",mxResources.get("reset"));b.style.position="relative";b.style.left="-16px";b.style.width="12px";b.style.height="14px";b.style.cursor="pointer";b.style.display=mxClient.IS_VML?"inline":"inline-block";b.style.top=(mxClient.IS_VML?0:3)+"px";b.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(b,"click",function(){n.value="";n.focus()});c.appendChild(n);c.appendChild(b);
-m.appendChild(c);var q=function(b,c,f,k){var p="data:"==b.substring(0,5);!a.isOffline()||p&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(p){a.spinner.stop();a.hideDialog();var v=!1===k?1:null!=c&&null!=f?Math.max(c/p.width,f/p.height):Math.min(1,Math.min(520/p.width,520/p.height));g&&(b=a.convertDataUri(b));d(b,Math.round(Number(p.width)*v),Math.round(Number(p.height)*v))},function(){a.spinner.stop();d(null);a.showError(mxResources.get("error"),
-mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),d(b)):(b=a.convertDataUri(b),c=null==c?120:c,f=null==f?100:f,a.hideDialog(),d(b,c,f))},f=function(b,c){if(null!=b){var f=e?null:l.getModel().getGeometry(l.getSelectionCell());null!=f?q(b,f.width,f.height,c):q(b,null,null,c)}else a.hideDialog(),d(null)};this.init=function(){n.focus();if(Graph.fileSupport){n.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=m.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(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.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,k,p,e,g){f(a,
-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(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)&&f(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),
+m.appendChild(c);var q=function(b,c,f,k){var p="data:"==b.substring(0,5);!a.isOffline()||p&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(p){a.spinner.stop();a.hideDialog();var v=!1===k?1:null!=c&&null!=f?Math.max(c/p.width,f/p.height):Math.min(1,Math.min(520/p.width,520/p.height));e&&(b=a.convertDataUri(b));d(b,Math.round(Number(p.width)*v),Math.round(Number(p.height)*v))},function(){a.spinner.stop();d(null);a.showError(mxResources.get("error"),
+mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),d(b)):(b=a.convertDataUri(b),c=null==c?120:c,f=null==f?100:f,a.hideDialog(),d(b,c,f))},f=function(b,c){if(null!=b){var f=g?null:l.getModel().getGeometry(l.getSelectionCell());null!=f?q(b,f.width,f.height,c):q(b,null,null,c)}else a.hideDialog(),d(null)};this.init=function(){n.focus();if(Graph.fileSupport){n.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=m.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(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.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,k,d,p,e,g){f(a,
+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(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var k=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(k)&&f(decodeURIComponent(k))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),
 function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);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 k=document.createElement("input");k.setAttribute("multiple","multiple");k.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(k,"change",function(b){a.importFiles(k.files,
-0,0,a.maxImageSize,function(a,b,c,d,k,p){f(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 p=mxUtils.button(mxResources.get("open"),function(){k.click()});p.className="geBtn";b.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 b=new CropImageDialog(a,n.value,function(a){n.value=
+0,0,a.maxImageSize,function(a,b,c,k,d,p){f(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 p=mxUtils.button(mxResources.get("open"),function(){k.click()});p.className="geBtn";b.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 b=new CropImageDialog(a,n.value,function(a){n.value=
 a});a.showDialog(b.container,200,185,!0,!0);b.init()}),p.className="geBtn",b.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 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)}),
 p.className="geBtn",b.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 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)}))}),p.className="geBtn",b.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";b.appendChild(p);a.editor.cancelFirst||b.appendChild(c);Graph.fileSupport&&(b.style.marginTop="120px",m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",m.style.backgroundPosition=
-"center 65%",m.style.backgroundRepeat="no-repeat",c=document.createElement("div"),c.style.position="absolute",c.style.width="420px",c.style.top="58%",c.style.textAlign="center",c.style.fontSize="18px",c.style.color="#a0c3ff",mxUtils.write(c,mxResources.get("dragImagesHere")),m.appendChild(c));m.appendChild(b);this.container=m},LinkDialog=function(a,c,b,d,e){function g(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";
+"center 65%",m.style.backgroundRepeat="no-repeat",c=document.createElement("div"),c.style.position="absolute",c.style.width="420px",c.style.top="58%",c.style.textAlign="center",c.style.fontSize="18px",c.style.color="#a0c3ff",mxUtils.write(c,mxResources.get("dragImagesHere")),m.appendChild(c));m.appendChild(b);this.container=m},LinkDialog=function(a,c,b,d,g){function e(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);z.appendChild(c)}var l=document.createElement("div");mxUtils.write(l,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="440px";n.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";n.style.backgroundRepeat="no-repeat";n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";var q=document.createElement("div");q.setAttribute("title",mxResources.get("reset"));q.style.position="relative";q.style.left="-16px";q.style.width="12px";q.style.height="14px";q.style.cursor="pointer";
 q.style.display=mxClient.IS_VML?"inline":"inline-block";q.style.top=(mxClient.IS_VML?0:3)+"px";q.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(q,"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 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 p=document.createElement("select");p.style.width="420px";if(e&&null!=a.pages){null!=c&&"data:page/id,"==c.substring(0,13)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(n.setAttribute("value",c),f.setAttribute("checked","checked"),f.defaultChecked=!0);n.style.width="420px";m.appendChild(f);m.appendChild(n);m.appendChild(q);mxUtils.br(m);m.appendChild(k);e=!1;for(q=0;q<a.pages.length;q++){var t=
-document.createElement("option");mxUtils.write(t,a.pages[q].getName()||mxResources.get("pageWithNumber",[q+1]));t.setAttribute("value","data:page/id,"+a.pages[q].getId());c==t.getAttribute("value")&&(t.setAttribute("selected","selected"),e=!0);p.appendChild(t)}if(!e&&k.checked){var u=document.createElement("option");mxUtils.write(u,mxResources.get("pageNotFound"));u.setAttribute("disabled","disabled");u.setAttribute("selected","selected");u.setAttribute("value","pageNotFound");p.appendChild(u);mxEvent.addListener(p,
+k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","current-linkdialog");var p=document.createElement("select");p.style.width="420px";if(g&&null!=a.pages){null!=c&&"data:page/id,"==c.substring(0,13)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(n.setAttribute("value",c),f.setAttribute("checked","checked"),f.defaultChecked=!0);n.style.width="420px";m.appendChild(f);m.appendChild(n);m.appendChild(q);mxUtils.br(m);m.appendChild(k);g=!1;for(q=0;q<a.pages.length;q++){var t=
+document.createElement("option");mxUtils.write(t,a.pages[q].getName()||mxResources.get("pageWithNumber",[q+1]));t.setAttribute("value","data:page/id,"+a.pages[q].getId());c==t.getAttribute("value")&&(t.setAttribute("selected","selected"),g=!0);p.appendChild(t)}if(!g&&k.checked){var u=document.createElement("option");mxUtils.write(u,mxResources.get("pageNotFound"));u.setAttribute("disabled","disabled");u.setAttribute("selected","selected");u.setAttribute("value","pageNotFound");p.appendChild(u);mxEvent.addListener(p,
 "change",function(){null==u.parentNode||u.selected||u.parentNode.removeChild(u)})}m.appendChild(p)}else n.setAttribute("value",c),m.appendChild(n),m.appendChild(q);l.appendChild(m);var y=mxUtils.button(b,function(){a.hideDialog();d(k.checked?"pageNotFound"!==p.value?p.value:c:n.value,LinkDialog.selectedDocs)});y.style.verticalAlign="middle";y.className="geBtn gePrimaryBtn";this.init=function(){k.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");k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(n,"focus",function(){k.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){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(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.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")&&(n.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,y.click());a.stopPropagation();a.preventDefault()}),!1)}};var z=document.createElement("div");
 z.style.marginTop="20px";z.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.style.verticalAlign="middle";b.className="geBtn";a.editor.cancelFirst&&z.appendChild(b);m=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});m.style.verticalAlign="middle";m.className="geBtn";z.appendChild(m);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(m.style.display="none");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||null!=a.docs[0].mimeType&&"application/vnd.jgraph."==a.docs[0].mimeType.substring(0,23)?b="https://www.draw.io/#G"+a.docs[0].id:"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);n.value=b;n.focus()}else LinkDialog.selectedDocs=null;n.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&
-null!=a.drive&&g(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),f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),d=(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(f).addView(d).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&&g(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&&g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){n.value=b.value[0].webUrl;
-n.focus()})});null!=a.gitHub&&g(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],f=a[2];a=a.slice(3,a.length).join("/");n.value="https://github.com/"+b+"/"+c+"/blob/"+f+"/"+a;n.focus()}})});mxEvent.addListener(n,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),d(k.checked?p.value:n.value,LinkDialog.selectedDocs))});z.appendChild(y);a.editor.cancelFirst||z.appendChild(b);l.appendChild(z);this.container=
+null!=a.drive&&e(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),f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),k=(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(f).addView(k).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&&e(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&&e(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){n.value=b.value[0].webUrl;
+n.focus()})});null!=a.gitHub&&e(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],f=a[2];a=a.slice(3,a.length).join("/");n.value="https://github.com/"+b+"/"+c+"/blob/"+f+"/"+a;n.focus()}})});mxEvent.addListener(n,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),d(k.checked?p.value:n.value,LinkDialog.selectedDocs))});z.appendChild(y);a.editor.cancelFirst||z.appendChild(b);l.appendChild(z);this.container=
 l},AboutDialog=function(a){var c=document.createElement("div");c.style.marginTop="6px";c.setAttribute("align","center");var b=document.createElement("img");b.style.border="0px";mxClient.IS_SVG?(b.setAttribute("width","164"),b.setAttribute("height","221"),b.style.width="164px",b.style.height="221px",b.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(b.setAttribute("width","176"),b.setAttribute("height","219"),b.style.width="170px",b.style.height="219px",b.setAttribute("src",IMAGE_PATH+
 "/logo-flat.png"));"dark"==uiTheme&&(b.style.filter="grayscale(100%) invert(100%)");c.appendChild(b);mxUtils.br(c);var b="dark"==uiTheme?"#cccccc":"#505050",d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color=b;c.appendChild(d);mxUtils.br(c);mxUtils.br(c);d=document.createElement("small");d.style.color=b;d.innerHTML='&copy; 2005-2019 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';c.appendChild(d);mxEvent.addListener(c,
 "click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=c},FeedbackDialog=function(a){var c=document.createElement("div"),b=document.createElement("div");mxUtils.write(b,mxResources.get("sendYourFeedbackToDrawIo"));b.style.fontSize="18px";b.style.marginBottom="18px";c.appendChild(b);b=document.createElement("div");mxUtils.write(b,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");c.appendChild(b);var d=document.createElement("input");d.setAttribute("type",
-"text");d.style.marginTop="6px";d.style.width="600px";var e=mxUtils.button(mxResources.get("sendMessage"),function(){var b=n.value+(l.checked?"\nDiagram:\n"+mxUtils.getXml(a.getXmlFileData()):"")+"\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(d.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+
-"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+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 g=/^(([^<>()[\]\\.,;:\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(d,"change",function(){0<d.value.length&&0<g.test(d.value)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")});mxEvent.addListener(d,"keyup",function(){0<d.value.length&&g.test(d.value)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")});c.appendChild(d);this.init=function(){d.focus()};var l=document.createElement("input");l.setAttribute("type","checkbox");l.setAttribute("checked","checked");l.defaultChecked=!0;b=document.createElement("p");b.style.marginTop=
+"text");d.style.marginTop="6px";d.style.width="600px";var g=mxUtils.button(mxResources.get("sendMessage"),function(){var b=n.value+(l.checked?"\nDiagram:\n"+mxUtils.getXml(a.getXmlFileData()):"")+"\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(d.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+
+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+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"))}))});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");var e=/^(([^<>()[\]\\.,;:\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(d,"change",function(){0<d.value.length&&0<e.test(d.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});mxEvent.addListener(d,"keyup",function(){0<d.value.length&&e.test(d.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});c.appendChild(d);this.init=function(){d.focus()};var l=document.createElement("input");l.setAttribute("type","checkbox");l.setAttribute("checked","checked");l.defaultChecked=!0;b=document.createElement("p");b.style.marginTop=
 "14px";b.appendChild(l);var m=document.createElement("span");mxUtils.write(m," "+mxResources.get("includeCopyOfMyDiagram"));b.appendChild(m);mxEvent.addListener(m,"click",function(a){l.checked=!l.checked;mxEvent.consume(a)});c.appendChild(b);b=document.createElement("div");mxUtils.write(b,mxResources.get("feedback"));c.appendChild(b);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"));
-c.appendChild(n);b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst?(b.appendChild(m),b.appendChild(e)):(b.appendChild(e),b.appendChild(m));c.appendChild(b);this.container=c};FeedbackDialog.maxAttachmentSize=1E6;
-var RevisionDialog=function(a,c,b){var d=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));d.appendChild(e);var g=document.createElement("div");g.style.position="absolute";g.style.overflow="auto";g.style.width="170px";g.style.height="378px";d.appendChild(g);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=
+c.appendChild(n);b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst?(b.appendChild(m),b.appendChild(g)):(b.appendChild(g),b.appendChild(m));c.appendChild(b);this.container=c};FeedbackDialog.maxAttachmentSize=1E6;
+var RevisionDialog=function(a,c,b){var d=document.createElement("div"),g=document.createElement("h3");g.style.marginTop="0px";mxUtils.write(g,mxResources.get("revisionHistory"));d.appendChild(g);var e=document.createElement("div");e.style.position="absolute";e.style.overflow="auto";e.style.width="170px";e.style.height="378px";d.appendChild(e);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);d.appendChild(l);var m=new Graph(l);m.setTooltips(!1);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,q=null,f=0,k=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[f]?q[f].getAttribute("name"):"pagenumber"==a?f+1:k.apply(this,arguments)};m.getLinkForCell=function(){return null};
 Editor.MathJaxRender&&m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){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%"}),t=a.getCurrentFile(),u=null,y=null,z=null,v=null,x=mxUtils.button("",function(){null!=z&&m.zoomIn()});x.className="geSprite geSprite-zoomin";x.setAttribute("title",
-mxResources.get("zoomIn"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var D=mxUtils.button("",function(){null!=z&&m.zoomOut()});D.className="geSprite geSprite-zoomout";D.setAttribute("title",mxResources.get("zoomOut"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var J=mxUtils.button("",function(){null!=z&&(m.maxFitScale=8,m.fit(8),
-m.center())});J.className="geSprite geSprite-fit";J.setAttribute("title",mxResources.get("fit"));J.style.outline="none";J.style.border="none";J.style.margin="2px";J.setAttribute("disabled","disabled");mxUtils.setOpacity(J,20);var F=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});F.className="geSprite geSprite-actualsize";F.setAttribute("title",mxResources.get("actualSize"));F.style.outline="none";F.style.border="none";F.style.margin="2px";F.setAttribute("disabled","disabled");
-mxUtils.setOpacity(F,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!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".xml";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b="undefined"===typeof pako?
-"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});E.className="geBtn";E.setAttribute("disabled","disabled");var I=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=v&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(v):a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();a.replaceFileData(v);
-a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});I.className="geBtn";I.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 G=null;mxEvent.addListener(C,"change",function(a){null!=G&&(G(a),mxEvent.consume(a))});
+mxResources.get("zoomIn"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var E=mxUtils.button("",function(){null!=z&&m.zoomOut()});E.className="geSprite geSprite-zoomout";E.setAttribute("title",mxResources.get("zoomOut"));E.style.outline="none";E.style.border="none";E.style.margin="2px";E.setAttribute("disabled","disabled");mxUtils.setOpacity(E,20);var J=mxUtils.button("",function(){null!=z&&(m.maxFitScale=8,m.fit(8),
+m.center())});J.className="geSprite geSprite-fit";J.setAttribute("title",mxResources.get("fit"));J.style.outline="none";J.style.border="none";J.style.margin="2px";J.setAttribute("disabled","disabled");mxUtils.setOpacity(J,20);var G=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});G.className="geSprite geSprite-actualsize";G.setAttribute("title",mxResources.get("actualSize"));G.style.outline="none";G.style.border="none";G.style.margin="2px";G.setAttribute("disabled","disabled");
+mxUtils.setOpacity(G,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 D=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".xml";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b="undefined"===typeof pako?
+"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});D.className="geBtn";D.setAttribute("disabled","disabled");var I=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=v&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(v):a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();a.replaceFileData(v);
+a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});I.className="geBtn";I.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 F=null;mxEvent.addListener(C,"change",function(a){null!=F&&(F(a),mxEvent.consume(a))});
 var H=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});H.className="geBtn";H.setAttribute("disabled","disabled");null!=b&&(H.style.display="none");var B=mxUtils.button(mxResources.get("show"),function(){null!=y&&a.openLink(y.getUrl(C.selectedIndex))});B.className="geBtn gePrimaryBtn";B.setAttribute("disabled","disabled");null!=b&&(B.style.display=
-"none",I.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var M=null;if(null!=c&&0<c.length){l.style.cursor="move";var Q=document.createElement("table");Q.style.border="1px solid lightGray";Q.style.borderCollapse=
-"collapse";Q.style.borderSpacing="0px";Q.style.width="100%";var O=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var U=c.length-1;0<=U;U--){var W=function(b){var d=new Date(b.modifiedDate),k=null;if(0<=d.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),g=a.editor.extractGraphModel(e.documentElement,!0);if(null!=g){var u=function(a){null!=a&&(a=y(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));
+"none",I.className="geBtn gePrimaryBtn");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.width="640px";g.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var M=null;if(null!=c&&0<c.length){l.style.cursor="move";var O=document.createElement("table");O.style.border="1px solid lightGray";O.style.borderCollapse=
+"collapse";O.style.borderSpacing="0px";O.style.width="100%";var Q=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var U=c.length-1;0<=U;U--){var W=function(b){var k=new Date(b.modifiedDate),d=null;if(0<=k.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),g=a.editor.extractGraphModel(e.documentElement,!0);if(null!=g){var u=function(a){null!=a&&(a=y(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));
 return a},y=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};C.style.display="none";C.innerHTML="";z=e;v=c;q=parseSelectFunction=null;f=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");q=[];for(c=0;c<e.length;c++)q.push(e[c]);f=Math.min(n,q.length-1);0<q.length&&u(q[f]);if(1<q.length)for(C.removeAttribute("disabled"),
-C.style.display="",c=0;c<q.length;c++)e=document.createElement("option"),mxUtils.write(e,q[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),C.appendChild(e);G=function(){try{var b=parseInt(C.value);u(q[b]);f=n=b}catch(L){C.value=n,a.handleError(L)}}}else y(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+d.toLocaleDateString()+" "+d.toLocaleTimeString());
-A.setAttribute("title",k.getAttribute("title"));x.removeAttribute("disabled");D.removeAttribute("disabled");J.removeAttribute("disabled");F.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&I.removeAttribute("disabled"),E.removeAttribute("disabled"),B.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(x,60);mxUtils.setOpacity(D,60);mxUtils.setOpacity(J,60);mxUtils.setOpacity(F,60)}else C.style.display="none",C.innerHTML="",A.innerHTML="",
-mxUtils.write(A,mxResources.get("errorLoadingFile"))},k=document.createElement("tr");k.style.borderBottom="1px solid lightGray";k.style.fontSize="12px";k.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):d.toDateString()===T?mxUtils.write(g,d.toLocaleTimeString()):mxUtils.write(g,d.toLocaleDateString()+" "+d.toLocaleTimeString());k.appendChild(g);k.setAttribute("title",d.toLocaleDateString()+
-" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(k,"click",function(a){y!=b&&(p.stop(),null!=u&&(u.style.backgroundColor=""),y=b,u=k,u.style.backgroundColor="#ebf2f9",v=z=null,A.removeAttribute("title"),A.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",m.getModel().clear(),I.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),
-x.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),mxUtils.setOpacity(x,20),mxUtils.setOpacity(D,20),mxUtils.setOpacity(J,20),mxUtils.setOpacity(F,20),p.spin(l),b.getXml(function(a){if(y==b)try{e(a)}catch(V){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+V.message)}},function(a){p.stop();
-C.style.display="none";C.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(k,"dblclick",function(a){B.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);O.appendChild(k)}return k}(c[U]);null!=W&&U==c.length-1&&(M=W)}Q.appendChild(O);g.appendChild(Q)}else null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==
-window.DropboxFile?(l.style.display="none",K.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(l.style.display="none",K.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";K.appendChild(C);K.appendChild(x);K.appendChild(D);K.appendChild(F);K.appendChild(J);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(E),e.appendChild(H),
-e.appendChild(I),e.appendChild(B)):(e.appendChild(E),e.appendChild(H),e.appendChild(I),e.appendChild(B),e.appendChild(g));d.appendChild(e);d.appendChild(K);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,e,g,l,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q);var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";
+C.style.display="",c=0;c<q.length;c++)e=document.createElement("option"),mxUtils.write(e,q[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),C.appendChild(e);F=function(){try{var b=parseInt(C.value);u(q[b]);f=n=b}catch(L){C.value=n,a.handleError(L)}}}else y(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+k.toLocaleDateString()+" "+k.toLocaleTimeString());
+A.setAttribute("title",d.getAttribute("title"));x.removeAttribute("disabled");E.removeAttribute("disabled");J.removeAttribute("disabled");G.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&I.removeAttribute("disabled"),D.removeAttribute("disabled"),B.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(x,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(J,60);mxUtils.setOpacity(G,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 g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):k.toDateString()===T?mxUtils.write(g,k.toLocaleTimeString()):mxUtils.write(g,k.toLocaleDateString()+" "+k.toLocaleTimeString());d.appendChild(g);d.setAttribute("title",k.toLocaleDateString()+
+" "+k.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(a){y!=b&&(p.stop(),null!=u&&(u.style.backgroundColor=""),y=b,u=d,u.style.backgroundColor="#ebf2f9",v=z=null,A.removeAttribute("title"),A.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",m.getModel().clear(),I.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),
+x.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),mxUtils.setOpacity(x,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(J,20),mxUtils.setOpacity(G,20),p.spin(l),b.getXml(function(a){if(y==b)try{e(a)}catch(V){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+V.message)}},function(a){p.stop();
+C.style.display="none";C.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(d,"dblclick",function(a){B.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);Q.appendChild(d)}return d}(c[U]);null!=W&&U==c.length-1&&(M=W)}O.appendChild(Q);e.appendChild(O)}else null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==
+window.DropboxFile?(l.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("notAvailable"))):(l.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};e=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.className="geBtn";K.appendChild(C);K.appendChild(x);K.appendChild(E);K.appendChild(G);K.appendChild(J);a.editor.cancelFirst?(g.appendChild(e),g.appendChild(D),g.appendChild(H),
+g.appendChild(I),g.appendChild(B)):(g.appendChild(D),g.appendChild(H),g.appendChild(I),g.appendChild(B),g.appendChild(e));d.appendChild(g);d.appendChild(K);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,g,e,l,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q);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 k=new Graph(f);k.setEnabled(!1);k.setPanning(!0);k.panningHandler.ignoreCell=!0;k.panningHandler.useLeftButtonForPanning=!0;k.minFitScale=null;k.maxFitScale=null;k.centerZoom=!0;c=mxUtils.parseXml(b);var p=a.editor.extractGraphModel(c.documentElement,!0),t=0,u=null,y=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a&&
 null!=u&&null!=u[t]?u[t].getAttribute("name"):"pagenumber"==a?t+1:y.apply(this,arguments)};k.getLinkForCell=function(){return null};c=mxUtils.button("",function(){k.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);b=mxUtils.button("",function(){k.zoomOut()});b.className="geSprite geSprite-zoomout";b.setAttribute("title",mxResources.get("zoomOut"));b.style.outline=
 "none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);q=mxUtils.button("",function(){k.maxFitScale=8;k.fit(8);k.center()});q.className="geSprite geSprite-fit";q.setAttribute("title",mxResources.get("fit"));q.style.outline="none";q.style.border="none";q.style.margin="2px";mxUtils.setOpacity(q,60);var z=mxUtils.button("",function(){k.zoomActual();k.center()});z.className="geSprite geSprite-actualsize";z.setAttribute("title",mxResources.get("actualSize"));z.style.outline="none";
-z.style.border="none";z.style.margin="2px";mxUtils.setOpacity(z,60);e=mxUtils.button(l||mxResources.get("discard"),e);e.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";d=mxUtils.button(g||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.width=
-"640px";g.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 a(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";f.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,k.getModel());k.maxFitScale=1;k.fit(8);k.center()}}function b(b){null!=b&&(b=
+z.style.border="none";z.style.margin="2px";mxUtils.setOpacity(z,60);g=mxUtils.button(l||mxResources.get("discard"),g);g.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";d=mxUtils.button(e||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";e=document.createElement("div");e.style.position="absolute";e.style.bottom="30px";e.style.width=
+"640px";e.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 a(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";f.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,k.getModel());k.maxFitScale=1;k.fit(8);k.center()}}function b(b){null!=b&&(b=
 a(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(b))).documentElement));return b}mxEvent.addListener(v,"change",function(a){t=parseInt(v.value);b(u[t]);mxEvent.consume(a)});if("mxfile"==p.nodeName){var c=p.getElementsByTagName("diagram");u=[];for(var d=0;d<c.length;d++)u.push(c[d]);0<u.length&&b(u[t]);if(1<u.length)for(v.style.display="",d=0;d<u.length;d++)c=document.createElement("option"),mxUtils.write(c,u[d].getAttribute("name")||mxResources.get("pageWithNumber",[d+1])),c.setAttribute("value",
-d),d==t&&c.setAttribute("selected","selected"),v.appendChild(c)}else a(p)};l.appendChild(v);l.appendChild(c);l.appendChild(b);l.appendChild(z);l.appendChild(q);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";m=null!=m?mxUtils.button(mxResources.get("ignore"),m):null;null!=m&&(m.className="geBtn");a.editor.cancelFirst?(g.appendChild(c),null!=m&&g.appendChild(m),g.appendChild(e),g.appendChild(d)):(g.appendChild(d),g.appendChild(e),null!=m&&g.appendChild(m),
-g.appendChild(c));n.appendChild(g);n.appendChild(l);this.container=n},FindWindow=function(a,c,b,d,e){function g(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var f=0;f<b.length;f++)if("label"!=b[f].nodeName){var d=mxUtils.trim(b[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&d.substring(0,c.length)===c||null!=a&&a.test(d))return!0}}return!1}function l(){var a=n.model.getDescendants(n.model.getRoot()),b=p.value.toLowerCase(),
-c=t.checked?new RegExp(b):null,d=null;q!=b&&(q=b,f=null);var k=null==f;if(0<b.length)for(var e=0;e<a.length;e++){var u=n.view.getState(a[e]);if(null!=u&&null!=u.cell.value&&(k||null==d)&&(n.model.isVertex(u.cell)||n.model.isEdge(u.cell))&&(n.isHtmlLabel(u.cell)?(y.innerHTML=n.getLabel(u.cell),label=mxUtils.extractTextWithWhitespace([y])):label=n.getLabel(u.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||g(c,u.cell,b))||
-null!=c&&(c.test(label)||g(c,u.cell,b))))if(k){d=u;break}else null==d&&(d=u);k=k||u==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,q=null,f=null,k=document.createElement("div");k.style.userSelect="none";k.style.overflow="hidden";k.style.padding="10px";k.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",
+d),d==t&&c.setAttribute("selected","selected"),v.appendChild(c)}else a(p)};l.appendChild(v);l.appendChild(c);l.appendChild(b);l.appendChild(z);l.appendChild(q);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";m=null!=m?mxUtils.button(mxResources.get("ignore"),m):null;null!=m&&(m.className="geBtn");a.editor.cancelFirst?(e.appendChild(c),null!=m&&e.appendChild(m),e.appendChild(g),e.appendChild(d)):(e.appendChild(d),e.appendChild(g),null!=m&&e.appendChild(m),
+e.appendChild(c));n.appendChild(e);n.appendChild(l);this.container=n},FindWindow=function(a,c,b,d,g){function e(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var f=0;f<b.length;f++)if("label"!=b[f].nodeName){var k=mxUtils.trim(b[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&k.substring(0,c.length)===c||null!=a&&a.test(k))return!0}}return!1}function l(){var a=n.model.getDescendants(n.model.getRoot()),b=p.value.toLowerCase(),
+c=t.checked?new RegExp(b):null,k=null;q!=b&&(q=b,f=null);var d=null==f;if(0<b.length)for(var g=0;g<a.length;g++){var u=n.view.getState(a[g]);if(null!=u&&null!=u.cell.value&&(d||null==k)&&(n.model.isVertex(u.cell)||n.model.isEdge(u.cell))&&(n.isHtmlLabel(u.cell)?(y.innerHTML=n.getLabel(u.cell),label=mxUtils.extractTextWithWhitespace([y])):label=n.getLabel(u.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||e(c,u.cell,b))||
+null!=c&&(c.test(label)||e(c,u.cell,b))))if(d){k=u;break}else null==k&&(k=u);d=d||u==f}null!=k?(f=k,n.scrollCellToVisible(f.cell),n.isEnabled()?n.setSelectionCell(f.cell):n.highlightCell(f.cell)):n.isEnabled()&&n.clearSelection();return 0==b.length||null!=k}var m=a.actions.get("find"),n=a.editor.graph,q=null,f=null,k=document.createElement("div");k.style.userSelect="none";k.style.overflow="hidden";k.style.padding="10px";k.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="200px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";k.appendChild(p);mxUtils.br(k);var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.marginRight="4px";k.appendChild(t);mxUtils.write(k,mxResources.get("regularExpression"));var u=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");u.style.position=
 "relative";u.style.marginLeft="6px";u.style.top="-1px";k.appendChild(u);var y=document.createElement("div");mxUtils.br(k);u=mxUtils.button(mxResources.get("reset"),function(){p.value="";p.style.backgroundColor="";q=f=null;p.focus()});u.setAttribute("title",mxResources.get("reset"));u.style.marginTop="6px";u.style.marginRight="4px";u.className="geBtn";k.appendChild(u);u=mxUtils.button(mxResources.get("find"),function(){try{p.style.backgroundColor=l()?"":"#ffcfcf"}catch(z){a.handleError(z)}});u.setAttribute("title",
 mxResources.get("find")+" (Enter)");u.style.marginTop="6px";u.className="geBtn gePrimaryBtn";k.appendChild(u);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(q!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=l()?"":"#ffcfcf"}catch(v){p.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(k,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(m.funct(),mxEvent.consume(b))});
-this.window=new mxWindow(mxResources.get("find"),k,c,b,d,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()?(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,c,b,d,e){var g=a.editor.graph,l="tags",m=document.createElement("div");
+this.window=new mxWindow(mxResources.get("find"),k,c,b,d,g,!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,c,b,d,g){var e=a.editor.graph,l="tags",m=document.createElement("div");
 m.style.userSelect="none";m.style.overflow="hidden";m.style.padding="10px";m.style.height="100%";var n=document.createElement("input");n.setAttribute("placeholder",mxResources.get("allTags"));n.setAttribute("type","text");n.style.marginTop="4px";n.style.width="260px";n.style.fontSize="12px";n.style.borderRadius="4px";n.style.padding="6px";m.appendChild(n);if(!a.isOffline()||mxClient.IS_CHROMEAPP){n.style.width="240px";var q=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");
-q.firstChild.style.marginBottom="6px";q.style.marginLeft="6px";m.appendChild(q)}mxEvent.addListener(n,"dblclick",function(){var b=new FilenameDialog(a,l,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(l=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});n.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(m);q=mxUtils.button(mxResources.get("hide"),function(){var a=g.getCellsForTags(n.value.split(" "),void 0,
-l);g.setCellsVisible(a,!1)});q.setAttribute("title",mxResources.get("hide"));q.style.marginTop="8px";q.style.marginRight="4px";q.className="geBtn";m.appendChild(q);q=mxUtils.button(mxResources.get("show"),function(){var a=g.getCellsForTags(n.value.split(" "),void 0,l);g.setCellsVisible(a,!0);if(g.isEnabled())g.setSelectionCells(a);else for(var b=0;b<a.length;b++)g.highlightCell(a[b])});q.setAttribute("title",mxResources.get("show"));q.style.marginTop="8px";q.style.marginRight="4px";q.className="geBtn";
-m.appendChild(q);var f=a.actions.get("tags"),q=mxUtils.button(mxResources.get("close"),function(){f.funct()});q.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");q.style.marginTop="8px";q.className="geBtn gePrimaryBtn";m.appendChild(q);mxEvent.addListener(n,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||f.funct()});this.window=new mxWindow(mxResources.get("tags"),m,c,b,d,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()?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):g.container.focus()}))},AuthDialog=function(a,c,b,d){var e=document.createElement("div");e.style.textAlign="center";var g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("authorizationRequired"));
+q.firstChild.style.marginBottom="6px";q.style.marginLeft="6px";m.appendChild(q)}mxEvent.addListener(n,"dblclick",function(){var b=new FilenameDialog(a,l,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(l=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});n.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(m);q=mxUtils.button(mxResources.get("hide"),function(){var a=e.getCellsForTags(n.value.split(" "),void 0,
+l);e.setCellsVisible(a,!1)});q.setAttribute("title",mxResources.get("hide"));q.style.marginTop="8px";q.style.marginRight="4px";q.className="geBtn";m.appendChild(q);q=mxUtils.button(mxResources.get("show"),function(){var a=e.getCellsForTags(n.value.split(" "),void 0,l);e.setCellsVisible(a,!0);if(e.isEnabled())e.setSelectionCells(a);else for(var b=0;b<a.length;b++)e.highlightCell(a[b])});q.setAttribute("title",mxResources.get("show"));q.style.marginTop="8px";q.style.marginRight="4px";q.className="geBtn";
+m.appendChild(q);var f=a.actions.get("tags"),q=mxUtils.button(mxResources.get("close"),function(){f.funct()});q.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");q.style.marginTop="8px";q.className="geBtn gePrimaryBtn";m.appendChild(q);mxEvent.addListener(n,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||f.funct()});this.window=new mxWindow(mxResources.get("tags"),m,c,b,d,g,!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()?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):e.container.focus()}))},AuthDialog=function(a,c,b,d){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("authorizationRequired"));
 var l="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?(l=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.trello&&
-(l=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[l]));var n=document.createElement("input");n.setAttribute("type","checkbox");l=mxUtils.button(mxResources.get("authorize"),function(){d(n.checked)});l.insertBefore(m,l.firstChild);l.style.marginTop="6px";l.className="geBigButton";e.appendChild(g);e.appendChild(a);e.appendChild(l);b&&(b=document.createElement("p"),b.style.marginTop="20px",b.appendChild(n),
-g=document.createElement("span"),mxUtils.write(g," "+mxResources.get("rememberMe")),b.appendChild(g),e.appendChild(b),n.checked=!0,n.defaultChecked=!0,mxEvent.addListener(g,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)}));this.container=e},MoreShapesDialog=function(a,c,b){b=null!=b?b:a.sidebar.entries;var d=document.createElement("div"),e=[];if(null!=a.sidebar.customEntries)for(var g=0;g<a.sidebar.customEntries.length;g++){for(var l=a.sidebar.customEntries[g],m={title:a.getResource(l.title),
-entries:[]},n=0;n<l.entries.length;n++){var q=l.entries[n];m.entries.push({id:q.id,title:a.getResource(q.title),desc:a.getResource(q.desc),image:q.preview})}e.push(m)}for(g=0;g<b.length;g++)if(null==a.sidebar.enabledLibraries)e.push(b[g]);else{m={title:b[g].title,entries:[]};for(n=0;n<b[g].entries.length;n++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,b[g].entries[n].id)&&m.entries.push(b[g].entries[n]);0<m.entries.length&&e.push(m)}b=e;if(c){n=document.createElement("div");n.className="geDialogTitle";
+(l=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[l]));var n=document.createElement("input");n.setAttribute("type","checkbox");l=mxUtils.button(mxResources.get("authorize"),function(){d(n.checked)});l.insertBefore(m,l.firstChild);l.style.marginTop="6px";l.className="geBigButton";g.appendChild(e);g.appendChild(a);g.appendChild(l);b&&(b=document.createElement("p"),b.style.marginTop="20px",b.appendChild(n),
+e=document.createElement("span"),mxUtils.write(e," "+mxResources.get("rememberMe")),b.appendChild(e),g.appendChild(b),n.checked=!0,n.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)}));this.container=g},MoreShapesDialog=function(a,c,b){b=null!=b?b:a.sidebar.entries;var d=document.createElement("div"),g=[];if(null!=a.sidebar.customEntries)for(var e=0;e<a.sidebar.customEntries.length;e++){for(var l=a.sidebar.customEntries[e],m={title:a.getResource(l.title),
+entries:[]},n=0;n<l.entries.length;n++){var q=l.entries[n];m.entries.push({id:q.id,title:a.getResource(q.title),desc:a.getResource(q.desc),image:q.preview})}g.push(m)}for(e=0;e<b.length;e++)if(null==a.sidebar.enabledLibraries)g.push(b[e]);else{m={title:b[e].title,entries:[]};for(n=0;n<b[e].entries.length;n++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,b[e].entries[n].id)&&m.entries.push(b[e].entries[n]);0<m.entries.length&&g.push(m)}b=g;if(c){n=document.createElement("div");n.className="geDialogTitle";
 mxUtils.write(n,mxResources.get("shapes"));n.style.position="absolute";n.style.top="0px";n.style.left="0px";n.style.lineHeight="40px";n.style.height="40px";n.style.right="0px";mxClient.IS_QUIRKS&&(n.style.width="718px");var f=document.createElement("div"),k=document.createElement("div");f.style.position="absolute";f.style.top="40px";f.style.left="0px";f.style.width="202px";f.style.bottom="60px";f.style.overflow="auto";mxClient.IS_QUIRKS&&(f.style.height="437px",f.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(n.style.width)-202+"px",k.style.height=f.style.height,k.style.marginTop=f.style.marginTop);var p=null,t=[],u=document.createElement("div");u.style.position="relative";u.style.left="0px";u.style.right="0px";for(g=0;g<b.length;g++)(function(b){var c=u.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);f.appendChild(c);for(var d=0;d<b.entries.length;d++)(function(b){var c=u.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";c.setAttribute("title",b.title+" ("+b.id+")");var e=document.createElement("input");e.setAttribute("type","checkbox");e.checked=a.sidebar.isEntryVisible(b.id);e.defaultChecked=e.checked;c.appendChild(e);mxUtils.write(c,
+"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(n.style.width)-202+"px",k.style.height=f.style.height,k.style.marginTop=f.style.marginTop);var p=null,t=[],u=document.createElement("div");u.style.position="relative";u.style.left="0px";u.style.right="0px";for(e=0;e<b.length;e++)(function(b){var c=u.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);f.appendChild(c);for(var d=0;d<b.entries.length;d++)(function(b){var c=u.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";c.setAttribute("title",b.title+" ("+b.id+")");var g=document.createElement("input");g.setAttribute("type","checkbox");g.checked=a.sidebar.isEntryVisible(b.id);g.defaultChecked=g.checked;c.appendChild(g);mxUtils.write(c,
 " "+b.title);f.appendChild(c);var v=function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName){k.style.textAlign="center";k.style.padding="0px";k.style.color="";k.innerHTML="";if(null!=b.desc){var f=document.createElement("pre");f.style.boxSizing="border-box";f.style.fontFamily="inherit";f.style.margin="20px";f.style.right="0px";f.style.textAlign="left";mxUtils.write(f,b.desc);k.appendChild(f)}null!=b.imageCallback?b.imageCallback(k):null!=b.image?k.innerHTML+='<img border="0" src="'+b.image+
-'"/>':null==b.desc&&(k.style.padding="20px",k.style.color="rgb(179, 179, 179)",mxUtils.write(k,mxResources.get("noPreview")));null!=p&&(p.style.backgroundColor="");p=c;p.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(c,"click",v);mxEvent.addListener(c,"dblclick",function(a){e.checked=!e.checked;mxEvent.consume(a)});t.push(function(){return e.checked?b.id:null});0==g&&0==d&&v()})(b.entries[d])})(b[g]);d.style.padding="30px";d.appendChild(n);
+'"/>':null==b.desc&&(k.style.padding="20px",k.style.color="rgb(179, 179, 179)",mxUtils.write(k,mxResources.get("noPreview")));null!=p&&(p.style.backgroundColor="");p=c;p.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(c,"click",v);mxEvent.addListener(c,"dblclick",function(a){g.checked=!g.checked;mxEvent.consume(a)});t.push(function(){return g.checked?b.id:null});0==e&&0==d&&v()})(b.entries[d])})(b[e]);d.style.padding="30px";d.appendChild(n);
 d.appendChild(f);d.appendChild(k);b=document.createElement("div");b.className="geDialogFooter";b.style.position="absolute";b.style.paddingRight="16px";b.style.color="gray";b.style.left="0px";b.style.right="0px";b.style.bottom="0px";b.style.height="60px";b.style.lineHeight="52px";mxClient.IS_QUIRKS&&(b.style.width=n.style.width,b.style.paddingTop="12px");var y=document.createElement("input");y.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)n=document.createElement("span"),
 n.style.paddingRight="20px",n.appendChild(y),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),y.checked=!0,y.defaultChecked=!0,mxEvent.addListener(n,"click",function(a){mxEvent.getSource(a)!=y&&(y.checked=!y.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(n.style.position="relative",n.style.top="-6px"),b.appendChild(n);n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=
-[],c=0;c<t.length;c++){var f=t[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),y.checked,!0)});c.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),n=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";m=document.createElement("tr");z.style.width="100%";c=document.createElement("td");var e=document.createElement("td"),l=document.createElement("td"),v=mxUtils.bind(this,function(b,c,f){var d=document.createElement("input");
-d.type="checkbox";z.appendChild(d);d.checked=a.sidebar.isEntryVisible(f);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");c.style.display="block";c.appendChild(d);c.appendChild(k);mxEvent.addListener(k,"click",function(a){d.checked=!d.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return d.checked?f:null}});m.appendChild(c);m.appendChild(e);m.appendChild(l);n.appendChild(m);z.appendChild(n);for(var t=[],x=0,g=0;g<b.length;g++)for(n=0;n<b[g].entries.length;n++)x++;
-for(var D=[c,e,l],J=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];t.push(v(D[Math.floor(J/(x/3))],c.title,c.id));J++}})(b[g]);d.appendChild(z);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";y=document.createElement("input");isLocalStorage&&(y.setAttribute("type","checkbox"),y.checked=!0,y.defaultChecked=!0,b.appendChild(y),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),
+[],c=0;c<t.length;c++){var f=t[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),y.checked,!0)});c.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),n=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";m=document.createElement("tr");z.style.width="100%";c=document.createElement("td");var g=document.createElement("td"),l=document.createElement("td"),v=mxUtils.bind(this,function(b,c,f){var k=document.createElement("input");
+k.type="checkbox";z.appendChild(k);k.checked=a.sidebar.isEntryVisible(f);var d=document.createElement("span");mxUtils.write(d,c);c=document.createElement("div");c.style.display="block";c.appendChild(k);c.appendChild(d);mxEvent.addListener(d,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return k.checked?f:null}});m.appendChild(c);m.appendChild(g);m.appendChild(l);n.appendChild(m);z.appendChild(n);for(var t=[],x=0,e=0;e<b.length;e++)for(n=0;n<b[e].entries.length;n++)x++;
+for(var E=[c,g,l],J=0,e=0;e<b.length;e++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];t.push(v(E[Math.floor(J/(x/3))],c.title,c.id));J++}})(b[e]);d.appendChild(z);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";y=document.createElement("input");isLocalStorage&&(y.setAttribute("type","checkbox"),y.checked=!0,y.defaultChecked=!0,b.appendChild(y),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),
 mxEvent.addListener(n,"click",function(a){y.checked=!y.checked;mxEvent.consume(a)}));d.appendChild(b);n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<t.length;c++){var f=t[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(0<b.length?b.join(";"):"",y.checked);a.hideDialog()});c.className="geBtn gePrimaryBtn";b=document.createElement("div");b.style.marginTop="26px";
-b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(n),b.appendChild(c)):(b.appendChild(c),b.appendChild(n));d.appendChild(b);this.container=d},PluginsDialog=function(a){function c(){if(0==e.length)d.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{d.innerHTML="";for(var b=0;b<e.length;b++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var p=document.createElement("span");p.className="geSprite geSprite-delete";p.style.position="relative";p.style.cursor=
-"pointer";p.style.top="5px";p.style.marginRight="4px";p.style.display="inline-block";k.appendChild(p);mxUtils.write(k,e[b]);d.appendChild(k);mxUtils.br(d);mxEvent.addListener(p,"click",function(b){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[b]+'"?',function(){e.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var e=mxSettings.getPlugins().slice();b.appendChild(d);c();var g=mxUtils.button(mxResources.get("add"),
-function(){var b="",d=urlParams.p;if(null!=d&&0<d.length){for(var p=d.split(";"),d=0;d<p.length;d++){var g=App.pluginRegistry[p[d]];null!=g&&(b+=g+";")}";"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1))}b=new FilenameDialog(a,b,mxResources.get("add"),function(a){if(null!=a&&0<a.length){p=a.split(";");for(a=0;a<p.length;a++){var b=p[a],f=App.pluginRegistry[b];null!=f&&(b=f);0<b.length&&0>mxUtils.indexOf(e,b)&&e.push(b)}c()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");a.showDialog(b.container,
-300,80,!0,!0);b.init()});g.className="geBtn";var l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";var m=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(e);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});m.className="geBtn gePrimaryBtn";var n=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000056430")});n.className="geBtn";a.isOffline()&&
-!mxClient.IS_CHROMEAPP&&(n.style.display="none");var q=document.createElement("div");q.style.marginTop="14px";q.style.textAlign="right";a.editor.cancelFirst?(q.appendChild(l),q.appendChild(n),q.appendChild(g),q.appendChild(m)):(q.appendChild(n),q.appendChild(g),q.appendChild(m),q.appendChild(l));b.appendChild(q);this.container=b},CropImageDialog=function(a,c,b){var d=document.createElement("div"),e=document.createElement("table"),g=document.createElement("tbody"),l=document.createElement("tr"),m=
-document.createElement("td");m.style.whiteSpace="nowrap";m.setAttribute("colspan","2");mxUtils.write(m,mxResources.get("loading")+"...");l.appendChild(m);g.appendChild(l);var l=document.createElement("tr"),n=document.createElement("td"),q=document.createElement("td");e.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()};q.appendChild(f);
-l.appendChild(n);l.appendChild(q);g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";q.appendChild(k);l.appendChild(n);l.appendChild(q);g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");q=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";q.appendChild(p);l.appendChild(n);l.appendChild(q);g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("bottom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";q.appendChild(t);l.appendChild(n);l.appendChild(q);g.appendChild(l);l=document.createElement("tr");
-n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("circle")+":");l.appendChild(n);var u=document.createElement("input");u.setAttribute("type","checkbox");q.appendChild(u);l.appendChild(q);g.appendChild(l);e.appendChild(g);d.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";var y=new Image,z=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),d=c.getContext("2d"),
+b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(n),b.appendChild(c)):(b.appendChild(c),b.appendChild(n));d.appendChild(b);this.container=d},PluginsDialog=function(a){function c(){if(0==g.length)d.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{d.innerHTML="";for(var b=0;b<g.length;b++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var p=document.createElement("span");p.className="geSprite geSprite-delete";p.style.position="relative";p.style.cursor=
+"pointer";p.style.top="5px";p.style.marginRight="4px";p.style.display="inline-block";k.appendChild(p);mxUtils.write(k,g[b]);d.appendChild(k);mxUtils.br(d);mxEvent.addListener(p,"click",function(b){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+g[b]+'"?',function(){g.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var g=mxSettings.getPlugins().slice();b.appendChild(d);c();var e=mxUtils.button(mxResources.get("add"),
+function(){var b="",k=urlParams.p;if(null!=k&&0<k.length){for(var d=k.split(";"),k=0;k<d.length;k++){var e=App.pluginRegistry[d[k]];null!=e&&(b+=e+";")}";"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1))}b=new FilenameDialog(a,b,mxResources.get("add"),function(a){if(null!=a&&0<a.length){d=a.split(";");for(a=0;a<d.length;a++){var b=d[a],f=App.pluginRegistry[b];null!=f&&(b=f);0<b.length&&0>mxUtils.indexOf(g,b)&&g.push(b)}c()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");a.showDialog(b.container,
+300,80,!0,!0);b.init()});e.className="geBtn";var l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";var m=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(g);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});m.className="geBtn gePrimaryBtn";var n=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000056430")});n.className="geBtn";a.isOffline()&&
+!mxClient.IS_CHROMEAPP&&(n.style.display="none");var q=document.createElement("div");q.style.marginTop="14px";q.style.textAlign="right";a.editor.cancelFirst?(q.appendChild(l),q.appendChild(n),q.appendChild(e),q.appendChild(m)):(q.appendChild(n),q.appendChild(e),q.appendChild(m),q.appendChild(l));b.appendChild(q);this.container=b},CropImageDialog=function(a,c,b){var d=document.createElement("div"),g=document.createElement("table"),e=document.createElement("tbody"),l=document.createElement("tr"),m=
+document.createElement("td");m.style.whiteSpace="nowrap";m.setAttribute("colspan","2");mxUtils.write(m,mxResources.get("loading")+"...");l.appendChild(m);e.appendChild(l);var l=document.createElement("tr"),n=document.createElement("td"),q=document.createElement("td");g.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()};q.appendChild(f);
+l.appendChild(n);l.appendChild(q);e.appendChild(l);l=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";q.appendChild(k);l.appendChild(n);l.appendChild(q);e.appendChild(l);l=document.createElement("tr");n=document.createElement("td");q=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";q.appendChild(p);l.appendChild(n);l.appendChild(q);e.appendChild(l);l=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("bottom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";q.appendChild(t);l.appendChild(n);l.appendChild(q);e.appendChild(l);l=document.createElement("tr");
+n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("circle")+":");l.appendChild(n);var u=document.createElement("input");u.setAttribute("type","checkbox");q.appendChild(u);l.appendChild(q);e.appendChild(l);g.appendChild(e);d.appendChild(g);g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";var y=new Image,z=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),d=c.getContext("2d"),
 e=y.width,g=y.height,l=parseInt(f.value),A=parseInt(k.value),e=Math.max(1,e-l-parseInt(p.value)),g=Math.max(1,g-A-parseInt(t.value));c.width=e;c.height=g;u.checked&&(d.fillStyle="#000000",d.arc(e/2,g/2,Math.min(e/2,g/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(y,l,A,e,g,0,0,e,g);b(c.toDataURL())});z.className="geBtn gePrimaryBtn";z.setAttribute("disabled","disabled");y.onload=function(){z.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+
-": "+y.width+" "+mxResources.get("height")+": "+y.height)};y.src=c;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&z.click()});c=document.createElement("div");c.style.marginTop="20px";c.style.textAlign="right";a.editor.cancelFirst?(c.appendChild(e),c.appendChild(z)):(c.appendChild(z),c.appendChild(e));d.appendChild(c);this.container=d},EditGeometryDialog=function(a,c){var b=a.editor.graph,d=1==c.length?b.getCellGeometry(c[0]):null,e=document.createElement("div"),g=document.createElement("table"),
-l=document.createElement("tbody"),m=document.createElement("tr"),n=document.createElement("td"),q=document.createElement("td");g.style.paddingLeft="6px";mxUtils.write(n,mxResources.get("relative")+":");var f=document.createElement("input");f.setAttribute("type","checkbox");null!=d&&d.relative&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);this.init=function(){f.focus()};q.appendChild(f);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");
+": "+y.width+" "+mxResources.get("height")+": "+y.height)};y.src=c;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&z.click()});c=document.createElement("div");c.style.marginTop="20px";c.style.textAlign="right";a.editor.cancelFirst?(c.appendChild(g),c.appendChild(z)):(c.appendChild(z),c.appendChild(g));d.appendChild(c);this.container=d},EditGeometryDialog=function(a,c){var b=a.editor.graph,d=1==c.length?b.getCellGeometry(c[0]):null,g=document.createElement("div"),e=document.createElement("table"),
+l=document.createElement("tbody"),m=document.createElement("tr"),n=document.createElement("td"),q=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(n,mxResources.get("relative")+":");var f=document.createElement("input");f.setAttribute("type","checkbox");null!=d&&d.relative&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);this.init=function(){f.focus()};q.appendChild(f);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");
 q=document.createElement("td");mxUtils.write(n,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d?d.x:"";q.appendChild(k);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("top")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=d?d.y:
 "";q.appendChild(p);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("dx")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d&&null!=d.offset?d.offset.x:"";q.appendChild(t);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");
 mxUtils.write(n,mxResources.get("dy")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=d&&null!=d.offset?d.offset.y:"";q.appendChild(u);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("width")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=d?d.width:"";
 q.appendChild(y);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("height")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=null!=d?d.height:"";q.appendChild(z);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,
-mxResources.get("rotation")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=1==c.length?mxUtils.getValue(b.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";q.appendChild(v);m.appendChild(n);m.appendChild(q);l.appendChild(m);g.appendChild(l);e.appendChild(g);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";var x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();
+mxResources.get("rotation")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=1==c.length?mxUtils.getValue(b.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";q.appendChild(v);m.appendChild(n);m.appendChild(q);l.appendChild(m);e.appendChild(l);g.appendChild(e);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";var x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();
 try{for(var d=0;d<c.length;d++){var e=b.getCellGeometry(c[d]);null!=e&&(e=e.clone(),b.isCellMovable(c[d])&&(e.relative=f.checked,0<mxUtils.trim(k.value).length&&(e.x=Number(k.value)),0<mxUtils.trim(p.value).length&&(e.y=Number(p.value)),0<mxUtils.trim(t.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.x=Number(t.value)),0<mxUtils.trim(u.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.y=Number(u.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(y.value).length&&(e.width=
-Number(y.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),b.getModel().setGeometry(c[d],e));0<mxUtils.trim(v.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(v.value),[c[d]])}}finally{b.getModel().endUpdate()}});x.className="geBtn gePrimaryBtn";mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&x.click()});g=document.createElement("div");g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(x)):(g.appendChild(x),
-g.appendChild(d));e.appendChild(g);this.container=e},LibraryDialog=function(a,c,b,d,e,g){function l(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 m(b,c,d,k,p,e,g,v,A){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==y[b]){var n=function(){C.innerHTML="";C.style.cursor="pointer";C.style.whiteSpace="nowrap";C.style.textOverflow=
-"ellipsis";mxUtils.write(C,null!=K.title&&0<K.title.length?K.title:mxResources.get("untitled"));C.style.color=null==K.title||0==K.title.length?"#d0d0d0":""};t.style.backgroundImage="";u.style.display="none";var E=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=B;e*=B}E>q?(q=Math.round(100*q/E),E=100):(E=Math.round(100*E/q),q=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=
-mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var F=document.createElement("img");F.setAttribute("src",D.convert(b));F.style.width=E+"px";F.style.height=q+"px";F.style.margin="10px";F.style.paddingBottom=Math.floor((100-q)/2)+"px";F.style.paddingLeft=Math.floor((100-E)/2)+"px";H.appendChild(F)}else if(null!=g){var I=a.stringToCells(Graph.decompress(g.xml));0<I.length&&
-(a.sidebar.createThumb(I,100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var G=document.createElement("img");G.setAttribute("src",Editor.closeImage);G.setAttribute("border","0");G.setAttribute("title",mxResources.get("delete"));G.setAttribute("align","top");G.style.paddingTop="4px";G.style.position="absolute";G.style.marginLeft="-12px";G.style.zIndex="1";G.style.cursor="pointer";mxEvent.addListener(G,"dragstart",function(a){mxEvent.consume(a)});
-(function(a,b,c){mxEvent.addListener(G,"click",function(d){y[b]=null;for(var k=0;k<f.length;k++)if(null!=f[k].data&&f[k].data==b||null!=f[k].xml&&null!=c&&f[k].xml==c.xml){f.splice(k,1);break}H.parentNode.removeChild(a);0==f.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",u.style.display="");mxEvent.consume(d)});mxEvent.addListener(G,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(G);H.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 K=null;null!=b?(K={data:b,w:p,h:e,title:A},null!=v&&(K.aspect=v),y[b]=F,f.push(K)):null!=g&&(g.aspect="fixed",f.push(g),K=g);mxEvent.addListener(C,"keydown",function(a){13==a.keyCode&&null!=x&&(x(),x=null,mxEvent.consume(a))});n();H.appendChild(C);mxEvent.addListener(C,"mousedown",function(a){"true"!=C.getAttribute("contentEditable")&&
+Number(y.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),b.getModel().setGeometry(c[d],e));0<mxUtils.trim(v.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(v.value),[c[d]])}}finally{b.getModel().endUpdate()}});x.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&x.click()});e=document.createElement("div");e.style.marginTop="20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(d),e.appendChild(x)):(e.appendChild(x),
+e.appendChild(d));g.appendChild(e);this.container=g},LibraryDialog=function(a,c,b,d,g,e){function l(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 m(b,c,k,d,p,e,g,v,A){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==y[b]){var n=function(){C.innerHTML="";C.style.cursor="pointer";C.style.whiteSpace="nowrap";C.style.textOverflow=
+"ellipsis";mxUtils.write(C,null!=K.title&&0<K.title.length?K.title:mxResources.get("untitled"));C.style.color=null==K.title||0==K.title.length?"#d0d0d0":""};t.style.backgroundImage="";u.style.display="none";var D=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=B;e*=B}D>q?(q=Math.round(100*q/D),D=100):(D=Math.round(100*D/q),q=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=
+mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var G=document.createElement("img");G.setAttribute("src",E.convert(b));G.style.width=D+"px";G.style.height=q+"px";G.style.margin="10px";G.style.paddingBottom=Math.floor((100-q)/2)+"px";G.style.paddingLeft=Math.floor((100-D)/2)+"px";H.appendChild(G)}else if(null!=g){var I=a.stringToCells(Graph.decompress(g.xml));0<I.length&&
+(a.sidebar.createThumb(I,100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.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.position="absolute";F.style.marginLeft="-12px";F.style.zIndex="1";F.style.cursor="pointer";mxEvent.addListener(F,"dragstart",function(a){mxEvent.consume(a)});
+(function(a,b,c){mxEvent.addListener(F,"click",function(k){y[b]=null;for(var d=0;d<f.length;d++)if(null!=f[d].data&&f[d].data==b||null!=f[d].xml&&null!=c&&f[d].xml==c.xml){f.splice(d,1);break}H.parentNode.removeChild(a);0==f.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",u.style.display="");mxEvent.consume(k)});mxEvent.addListener(F,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(F);H.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 K=null;null!=b?(K={data:b,w:p,h:e,title:A},null!=v&&(K.aspect=v),y[b]=G,f.push(K)):null!=g&&(g.aspect="fixed",f.push(g),K=g);mxEvent.addListener(C,"keydown",function(a){13==a.keyCode&&null!=x&&(x(),x=null,mxEvent.consume(a))});n();H.appendChild(C);mxEvent.addListener(C,"mousedown",function(a){"true"!=C.getAttribute("contentEditable")&&
 mxEvent.consume(a)});I=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,K.title||"",mxResources.get("ok"),function(a){null!=a&&(K.title=a,n())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=C.getAttribute("contentEditable")){null!=x&&(x(),x=null);if(null==K.title||0==K.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);x=function(){C.removeAttribute("contentEditable");C.style.cursor="pointer";K.title=C.innerHTML;n()};mxEvent.consume(b)}};mxEvent.addListener(C,"click",I);mxEvent.addListener(H,"dblclick",I);t.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(G.style.visibility="hidden",C.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",
-g.xml);z=l(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);G.style.visibility="";C.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==G.style.visibility&&(G.style.visibility="",C.style.visibility="");z=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else J||(J=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=
-!1;try{if(a.spinner.stop(),E=mxUtils.parseXml(b),"mxlibrary"==E.documentElement.nodeName){q=JSON.parse(mxUtils.getTextContent(E.documentElement));if(null!=q&&0<q.length)for(var M=0;M<q.length;M++)null!=q[M].xml?m(null,null,0,0,0,0,q[M]):m(q[M].data,null,0,0,q[M].w,q[M].h,null,"fixed",q[M].title);p=!0}else if("mxfile"==E.documentElement.nodeName){for(var Q=E.documentElement.getElementsByTagName("diagram"),M=0;M<Q.length;M++){var q=mxUtils.getTextContent(Q[M]),I=a.stringToCells(Graph.decompress(q)),
+"";C.style.cursor="text";C.style.color="";C.setAttribute("contentEditable","true");C.focus();document.execCommand("selectAll",!1,null);x=function(){C.removeAttribute("contentEditable");C.style.cursor="pointer";K.title=C.innerHTML;n()};mxEvent.consume(b)}};mxEvent.addListener(C,"click",I);mxEvent.addListener(H,"dblclick",I);t.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(F.style.visibility="hidden",C.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",
+g.xml);z=l(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);F.style.visibility="";C.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==F.style.visibility&&(F.style.visibility="",C.style.visibility="");z=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else J||(J=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=
+!1;try{if(a.spinner.stop(),D=mxUtils.parseXml(b),"mxlibrary"==D.documentElement.nodeName){q=JSON.parse(mxUtils.getTextContent(D.documentElement));if(null!=q&&0<q.length)for(var M=0;M<q.length;M++)null!=q[M].xml?m(null,null,0,0,0,0,q[M]):m(q[M].data,null,0,0,q[M].w,q[M].h,null,"fixed",q[M].title);p=!0}else if("mxfile"==D.documentElement.nodeName){for(var O=D.documentElement.getElementsByTagName("diagram"),M=0;M<O.length;M++){var q=mxUtils.getTextContent(O[M]),I=a.stringToCells(Graph.decompress(q)),
 S=a.editor.graph.getBoundingBoxFromGeometry(I);m(null,null,0,0,0,0,{xml:q,w:S.width,h:S.height})}p=!0}}catch(ba){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}function n(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function q(b){b.stopPropagation();b.preventDefault();J=!1;v=l(b);if(null!=z)null!=v&&v<t.children.length?(f.splice(v>z?v-1:v,0,f.splice(z,1)[0]),t.insertBefore(t.children[z],t.children[v])):
-(f.push(f.splice(z,1)[0]),t.appendChild(t.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,F(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){m(c,null,0,0,a.width,a.height);t.scrollTop=t.scrollHeight})}b.stopPropagation();b.preventDefault()}
-var f=[];b=document.createElement("div");b.style.height="100%";var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="40px";b.appendChild(k);mxUtils.write(k,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==e||e.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==e||e.isRenamable())p.focus(),
+(f.push(f.splice(z,1)[0]),t.appendChild(t.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,G(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){m(c,null,0,0,a.width,a.height);t.scrollTop=t.scrollHeight})}b.stopPropagation();b.preventDefault()}
+var f=[];b=document.createElement("div");b.style.height="100%";var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="40px";b.appendChild(k);mxUtils.write(k,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==g||g.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())p.focus(),
 mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};k.appendChild(p);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==f.length&&Graph.fileSupport&&(t.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"));b.appendChild(u);var y={},z=null,v=null,x=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=x&&(x(),x=null,mxEvent.consume(a))};mxEvent.addListener(t,"mousedown",c);mxEvent.addListener(t,"pointerdown",c);mxEvent.addListener(t,
-"touchstart",c);var D=new mxUrlConverter,J=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],m(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(t,"dragleave",function(a){u.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==t||b==u){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var F=function(b){return function(c,f,d,k,p,e,g,v,x){null!=x&&(/(\.vsdx)($|\?)/i.test(x.name)||/(\.vssx)($|\?)/i.test(x.name))?a.importVisio(x,mxUtils.bind(this,function(c){a.spinner.stop();
+"touchstart",c);var E=new mxUrlConverter,J=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],m(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(t,"dragleave",function(a){u.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==t||b==u){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var G=function(b){return function(c,f,d,k,p,e,g,v,x){null!=x&&(/(\.vsdx)($|\?)/i.test(x.name)||/(\.vssx)($|\?)/i.test(x.name))?a.importVisio(x,mxUtils.bind(this,function(c){a.spinner.stop();
 m(c,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," "))})):null!=x&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,x.name)?a.parseFile(x,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(m(c.responseText,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(m(c,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,
 g.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,"drop",q);mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,"drop",q);b.appendChild(t);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);k=mxUtils.button(mxResources.get("export"),
 function(){var b=a.createLibraryDataFromImages(f),c=p.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")});k.setAttribute("id","btnDownload");k.className="geBtn";d.appendChild(k);var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(A,
-"change",function(b){J=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,d,k,p,e,g,v){F(b)(a,c,f,d,k,p,e,g,v);A.value=""});t.scrollTop=t.scrollHeight}),k=mxUtils.button(mxResources.get("import"),function(){null!=x&&(x(),x=null);A.click()}),k.setAttribute("id","btnAddImage"),k.className="geBtn",d.appendChild(k));k=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=x&&(x(),x=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){J=!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,b,c);t.scrollTop=t.scrollHeight}})});k.setAttribute("id","btnAddImageUrl");k.className="geBtn";d.appendChild(k);this.saveBtnClickHandler=function(b,c,f,d){a.saveLibrary(b,c,f,d)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=x&&(x(),x=null);this.saveBtnClickHandler(p.value,f,e,g)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";d.appendChild(k);
-a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,e){d=null!=d?d:300;e=null!=e?e:120;var g,l,m=document.createElement("table"),n=document.createElement("tbody");m.style.cellPadding="4px";g=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,b);g.appendChild(l);n.appendChild(g);g=document.createElement("tr");l=document.createElement("td");var q=document.createElement("textarea");
-q.style.outline="none";q.style.resize="none";q.style.width=d-200+"px";q.style.height=e+"px";this.textarea=q;this.init=function(){q.focus();q.scrollTop=0};l.appendChild(q);g.appendChild(l);l=document.createElement("td");b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=e+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);l.appendChild(b);var f=new Graph(b);f.setEnabled(!1);
-var k=a.editor.graph.cloneCell(c);f.addCells([k]);b=f.view.getState(k);var p="";null!=b.shape&&null!=b.shape.stencil&&(p=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(q,p||"");b=f.getGraphBounds();e=Math.min(160/b.width,(e-40)/b.height);f.view.scaleAndTranslate(e,20/e-b.x,20/e-b.y);g.appendChild(l);n.appendChild(g);g=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");
-e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&l.appendChild(e);a.isOffline()||(b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),b.className="geBtn",l.appendChild(b));var t=function(b,c,f){var d=q.value,k=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(k.documentElement),k=k.documentElement.getElementsByTagName("parsererror");if(null!=k&&0<k.length)a.showError(mxResources.get("error"),
+"change",function(b){J=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,d,k,p,e,g,v){G(b)(a,c,f,d,k,p,e,g,v);A.value=""});t.scrollTop=t.scrollHeight}),k=mxUtils.button(mxResources.get("import"),function(){null!=x&&(x(),x=null);A.click()}),k.setAttribute("id","btnAddImage"),k.className="geBtn",d.appendChild(k));k=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=x&&(x(),x=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){J=!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,b,c);t.scrollTop=t.scrollHeight}})});k.setAttribute("id","btnAddImageUrl");k.className="geBtn";d.appendChild(k);this.saveBtnClickHandler=function(b,c,f,d){a.saveLibrary(b,c,f,d)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=x&&(x(),x=null);this.saveBtnClickHandler(p.value,f,g,e)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";d.appendChild(k);
+a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,g){d=null!=d?d:300;g=null!=g?g:120;var e,l,m=document.createElement("table"),n=document.createElement("tbody");m.style.cellPadding="4px";e=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,b);e.appendChild(l);n.appendChild(e);e=document.createElement("tr");l=document.createElement("td");var q=document.createElement("textarea");
+q.style.outline="none";q.style.resize="none";q.style.width=d-200+"px";q.style.height=g+"px";this.textarea=q;this.init=function(){q.focus();q.scrollTop=0};l.appendChild(q);e.appendChild(l);l=document.createElement("td");b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=g+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);l.appendChild(b);var f=new Graph(b);f.setEnabled(!1);
+var k=a.editor.graph.cloneCell(c);f.addCells([k]);b=f.view.getState(k);var p="";null!=b.shape&&null!=b.shape.stencil&&(p=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(q,p||"");b=f.getGraphBounds();g=Math.min(160/b.width,(g-40)/b.height);f.view.scaleAndTranslate(g,20/g-b.x,20/g-b.y);e.appendChild(l);n.appendChild(e);e=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");
+g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);a.isOffline()||(b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),b.className="geBtn",l.appendChild(b));var t=function(b,c,f){var d=q.value,k=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(k.documentElement),k=k.documentElement.getElementsByTagName("parsererror");if(null!=k&&0<k.length)a.showError(mxResources.get("error"),
 mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(f&&a.hideDialog(),k=!b.model.contains(c),!f||k||d!=p){d=Graph.compress(d);b.getModel().beginUpdate();try{if(k){var e=a.editor.graph.getInsertPoint();c.geometry.x=e.x;c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[c])}catch(J){throw J;}finally{b.getModel().endUpdate()}k&&b.setSelectionCell(c)}};b=mxUtils.button(mxResources.get("preview"),function(){t(f,k,!1)});b.className="geBtn";l.appendChild(b);
-b=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";l.appendChild(b);a.editor.cancelFirst||l.appendChild(e);g.appendChild(l);n.appendChild(g);m.appendChild(n);this.container=m},CustomDialog=function(a,c,b,d,e,g,l,m){var n=document.createElement("div");n.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=l&&c.appendChild(l);l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();
-null!=d&&d()});l.className="geBtn";m&&(l.style.display="none");a.editor.cancelFirst&&c.appendChild(l);a.isOffline()||null==g||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(g)}),m.className="geBtn",c.appendChild(m));e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(l);n.appendChild(c);this.cancelBtn=l;this.okButton=e;this.container=n},TemplatesDialog=function(){var a=
+b=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";l.appendChild(b);a.editor.cancelFirst||l.appendChild(g);e.appendChild(l);n.appendChild(e);m.appendChild(n);this.container=m},CustomDialog=function(a,c,b,d,g,e,l,m){var n=document.createElement("div");n.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=l&&c.appendChild(l);l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();
+null!=d&&d()});l.className="geBtn";m&&(l.style.display="none");a.editor.cancelFirst&&c.appendChild(l);a.isOffline()||null==e||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(e)}),m.className="geBtn",c.appendChild(m));g=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(l);n.appendChild(c);this.cancelBtn=l;this.okButton=g;this.container=n},TemplatesDialog=function(){var a=
 '<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+
 mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTempDlgDiagramsList"><div class="geTempDlgDiagramsListHeader"><div class="geTempDlgDiagramsListTitle"></div><div class="geTempDlgDiagramsListBtns"><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge" data-id="myDiagramsBtn"><img src="/images/my-diagrams.svg" class="geTempDlgMyDiagramsBtnImg"> <span>'+
 mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">&#x1F6C8; '+
 mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg";
-var a=window.innerWidth,b=window.innerHeight,d=987,e=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<e&&(e=Math.max(.9*b,300),c.style.height=e+"px");this.width=d;this.height=e;this.container=c};
-TemplatesDialog.prototype.init=function(a,c,b,d,e,g,l,m,n,q){function f(){null!=I&&(I.style.fontWeight="normal",I.style.textDecoration="none",I=null)}function k(a,b,c,f,d,k,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";F.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");F.querySelector("."+b).src="/images/"+c+"-sel.svg";F.querySelector("."+d).src="/images/"+
-k+".svg";return!0}function p(a){function b(a){Y.removeChild(f);F.removeChild(c);Y.scrollTop=k}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";F.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
-a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var k=Y.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);Y.appendChild(f);Y.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function t(a,b,c){if(null!=C){for(var f=C.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}C.className=f.join(" ")}null!=a?(C=a,C.className+=" "+b,G=c,P.className="geTempDlgCreateBtn"):(G=C=null,P.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
-function u(b){if(null!=G){var f=G;G=null;P.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function y(a){a=a?"":"none";for(var b=F.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
+var a=window.innerWidth,b=window.innerHeight,d=987,g=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<g&&(g=Math.max(.9*b,300),c.style.height=g+"px");this.width=d;this.height=g;this.container=c};
+TemplatesDialog.prototype.init=function(a,c,b,d,g,e,l,m,n,q){function f(){null!=I&&(I.style.fontWeight="normal",I.style.textDecoration="none",I=null)}function k(a,b,c,f,d,k,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";G.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");G.querySelector("."+b).src="/images/"+c+"-sel.svg";G.querySelector("."+d).src="/images/"+
+k+".svg";return!0}function p(a){function b(a){Y.removeChild(f);G.removeChild(c);Y.scrollTop=k}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";G.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
+a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var k=Y.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);Y.appendChild(f);Y.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function t(a,b,c){if(null!=C){for(var f=C.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}C.className=f.join(" ")}null!=a?(C=a,C.className+=" "+b,F=c,P.className="geTempDlgCreateBtn"):(F=C=null,P.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
+function u(b){if(null!=F){var f=F;F=null;P.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function y(a){a=a?"":"none";for(var b=G.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
 a}function z(a,b,c){function f(){P.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));y(!b)}T.innerHTML="";t();M=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=
 mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));k.appendChild(e);d.appendChild(k);T.appendChild(d)}for(k=0;k<a.length;k++){a[k].isExternal=!b;var g=a[k].url,e=mxUtils.htmlEntities(a[k].title),v=a[k].tooltip||a[k].title,x=a[k].imgUrl,l=mxUtils.htmlEntities(a[k].changedBy||""),A=mxUtils.htmlEntities(a[k].lastModifiedOn||
 "");x||(x=TEMPLATE_PATH+"/"+g.substring(0,g.length-4)+".png");g=c?50:15;null!=e&&e.length>g&&(e=e.substring(0,g)+"&hellip;");if(c){var m=document.createElement("tr"),x=document.createElement("td"),n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramListPreviewBtn";n.setAttribute("title",mxResources.get("preview"));x.appendChild(n);v=document.createElement("span");v.className="geTempDlgDiagramTitle";v.innerHTML=e;x.appendChild(v);m.appendChild(x);x=document.createElement("td");
 x.innerHTML=l;m.appendChild(x);x=document.createElement("td");x.innerHTML=A;m.appendChild(x);d.appendChild(m);null==C&&(f(),t(m,"geTempDlgDiagramsListGridActive",a[k]));(function(a,b){mxEvent.addListener(m,"click",function(){C!=b&&(f(),t(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(m,"dblclick",u);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],m)}else{var z=document.createElement("div");z.className="geTempDlgDiagramTile";z.setAttribute("title",v);null==C&&(f(),t(z,"geTempDlgDiagramTileActive",
 a[k]));l=document.createElement("div");l.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var q=document.createElement("img");q.style.display="none";(function(a,b){q.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};q.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(q,l);q.src=x;l.appendChild(q);z.appendChild(l);l=document.createElement("div");l.className="geTempDlgDiagramTileLbl";l.innerHTML=null!=e?e:"";z.appendChild(l);
-n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));z.appendChild(n);(function(a,b){mxEvent.addListener(z,"click",function(){C!=b&&(f(),t(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(z,"dblclick",u);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],z);T.appendChild(z)}}}function v(a,b){Z.innerHTML="";t();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory=!0;
-var k=document.createElement("div"),p=mxResources.get(d.title);null==p&&(p=d.title.substring(0,1).toUpperCase()+d.title.substring(1));k.className="geTempDlgNewDiagramCatItem";k.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"&hellip;");null==C&&(P.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),y(),t(k,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img");
-g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);k.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;k.appendChild(e);Z.appendChild(k);(function(a,b){mxEvent.addListener(k,"click",function(){C!=b&&(P.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),y(),t(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",u)})(d,k)}O.style.display=5>a.length?"none":""}function x(a){var b=F.querySelector(".geTemplatesList"),
-c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),k=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",d+" ("+k.length+")");d=mxUtils.htmlEntities(d);15<d.length&&(d=d.substring(0,15)+"&hellip;");f.innerHTML=d+" ("+k.length+")";b.appendChild(f);(function(b,c,d){mxEvent.addListener(f,"click",function(){I!=d&&(null!=I?(I.style.fontWeight="normal",I.style.textDecoration="none"):(N.style.display="none",fa.style.minHeight=
-"100%"),I=d,I.style.fontWeight="bold",I.style.textDecoration="underline",Y.scrollTop=0,A&&(E=!0),U.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,d,f)}}function D(a){l&&(Y.scrollTop=0,T.innerHTML="",R.spin(T),E=!1,A=!0,U.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),Q=null,l(L,a?null:g))}function J(a){f();Y.scrollTop=0;T.innerHTML="";R.spin(T);E=!1;A=!0;ea=null;U.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+
-mxUtils.htmlEntities(a)+'"';m(a,L,B?null:g);Q=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";e=null!=e?e:NEW_DIAGRAM_CATS_PATH+"/index.xml";var F=this.container,A=!1,E=!1,I=null,C=null,G=null,H=!1,B=!0,K=!1,M=[],Q,O=F.querySelector(".geTempDlgShowAllBtn"),T=F.querySelector(".geTempDlgDiagramsTiles"),U=F.querySelector(".geTempDlgDiagramsListTitle"),W=F.querySelector(".geTempDlgDiagramsListBtns"),Y=F.querySelector(".geTempDlgContent"),fa=F.querySelector(".geTempDlgDiagramsList"),N=F.querySelector(".geTempDlgNewDiagramCat"),
-Z=F.querySelector(".geTempDlgNewDiagramCatList"),P=F.querySelector(".geTempDlgCreateBtn"),R=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(F.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();N.style.display="";fa.style.minHeight="calc(100% - 280px)";D(B)});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
-"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(B=!0,null==Q?D(B):J(Q))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(B=!1,null==Q?D(B):J(Q))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
-"tiles",!1)&&(K=!0,z(M,!1,K))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(M,!1,K))});mxEvent.addListener(O,"click",function(){H?(N.style.height="280px",Z.style.height="190px",O.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),v(ba)):(N.style.height="440px",Z.style.height="355px",O.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
-null,"- Show less")),v(ba,!0));H=!H});var aa=!1,V=!1,S={},ba=[],ga=1;mxUtils.get(d,function(a){if(!aa){aa=!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=S[b];null==c&&(ga++,c=[],S[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=a.nextSibling}x(S)}});mxUtils.get(e,
-function(a){if(!V){V=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ba.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;v(ba)}});var L=function(a,b){W.style.display="";R.stop();A=!1;E?E=!1:b?T.innerHTML=b:0==a.length?T.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):z(a,!1,K)};D(B);var ea=null;m&&mxEvent.addListener(F.querySelector(".geTempDlgSearchBox"),
-"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?J(b.value):ea=setTimeout(function(){J(b.value)},500)});mxEvent.addListener(P,"click",u);mxEvent.addListener(F.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){u(!0)});mxEvent.addListener(F.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
-var BtnDialog=function(a,c,b,d){var e=document.createElement("div");e.style.textAlign="center";var g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("done"));var l="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
+n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));z.appendChild(n);(function(a,b){mxEvent.addListener(z,"click",function(){C!=b&&(f(),t(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(z,"dblclick",u);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],z);T.appendChild(z)}}}function v(a,b){Z.innerHTML="";t();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var k=a[f];k.isCategory=!0;
+var d=document.createElement("div"),p=mxResources.get(k.title);null==p&&(p=k.title.substring(0,1).toUpperCase()+k.title.substring(1));d.className="geTempDlgNewDiagramCatItem";d.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"&hellip;");null==C&&(P.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),y(),t(d,"geTempDlgNewDiagramCatItemActive",k));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img");
+g.src=NEW_DIAGRAM_CATS_PATH+"/"+k.img;e.appendChild(g);d.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;d.appendChild(e);Z.appendChild(d);(function(a,b){mxEvent.addListener(d,"click",function(){C!=b&&(P.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),y(),t(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(d,"dblclick",u)})(k,d)}Q.style.display=5>a.length?"none":""}function x(a){var b=G.querySelector(".geTemplatesList"),
+c;for(c in a){var f=document.createElement("div"),k=mxResources.get(c),d=a[c];null==k&&(k=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",k+" ("+d.length+")");k=mxUtils.htmlEntities(k);15<k.length&&(k=k.substring(0,15)+"&hellip;");f.innerHTML=k+" ("+d.length+")";b.appendChild(f);(function(b,c,k){mxEvent.addListener(f,"click",function(){I!=k&&(null!=I?(I.style.fontWeight="normal",I.style.textDecoration="none"):(N.style.display="none",fa.style.minHeight=
+"100%"),I=k,I.style.fontWeight="bold",I.style.textDecoration="underline",Y.scrollTop=0,A&&(D=!0),U.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,k,f)}}function E(a){l&&(Y.scrollTop=0,T.innerHTML="",R.spin(T),D=!1,A=!0,U.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),O=null,l(L,a?null:e))}function J(a){f();Y.scrollTop=0;T.innerHTML="";R.spin(T);D=!1;A=!0;ea=null;U.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+
+mxUtils.htmlEntities(a)+'"';m(a,L,B?null:e);O=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var G=this.container,A=!1,D=!1,I=null,C=null,F=null,H=!1,B=!0,K=!1,M=[],O,Q=G.querySelector(".geTempDlgShowAllBtn"),T=G.querySelector(".geTempDlgDiagramsTiles"),U=G.querySelector(".geTempDlgDiagramsListTitle"),W=G.querySelector(".geTempDlgDiagramsListBtns"),Y=G.querySelector(".geTempDlgContent"),fa=G.querySelector(".geTempDlgDiagramsList"),N=G.querySelector(".geTempDlgNewDiagramCat"),
+Z=G.querySelector(".geTempDlgNewDiagramCatList"),P=G.querySelector(".geTempDlgCreateBtn"),R=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(G.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();N.style.display="";fa.style.minHeight="calc(100% - 280px)";E(B)});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
+"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(B=!0,null==O?E(B):J(O))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(B=!1,null==O?E(B):J(O))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
+"tiles",!1)&&(K=!0,z(M,!1,K))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(M,!1,K))});mxEvent.addListener(Q,"click",function(){H?(N.style.height="280px",Z.style.height="190px",Q.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),v(ba)):(N.style.height="440px",Z.style.height="355px",Q.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
+null,"- Show less")),v(ba,!0));H=!H});var aa=!1,V=!1,S={},ba=[],ga=1;mxUtils.get(d,function(a){if(!aa){aa=!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=S[b];null==c&&(ga++,c=[],S[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=a.nextSibling}x(S)}});mxUtils.get(g,
+function(a){if(!V){V=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ba.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;v(ba)}});var L=function(a,b){W.style.display="";R.stop();A=!1;D?D=!1:b?T.innerHTML=b:0==a.length?T.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):z(a,!1,K)};E(B);var ea=null;m&&mxEvent.addListener(G.querySelector(".geTempDlgSearchBox"),
+"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?J(b.value):ea=setTimeout(function(){J(b.value)},500)});mxEvent.addListener(P,"click",u);mxEvent.addListener(G.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){u(!0)});mxEvent.addListener(G.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
+var BtnDialog=function(a,c,b,d){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("done"));var l="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
 (l=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.trello&&(l=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[l],"You are now authorized in {1}"));b=mxUtils.button(b,d);b.insertBefore(m,b.firstChild);
-b.style.marginTop="6px";b.className="geBigButton";e.appendChild(g);e.appendChild(a);e.appendChild(b);this.container=e};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];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":
+b.style.marginTop="6px";b.className="geBigButton";g.appendChild(e);g.appendChild(a);g.appendChild(b);this.container=g};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];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.globeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNi45MyA2aC0yLjk1Yy0uMzItMS4yNS0uNzgtMi40NS0xLjM4LTMuNTYgMS44NC42MyAzLjM3IDEuOTEgNC4zMyAzLjU2ek0xMiA0LjA0Yy44MyAxLjIgMS40OCAyLjUzIDEuOTEgMy45NmgtMy44MmMuNDMtMS40MyAxLjA4LTIuNzYgMS45MS0zLjk2ek00LjI2IDE0QzQuMSAxMy4zNiA0IDEyLjY5IDQgMTJzLjEtMS4zNi4yNi0yaDMuMzhjLS4wOC42Ni0uMTQgMS4zMi0uMTQgMiAwIC42OC4wNiAxLjM0LjE0IDJINC4yNnptLjgyIDJoMi45NWMuMzIgMS4yNS43OCAyLjQ1IDEuMzggMy41Ni0xLjg0LS42My0zLjM3LTEuOS00LjMzLTMuNTZ6bTIuOTUtOEg1LjA4Yy45Ni0xLjY2IDIuNDktMi45MyA0LjMzLTMuNTZDOC44MSA1LjU1IDguMzUgNi43NSA4LjAzIDh6TTEyIDE5Ljk2Yy0uODMtMS4yLTEuNDgtMi41My0xLjkxLTMuOTZoMy44MmMtLjQzIDEuNDMtMS4wOCAyLjc2LTEuOTEgMy45NnpNMTQuMzQgMTRIOS42NmMtLjA5LS42Ni0uMTYtMS4zMi0uMTYtMiAwLS42OC4wNy0xLjM1LjE2LTJoNC42OGMuMDkuNjUuMTYgMS4zMi4xNiAyIDAgLjY4LS4wNyAxLjM0LS4xNiAyem0uMjUgNS41NmMuNi0xLjExIDEuMDYtMi4zMSAxLjM4LTMuNTZoMi45NWMtLjk2IDEuNjUtMi40OSAyLjkzLTQuMzMgMy41NnpNMTYuMzYgMTRjLjA4LS42Ni4xNC0xLjMyLjE0LTIgMC0uNjgtLjA2LTEuMzQtLjE0LTJoMy4zOGMuMTYuNjQuMjYgMS4zMS4yNiAycy0uMSAxLjM2LS4yNiAyaC0zLjM4eiIvPjwvc3ZnPg==";
@@ -8082,41 +8082,41 @@ if(null!=a.css){var c=document.createElement("style");c.setAttribute("type","tex
 a.defaultCustomLibraries);null!=a.enableCustomLibraries&&(Editor.enableCustomLibraries=a.enableCustomLibraries);null!=a.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=a.defaultVertexStyle);null!=a.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=a.defaultEdgeStyle);a.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=a.emptyDiagramXml);a.thumbWidth&&(Sidebar.prototype.thumbWidth=a.thumbWidth);a.thumbHeight&&(Sidebar.prototype.thumbHeight=a.thumbHeight);a.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=
 a.emptyLibraryXml);a.sidebarWidth&&(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(c=document.createElement("style"),c.setAttribute("type","text/css"),c.appendChild(document.createTextNode(a.fontCss)),f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(c,f),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!b)for(App.initPluginCallback(),c=0;c<a.plugins.length;c++)mxscript(a.plugins[c])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
 Editor.GUID_LENGTH=20;Editor.guid=function(a){a=null!=a?a:Editor.GUID_LENGTH;for(var b=[],c=0;c<a;c++)b.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return b.join("")};Editor.prototype.useForeignObjectForMath=!1;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(b){b=null!=b&&"mxlibrary"!=b.nodeName?this.extractGraphModel(b):null;if(null!=b){var c=
-b.getElementsByTagName("parsererror");if(null!=c&&0<c.length){var c=c[0],f=c.getElementsByTagName("div");null!=f&&0<f.length&&(c=f[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&&(f=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+"/"+c+".xml").getDocumentElement(),null!=f&&(d=new mxCodec(f.ownerDocument),d.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 d=new mxCodec(f.ownerDocument);d.decode(f,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&&
+b.getElementsByTagName("parsererror");if(null!=c&&0<c.length){var c=c[0],f=c.getElementsByTagName("div");null!=f&&0<f.length&&(c=f[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&&(f=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+"/"+c+".xml").getDocumentElement(),null!=f&&(k=new mxCodec(f.ownerDocument),k.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 k=new mxCodec(f.ownerDocument);k.decode(f,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&&
 !this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();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 c=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var b=c.apply(this,
 arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&b.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&b.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));b.setAttribute("math",this.graph.mathEnabled?"1":"0");b.setAttribute("shadow",this.graph.shadowVisible?"1":"0");return b};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(C){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=c&&0<c.length)for(var d=0;d<c.length;d++)if("mxgraph"==c[d].getAttribute("class")){f.push(c[d]);
+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(C){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=c&&0<c.length)for(var k=0;k<c.length;k++)if("mxgraph"==c[k].getAttribute("class")){f.push(c[k]);
 break}0<f.length&&(c=f[0].getAttribute("data-mxgraph"),null!=c?(f=JSON.parse(c),null!=f&&null!=f.xml&&(f=mxUtils.parseXml(f.xml),a=f.documentElement)):(f=f[0].getElementsByTagName("div"),0<f.length&&(c=mxUtils.getTextContent(f[0]),c=Graph.decompress(c),0<c.length&&(f=mxUtils.parseXml(c),a=f.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||(f=null,"diagram"==a.nodeName?f=a:"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),0<c.length&&(f=c[Math.max(0,Math.min(c.length-1,urlParams.page||0))])),null!=f&&(c=Graph.decompress(mxUtils.getTextContent(f)),null!=c&&0<c.length&&(a=mxUtils.parseXml(c).documentElement)));null==a||"mxGraphModel"==a.nodeName||b&&"mxfile"==a.nodeName||(a=null);
 return a};var b=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&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();b.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=
 function(){d.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(a,b){a=null!=a?a:"https://math.draw.io/current/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){window.setTimeout(function(){"hidden"!=
 a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(b||{jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],"HTML-CSS":{imageFont:null},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 c=Editor.prototype.init;Editor.prototype.init=function(){c.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,
-b){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");if(null!=f&&0<f.length){var d=document.createElement("script");d.type="text/javascript";d.src=a;f[0].parentNode.appendChild(d)}};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,f,d){void 0!==c?b.push(c.replace(/\\'/g,"'")):void 0!==f?b.push(f.replace(/\\"/g,'"')):void 0!==d&&b.push(d);return""});/,\s*$/.test(a)&&b.push("");return b};Editor.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&
+b){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");if(null!=f&&0<f.length){var k=document.createElement("script");k.type="text/javascript";k.src=a;f[0].parentNode.appendChild(k)}};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,f,k){void 0!==c?b.push(c.replace(/\\'/g,"'")):void 0!==f?b.push(f.replace(/\\"/g,'"')):void 0!==k&&b.push(k);return""});/,\s*$/.test(a)&&b.push("");return b};Editor.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&
 this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(f){if(null!=
-f){var d="http://"==f.substring(0,7)||"https://"==f.substring(0,8);d&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!d||f.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"!=f.substring(0,19)&&(f=b.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=
+f){var k="http://"==f.substring(0,7)||"https://"==f.substring(0,8);k&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!k||f.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"!=f.substring(0,19)&&(f=b.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.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(EditorUi.prototype.svgBrokenImage.src)});else{var c=new Image;EditorUi.prototype.crossOriginImages&&(c.crossOrigin="anonymous");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);try{b(a.toDataURL())}catch(H){b(EditorUi.prototype.svgBrokenImage.src)}};c.onerror=function(){b(EditorUi.prototype.svgBrokenImage.src)};
-c.src=a}};Editor.prototype.convertImages=function(a,b,c,f){null==f&&(f=this.createImageUrlConverter());var d=0,k=c||{};c=mxUtils.bind(this,function(c,p){for(var e=a.getElementsByTagName(c),g=0;g<e.length;g++)mxUtils.bind(this,function(c){var e=f.convert(c.getAttribute(p));if(null!=e&&"data:"!=e.substring(0,5)){var g=k[e];null==g?(d++,this.convertImageToDataUri(e,function(f){null!=f&&(k[e]=f,c.setAttribute(p,f));d--;0==d&&b(a)})):c.setAttribute(p,g)}else null!=e&&c.setAttribute(p,e)})(e[g])});c("image",
-"xlink:href");c("img","src");0==d&&b(a)};Editor.prototype.base64Encode=function(a){for(var b="",c=0,f=a.length,d,k,p;c<f;){d=a.charCodeAt(c++)&255;if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);b+="==";break}k=a.charCodeAt(c++);if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&
-3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);b+="=";break}p=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(p&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(p&63)}return b};
-Editor.prototype.loadUrl=function(a,b,c,f,d,k){try{var p=f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);d=null!=d?d:!0;var e=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(p){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),
-d=0;d<a.length;d++)f[d]=String.fromCharCode(a[d]);f=f.join("")}k=null!=k?k:"data:image/png;base64,";f=k+this.base64Encode(f)}b(f)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},p,this.timeout,function(){d&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:e})})});e()}catch(M){null!=c&&c(M)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
-"g"),"")},c=this.fontCss.split("url("),f=0,d={},k=mxUtils.bind(this,function(){if(0==f){for(var k=[c[0]],p=1;p<c.length;p++){var e=c[p].indexOf(")");k.push('url("');k.push(d[b(c[p].substring(0,e))]);k.push('"'+c[p].substring(e))}this.resolvedFontCss=k.join("");a()}});if(0<c.length)for(var p=1;p<c.length;p++){var e=c[p].indexOf(")"),g=null,v=c[p].indexOf("format(",e);0<v&&(g=b(c[p].substring(v+7,c[p].indexOf(")",v))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;f++;var b="application/x-font-ttf";
+c.src=a}};Editor.prototype.convertImages=function(a,b,c,f){null==f&&(f=this.createImageUrlConverter());var k=0,d=c||{};c=mxUtils.bind(this,function(c,p){for(var e=a.getElementsByTagName(c),g=0;g<e.length;g++)mxUtils.bind(this,function(c){var e=f.convert(c.getAttribute(p));if(null!=e&&"data:"!=e.substring(0,5)){var g=d[e];null==g?(k++,this.convertImageToDataUri(e,function(f){null!=f&&(d[e]=f,c.setAttribute(p,f));k--;0==k&&b(a)})):c.setAttribute(p,g)}else null!=e&&c.setAttribute(p,e)})(e[g])});c("image",
+"xlink:href");c("img","src");0==k&&b(a)};Editor.prototype.base64Encode=function(a){for(var b="",c=0,f=a.length,k,d,p;c<f;){k=a.charCodeAt(c++)&255;if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&3)<<4);b+="==";break}d=a.charCodeAt(c++);if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&
+3)<<4|(d&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&15)<<2);b+="=";break}p=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&3)<<4|(d&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&15)<<2|(p&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(p&63)}return b};
+Editor.prototype.loadUrl=function(a,b,c,f,k,d){try{var p=f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var e=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(p){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),
+k=0;k<a.length;k++)f[k]=String.fromCharCode(a[k]);f=f.join("")}d=null!=d?d:"data:image/png;base64,";f=d+this.base64Encode(f)}b(f)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},p,this.timeout,function(){k&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:e})})});e()}catch(M){null!=c&&c(M)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
+"g"),"")},c=this.fontCss.split("url("),f=0,k={},d=mxUtils.bind(this,function(){if(0==f){for(var d=[c[0]],p=1;p<c.length;p++){var e=c[p].indexOf(")");d.push('url("');d.push(k[b(c[p].substring(0,e))]);d.push('"'+c[p].substring(e))}this.resolvedFontCss=d.join("");a()}});if(0<c.length)for(var p=1;p<c.length;p++){var e=c[p].indexOf(")"),g=null,v=c[p].indexOf("format(",e);0<v&&(g=b(c[p].substring(v+7,c[p].indexOf(")",v))));mxUtils.bind(this,function(a){if(null==k[a]){k[a]=a;f++;var b="application/x-font-ttf";
 if("svg"==g||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==g||"embedded-opentype"==g||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==g||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==g||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==g||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==g||/(\.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){d[a]=b;f--;k()}),mxUtils.bind(this,function(a){f--;k()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[p].substring(0,e)),g)}}else a()};Editor.prototype.convertMath=function(a,b,c,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=
-function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,b,c,f,d,k,p,e,g,v,x,u,t,l){k=null!=k?k:!0;u=null!=u?u:this.graph;t=null!=t?t:0;var y=g?null:u.background;y==mxConstants.NONE&&(y=null);null==y&&(y=f);null==y&&0==g&&(y=this.graph.defaultPageBackgroundColor);this.convertImages(u.getSvg(y,null,null,l,null,null!=p?p:!0,null,null,null,v),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var p=
-document.createElement("canvas"),g=parseInt(c.getAttribute("width")),v=parseInt(c.getAttribute("height"));e=null!=e?e:1;null!=b&&(e=k?Math.min(1,Math.min(3*b/(4*v),b/g)):b/g);g=Math.ceil(e*g)+2*t;v=Math.ceil(e*v)+2*t;p.setAttribute("width",g);p.setAttribute("height",v);var x=p.getContext("2d");null!=y&&(x.beginPath(),x.rect(0,0,g,v),x.fillStyle=y,x.fill());x.scale(e,e);mxClient.IS_SF?window.setTimeout(function(){x.drawImage(f,t/e,t/e);a(p)},0):(x.drawImage(f,t/e,t/e),a(p))}catch(S){null!=d&&d(S)}});
-f.onerror=function(a){null!=d&&d(a)};try{v&&this.graph.addSvgShadow(c);var p=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(u,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(p)}catch(P){null!=d&&d(P)}}),c,x)};Editor.prototype.writeGraphModelToPng=function(a,b,c,f,
-d){function k(a,b){var c=g;g+=b;return a.substring(c,g)}function p(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function e(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 g=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(k(a,4),"IHDR"!=k(a,4))null!=d&&d();else{k(a,17);d=a.substring(0,g);do{var v=p(a);
-if("IDAT"==k(a,4)){d=a.substring(0,g-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+f;f=4294967295;f=EditorUi.prototype.updateCRC(f,b,0,4);f=EditorUi.prototype.updateCRC(f,c,0,c.length);d+=e(c.length)+b+c+e(f^4294967295);d+=a.substring(g-8,a.length);break}d+=a.substring(g-8,g-4+v);k(a,v);k(a,4)}while(v);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";
-var e=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,b){e.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var g=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){g.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(a,b){var c=null;null!=a.editor.graph.getModel().getParent(b)?c=b.getId():null!=a.currentPage&&
+(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){k[a]=b;f--;d()}),mxUtils.bind(this,function(a){f--;d()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[p].substring(0,e)),g)}}else a()};Editor.prototype.convertMath=function(a,b,c,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=
+function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,b,c,f,k,d,p,e,g,v,x,u,t,l){d=null!=d?d:!0;u=null!=u?u:this.graph;t=null!=t?t:0;var m=g?null:u.background;m==mxConstants.NONE&&(m=null);null==m&&(m=f);null==m&&0==g&&(m=this.graph.defaultPageBackgroundColor);this.convertImages(u.getSvg(m,null,null,l,null,null!=p?p:!0,null,null,null,v),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var p=
+document.createElement("canvas"),g=parseInt(c.getAttribute("width")),v=parseInt(c.getAttribute("height"));e=null!=e?e:1;null!=b&&(e=d?Math.min(1,Math.min(3*b/(4*v),b/g)):b/g);g=Math.ceil(e*g)+2*t;v=Math.ceil(e*v)+2*t;p.setAttribute("width",g);p.setAttribute("height",v);var x=p.getContext("2d");null!=m&&(x.beginPath(),x.rect(0,0,g,v),x.fillStyle=m,x.fill());x.scale(e,e);mxClient.IS_SF?window.setTimeout(function(){x.drawImage(f,t/e,t/e);a(p)},0):(x.drawImage(f,t/e,t/e),a(p))}catch(S){null!=k&&k(S)}});
+f.onerror=function(a){null!=k&&k(a)};try{v&&this.graph.addSvgShadow(c);var p=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(u,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(p)}catch(P){null!=k&&k(P)}}),c,x)};Editor.prototype.writeGraphModelToPng=function(a,b,c,f,
+k){function d(a,b){var c=g;g+=b;return a.substring(c,g)}function p(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function e(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 g=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(d(a,4),"IHDR"!=d(a,4))null!=k&&k();else{d(a,17);k=a.substring(0,g);do{var v=p(a);
+if("IDAT"==d(a,4)){k=a.substring(0,g-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+f;f=4294967295;f=EditorUi.prototype.updateCRC(f,b,0,4);f=EditorUi.prototype.updateCRC(f,c,0,c.length);k+=e(c.length)+b+c+e(f^4294967295);k+=a.substring(g-8,a.length);break}k+=a.substring(g-8,g-4+v);d(a,v);d(a,4)}while(v);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";
+var g=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,b){g.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var e=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){e.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(a,b){var c=null;null!=a.editor.graph.getModel().getParent(b)?c=b.getId():null!=a.currentPage&&
 (c=a.currentPage.getId());return c});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 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()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile();
 return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var n=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=n.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var b=this.editorUi,c=b.editor.graph,f=this.createOption(mxResources.get("shadow"),function(){return c.shadowVisible},function(a){var f=new ChangePageSetup(b);f.ignoreColor=!0;f.ignoreImage=
 !0;f.shadowVisible=a;c.model.execute(f)},{install:function(a){this.listener=function(){a(c.shadowVisible)};b.addListener("shadowVisibleChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}});Editor.shadowOptionEnabled||(f.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(f,60));a.appendChild(f)}return a};var q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=q.apply(this,arguments);var b=this.editorUi,
 c=b.editor.graph;if(c.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))}if(this.isMathOptionVisible()&&c.isEnabled()&&"undefined"!==typeof MathJax){f=this.createOption(mxResources.get("mathematicalTypesetting"),
-function(){return c.mathEnabled},function(a){b.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(c.mathEnabled)};b.addListener("mathEnabledChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var d=b.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");d.style.position="relative";d.style.marginLeft="6px";d.style.top="2px";f.appendChild(d)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=
+function(){return c.mathEnabled},function(a){b.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(c.mathEnabled)};b.addListener("mathEnabledChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var k=b.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");k.style.position="relative";k.style.marginLeft="6px";k.style.top="2px";f.appendChild(k)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=
 [{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",
 dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",
 type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",
@@ -8137,35 +8137,35 @@ type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,de
 {fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#aa00ff",stroke:"#7700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#ffffff"},{fill:"#f0a30a",stroke:"#BD7000",font:"#ffffff"},{fill:"#e3c800",
 stroke:"#B09500",font:"#ffffff"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},
 {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"}],[{fill:"",stroke:""},{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"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,b,c){if(null!=b){var f=function(a){if(null!=a)if(c)for(var f=0;f<a.length;f++)b[a[f].name]=a[f];else for(var d in b){for(var k=!1,f=0;f<a.length;f++)if(a[f].name==d&&a[f].type==b[d].type){k=!0;break}k||delete b[d]}},d=this.editorUi.editor.graph.view.getState(a);null!=d&&
-null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(H){}}};var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
-this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,d=a.edges,k=0;k<c.length;k++)this.findCommonProperties(c[k],b,0==k);for(k=0;k<d.length;k++)this.findCommonProperties(d[k],b,0==c.length&&0==k);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var k=
+stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,b,c){if(null!=b){var f=function(a){if(null!=a)if(c)for(var f=0;f<a.length;f++)b[a[f].name]=a[f];else for(var k in b){for(var d=!1,f=0;f<a.length;f++)if(a[f].name==k&&a[f].type==b[k].type){d=!0;break}d||delete b[k]}},k=this.editorUi.editor.graph.view.getState(a);null!=k&&
+null!=k.shape&&(k.shape.commonCustomPropAdded||(k.shape.commonCustomPropAdded=!0,k.shape.customProperties=k.shape.customProperties||[],k.cell.vertex?Array.prototype.push.apply(k.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(k.shape.customProperties,Editor.commonEdgeProperties)),f(k.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(H){}}};var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
+this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,k=a.edges,d=0;d<c.length;d++)this.findCommonProperties(c[d],b,0==d);for(d=0;d<k.length;d++)this.findCommonProperties(k[d],b,0==c.length&&0==d);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var k=
 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 k.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function f(a,b,c,f){u.getModel().beginUpdate();try{var d=[],k=[];if(null!=c.index){for(var p=[],e=c.parentRow.nextSibling;e&&e.getAttribute("data-pName")==a;)p.push(e.getAttribute("data-pValue")),
-e=e.nextSibling;c.index<p.length?null!=f?p.splice(f,1):p[c.index]=b:p.push(b);null!=c.size&&p.length>c.size&&(p=p.slice(0,c.size));b=p.join(",");null!=c.countProperty&&(u.setCellStyles(c.countProperty,p.length,u.getSelectionCells()),d.push(c.countProperty),k.push(p.length))}u.setCellStyles(a,b,u.getSelectionCells());d.push(a);k.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var g=c.dependentPropsDefVal[a],v=c.dependentPropsVals[a];if(v.length>b)v=v.slice(0,b);else for(var t=
-v.length;t<b;t++)v.push(g);v=v.join(",");u.setCellStyles(c.dependentProps[a],v,u.getSelectionCells());d.push(c.dependentProps[a]);k.push(v)}x.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(b,!0);c.style.position="absolute";c.style.left=k.x-d.x+"px";c.style.top=k.y-d.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:
-0)+"px";c.style.zIndex=5}function k(a,b,c){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(x,function(k){this.editorUi.pickColor(b,function(b){d.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+"')":b;f(a,b,c)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className=
-"geColorBtn";btn.appendChild(d);return btn}function p(a,b,c,d,k,p,e){null!=b&&(b=b.split(","),t.push({name:a,values:b,type:c,defVal:d,countProperty:k,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(x,function(b){for(var g=p,x=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,x++;else break;var u={type:c,parentRow:p,index:x,isDeletable:!0,defVal:d,countProperty:k},x=v(a,"",u,0==x%2,e);f(a,d,u);g.parentNode.insertBefore(x,g.nextSibling);
-mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,d,k,p){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var g=0;g<d;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";t.push({name:a,values:e,type:c,defVal:f,parentRow:k,flipBkg:p,size:d})}return document.createElement("div")}function g(a,b,c){var d=document.createElement("input");d.type="checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});
-return d}function v(b,c,v,u,t){var l=v.dispName,y=v.type,m=document.createElement("tr");m.className="gePropRow"+(t?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",b);m.setAttribute("data-pValue",c);u=!1;null!=v.index&&(m.setAttribute("data-index",v.index),l=(null!=l?l:"")+"["+v.index+"]",u=!0);var n=document.createElement("td");n.className="gePropRowCell";n.innerHTML=mxUtils.htmlEntities(mxResources.get(l,null,l));u&&(n.style.textAlign="right");m.appendChild(n);n=document.createElement("td");
-n.className="gePropRowCell";if("color"==y)n.appendChild(k(b,c,v));else if("bool"==y||"boolean"==y)n.appendChild(g(b,c,v));else if("enum"==y){var A=v.enumList;for(t=0;t<A.length;t++)if(l=A[t],l.val==c){n.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));break}mxEvent.addListener(n,"click",mxUtils.bind(x,function(){var k=document.createElement("select");d(n,k);for(var p=0;p<A.length;p++){var e=A[p],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=
-mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));k.appendChild(g)}k.value=c;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);f(b,a,v)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==y?n.appendChild(p(b,c,v.subType,v.subDefVal,v.countProperty,m,t)):"staticArr"==y?n.appendChild(e(b,c,v.subType,v.subDefVal,v.size,m,t)):(n.innerHTML=c,mxEvent.addListener(n,"click",mxUtils.bind(x,function(){function k(){var a=
-p.value,a=0==a.length&&"string"!=y?0:a;v.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",y="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=v.min&&a<v.min?a=v.min:null!=v.max&&a>v.max&&(a=v.max);a=mxUtils.htmlEntities(("int"==y?parseInt(a):a)+"");f(b,a,v)}var p=document.createElement("input");d(n,p,!0);p.value=c;p.className="gePropEditor";"int"!=y&&"float"!=y||v.allowAuto||(p.type="number",p.step="int"==y?"1":"any",null!=v.min&&(p.min=parseFloat(v.min)),null!=v.max&&(p.max=parseFloat(v.max)));
-a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&k()});p.focus();mxEvent.addListener(p,"blur",function(){k()})})));v.isDeletable&&(t=mxUtils.button("-",mxUtils.bind(x,function(a){f(b,"",v,v.index);mxEvent.consume(a)})),t.style.height="16px",t.style.width="25px",t.style["float"]="right",t.className="geColorBtn",n.appendChild(t));m.appendChild(n);return m}var x=this,u=this.editorUi.editor.graph,t=[];a.style.position="relative";a.style.padding="0";var l=document.createElement("table");
-l.style.whiteSpace="nowrap";l.style.width="100%";var y=document.createElement("tr");y.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;m.appendChild(n);mxUtils.write(m,mxResources.get("property"));y.style.cursor="pointer";var A=function(){var b=l.querySelectorAll(".gePropNonHeaderRow"),c;if(x.editorUi.propertiesCollapsed){n.src=Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-
-1;0<=f;f--)try{var d=a.childNodes[f],k=d.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(d)}catch(da){}}else n.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(y,"click",function(){x.editorUi.propertiesCollapsed=!x.editorUi.propertiesCollapsed;A()});y.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");y.appendChild(m);l.appendChild(y);var z=!1,q=!1,D;for(D in b)if(y=
-b[D],"function"!=typeof y.isVisible||y.isVisible(c)){var J=null!=c.style[D]?mxUtils.htmlEntities(c.style[D]+""):y.defVal;if("separator"==y.type)q=!q;else{if("staticArr"==y.type)y.size=parseInt(c.style[y.sizeProperty]||b[y.sizeProperty].defVal)||0;else if(null!=y.dependentProps){for(var F=y.dependentProps,E=[],I=[],m=0;m<F.length;m++){var L=c.style[F[m]];I.push(b[F[m]].subDefVal);E.push(null!=L?L.split(","):[])}y.dependentPropsDefVal=I;y.dependentPropsVals=E}l.appendChild(v(D,J,y,z,q));z=!z}}for(m=
-0;m<t.length;m++)for(y=t[m],b=y.parentRow,c=0;c<y.values.length;c++)D=v(y.name,y.values[c],{type:y.type,parentRow:y.parentRow,isDeletable:y.isDeletable,index:c,defVal:y.defVal,countProperty:y.countProperty,size:y.size},0==c%2,y.flipBkg),b.parentNode.insertBefore(D,b.nextSibling),b=D;a.appendChild(l);A();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var d=
-f.getModel().getStyle(c[b]),p=0;p<k.length;p++)d=mxUtils.removeStylename(d,k[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,
-null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,
-mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(c[b],d)}}finally{f.getModel().endUpdate()}});b.className="geStyleButton";b.style.width="36px";b.style.height="30px";b.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?b.style.filter=
+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 k.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function f(a,b,c,f){u.getModel().beginUpdate();try{var k=[],d=[];if(null!=c.index){for(var p=[],e=c.parentRow.nextSibling;e&&e.getAttribute("data-pName")==a;)p.push(e.getAttribute("data-pValue")),
+e=e.nextSibling;c.index<p.length?null!=f?p.splice(f,1):p[c.index]=b:p.push(b);null!=c.size&&p.length>c.size&&(p=p.slice(0,c.size));b=p.join(",");null!=c.countProperty&&(u.setCellStyles(c.countProperty,p.length,u.getSelectionCells()),k.push(c.countProperty),d.push(p.length))}u.setCellStyles(a,b,u.getSelectionCells());k.push(a);d.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var g=c.dependentPropsDefVal[a],v=c.dependentPropsVals[a];if(v.length>b)v=v.slice(0,b);else for(var t=
+v.length;t<b;t++)v.push(g);v=v.join(",");u.setCellStyles(c.dependentProps[a],v,u.getSelectionCells());k.push(c.dependentProps[a]);d.push(v)}x.editorUi.fireEvent(new mxEventObject("styleChanged","keys",k,"values",d,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function k(b,c,f){var k=mxUtils.getOffset(a,!0),d=mxUtils.getOffset(b,!0);c.style.position="absolute";c.style.left=d.x-k.x+"px";c.style.top=d.y-k.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:
+0)+"px";c.style.zIndex=5}function d(a,b,c){var k=document.createElement("div");k.style.width="32px";k.style.height="4px";k.style.margin="2px";k.style.border="1px solid black";k.style.background=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(x,function(d){this.editorUi.pickColor(b,function(b){k.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+"')":b;f(a,b,c)});mxEvent.consume(d)}));btn.style.height="12px";btn.style.width="40px";btn.className=
+"geColorBtn";btn.appendChild(k);return btn}function p(a,b,c,k,d,p,e){null!=b&&(b=b.split(","),t.push({name:a,values:b,type:c,defVal:k,countProperty:d,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(x,function(b){for(var g=p,x=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,x++;else break;var u={type:c,parentRow:p,index:x,isDeletable:!0,defVal:k,countProperty:d},x=v(a,"",u,0==x%2,e);f(a,k,u);g.parentNode.insertBefore(x,g.nextSibling);
+mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,k,d,p){if(0<k){var e=Array(k);b=null!=b?b.split(","):[];for(var g=0;g<k;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";t.push({name:a,values:e,type:c,defVal:f,parentRow:d,flipBkg:p,size:k})}return document.createElement("div")}function g(a,b,c){var k=document.createElement("input");k.type="checkbox";k.checked="1"==b;mxEvent.addListener(k,"change",function(){f(a,k.checked?"1":"0",c)});
+return k}function v(b,c,v,u,t){var l=v.dispName,m=v.type,y=document.createElement("tr");y.className="gePropRow"+(t?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";y.setAttribute("data-pName",b);y.setAttribute("data-pValue",c);u=!1;null!=v.index&&(y.setAttribute("data-index",v.index),l=(null!=l?l:"")+"["+v.index+"]",u=!0);var n=document.createElement("td");n.className="gePropRowCell";n.innerHTML=mxUtils.htmlEntities(mxResources.get(l,null,l));u&&(n.style.textAlign="right");y.appendChild(n);n=document.createElement("td");
+n.className="gePropRowCell";if("color"==m)n.appendChild(d(b,c,v));else if("bool"==m||"boolean"==m)n.appendChild(g(b,c,v));else if("enum"==m){var A=v.enumList;for(t=0;t<A.length;t++)if(l=A[t],l.val==c){n.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));break}mxEvent.addListener(n,"click",mxUtils.bind(x,function(){var d=document.createElement("select");k(n,d);for(var p=0;p<A.length;p++){var e=A[p],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=
+mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));d.appendChild(g)}d.value=c;a.appendChild(d);mxEvent.addListener(d,"change",function(){var a=mxUtils.htmlEntities(d.value);f(b,a,v)});d.focus();mxEvent.addListener(d,"blur",function(){a.removeChild(d)})}))}else"dynamicArr"==m?n.appendChild(p(b,c,v.subType,v.subDefVal,v.countProperty,y,t)):"staticArr"==m?n.appendChild(e(b,c,v.subType,v.subDefVal,v.size,y,t)):(n.innerHTML=c,mxEvent.addListener(n,"click",mxUtils.bind(x,function(){function d(){var a=
+p.value,a=0==a.length&&"string"!=m?0:a;v.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",m="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=v.min&&a<v.min?a=v.min:null!=v.max&&a>v.max&&(a=v.max);a=mxUtils.htmlEntities(("int"==m?parseInt(a):a)+"");f(b,a,v)}var p=document.createElement("input");k(n,p,!0);p.value=c;p.className="gePropEditor";"int"!=m&&"float"!=m||v.allowAuto||(p.type="number",p.step="int"==m?"1":"any",null!=v.min&&(p.min=parseFloat(v.min)),null!=v.max&&(p.max=parseFloat(v.max)));
+a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&d()});p.focus();mxEvent.addListener(p,"blur",function(){d()})})));v.isDeletable&&(t=mxUtils.button("-",mxUtils.bind(x,function(a){f(b,"",v,v.index);mxEvent.consume(a)})),t.style.height="16px",t.style.width="25px",t.style["float"]="right",t.className="geColorBtn",n.appendChild(t));y.appendChild(n);return y}var x=this,u=this.editorUi.editor.graph,t=[];a.style.position="relative";a.style.padding="0";var l=document.createElement("table");
+l.style.whiteSpace="nowrap";l.style.width="100%";var m=document.createElement("tr");m.className="gePropHeader";var y=document.createElement("th");y.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;y.appendChild(n);mxUtils.write(y,mxResources.get("property"));m.style.cursor="pointer";var A=function(){var b=l.querySelectorAll(".gePropNonHeaderRow"),c;if(x.editorUi.propertiesCollapsed){n.src=Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-
+1;0<=f;f--)try{var k=a.childNodes[f],d=k.nodeName.toUpperCase();"INPUT"!=d&&"SELECT"!=d||a.removeChild(k)}catch(da){}}else n.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(m,"click",function(){x.editorUi.propertiesCollapsed=!x.editorUi.propertiesCollapsed;A()});m.appendChild(y);y=document.createElement("th");y.className="gePropHeaderCell";y.innerHTML=mxResources.get("value");m.appendChild(y);l.appendChild(m);var z=!1,q=!1,E;for(E in b)if(m=
+b[E],"function"!=typeof m.isVisible||m.isVisible(c)){var J=null!=c.style[E]?mxUtils.htmlEntities(c.style[E]+""):m.defVal;if("separator"==m.type)q=!q;else{if("staticArr"==m.type)m.size=parseInt(c.style[m.sizeProperty]||b[m.sizeProperty].defVal)||0;else if(null!=m.dependentProps){for(var G=m.dependentProps,D=[],I=[],y=0;y<G.length;y++){var L=c.style[G[y]];I.push(b[G[y]].subDefVal);D.push(null!=L?L.split(","):[])}m.dependentPropsDefVal=I;m.dependentPropsVals=D}l.appendChild(v(E,J,m,z,q));z=!z}}for(y=
+0;y<t.length;y++)for(m=t[y],b=m.parentRow,c=0;c<m.values.length;c++)E=v(m.name,m.values[c],{type:m.type,parentRow:m.parentRow,isDeletable:m.isDeletable,index:c,defVal:m.defVal,countProperty:m.countProperty,size:m.size},0==c%2,m.flipBkg),b.parentNode.insertBefore(E,b.nextSibling),b=E;a.appendChild(l);A();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var k=
+f.getModel().getStyle(c[b]),p=0;p<d.length;p++)k=mxUtils.removeStylename(k,d[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(k=mxUtils.setStyle(k,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),k=""==a.fill?mxUtils.setStyle(k,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(k,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,null)),k=""==a.stroke?mxUtils.setStyle(k,mxConstants.STYLE_STROKECOLOR,
+null):mxUtils.setStyle(k,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&&(k=mxUtils.setStyle(k,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(k=mxUtils.setStyle(k,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),k=mxUtils.setStyle(k,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,"#000000")),k=mxUtils.setStyle(k,
+mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(k=mxUtils.setStyle(k,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(c[b],k)}}finally{f.getModel().endUpdate()}});b.className="geStyleButton";b.style.width="36px";b.style.height="30px";b.style.margin="0px 6px 6px 0px";if(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%)":a.fill==mxConstants.NONE?b.style.background="url('"+Dialog.prototype.noColorImage+"')":b.style.backgroundColor=""==a.fill?mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#000000":"#ffffff"):a.fill||mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==
 uiTheme?"#000000":"#ffffff"),b.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#000000":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#000000":"#ffffff"));else{var c=mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),p=mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,
-"#000000");b.style.backgroundColor=c;b.style.border="1px solid "+p}d.appendChild(b)}d.innerHTML="";for(var c=0;c<a.length;c++)0<c&&0==mxUtils.mod(c,4)&&mxUtils.br(d),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 f=this.editorUi.editor.graph,d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.paddingLeft="24px";d.style.paddingRight="20px";a.style.paddingLeft="16px";
-a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(d);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 p=document.createElement("div");p.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=);";
+"#000000");b.style.backgroundColor=c;b.style.border="1px solid "+p}k.appendChild(b)}k.innerHTML="";for(var c=0;c<a.length;c++)0<c&&0==mxUtils.mod(c,4)&&mxUtils.br(k),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 f=this.editorUi.editor.graph,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.paddingLeft="24px";k.style.paddingRight="20px";a.style.paddingLeft="16px";
+a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(k);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 p=document.createElement("div");p.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(p,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));var e=document.createElement("div");e.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(p),a.appendChild(e));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])}));c(p);c(e);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 f=this.editorUi.editor.graph,d=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=d&&null!=d.shape&&null!=d.shape.stencil?(b=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
+(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 f=this.editorUi.editor.graph,k=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=k&&null!=k.shape&&null!=k.shape.stencil?(b=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
 function(a){this.editorUi.actions.get("editShape").funct()})),b.setAttribute("title",mxResources.get("editShape")),b.style.marginBottom="2px",null==c?b.style.width="202px":(c.style.width="100px",b.style.width="100px",b.style.marginLeft="2px"),a.appendChild(b)):b.image&&(b=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),b.setAttribute("title",mxResources.get("editImage")),b.style.marginBottom="2px",null==c?b.style.width="202px":
 (c.style.width="100px",b.style.width="100px",b.style.marginLeft="2px"),a.appendChild(b));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){b=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)b=document.createEventObject(a),b.type=a.type,b.canBubble=a.canBubble,b.cancelable=a.cancelable,b.view=a.view,b.detail=a.detail,b.screenX=a.screenX,b.screenY=a.screenY,b.clientX=a.clientX,b.clientY=a.clientY,b.ctrlKey=a.ctrlKey,b.altKey=a.altKey,b.shiftKey=a.shiftKey,b.metaKey=a.metaKey,b.button=
@@ -8179,14 +8179,14 @@ null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode|
 this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};var v=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){v.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var b=0;b<a.actions.length;b++)if(null!=a.actions[b].open)if(this.isCustomLink(a.actions[b].open)){if(!this.customLinkClicked(a.actions[b].open))return}else this.openLink(a.actions[b].open);
 this.model.beginUpdate();try{for(b=0;b<a.actions.length;b++)this.handleLinkAction(a.actions[b])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var b=[];null!=a.select&&this.isEnabled()&&(b=this.getCellsForAction(a.select),this.setSelectionCells(b));null!=a.highlight&&(b=this.getCellsForAction(a.highlight),this.highlightCells(b,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&
 this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(b=this.getCellsForAction(a.scroll));0<b.length&&this.scrollCellToVisible(b[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))};Graph.prototype.getCellsById=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++)if("*"==a[c])var f=this.getDefaultParent(),b=b.concat(this.model.filterDescendants(function(a){return a!=
-f},f));else{var d=this.model.getCell(a[c]);null!=d&&b.push(d)}return b};Graph.prototype.getCellsForTags=function(a,b,c){var f=[];if(null!=a){b=null!=b?b:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var d=0;d<b.length;d++)if(this.model.isVertex(b[d])||this.model.isEdge(b[d])){var k=null!=b[d].value&&"object"==typeof b[d].value?mxUtils.trim(b[d].value.getAttribute(c)||""):"",p=!0;if(0<k.length)for(var k=k.toLowerCase().split(" "),e=0;e<a.length&&p;e++)var g=mxUtils.trim(a[e]).toLowerCase(),
-p=p&&(0==g.length||0<=mxUtils.indexOf(k,g));else p=0==a.length;p&&f.push(b[d])}}return f};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],!this.model.isVisible(a[b]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,b){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,b,c,f){for(var d=0;d<
-a.length;d++)this.highlightCell(a[d],b,c,f)};Graph.prototype.highlightCell=function(a,b,c,f){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),k=new mxCellHighlight(this,b,d,!1);null!=f&&(k.opacity=f);k.highlight(a);window.setTimeout(function(){null!=k.shape&&(mxUtils.setPrefixedStyle(k.shape.node.style,"transition","all 1200ms ease-in-out"),k.shape.node.style.opacity=0);window.setTimeout(function(){k.destroy()},
-1200)},c)}};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;var f=a.ownerDocument,d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");d.setAttribute("id",this.shadowId);var k=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");k.setAttribute("in","SourceAlpha");k.setAttribute("stdDeviation",this.svgShadowBlur);k.setAttribute("result","blur");d.appendChild(k);k=null!=f.createElementNS?
-f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");k.setAttribute("in","blur");k.setAttribute("dx",this.svgShadowSize);k.setAttribute("dy",this.svgShadowSize);k.setAttribute("result","offsetBlur");d.appendChild(k);k=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");k.setAttribute("flood-color",this.svgShadowColor);k.setAttribute("flood-opacity",this.svgShadowOpacity);k.setAttribute("result","offsetColor");d.appendChild(k);
-k=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");k.setAttribute("in","offsetColor");k.setAttribute("in2","offsetBlur");k.setAttribute("operator","in");k.setAttribute("result","offsetBlur");d.appendChild(k);k=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");k.setAttribute("in","SourceGraphic");k.setAttribute("in2","offsetBlur");d.appendChild(k);k=a.getElementsByTagName("defs");0==k.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=k[0];f.appendChild(d);c||(b=null!=b?b:a.getElementsByTagName("g")[0],null!=b&&(b.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),b=a.getAttribute("viewBox"),null!=b&&0<b.length&&
-(b=b.split(" "),3<b.length&&(w=parseFloat(b[2])+6,h=parseFloat(b[3])+6,a.setAttribute("viewBox",b[0]+" "+b[1]+" "+w+" "+h))))));return d};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=
+f},f));else{var k=this.model.getCell(a[c]);null!=k&&b.push(k)}return b};Graph.prototype.getCellsForTags=function(a,b,c){var f=[];if(null!=a){b=null!=b?b:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var k=0;k<b.length;k++)if(this.model.isVertex(b[k])||this.model.isEdge(b[k])){var d=null!=b[k].value&&"object"==typeof b[k].value?mxUtils.trim(b[k].value.getAttribute(c)||""):"",p=!0;if(0<d.length)for(var d=d.toLowerCase().split(" "),e=0;e<a.length&&p;e++)var g=mxUtils.trim(a[e]).toLowerCase(),
+p=p&&(0==g.length||0<=mxUtils.indexOf(d,g));else p=0==a.length;p&&f.push(b[k])}}return f};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],!this.model.isVisible(a[b]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,b){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,b,c,f){for(var k=0;k<
+a.length;k++)this.highlightCell(a[k],b,c,f)};Graph.prototype.highlightCell=function(a,b,c,f){b=null!=b?b:mxConstants.DEFAULT_VALID_COLOR;c=null!=c?c:1E3;a=this.view.getState(a);if(null!=a){var k=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),d=new mxCellHighlight(this,b,k,!1);null!=f&&(d.opacity=f);d.highlight(a);window.setTimeout(function(){null!=d.shape&&(mxUtils.setPrefixedStyle(d.shape.node.style,"transition","all 1200ms ease-in-out"),d.shape.node.style.opacity=0);window.setTimeout(function(){d.destroy()},
+1200)},c)}};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;var f=a.ownerDocument,k=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");k.setAttribute("id",this.shadowId);var d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");d.setAttribute("in","SourceAlpha");d.setAttribute("stdDeviation",this.svgShadowBlur);d.setAttribute("result","blur");k.appendChild(d);d=null!=f.createElementNS?
+f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");d.setAttribute("in","blur");d.setAttribute("dx",this.svgShadowSize);d.setAttribute("dy",this.svgShadowSize);d.setAttribute("result","offsetBlur");k.appendChild(d);d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");d.setAttribute("flood-color",this.svgShadowColor);d.setAttribute("flood-opacity",this.svgShadowOpacity);d.setAttribute("result","offsetColor");k.appendChild(d);
+d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");d.setAttribute("in","offsetColor");d.setAttribute("in2","offsetBlur");d.setAttribute("operator","in");d.setAttribute("result","offsetBlur");k.appendChild(d);d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");d.setAttribute("in","SourceGraphic");d.setAttribute("in2","offsetBlur");k.appendChild(d);d=a.getElementsByTagName("defs");0==d.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=d[0];f.appendChild(k);c||(b=null!=b?b:a.getElementsByTagName("g")[0],null!=b&&(b.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),b=a.getAttribute("viewBox"),null!=b&&0<b.length&&
+(b=b.split(" "),3<b.length&&(w=parseFloat(b[2])+6,h=parseFloat(b[3])+6,a.setAttribute("viewBox",b[0]+" "+b[1]+" "+w+" "+h))))));return k};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",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",
 STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];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"]=[SHAPES_PATH+"/mxElectrical.js",
@@ -8195,31 +8195,31 @@ STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries["electr
 [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.gcp2=[SHAPES_PATH+"/mxGCP2.js",
 STENCIL_PATH+"/gcp2.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.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.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 x=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,f,d,k,p,e,g,v){if(null!=c&&null==mxMarker.markers[c]){var u=
-this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return x.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){l.value=Math.max(1,Math.min(e,Math.max(parseInt(l.value),parseInt(t.value))));t.value=Math.max(1,Math.min(e,Math.min(parseInt(l.value),parseInt(t.value))))}function f(b){function c(b,c,d){var k=b.getGraphBounds(),p=0,e=0,g=ha.get(),v=1/b.pageScale,x=z.checked;if(x)var v=parseInt(X.value),t=parseInt(ia.value),v=Math.min(g.height*t/(k.height/b.view.scale),
-g.width*v/(k.width/b.view.scale));else v=parseInt(n.value)/(100*b.pageScale),isNaN(v)&&(f=1/b.pageScale,n.value="100 %");g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*f);g.height=Math.ceil(g.height*f);v*=f;!x&&b.pageVisible?(k=b.getPageLayout(),p-=k.x*g.width,e-=k.y*g.height):x=!0;if(null==c){c=PrintDialog.createPrintPreview(b,v,g,0,p,e,x);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var u=c.writeHead;c.writeHead=function(b){u.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 l=c.renderPage;c.renderPage=function(a,b,c,f,d,k){var p=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=l.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,d,!0)}else{g=
-b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=x;c.appendGraph(b,v,p,e,d,!0)}return c}var f=parseInt(ca.value)/100;isNaN(f)&&(f=1,ca.value="100 %");var f=.75*f,k=t.value,p=l.value,e=!x.checked,v=null;e&&(e=k==g&&p==g);if(!e&&null!=a.pages&&a.pages.length){var u=0,e=a.pages.length-1;x.checked||(u=parseInt(k)-1,e=parseInt(p)-1);for(var y=u;y<=e;y++){var m=a.pages[y],k=m==a.currentPage?d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),
-p=!0,u=!1,q=null,D=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(p=m.viewState.pageVisible,u=m.viewState.mathEnabled,q=m.viewState.background,D=m.viewState.backgroundImage);k.background=q;k.backgroundImage=null!=D?new mxImage(D.src,D.width,D.height):null;k.pageVisible=p;k.mathEnabled=u;var J=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?y+1:J.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);
-k.model.setRoot(m.root)}v=c(k,v,y!=e);k!=d&&k.container.parentNode.removeChild(k.container)}}else v=c(d);null==v?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(v.mathEnabled&&(e=v.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),e.writeln("MathJax.Hub.Config({"),e.writeln("showMathMenu: false,"),e.writeln('messageStyle: "none",'),e.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),e.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
+[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 x=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,f,k,d,p,e,g,v){if(null!=c&&null==mxMarker.markers[c]){var t=
+this.getPackageForType(c);null!=t&&mxStencilRegistry.getStencil(t)}return x.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){l.value=Math.max(1,Math.min(e,Math.max(parseInt(l.value),parseInt(u.value))));u.value=Math.max(1,Math.min(e,Math.min(parseInt(l.value),parseInt(u.value))))}function f(b){function c(b,c,k){var d=b.getGraphBounds(),p=0,e=0,g=ha.get(),v=1/b.pageScale,x=z.checked;if(x)var v=parseInt(X.value),u=parseInt(ia.value),v=Math.min(g.height*u/(d.height/b.view.scale),
+g.width*v/(d.width/b.view.scale));else v=parseInt(n.value)/(100*b.pageScale),isNaN(v)&&(f=1/b.pageScale,n.value="100 %");g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*f);g.height=Math.ceil(g.height*f);v*=f;!x&&b.pageVisible?(d=b.getPageLayout(),p-=d.x*g.width,e-=d.y*g.height):x=!0;if(null==c){c=PrintDialog.createPrintPreview(b,v,g,0,p,e,x);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var t=c.writeHead;c.writeHead=function(b){t.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 l=c.renderPage;c.renderPage=function(a,b,c,f,k,d){var p=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=l.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,k,!0)}else{g=
+b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=x;c.appendGraph(b,v,p,e,k,!0)}return c}var f=parseInt(ca.value)/100;isNaN(f)&&(f=1,ca.value="100 %");var f=.75*f,d=u.value,p=l.value,e=!x.checked,v=null;e&&(e=d==g&&p==g);if(!e&&null!=a.pages&&a.pages.length){var t=0,e=a.pages.length-1;x.checked||(t=parseInt(d)-1,e=parseInt(p)-1);for(var m=t;m<=e;m++){var y=a.pages[m],d=y==a.currentPage?k:null;if(null==d){var d=a.createTemporaryGraph(k.getStylesheet()),
+p=!0,t=!1,q=null,E=null;null==y.viewState&&null==y.root&&a.updatePageRoot(y);null!=y.viewState&&(p=y.viewState.pageVisible,t=y.viewState.mathEnabled,q=y.viewState.background,E=y.viewState.backgroundImage);d.background=q;d.backgroundImage=null!=E?new mxImage(E.src,E.width,E.height):null;d.pageVisible=p;d.mathEnabled=t;var J=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?m+1:J.apply(this,arguments)};document.body.appendChild(d.container);a.updatePageRoot(y);
+d.model.setRoot(y.root)}v=c(d,v,m!=e);d!=k&&d.container.parentNode.removeChild(d.container)}}else v=c(k);null==v?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(v.mathEnabled&&(e=v.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),e.writeln("MathJax.Hub.Config({"),e.writeln("showMathMenu: false,"),e.writeln('messageStyle: "none",'),e.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),e.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
 e.writeln('"HTML-CSS": {'),e.writeln("imageFont: null"),e.writeln("},"),e.writeln("TeX: {"),e.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),e.writeln("},"),e.writeln("tex2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("},"),e.writeln("asciimath2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("}"),e.writeln("});"),b&&(e.writeln("MathJax.Hub.Queue(function () {"),e.writeln("window.print();"),e.writeln("});")),e.writeln("\x3c/script>"),
-e.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),v.closeDocument(),!v.mathEnabled&&b&&PrintDialog.printPreview(v))}var d=a.editor.graph,k=document.createElement("div"),p=document.createElement("h3");p.style.width="100%";p.style.textAlign="center";p.style.marginTop="0px";mxUtils.write(p,b||mxResources.get("print"));k.appendChild(p);var e=1,g=1,v=document.createElement("div");v.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";
-var x=document.createElement("input");x.style.cssText="margin-right:8px;margin-bottom:8px;";x.setAttribute("value","all");x.setAttribute("type","radio");x.setAttribute("name","pages-printdialog");v.appendChild(x);p=document.createElement("span");mxUtils.write(p,mxResources.get("printAllPages"));v.appendChild(p);mxUtils.br(v);var u=x.cloneNode(!0);x.setAttribute("checked","checked");u.setAttribute("value","range");v.appendChild(u);p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+
-":");v.appendChild(p);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";v.appendChild(t);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));v.appendChild(p);var l=t.cloneNode(!0);v.appendChild(l);mxEvent.addListener(t,"focus",function(){u.checked=!0});mxEvent.addListener(l,"focus",function(){u.checked=!0});mxEvent.addListener(t,"change",c);mxEvent.addListener(l,
-"change",c);if(null!=a.pages&&(e=a.pages.length,null!=a.currentPage))for(p=0;p<a.pages.length;p++)if(a.currentPage==a.pages[p]){g=p+1;t.value=g;l.value=g;break}t.setAttribute("max",e);l.setAttribute("max",e);1<e&&k.appendChild(v);var y=document.createElement("div");y.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");y.appendChild(m);p=document.createElement("span");
-mxUtils.write(p,mxResources.get("adjustTo"));y.appendChild(p);var n=document.createElement("input");n.style.cssText="margin:0 8px 0 8px;";n.setAttribute("value","100 %");n.style.width="50px";y.appendChild(n);mxEvent.addListener(n,"focus",function(){m.checked=!0});k.appendChild(y);var v=v.cloneNode(!1),z=m.cloneNode(!0);z.setAttribute("value","fit");m.setAttribute("checked","checked");p=document.createElement("div");p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
-p.appendChild(z);v.appendChild(p);y=document.createElement("table");y.style.display="inline-block";var q=document.createElement("tbody"),D=document.createElement("tr"),J=D.cloneNode(!0),A=document.createElement("td"),F=A.cloneNode(!0),E=A.cloneNode(!0),ga=A.cloneNode(!0),L=A.cloneNode(!0),ea=A.cloneNode(!0);A.style.textAlign="right";ga.style.textAlign="right";mxUtils.write(A,mxResources.get("fitTo"));var X=document.createElement("input");X.style.cssText="margin:0 8px 0 8px;";X.setAttribute("value",
-"1");X.setAttribute("min","1");X.setAttribute("type","number");X.style.width="40px";F.appendChild(X);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));E.appendChild(p);mxUtils.write(ga,mxResources.get("fitToBy"));var ia=X.cloneNode(!0);L.appendChild(ia);mxEvent.addListener(X,"focus",function(){z.checked=!0});mxEvent.addListener(ia,"focus",function(){z.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));ea.appendChild(p);
-D.appendChild(A);D.appendChild(F);D.appendChild(E);J.appendChild(ga);J.appendChild(L);J.appendChild(ea);q.appendChild(D);q.appendChild(J);y.appendChild(q);v.appendChild(y);k.appendChild(v);v=document.createElement("div");p=document.createElement("div");p.style.fontWeight="bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));v.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(p,"printdialog",a.editor.graph.pageFormat||
-mxConstants.PAGE_FORMAT_A4_PORTRAIT);v.appendChild(p);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageScale"));v.appendChild(p);var ca=document.createElement("input");ca.style.cssText="margin:0 8px 0 8px;";ca.setAttribute("value","100 %");ca.style.width="60px";v.appendChild(ca);k.appendChild(v);p=document.createElement("div");p.style.cssText="text-align:right;margin:48px 0 0 0;";v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&
-p.appendChild(v);a.isOffline()||(y=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),y.className="geBtn",p.appendChild(y));PrintDialog.previewEnabled&&(y=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),y.className="geBtn",p.appendChild(y));y=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});y.className="geBtn gePrimaryBtn";p.appendChild(y);
-a.editor.cancelFirst||p.appendChild(v);k.appendChild(p);this.container=k};var D=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)):(D.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))};Editor.prototype.useCanvasForExport=!1;try{var J=
-document.createElement("canvas"),F=new Image;F.onload=function(){try{J.getContext("2d").drawImage(F,0,0);var a=J.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(E){}};F.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(A){}})();
-var ErrorDialog=function(a,c,b,d,e,g,l,m,n,q,f){n=null!=n?n:!0;var k=document.createElement("div");k.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="10px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";p.style.whiteSpace="nowrap";p.style.textOverflow="ellipsis";p.style.overflow="hidden";mxUtils.write(p,c);p.setAttribute("title",c);k.appendChild(p)}c=
-document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;k.appendChild(c);b=document.createElement("div");b.style.marginTop="12px";b.style.textAlign="center";null!=g&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=q&&(q=mxUtils.button(q,function(){null!=f&&f()}),q.className="geBtn",b.appendChild(q));var t=mxUtils.button(d,function(){n&&a.hideDialog();null!=e&&e()});
+e.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),v.closeDocument(),!v.mathEnabled&&b&&PrintDialog.printPreview(v))}var k=a.editor.graph,d=document.createElement("div"),p=document.createElement("h3");p.style.width="100%";p.style.textAlign="center";p.style.marginTop="0px";mxUtils.write(p,b||mxResources.get("print"));d.appendChild(p);var e=1,g=1,v=document.createElement("div");v.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";
+var x=document.createElement("input");x.style.cssText="margin-right:8px;margin-bottom:8px;";x.setAttribute("value","all");x.setAttribute("type","radio");x.setAttribute("name","pages-printdialog");v.appendChild(x);p=document.createElement("span");mxUtils.write(p,mxResources.get("printAllPages"));v.appendChild(p);mxUtils.br(v);var t=x.cloneNode(!0);x.setAttribute("checked","checked");t.setAttribute("value","range");v.appendChild(t);p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+
+":");v.appendChild(p);var u=document.createElement("input");u.style.cssText="margin:0 8px 0 8px;";u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.style.width="50px";v.appendChild(u);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));v.appendChild(p);var l=u.cloneNode(!0);v.appendChild(l);mxEvent.addListener(u,"focus",function(){t.checked=!0});mxEvent.addListener(l,"focus",function(){t.checked=!0});mxEvent.addListener(u,"change",c);mxEvent.addListener(l,
+"change",c);if(null!=a.pages&&(e=a.pages.length,null!=a.currentPage))for(p=0;p<a.pages.length;p++)if(a.currentPage==a.pages[p]){g=p+1;u.value=g;l.value=g;break}u.setAttribute("max",e);l.setAttribute("max",e);1<e&&d.appendChild(v);var m=document.createElement("div");m.style.marginBottom="10px";var y=document.createElement("input");y.style.marginRight="8px";y.setAttribute("value","adjust");y.setAttribute("type","radio");y.setAttribute("name","printZoom");m.appendChild(y);p=document.createElement("span");
+mxUtils.write(p,mxResources.get("adjustTo"));m.appendChild(p);var n=document.createElement("input");n.style.cssText="margin:0 8px 0 8px;";n.setAttribute("value","100 %");n.style.width="50px";m.appendChild(n);mxEvent.addListener(n,"focus",function(){y.checked=!0});d.appendChild(m);var v=v.cloneNode(!1),z=y.cloneNode(!0);z.setAttribute("value","fit");y.setAttribute("checked","checked");p=document.createElement("div");p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
+p.appendChild(z);v.appendChild(p);m=document.createElement("table");m.style.display="inline-block";var q=document.createElement("tbody"),E=document.createElement("tr"),J=E.cloneNode(!0),A=document.createElement("td"),G=A.cloneNode(!0),D=A.cloneNode(!0),ga=A.cloneNode(!0),L=A.cloneNode(!0),ea=A.cloneNode(!0);A.style.textAlign="right";ga.style.textAlign="right";mxUtils.write(A,mxResources.get("fitTo"));var X=document.createElement("input");X.style.cssText="margin:0 8px 0 8px;";X.setAttribute("value",
+"1");X.setAttribute("min","1");X.setAttribute("type","number");X.style.width="40px";G.appendChild(X);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));D.appendChild(p);mxUtils.write(ga,mxResources.get("fitToBy"));var ia=X.cloneNode(!0);L.appendChild(ia);mxEvent.addListener(X,"focus",function(){z.checked=!0});mxEvent.addListener(ia,"focus",function(){z.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));ea.appendChild(p);
+E.appendChild(A);E.appendChild(G);E.appendChild(D);J.appendChild(ga);J.appendChild(L);J.appendChild(ea);q.appendChild(E);q.appendChild(J);m.appendChild(q);v.appendChild(m);d.appendChild(v);v=document.createElement("div");p=document.createElement("div");p.style.fontWeight="bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));v.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(p,"printdialog",a.editor.graph.pageFormat||
+mxConstants.PAGE_FORMAT_A4_PORTRAIT);v.appendChild(p);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageScale"));v.appendChild(p);var ca=document.createElement("input");ca.style.cssText="margin:0 8px 0 8px;";ca.setAttribute("value","100 %");ca.style.width="60px";v.appendChild(ca);d.appendChild(v);p=document.createElement("div");p.style.cssText="text-align:right;margin:48px 0 0 0;";v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&
+p.appendChild(v);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){k.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",p.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),m.className="geBtn",p.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});m.className="geBtn gePrimaryBtn";p.appendChild(m);
+a.editor.cancelFirst||p.appendChild(v);d.appendChild(p);this.container=d};var E=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)):(E.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))};Editor.prototype.useCanvasForExport=!1;try{var J=
+document.createElement("canvas"),G=new Image;G.onload=function(){try{J.getContext("2d").drawImage(G,0,0);var a=J.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(D){}};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(A){}})();
+var ErrorDialog=function(a,c,b,d,g,e,l,m,n,q,f){n=null!=n?n:!0;var k=document.createElement("div");k.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="10px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";p.style.whiteSpace="nowrap";p.style.textOverflow="ellipsis";p.style.overflow="hidden";mxUtils.write(p,c);p.setAttribute("title",c);k.appendChild(p)}c=
+document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;k.appendChild(c);b=document.createElement("div");b.style.marginTop="12px";b.style.textAlign="center";null!=e&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();e()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=q&&(q=mxUtils.button(q,function(){null!=f&&f()}),q.className="geBtn",b.appendChild(q));var t=mxUtils.button(d,function(){n&&a.hideDialog();null!=g&&g()});
 t.className="geBtn";b.appendChild(t);null!=l&&(d=mxUtils.button(l,function(){n&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn",b.appendChild(d));this.init=function(){t.focus()};k.appendChild(b);this.container=k};
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,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="10.4.4";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,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="10.4.5";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=
 EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",k=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=k+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+
 encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+encodeURIComponent(e.stack):"")}}catch(v){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else 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(p){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(p){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.dev){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
@@ -8230,10 +8230,10 @@ EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0"
 0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(y){}};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(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,b,c){return this.editor.graph.openLink(a,b,c)};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);null!=c&&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 f=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}),d=f.spin;f.spin=function(c,k){var p=!1;this.active||(d.call(this,c),this.active=!0,null!=k&&(p=document.createElement("div"),p.style.position="absolute",p.style.whiteSpace="nowrap",p.style.background="#4B4243",p.style.color="white",
-p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6px",p.style.paddingLeft="10px",p.style.paddingRight="10px",p.style.zIndex=2E9,p.style.left=Math.max(0,a)+"px",p.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(p.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(p.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=k.substring(k.length-3,k.length)&&"!"!=k.charAt(k.length-1)&&
-(k+="..."),p.innerHTML=k,c.appendChild(p),f.status=p,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(p.style.left=Math.round(Math.max(0,a-p.offsetWidth/2))+"px",p.style.top=Math.round(Math.max(0,b+70-p.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}),p=!0);return p};var k=f.stop;f.stop=function(){k.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),
-f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=d(a);var p=f(a,4);if(null!=b&&b(k-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)break}while(c)}};
+"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var f=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}),k=f.spin;f.spin=function(c,d){var p=!1;this.active||(k.call(this,c),this.active=!0,null!=d&&(p=document.createElement("div"),p.style.position="absolute",p.style.whiteSpace="nowrap",p.style.background="#4B4243",p.style.color="white",
+p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6px",p.style.paddingLeft="10px",p.style.paddingRight="10px",p.style.zIndex=2E9,p.style.left=Math.max(0,a)+"px",p.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(p.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(p.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=d.substring(d.length-3,d.length)&&"!"!=d.charAt(d.length-1)&&
+(d+="..."),p.innerHTML=d,c.appendChild(p),f.status=p,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(p.style.left=Math.round(Math.max(0,a-p.offsetWidth/2))+"px",p.style.top=Math.round(Math.max(0,b+70-p.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,d)}));this.stop();return a}),p=!0);return p};var d=f.stop;f.stop=function(){d.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),
+f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=d;d+=b;return a.substring(c,d)}function k(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var d=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=k(a);var p=f(a,4);if(null!=b&&b(d-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)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(t){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&
 4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};EditorUi.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("&lt;mxfile ");
 if(0<=f){var d=b.lastIndexOf("&lt;/mxfile&gt;");d>f&&(c=b.substring(f,d+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}catch(z){}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"/>'+
@@ -8265,22 +8265,22 @@ null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfi
 var k=this.createDownloadRequest(b,a,d,c,l,e);this.editor.graph.pageVisible=f;return k}catch(B){this.handleError(B)}}));else{var u=null,t=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 m=this.editor.graph.background;if(l||m==mxConstants.NONE)m=null;var y=this.editor.graph.getSvg(m,null,null,null,
 null,d);c&&this.editor.graph.addSvgShadow(y);this.convertImages(y,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 k=f+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),d)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e,g){var f=
 this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var k="",p="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){k="&from="+g;break}g=this.editor.graph.background;"png"==b&&e&&(g=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,
-"format="+b+k+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):
-this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,e=null,p=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===this.currentPage&&(200<=
+"format="+b+k+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var f=window.location.hash,d=mxUtils.bind(this,function(c){var d=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<d.length&&(d+="\n"),d+=c);c=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):
+this.defaultFilename,!0);c.getHash=function(){return f};this.fileLoaded(c);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,e=null,p=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===this.currentPage&&(200<=
 a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(p,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();p()}));g();p()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+
-"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||f.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){d.alert(a.tooltip)});return b}var c=null,d=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,
-e=f.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var v=e.getCell(a.getAttribute("id"));if(null!=v){try{var x=a.getAttribute("value");if(null!=x){var l=mxUtils.parseXml(x).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))e.setValue(v,l);else for(var m=l.attributes,n=0;n<m.length;n++)f.setAttributeForCell(v,m[n].nodeName,0<m[n].nodeValue.length?m[n].nodeValue:null)}}catch(K){null!=window.console&&console.log("Error in value for "+
-v.id+": "+K)}try{var q=a.getAttribute("style");null!=q&&f.model.setStyle(v,q)}catch(K){null!=window.console&&console.log("Error in style for "+v.id+": "+K)}try{var E=a.getAttribute("icon");if(null!=E){var I=0<E.length?JSON.parse(E):null;null!=I&&I.append||f.removeCellOverlays(v);null!=I&&f.addCellOverlay(v,b(I))}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),G=f.getCellGeometry(v);if(null!=G){G=G.clone();
-for(key in C){var H=parseFloat(C[key]);"dx"==key?G.x+=H:"dy"==key?G.y+=H:"dw"==key?G.width+=H:"dh"==key?G.height+=H:G[key]=parseFloat(C[key])}f.model.setGeometry(v,G)}}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(f.view.scale=parseFloat(a.getAttribute("scale"))),
-a.hasAttribute("dx")||a.hasAttribute("dy"))f.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,d="",f=c.lastIndexOf(".");0<=f&&(d=
-c.substring(f),c=c.substring(0,f));if(b)var k=new Date,f=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),x=k.getHours(),l=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(f+"-"+e+"-"+g+"-"+x+"-"+l+"-"+k));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var d=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
-var f=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&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.editor.setStatus("");this.updateUi();b||this.showSplash()});
+"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){d(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else d("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){f.alert(a.tooltip)});return b}var c=null,f=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var d=this.editor.graph,
+e=d.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var v=e.getCell(a.getAttribute("id"));if(null!=v){try{var x=a.getAttribute("value");if(null!=x){var l=mxUtils.parseXml(x).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))e.setValue(v,l);else for(var m=l.attributes,n=0;n<m.length;n++)d.setAttributeForCell(v,m[n].nodeName,0<m[n].nodeValue.length?m[n].nodeValue:null)}}catch(K){null!=window.console&&console.log("Error in value for "+
+v.id+": "+K)}try{var q=a.getAttribute("style");null!=q&&d.model.setStyle(v,q)}catch(K){null!=window.console&&console.log("Error in style for "+v.id+": "+K)}try{var D=a.getAttribute("icon");if(null!=D){var I=0<D.length?JSON.parse(D):null;null!=I&&I.append||d.removeCellOverlays(v);null!=I&&d.addCellOverlay(v,b(I))}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),F=d.getCellGeometry(v);if(null!=F){F=F.clone();
+for(key in C){var H=parseFloat(C[key]);"dx"==key?F.x+=H:"dy"==key?F.y+=H:"dw"==key?F.width+=H:"dh"==key?F.height+=H:F[key]=parseFloat(C[key])}d.model.setGeometry(v,F)}}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(d.view.scale=parseFloat(a.getAttribute("scale"))),
+a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,f="",d=c.lastIndexOf(".");0<=d&&(f=
+c.substring(d),c=c.substring(0,d));if(b)var k=new Date,d=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),x=k.getHours(),l=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(d+"-"+e+"-"+g+"-"+x+"-"+l+"-"+k));return c=mxResources.get("copyOf",[c])+f};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var f=!1;this.hideDialog();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();this.setBackgroundImage(null);!b&&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.editor.setStatus("");this.updateUi();b||this.showSplash()});
 if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),
 null!=a.backupPatch&&a.patch([a.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));
-d=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getMode()+"."+a.getSize()});if(this.editor.editable&&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(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&console.log("error in fileLoaded:",a,z);if(EditorUi.enableLogging&&
+f=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getMode()+"."+a.getSize()});if(this.editor.editable&&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(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&console.log("error in fileLoaded:",a,z);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!=z&&null!=z.message?":err:"+encodeURIComponent(z.message):"")+(null!=z&&null!=z.stack?"&stack="+encodeURIComponent(z.stack):"")}catch(v){}var k=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
-null!=c?this.fileLoaded(c):f()});b?k():this.handleError(z,mxResources.get("errorLoadingFile"),k,!0)}else f();return d};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,d=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var k=0;k<a.length;k++){this.updatePageRoot(a[k]);var e=a[k].node.cloneNode(!1);e.removeAttribute("name");d.root=a[k].root;var g=f.encode(d);this.editor.graph.saveViewState(a[k].viewState,g,!0);g.removeAttribute("pageWidth");
-g.removeAttribute("pageHeight");e.appendChild(g);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,d){return!d||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?d&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
+null!=c?this.fileLoaded(c):d()});b?k():this.handleError(z,mxResources.get("errorLoadingFile"),k,!0)}else d();return f};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,f=new mxGraphModel,d=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var k=0;k<a.length;k++){this.updatePageRoot(a[k]);var e=a[k].node.cloneNode(!1);e.removeAttribute("name");f.root=a[k].root;var g=d.encode(f);this.editor.graph.saveViewState(a[k].viewState,g,!0);g.removeAttribute("pageWidth");
+g.removeAttribute("pageHeight");e.appendChild(g);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,f){return!f||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?f&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
 typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var k=a.attributes[f].name,e=null!=b?b(a,k,a.attributes[f].value,!0):a.attributes[f].value;null!=e&&(d^=this.hashValue(k,b,c)+this.hashValue(e,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==
 typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,g,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()),
@@ -8290,16 +8290,16 @@ this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash
 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(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);c=null!=c&&0<c.length?c:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){k(b,a)}));this.repositionLibrary(d);var p=g.parentNode.previousSibling;c=p.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&p.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var l=document.createElement("div");l.style.position=
 "absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(l.style.backgroundColor="inherit");p.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title",mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(m),mxEvent.addListener(m,
-"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 q=this.editor.graph,E=null,I=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=
-E&&null!=E.parentNode&&E.parentNode.removeChild(E),E=m.cloneNode(!1),E.setAttribute("src",Editor.spinImage),E.setAttribute("title",mxResources.get("saving")),E.style.cursor="default",E.style.marginRight="2px",E.style.marginTop="-2px",l.insertBefore(E,l.firstChild),p.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=E&&null!=E.parentNode&&(E.parentNode.removeChild(E),p.style.paddingRight=18*l.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),
-n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),l.insertBefore(n,l.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()||(p.style.paddingRight=18*l.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*l.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,c,d,k){a=
+"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 q=this.editor.graph,D=null,I=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=
+D&&null!=D.parentNode&&D.parentNode.removeChild(D),D=m.cloneNode(!1),D.setAttribute("src",Editor.spinImage),D.setAttribute("title",mxResources.get("saving")),D.style.cursor="default",D.style.marginRight="2px",D.style.marginTop="-2px",l.insertBefore(D,l.firstChild),p.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=D&&null!=D.parentNode&&(D.parentNode.removeChild(D),p.style.paddingRight=18*l.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),
+n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),l.insertBefore(n,l.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()||(p.style.paddingRight=18*l.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*l.childNodes.length+"px")}),F=mxUtils.bind(this,function(a,c,d,k){a=
 q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var p=q.getCellGeometry(a[e]);null!=p&&p.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);C(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=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 b=q.getSelectionCells(),c=q.view.getBounds(b),d=q.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=q.view.translate.x;c.y-=q.view.translate.y;G(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility=
+(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=q.getSelectionCells(),c=q.view.getBounds(b),d=q.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=q.view.translate.x;c.y-=q.view.translate.y;F(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility=
 "hidden",g.style.backgroundColor="#f1f3f4",g.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&&(g.style.backgroundColor="",g.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,
 q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",g.style.backgroundColor="",g.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){g.style.backgroundColor=
 "#f1f3f4";a.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(a){g.style.cursor="";g.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,p,v,x,l,m,t){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,v,x),c)],c[0].vertex=!0,G(c,new mxRectangle(0,0,v,x),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 u=!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);C(a);this.spinner.stop();
-u=!0}catch(L){}else if("mxfile"==e.documentElement.nodeName)try{for(var v=e.documentElement.getElementsByTagName("diagram"),e=0;e<v.length;e++){var p=mxUtils.getTextContent(v[e]),x=this.stringToCells(Graph.decompress(p)),l=this.editor.graph.getBoundingBoxFromGeometry(x);G(x,new mxRectangle(0,0,l.width,l.height),a)}u=!0}catch(L){null!=window.console&&console.log("error in drop handler:",L)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&
+c=[new mxCell("",new mxGeometry(0,0,v,x),c)],c[0].vertex=!0,F(c,new mxRectangle(0,0,v,x),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 u=!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);C(a);this.spinner.stop();
+u=!0}catch(L){}else if("mxfile"==e.documentElement.nodeName)try{for(var v=e.documentElement.getElementsByTagName("diagram"),e=0;e<v.length;e++){var p=mxUtils.getTextContent(v[e]),x=this.stringToCells(Graph.decompress(p)),l=this.editor.graph.getBoundingBoxFromGeometry(x);F(x,new mxRectangle(0,0,l.width,l.height),a)}u=!0}catch(L){null!=window.console&&console.log("error in drop handler:",L)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&
 0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=t&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(t,function(a){n(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?n(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},
 mxResources.get("errorLoadingFile")))})):n(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){g.style.cursor="";g.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));l.insertBefore(m,l.firstChild);mxEvent.addListener(m,"click",I);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&I(a)});c=m.cloneNode(!1);c.setAttribute("src",
 Editor.plusImage);c.setAttribute("title",mxResources.get("add"));l.insertBefore(c,l.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:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),
@@ -8321,51 +8321,51 @@ a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c)
 "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.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",!1,null)};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{var f=document.createElement("a"),k=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),
 k=65==(g?parseInt(g[2],10):!1)?!1:k;if(k||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(x){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
-a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&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 g=1024*k,x=Math.min(g+1024,d),l=Array(x-g),m=0;g<x;++m,++g)l[m]=c[g].charCodeAt(0);e[k]=new Uint8Array(l)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,l){g=null!=g?g:!1;l=null!=l?l:
-"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,
-mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(F){this.handleError(F)}}))}catch(J){this.handleError(J)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,l,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?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");
+a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),k=Array(f),e=0;e<f;++e){for(var g=1024*e,l=Math.min(g+1024,d),m=Array(l-g),n=0;g<l;++n,++g)m[n]=c[g].charCodeAt(0);k[e]=new Uint8Array(m)}return new Blob(k,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,l){g=null!=g?g:!1;l=null!=l?l:
+"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var k=window.open("about:blank");null==k?mxUtils.popup(a,!0):(k.document.write(mxUtils.htmlEntities(a,!1)),k.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,
+mxUtils.bind(this,function(k){try{this.exportFile(a,b,c,d,f,k)}catch(G){this.handleError(G)}}))}catch(J){this.handleError(J)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,l,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?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||null==d.document?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&&null!=d.document||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.style.backgroundColor="white";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,f){return this.createEchoRequest(c,a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,g,l){l=null!=l?l:!mxClient.IS_IOS||!navigator.standalone;var f=this.getServiceCount(!1);a=new CreateDialog(this,
-a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0<a.length){var e=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=e&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?e.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&e.send(mxUtils.bind(this,
-function(){this.spinner.stop();if(200<=e.getStatus()&&299>=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,f,c)}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,l,null,1<f,4<f?3:4,d,g,e);this.showDialog(a.container,380,1==f?160:4<f?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=
+a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0<a.length){var k=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=k&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?k.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&k.send(mxUtils.bind(this,
+function(){this.spinner.stop();if(200<=k.getStatus()&&299>=k.getStatus())try{this.exportFile(k.getText(),a,g,!0,f,c)}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,l,null,1<f,4<f?3:4,d,g,e);this.showDialog(a.container,380,1==f?160:4<f?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=
 function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,g,l,v,x,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;f=b?null:this.editor.graph.background;f==mxConstants.NONE&&(f=null);null==f&&0==b&&(f="#ffffff");var k=this.editor.graph.getSvg(f,a,l,v,null,c,null,null,"blank"==m?"_blank":
 "self"==m?"_top":null);d&&this.editor.graph.addSvgShadow(k);var p=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,x));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(p,"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(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,n,this.thumbImageCache)):
 n(k)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,d,e,g,l){return this.addCheckbox(a,c,d,e,g,l,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,g,l,v){g=null!=g?g:!0;var f=document.createElement("input");f.style.marginRight="8px";f.style.marginTop="16px";f.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();f.id=l;null!=v&&f.setAttribute("name",v);c&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);d&&f.setAttribute("disabled","disabled");g&&(a.appendChild(f),
-c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),e||mxUtils.br(a));return f};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(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";
-e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=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":f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};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"));
+c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),e||mxUtils.br(a));return f};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(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var k=document.createElement("select");k.style.width="120px";k.style.marginLeft="8px";k.style.marginRight="10px";
+k.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));k.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");k.appendChild(d);a.appendChild(k);mxEvent.addListener(k,"change",mxUtils.bind(this,function(){if("custom"==k.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:k.value="blank"},mxResources.get("url"),null,
+null,null,null,function(){k.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)?k.removeAttribute("disabled"):k.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===k.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return k}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){e.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+
+(null!=k&&k!=mxConstants.NONE?"border:1px solid black;background-color:"+k:"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},
+":");var k="#0000ff",e=null,e=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(k||"none",function(a){k=a;c()});mxEvent.consume(a)}));c();e.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";e.style.marginLeft="4px";e.style.height="22px";e.style.width="22px";e.style.position="relative";e.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";e.className="geColorBtn";a.appendChild(e);mxUtils.br(a);return{getColor:function(){return k},getTarget:function(){return d.value},
 focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,l,v){var f=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)),g&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&k.push("page-id="+this.currentPage.getId());
 a=!0;null!=l?c="#U"+encodeURIComponent(l):(f=this.getCurrentFile(),v||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+f.getHash(),a=!1));a&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:
 "https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,g,l,v,x,m,n){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);x||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];l&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);
 v&&c.push("layers");0<c.length&&(x&&c.push("lightbox"),f.toolbar=c.join(" "));null!=m&&0<m.length&&(f.edit=m);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";n(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":
-EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("html"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(e);var k=document.createElement("div");
-k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value","copy");k.appendChild(e);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(p);mxUtils.br(k);k.appendChild(g);
-p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));k.appendChild(p);var l=this.getCurrentFile();null==c&&null!=l&&l.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),k.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));e.setAttribute("checked",
-"checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(k);var m=this.addLinkSection(f),n=this.addCheckbox(f,mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value="100%";f.appendChild(t);var q=this.addCheckbox(f,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,I=I=this.addCheckbox(f,mxResources.get("allPages"),
-k,!k),C=this.addCheckbox(f,mxResources.get("layers"),!0),G=this.addCheckbox(f,mxResources.get("lightbox"),!0),H=this.addEditButton(f,G),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&G.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,n.checked,
-t.value,m.getTarget(),m.getColor(),q.checked,I.checked,C.checked,G.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.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";f.appendChild(k);var p=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";
+EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,mxResources.get("html"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var e=document.createElement("div");
+e.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");k=g.cloneNode(!0);k.setAttribute("value","copy");e.appendChild(k);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));e.appendChild(p);mxUtils.br(e);e.appendChild(g);
+p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));e.appendChild(p);var l=this.getCurrentFile();null==c&&null!=l&&l.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),e.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));k.setAttribute("checked",
+"checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(e);var m=this.addLinkSection(f),n=this.addCheckbox(f,mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value="100%";f.appendChild(t);var q=this.addCheckbox(f,mxResources.get("fit"),!0),e=null!=this.pages&&1<this.pages.length,I=I=this.addCheckbox(f,mxResources.get("allPages"),
+e,!e),C=this.addCheckbox(f,mxResources.get("layers"),!0),F=this.addCheckbox(f,mxResources.get("lightbox"),!0),H=this.addEditButton(f,F),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&F.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,n.checked,
+t.value,m.getTarget(),m.getColor(),q.checked,I.checked,C.checked,F.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);k.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.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";f.appendChild(k);var p=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";
 a=0;if(null!=p&&p.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var m=document.createElement("div");m.style.whiteSpace="normal";mxUtils.write(m,mxResources.get("linkAccountRequired"));l.appendChild(m);m=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(p.getId())}));
 m.style.marginTop="12px";m.className="geBtn";l.appendChild(m);f.appendChild(l);m=document.createElement("a");m.style.paddingLeft="12px";m.style.color="gray";m.style.fontSize="11px";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("check"));l.appendChild(m);mxEvent.addListener(m,"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 n=null,t=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",f.appendChild(n),mxUtils.write(f,mxResources.get("height")+
-":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",f.appendChild(t),mxUtils.br(f);var u=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null;if(null==p||p.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var y=this.addCheckbox(f,mxResources.get("lightbox"),!0),G=this.addEditButton(f,y),H=G.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),
-!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&y.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(u.getTarget(),u.getColor(),null==q?
-!0:q.checked,y.checked,G.getLink(),B.checked,null!=n?n.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,
-mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(e);var k=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),!0),e=this.editor.graph,p=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=p&&(p.style.marginBottom="16px");a=new CustomDialog(this,f,
-mxUtils.bind(this,function(){c(!k.checked,null!=g?g.checked:!1,null!=p?p.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,l,v){l=null!=l?l:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=this.editor.graph,p="jpeg"==v?196:300,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(m);mxUtils.write(f,mxResources.get("zoom")+
+":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",f.appendChild(t),mxUtils.br(f);var u=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null;if(null==p||p.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var y=this.addCheckbox(f,mxResources.get("lightbox"),!0),F=this.addEditButton(f,y),H=F.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),
+!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&y.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(u.getTarget(),u.getColor(),null==q?
+!0:q.checked,y.checked,F.getLink(),B.checked,null!=n?n.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,
+mxResources.get("image"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(k);var e=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),!0),k=this.editor.graph,p=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background);null!=p&&(p.style.marginBottom="16px");a=new CustomDialog(this,f,
+mxUtils.bind(this,function(){c(!e.checked,null!=g?g.checked:!1,null!=p?p.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,l,v){l=null!=l?l:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=this.editor.graph,p="jpeg"==v?196:300,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(m);mxUtils.write(f,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%";f.appendChild(n);mxUtils.write(f,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.value=this.lastExportBorder||"0";f.appendChild(t);mxUtils.br(f);var u=this.addCheckbox(f,
 mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=v),q=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,k.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");g&&(f.appendChild(y),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),p+=26,mxEvent.addListener(q,"change",function(){q.checked?y.removeAttribute("disabled"):y.setAttribute("disabled",
 "disabled")}));k.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var z=this.addCheckbox(f,mxResources.get("shadow"),k.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&&(f.appendChild(B),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),p+=26);var K=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),
-l,null,null,"jpeg"!=v),M=null!=this.pages&&1<this.pages.length,Q=this.addCheckbox(f,M?mxResources.get("allPages"):"",M,!M,null,"jpeg"!=v);Q.style.marginLeft="24px";Q.style.marginBottom="16px";M||(Q.style.display="none");mxEvent.addListener(K,"change",function(){K.checked&&M?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")});l&&M||Q.setAttribute("disabled","disabled");var O=document.createElement("select");O.style.maxWidth="260px";O.style.marginLeft="8px";O.style.marginRight="10px";
-O.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));O.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));O.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));O.appendChild(a);"svg"==v&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(O),mxUtils.br(f),
-mxUtils.br(f),p+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=n.value;e(n.value,u.checked,!q.checked,z.checked,K.checked,B.checked,t.value,y.checked,!Q.checked,O.value)}),null,c,d);this.showDialog(c.container,340,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,c,d,e){var f=document.createElement("div");
+l,null,null,"jpeg"!=v),M=null!=this.pages&&1<this.pages.length,O=this.addCheckbox(f,M?mxResources.get("allPages"):"",M,!M,null,"jpeg"!=v);O.style.marginLeft="24px";O.style.marginBottom="16px";M||(O.style.display="none");mxEvent.addListener(K,"change",function(){K.checked&&M?O.removeAttribute("disabled"):O.setAttribute("disabled","disabled")});l&&M||O.setAttribute("disabled","disabled");var Q=document.createElement("select");Q.style.maxWidth="260px";Q.style.marginLeft="8px";Q.style.marginRight="10px";
+Q.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));Q.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));Q.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));Q.appendChild(a);"svg"==v&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(Q),mxUtils.br(f),
+mxUtils.br(f),p+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=n.value;e(n.value,u.checked,!q.checked,z.checked,K.checked,B.checked,t.value,y.checked,!O.checked,Q.value)}),null,c,d);this.showDialog(c.container,340,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,c,d,e){var f=document.createElement("div");
 f.style.whiteSpace="nowrap";var k=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";f.appendChild(g)}var p=this.addCheckbox(f,mxResources.get("fit"),!0),l=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible&&d,!d),m=this.addCheckbox(f,c),n=this.addCheckbox(f,mxResources.get("lightbox"),!0),t=this.addEditButton(f,n),u=t.getEditInput(),q=1<k.model.getChildCount(k.model.getRoot()),
 C=this.addCheckbox(f,mxResources.get("layers"),q,!q);C.style.marginLeft=u.style.marginLeft;C.style.marginBottom="12px";C.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(q&&C.removeAttribute("disabled"),u.removeAttribute("disabled")):(C.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));u.checked&&n.checked?t.getEditSelect().removeAttribute("disabled"):t.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,
 function(){a(p.checked,l.checked,m.checked,n.checked,t.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,g,l,v){function f(b){var f=" ",p="";d&&(f=" 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('"+
@@ -8377,22 +8377,22 @@ EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(g?"&layers=1":"
 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){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
 function(){d()}))}),0)):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],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=Graph.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(y){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){try{var d=this.editor.graph,f=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),f=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),
-e=d.getGlobalVariable,k=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(D){null!=
-b&&b(D)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(v){null!=b&&b(v)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,g,l){l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,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')+
+k=d.getGlobalVariable,e=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?e.getName():"pagenumber"==a?1:k.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(e.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var k=c.toDataURL("image/png"),k=this.writeGraphModelToPng(k,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(k.substring(k.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(E){null!=
+b&&b(E)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(v){null!=b&&b(v)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,g,l){l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,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(g)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,l,v,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;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,v):null,m)}catch(F){"Invalid image"==F.message?this.downloadFile(m):this.handleError(F)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,l)}catch(J){this.spinner.stop(),this.handleError(J)}}};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,f={},e=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],g=1;g<c.length;g++){var k=c[g].indexOf(")");e.push('url("');e.push(f[b(c[g].substring(0,k))]);e.push('"'+c[g].substring(k))}this.editor.resolvedFontCss=e.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var l=c[g].indexOf(")"),m=null,n=c[g].indexOf("format(",l);0<n&&(m=b(c[g].substring(n+7,c[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==
+try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,v):null,m)}catch(G){"Invalid image"==G.message?this.downloadFile(m):this.handleError(G)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,l)}catch(J){this.spinner.stop(),this.handleError(J)}}};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,f={},e=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],k=1;k<c.length;k++){var g=c[k].indexOf(")");e.push('url("');e.push(f[b(c[k].substring(0,g))]);e.push('"'+c[k].substring(g))}this.editor.resolvedFontCss=e.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var l=c[g].indexOf(")"),m=null,n=c[g].indexOf("format(",l);0<n&&(m=b(c[g].substring(n+7,c[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==
 f[a]){f[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.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,l,v,m,n,q,F,A,E){g=null!=g?g:!0;F=null!=F?F:this.editor.graph;A=null!=A?A:0;var f=m?null:F.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==
-f&&0==m&&(f="#ffffff");this.convertImages(F.getSvg(f,null,null,E,null,null!=l?l:!0,null,null,null,n),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));v=null!=v?v:1;null!=b&&(v=g?Math.min(1,Math.min(3*b/(4*l),b/p)):b/p);p=Math.ceil(v*p)+2*A;l=Math.ceil(v*l)+2*A;k.setAttribute("width",p);k.setAttribute("height",l);var m=k.getContext("2d");null!=f&&(m.beginPath(),
-m.rect(0,0,p,l),m.fillStyle=f,m.fill());m.scale(v,v);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(d,A/v,A/v);a(k)},0):(m.drawImage(d,A/v,A/v),a(k))}catch(O){null!=e&&e(O)}});d.onerror=function(a){null!=e&&e(a)};try{n&&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(F,
+a;/^https?:\/\//.test(c)&&!this.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,l,v,m,n,q,G,A,D){g=null!=g?g:!0;G=null!=G?G:this.editor.graph;A=null!=A?A:0;var f=m?null:G.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==
+f&&0==m&&(f="#ffffff");this.convertImages(G.getSvg(f,null,null,D,null,null!=l?l:!0,null,null,null,n),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));v=null!=v?v:1;null!=b&&(v=g?Math.min(1,Math.min(3*b/(4*l),b/p)):b/p);p=Math.ceil(v*p)+2*A;l=Math.ceil(v*l)+2*A;k.setAttribute("width",p);k.setAttribute("height",l);var m=k.getContext("2d");null!=f&&(m.beginPath(),
+m.rect(0,0,p,l),m.fillStyle=f,m.fill());m.scale(v,v);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(d,A/v,A/v);a(k)},0):(m.drawImage(d,A/v,A/v),a(k))}catch(Q){null!=e&&e(Q)}});d.onerror=function(a){null!=e&&e(a)};try{n&&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(G,
 c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(B){null!=e&&e(B)}}),c,q)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.editor.isCorsEnabledForUrl(d)?"chrome-extension://"!=
-d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,e=c||{};c=mxUtils.bind(this,function(c,g){for(var k=a.getElementsByTagName(c),p=0;p<k.length;p++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(g));if(null!=k&&"data:"!=k.substring(0,5)){var p=e[k];null==p?(f++,this.convertImageToDataUri(k,function(d){null!=d&&(e[k]=d,c.setAttribute(g,
-d));f--;0==f&&b(a)})):c.setAttribute(g,p)}else null!=k&&c.setAttribute(g,k)})(k[p])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g,l){try{var f=!l&&(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(f){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("")}g=null!=g?g:"data:image/png;base64,";d=g+this.base64Encode(d)}b(d)}}else null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()})},f,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:k})})});k()}catch(D){null!=
-c&&c(D)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(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(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");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);try{b(a.toDataURL())}catch(z){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var f=[];try{var g=this.editor.graph;if(null!=a&&0<a.length){g.model.beginUpdate();try{var k=mxUtils.parseXml(a),p=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=p&&"mxfile"==p.nodeName&&null!=this.pages){var l=p.getElementsByTagName("diagram");if(1==l.length)p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement;
-else if(1<l.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement,d=!1,a=1);a<l.length;a++){l[a].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(l[a])),n=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[n+1]));g.model.execute(new ChangePage(this,m,m,n,!0))}}null!=p&&"mxGraphModel"===p.nodeName&&(f=g.importGraphModel(p,b,c,d))}finally{g.model.endUpdate()}}}catch(A){if(e)throw A;
+d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,e=c||{};c=mxUtils.bind(this,function(c,k){for(var g=a.getElementsByTagName(c),p=0;p<g.length;p++)mxUtils.bind(this,function(c){var g=d.convert(c.getAttribute(k));if(null!=g&&"data:"!=g.substring(0,5)){var p=e[g];null==p?(f++,this.convertImageToDataUri(g,function(d){null!=d&&(e[g]=d,c.setAttribute(k,
+d));f--;0==f&&b(a)})):c.setAttribute(k,p)}else null!=g&&c.setAttribute(k,g)})(g[p])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g,l){try{var f=!l&&(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(f){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("")}g=null!=g?g:"data:image/png;base64,";d=g+this.base64Encode(d)}b(d)}}else null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()})},f,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:k})})});k()}catch(E){null!=
+c&&c(E)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(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(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");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);try{b(a.toDataURL())}catch(z){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var f=[];try{var k=this.editor.graph;if(null!=a&&0<a.length){k.model.beginUpdate();try{var g=mxUtils.parseXml(a),p=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=p&&"mxfile"==p.nodeName&&null!=this.pages){var l=p.getElementsByTagName("diagram");if(1==l.length)p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement;
+else if(1<l.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement,d=!1,a=1);a<l.length;a++){l[a].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(l[a])),n=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[n+1]));k.model.execute(new ChangePage(this,m,m,n,!0))}}null!=p&&"mxGraphModel"===p.nodeName&&(f=k.importGraphModel(p,b,c,d))}finally{k.model.endUpdate()}}}catch(A){if(e)throw A;
 this.handleError(A)}return f};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,d){d=null!=d?d:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(this.isRemoteVisioFormat(d)&&null!=VSD_CONVERT_URL){var f=new FormData;f.append("file1",a,d);var e=new XMLHttpRequest;e.open("POST",VSD_CONVERT_URL);
 e.responseType="blob";e.onreadystatechange=mxUtils.bind(this,function(){if(4==e.readyState)if(200<=e.status&&299>=e.status)try{e.response.name=d,this.doImportVisio(e.response,b,c)}catch(v){c(v)}else c({})});e.send(f)}else try{this.doImportVisio(a,b,c)}catch(v){c(v)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
 var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(u){c(u)}});this.doImportGraphML||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(k){this.handleError(k)}});
@@ -8400,7 +8400,7 @@ var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGra
 window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,f=null;d.getModel().beginUpdate();try{f=d.insertVertex(null,null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=center;verticalAlign=middle;"),d.updateCellSize(f,!0)}finally{d.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,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,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var f=this.editor.graph;if("data:image/png;base64,"==
 a.substring(0,22)){var k=this.extractGraphModelFromPng(a),p=this.importXml(k,b,c,g,!0);if(0<p.length)return p}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)),p=this.importXml(k,b,c,g,!0),0<p.length)return p}catch(J){}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){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),d,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/d.width,this.maxImageSize/d.height)),g=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),g,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+a,mxUtils.bind(this,function(a,d,e){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),d,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/d.width,this.maxImageSize/d.height)),k=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),k,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
 a+";"))}}),mxUtils.bind(this,function(){var e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,a,f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(e),f.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{f.getModel().endUpdate()}f.setSelectionCell(e)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,g);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,
 function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,g))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted","cells",[e])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),e.value=a,f.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)&&
 f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gridSize}finally{f.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=
@@ -8411,19 +8411,19 @@ function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary
 a+";")])):/(\.*<graphml )/.test(a)?(f=!0,this.importGraphML(a,p)):null!=m&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(f=!0,this.importVisio(m,p)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(f=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?p(a.responseText):null!=v&&v(null))}),l)):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||
 (k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,n));f||null==v||v(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,g;c<d;){f=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);b+="==";break}e=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);
 b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);b+=
-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,l,v,m,n,q,F){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;n=null!=n?n:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var x=q||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>x){p=!0;break}var u=mxUtils.bind(this,function(){var p=this.editor.graph,m=p.gridSize;
-e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,l,p){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,g,k,l,p,f,F)});g=null!=g?g:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var x=a.length,t=x,u=[],y=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--t){this.spinner.stop();if(null!=v)v(u);else{var c=[];p.getModel().beginUpdate();
-try{for(var d=0;d<u.length;d++){var f=u[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}g(c)}}),D=0;D<x;D++)mxUtils.bind(this,function(f){var g=a[f];if(null!=g){var v=new FileReader;v.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 v=a.target.result,x=v.indexOf(","),t=decodeURIComponent(escape(atob(v.substring(x+1)))),u=mxUtils.parseXml(t),t=u.getElementsByTagName("svg");if(0<t.length){var t=t[0],
-D=F?null:t.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)?y(f,mxUtils.bind(this,function(){try{if(v.substring(0,x+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=parseFloat(k.getAttribute("width")),n=parseFloat(k.getAttribute("height")),q=k.getAttribute("viewBox");if(null==
-q||0==q.length)k.setAttribute("viewBox","0 0 "+l+" "+n);else if(isNaN(l)||isNaN(n)){var t=q.split(" ");3<t.length&&(l=parseFloat(t[2]),n=parseFloat(t[3]))}v=this.createSvgDataUri(mxUtils.getXml(k));var y=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,n)),D=e(v,g.type,b+f*m,c+f*m,Math.max(1,Math.round(l*y)),Math.max(1,Math.round(n*y)),g.name);if(isNaN(l)||isNaN(n)){var J=new Image;J.onload=mxUtils.bind(this,function(){l=Math.max(1,J.width);n=Math.max(1,J.height);D[0].geometry.width=l;D[0].geometry.height=
-n;k.setAttribute("viewBox","0 0 "+l+" "+n);v=this.createSvgDataUri(mxUtils.getXml(k));var a=v.indexOf(";");0<a&&(v=v.substring(0,a)+v.substring(v.indexOf(",",a+1)));p.setCellStyles("image",v,[D[0]])});J.src=this.createSvgDataUri(mxUtils.getXml(k))}return D}}}catch(pa){}return null})):y(f,mxUtils.bind(this,function(){return e(D,"text/xml",b+f*m,c+f*m,0,0,g.name)}))}else y(f,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==g.type){var J=F?null:this.extractGraphModelFromPng(a.target.result);
-if(null!=J&&0<J.length){var z=new Image;z.src=a.target.result;y(f,mxUtils.bind(this,function(){return e(J,"text/xml",b+f*m,c+f*m,z.width,z.height,g.name)}));t=!0}}t||(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(l){this.resizeImage(l,
-a.target.result,mxUtils.bind(this,function(l,p,v){y(f,mxUtils.bind(this,function(){if(null!=l&&l.length<n){var x=k&&this.isResampleImage(a.target.result,q)?Math.min(1,Math.min(d/p,d/v)):1;return e(l,g.type,b+f*m,c+f*m,Math.round(p*x),Math.round(v*x),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,q)}),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){y(f,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*m,c+f*m,240,160,g.name,function(a){y(f,function(){return a})},g):"image"==g.type.substring(0,5)?v.readAsDataURL(g):v.readAsText(g)}})(D)});p?this.confirmImageResize(function(a){k=a;u()},m):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?
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,l,m,n,q,J,G){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;q=null!=q?q:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var v=J||this.resampleThreshold,x=0;x<a.length;x++)if("image/"==a[x].type.substring(0,6)&&a[x].size>v){p=!0;break}var t=mxUtils.bind(this,function(){var p=this.editor.graph,v=p.gridSize;
+e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,k,g,l,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,k,g,l,p,f,G)});g=null!=g?g:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,x=n,t=[],u=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--x){this.spinner.stop();if(null!=m)m(t);else{var c=[];p.getModel().beginUpdate();
+try{for(var d=0;d<t.length;d++){var f=t[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}g(c)}}),y=0;y<n;y++)mxUtils.bind(this,function(f){var g=a[f];if(null!=g){var m=new FileReader;m.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 m=a.target.result,n=m.indexOf(","),x=decodeURIComponent(escape(atob(m.substring(n+1)))),t=mxUtils.parseXml(x),x=t.getElementsByTagName("svg");if(0<x.length){var x=x[0],
+y=G?null:x.getAttribute("content");null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=unescape(window.atob?atob(y):Base64.decode(y,!0)));null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y));null==y||"<mxfile "!==y.substring(0,8)&&"<mxGraphModel "!==y.substring(0,14)?u(f,mxUtils.bind(this,function(){try{if(m.substring(0,n+1),null!=t){var a=t.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=parseFloat(k.getAttribute("width")),x=parseFloat(k.getAttribute("height")),q=k.getAttribute("viewBox");if(null==
+q||0==q.length)k.setAttribute("viewBox","0 0 "+l+" "+x);else if(isNaN(l)||isNaN(x)){var u=q.split(" ");3<u.length&&(l=parseFloat(u[2]),x=parseFloat(u[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var y=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,x)),E=e(m,g.type,b+f*v,c+f*v,Math.max(1,Math.round(l*y)),Math.max(1,Math.round(x*y)),g.name);if(isNaN(l)||isNaN(x)){var J=new Image;J.onload=mxUtils.bind(this,function(){l=Math.max(1,J.width);x=Math.max(1,J.height);E[0].geometry.width=l;E[0].geometry.height=
+x;k.setAttribute("viewBox","0 0 "+l+" "+x);m=this.createSvgDataUri(mxUtils.getXml(k));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));p.setCellStyles("image",m,[E[0]])});J.src=this.createSvgDataUri(mxUtils.getXml(k))}return E}}}catch(pa){}return null})):u(f,mxUtils.bind(this,function(){return e(y,"text/xml",b+f*v,c+f*v,0,0,g.name)}))}else u(f,mxUtils.bind(this,function(){return null}))}else{x=!1;if("image/png"==g.type){var E=G?null:this.extractGraphModelFromPng(a.target.result);
+if(null!=E&&0<E.length){var z=new Image;z.src=a.target.result;u(f,mxUtils.bind(this,function(){return e(E,"text/xml",b+f*v,c+f*v,z.width,z.height,g.name)}));x=!0}}x||(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(l){this.resizeImage(l,
+a.target.result,mxUtils.bind(this,function(l,p,m){u(f,mxUtils.bind(this,function(){if(null!=l&&l.length<q){var n=k&&this.isResampleImage(a.target.result,J)?Math.min(1,Math.min(d/p,d/m)):1;return e(l,g.type,b+f*v,c+f*v,Math.round(p*n),Math.round(m*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,J)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*v,c+f*v,240,160,g.name,
+function(a){u(f,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*v,c+f*v,240,160,g.name,function(a){u(f,function(){return a})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)}})(y)});p?this.confirmImageResize(function(a){k=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(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?
 mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(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):f(!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 f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.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,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),k=Math.max(1,a.height);
-if(d&&this.isResampleImage(b,g))try{var l=Math.max(f/e,k/e);if(1<l){var p=Math.round(f/l),m=Math.round(k/l),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var q=n.toDataURL();if(q.length<b.length){var t=document.createElement("canvas");t.width=p;t.height=m;var u=t.toDataURL();q!==u&&(b=q,f=p,k=m)}}}catch(C){}c(b,f,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var e=d,g=0;8>g;g++)e=1==(e&1)?3988292384^e>>>1:e>>>1,EditorUi.prototype.crcTable[d]=
-e;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=l;l+=b;return a.substring(c,l)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
+if(d&&this.isResampleImage(b,g))try{var l=Math.max(f/e,k/e);if(1<l){var p=Math.round(f/l),m=Math.round(k/l),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var q=n.toDataURL();if(q.length<b.length){var t=document.createElement("canvas");t.width=p;t.height=m;var u=t.toDataURL();q!==u&&(b=q,f=p,k=m)}}}catch(C){}c(b,f,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var g=d,e=0;8>e;e++)g=1==(g&1)?3988292384^g>>>1:g>>>1,EditorUi.prototype.crcTable[d]=
+g;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=l;l+=b;return a.substring(c,l)}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 l=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,l);do{var p=g(a);if("IDAT"==f(a,4)){e=a.substring(0,l-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(l-8,a.length);break}e+=a.substring(l-8,l-4+p);f(a,p);f(a,4)}while(p);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,f){a=d.substring(a+8,a+8+f);"zTXt"==
 c?(f=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,f)&&(a=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,c){try{var d=new Image;d.onload=
@@ -8438,18 +8438,18 @@ if(!this.editor.chromeless||this.editor.editable){var n=function(){window.setTim
 0);q.style.width="1px";q.style.height="1px";q.innerHTML="&nbsp;";var J=!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 c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||
 J||(q.style.left=b.container.scrollLeft+10+"px",q.style.top=b.container.scrollTop+10+"px",b.container.appendChild(q),J=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){q.focus();document.execCommand("selectAll",!1,null)},0):(q.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!J||224!=c&&17!=c&&91!=c||(J=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),
 q.parentNode.removeChild(q),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(q,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q),n())}));mxEvent.addListener(q,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q,!0),n())}));mxEvent.addListener(q,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(q.innerHTML="&nbsp;",q.focus(),window.setTimeout(mxUtils.bind(this,
-function(){this.pasteCells(a,q);q.innerHTML="&nbsp;"}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==q?!0:F.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&&
+function(){this.pasteCells(a,q);q.innerHTML="&nbsp;"}),0))}),!0);var G=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==q?!0:G.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,f,e,g){b.insertImage(a,e,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 f=this.maxImageSize,f=Math.min(1,
 Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):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 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,v,!1)}if("1"==urlParams.styledev){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",
+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 D=document.createElement("div");D.style.position="absolute";D.style.top=
+"95px";D.style.left="220px";D.style.width="30px";D.style.height="30px";D.style.background="whiteSmoke";document.body.appendChild(D);this.vRuler=new mxRuler(this.editor.graph,A,!0);this.hRuler=new mxRuler(this.editor.graph,v,!1)}if("1"==urlParams.styledev){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 I=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:I.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(b.container,"dragleave",
 function(a){b.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=C&&(C.parentNode.removeChild(C),C=null);if(b.isEnabled()){var c=
 mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,e,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,c=this.extractGraphModelFromEvent(a,null!=this.pages);
-if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var v=!0,m=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,
-e,g,!0,p,null,v))});p&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){v=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 c=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,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var m=!0,v=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,
+e,g,!0,p,null,m))});p&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;v()},mxEvent.isControlDown(a)):v()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var c=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,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
 k+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(k,e,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),e,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,
 this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");0<c&&(b=this.getPageById(a.substring(c+1)),b=null!=b?b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,
 13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};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.fireEvent(new mxEventObject("styleChanged",
@@ -8469,7 +8469,7 @@ function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.document
 c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,
 f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==
 a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));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(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(D){this.handleError(D)}});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):
+this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(E){this.handleError(E)}});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(),f=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))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():
 (mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,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(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()})));else throw Error(mxResources.get("notADiagramFile"));
 };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,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,f=d.getCellStyle(a);
@@ -8480,20 +8480,20 @@ this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(
 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,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,f=null,e=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,e);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){if(e.source==(window.opener||window.parent)){var k=e.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"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=Graph.decompress(a)))}catch(M){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(K){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();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){var p=l(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",
-[k.name||this.defaultFilename]),p,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(K){g.postMessage(JSON.stringify({event:"draft",error:K.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();l=1==k.enableRecent;p=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,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,p?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,
+k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();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){var m=l(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",
+[k.name||this.defaultFilename]),m,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(K){g.postMessage(JSON.stringify({event:"draft",error:K.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();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,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,m?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):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("textContent"==k.action){l=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:l,message:k}),"*");return}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 m=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,m):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 v=null!=k.xml?k.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);
+k.action){var p=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,p):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 v=null!=k.xml?k.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=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(v);g.postMessage(JSON.stringify(b),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(v))));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,y=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(n.container);n.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,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(v)))).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!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);m=this.createLoadMessage("export");if("html2"==k.format||"html"==k.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=k.format;else if("html"==k.format)v=this.editor.getGraphXml(),
-m.data=this.getHtml(v,this.editor.graph),m.xml=mxUtils.getXml(v),m.format=k.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(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(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"==k.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"==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&&(p=document.createElement("span"),mxUtils.write(p,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right=
-"25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(p),this.embedFilenameSpan=p),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):
-g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}var z=mxUtils.bind(this,function(e,k){c=!0;try{a(e,k)}catch(O){this.handleError(O)}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())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");
+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!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);p=this.createLoadMessage("export");if("html2"==k.format||"html"==k.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=k.format;else if("html"==k.format)v=this.editor.getGraphXml(),
+p.data=this.getHtml(v,this.editor.graph),p.xml=mxUtils.getXml(v),p.format=k.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(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(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);g.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));g.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=
+this.createSvgDataUri(l)}g.postMessage(JSON.stringify(p),"*")}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&&(m=document.createElement("span"),mxUtils.write(m,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right=
+"25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(m),this.embedFilenameSpan=m),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):
+g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}var z=mxUtils.bind(this,function(e,k){c=!0;try{a(e,k)}catch(Q){this.handleError(Q)}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())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");
 e.xml=d;d=JSON.stringify(e);(window.opener||window.parent).postMessage(d,"*")}f=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")),"*")});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(l="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+1)),function(a){z(a,e)},mxUtils.bind(this,function(a){this.handleError(a)}),
 l)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&z(a.responseText,e)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,mxUtils.bind(this,function(a){z(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):
@@ -8501,16 +8501,16 @@ l)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpReq
 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,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,k=null,l=null,m="",n="auto",q="auto",A=null,E=null,I=40,C=40,G=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var K=function(){null!=b?b(ca):(B.setSelectionCells(ca),B.scrollCellToVisible(B.getSelectionCell()))},M=B.getFreeInsertPoint(),Q=M.x,O=M.y,M=O,T=null,U="auto",l=null,W=[],Y=null,fa=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&
-"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var P=mxUtils.trim(a.substring(1,Z)),R=mxUtils.trim(a.substring(Z+1));"label"==P?T=B.sanitizeHtml(R):"style"==P?f=R:"parentstyle"==P?g=R:"identity"==P&&0<R.length&&"-"!=R?k=R:"parent"==P&&0<R.length&&"-"!=R?l=R:"namespace"==P&&0<R.length&&"-"!=R?m=R:"width"==P?n=R:"height"==P?q=R:"left"==P&&0<R.length?A=R:"top"==P&&0<R.length?E=R:"ignore"==P?fa=R.split(","):"connect"==
-P?W.push(JSON.parse(R)):"link"==P?Y=R:"padding"==P?H=parseFloat(R):"edgespacing"==P?I=parseFloat(R):"nodespacing"==P?C=parseFloat(R):"levelspacing"==P?G=parseFloat(R):"layout"==P&&(U=R)}}}var aa=this.editor.csvToArray(c[N]),P=Z=null;if(null!=k||null!=l)for(var V=0;V<aa.length;V++)k==aa[V]&&(Z=V),l==aa[V]&&(P=V);null==T&&(T="%"+aa[0]+"%");if(null!=W)for(var S=0;S<W.length;S++)null==e[W[S].to]&&(e[W[S].to]={});B.model.beginUpdate();try{for(V=N+1;V<c.length;V++){var ba=this.editor.csvToArray(c[V]);if(null==
-ba){var ga=40<c[V].length?c[V].substring(0,40)+"...":c[V];throw Error(V+" ("+ga+") "+mxResources.get("containsValidationErrors"));}if(ba.length==aa.length){var L=null,ea=null!=Z?m+ba[Z]:null;null!=ea&&(L=B.model.getCell(ea));null==L&&(L=new mxCell(T,new mxGeometry(Q,M,0,0),f||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=ea);for(var X=0;X<ba.length;X++)B.setAttributeForCell(L,aa[X],ba[X]);B.setAttributeForCell(L,"placeholders","1");L.style=B.replacePlaceholders(L,L.style);for(S=0;S<W.length;S++)e[W[S].to][L.getAttribute(W[S].to)]=
-L;null!=Y&&"link"!=Y&&(B.setLinkForCell(L,L.getAttribute(Y)),B.setAttributeForCell(L,Y,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var ia=this.editor.graph.getPreferredSizeForCell(L);L.vertex&&(null!=A&&null!=L.getAttribute(A)&&(L.geometry.x=Q+parseFloat(L.getAttribute(A))),null!=E&&null!=L.getAttribute(E)&&(L.geometry.y=O+parseFloat(L.getAttribute(E))),"@"==n.charAt(0)&&null!=L.getAttribute(n.substring(1))?L.geometry.width=parseFloat(L.getAttribute(n.substring(1))):L.geometry.width=
+EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,k=null,l=null,m="",n="auto",q="auto",A=null,D=null,I=40,C=40,F=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var K=function(){null!=b?b(ca):(B.setSelectionCells(ca),B.scrollCellToVisible(B.getSelectionCell()))},M=B.getFreeInsertPoint(),O=M.x,Q=M.y,M=Q,T=null,U="auto",l=null,W=[],Y=null,fa=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&
+"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var P=mxUtils.trim(a.substring(1,Z)),R=mxUtils.trim(a.substring(Z+1));"label"==P?T=B.sanitizeHtml(R):"style"==P?f=R:"parentstyle"==P?g=R:"identity"==P&&0<R.length&&"-"!=R?k=R:"parent"==P&&0<R.length&&"-"!=R?l=R:"namespace"==P&&0<R.length&&"-"!=R?m=R:"width"==P?n=R:"height"==P?q=R:"left"==P&&0<R.length?A=R:"top"==P&&0<R.length?D=R:"ignore"==P?fa=R.split(","):"connect"==
+P?W.push(JSON.parse(R)):"link"==P?Y=R:"padding"==P?H=parseFloat(R):"edgespacing"==P?I=parseFloat(R):"nodespacing"==P?C=parseFloat(R):"levelspacing"==P?F=parseFloat(R):"layout"==P&&(U=R)}}}var aa=this.editor.csvToArray(c[N]),P=Z=null;if(null!=k||null!=l)for(var V=0;V<aa.length;V++)k==aa[V]&&(Z=V),l==aa[V]&&(P=V);null==T&&(T="%"+aa[0]+"%");if(null!=W)for(var S=0;S<W.length;S++)null==e[W[S].to]&&(e[W[S].to]={});B.model.beginUpdate();try{for(V=N+1;V<c.length;V++){var ba=this.editor.csvToArray(c[V]);if(null==
+ba){var ga=40<c[V].length?c[V].substring(0,40)+"...":c[V];throw Error(V+" ("+ga+") "+mxResources.get("containsValidationErrors"));}if(ba.length==aa.length){var L=null,ea=null!=Z?m+ba[Z]:null;null!=ea&&(L=B.model.getCell(ea));null==L&&(L=new mxCell(T,new mxGeometry(O,M,0,0),f||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=ea);for(var X=0;X<ba.length;X++)B.setAttributeForCell(L,aa[X],ba[X]);B.setAttributeForCell(L,"placeholders","1");L.style=B.replacePlaceholders(L,L.style);for(S=0;S<W.length;S++)e[W[S].to][L.getAttribute(W[S].to)]=
+L;null!=Y&&"link"!=Y&&(B.setLinkForCell(L,L.getAttribute(Y)),B.setAttributeForCell(L,Y,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var ia=this.editor.graph.getPreferredSizeForCell(L);L.vertex&&(null!=A&&null!=L.getAttribute(A)&&(L.geometry.x=O+parseFloat(L.getAttribute(A))),null!=D&&null!=L.getAttribute(D)&&(L.geometry.y=Q+parseFloat(L.getAttribute(D))),"@"==n.charAt(0)&&null!=L.getAttribute(n.substring(1))?L.geometry.width=parseFloat(L.getAttribute(n.substring(1))):L.geometry.width=
 "auto"==n?ia.width+H:parseFloat(n),"@"==q.charAt(0)&&null!=L.getAttribute(q.substring(1))?L.geometry.height=parseFloat(L.getAttribute(q.substring(1))):L.geometry.height="auto"==q?ia.height+H:parseFloat(q),M+=L.geometry.height+C);l=null!=P?B.model.getCell(m+ba[P]):null;null!=l?(l.style=B.replacePlaceholders(l,g),B.addCell(L,l)):d.push(B.addCell(L))}}for(var ha=d.slice(),ca=d.slice(),S=0;S<W.length;S++)for(var da=W[S],V=0;V<d.length;V++){var L=d[V],qa=L.getAttribute(da.from);if(null!=qa){B.setAttributeForCell(L,
 da.from,null);for(var pa=qa.split(","),X=0;X<pa.length;X++){var ja=e[da.to][pa[X]];null!=ja&&(T=da.label,null!=da.fromlabel&&(T=(L.getAttribute(da.fromlabel)||"")+(T||"")),null!=da.tolabel&&(T=(T||"")+(ja.getAttribute(da.tolabel)||"")),ca.push(B.insertEdge(null,null,T||"",da.invert?ja:L,da.invert?L:ja,da.style||B.createCurrentEdgeStyle())),mxUtils.remove(da.invert?L:ja,ha))}}}if(null!=fa)for(V=0;V<d.length;V++)for(L=d[V],X=0;X<fa.length;X++)B.setAttributeForCell(L,mxUtils.trim(fa[X]),null);var ma=
 new mxParallelEdgeLayout(B);ma.spacing=I;var ra=function(){ma.execute(B.getDefaultParent());for(var a=0;a<d.length;a++){var b=B.getCellGeometry(d[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==n&&(b.width=Math.round(B.snap(b.width)));"auto"==q&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==U){var na=new mxCircleLayout(B);na.resetEdges=!1;var sa=na.isVertexIgnored;na.isVertexIgnored=function(a){return sa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){na.execute(B.getDefaultParent());
 ra()},!0,K);K=null}else if("horizontaltree"==U||"verticaltree"==U||"auto"==U&&ca.length==2*d.length-1&&1==ha.length){B.view.validate();var oa=new mxCompactTreeLayout(B,"horizontaltree"==U);oa.levelDistance=C;oa.edgeRouting=!1;oa.resetEdges=!1;this.executeLayout(function(){oa.execute(B.getDefaultParent(),0<ha.length?ha[0]:null)},!0,K);K=null}else if("horizontalflow"==U||"verticalflow"==U||"auto"==U&&1==ha.length){B.view.validate();var ka=new mxHierarchicalLayout(B,"horizontalflow"==U?mxConstants.DIRECTION_WEST:
-mxConstants.DIRECTION_NORTH);ka.intraCellSpacing=C;ka.parallelEdgeSpacing=I;ka.interRankCellSpacing=G;ka.disableEdgeStyle=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),ca);B.moveCells(ca,Q,O)},!0,K);K=null}else if("organic"==U||"auto"==U&&ca.length>d.length){B.view.validate();var la=new mxFastOrganicLayout(B);la.forceConstant=3*C;la.resetEdges=!1;var ua=la.isVertexIgnored;la.isVertexIgnored=function(a){return ua.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ma=new mxParallelEdgeLayout(B);
+mxConstants.DIRECTION_NORTH);ka.intraCellSpacing=C;ka.parallelEdgeSpacing=I;ka.interRankCellSpacing=F;ka.disableEdgeStyle=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),ca);B.moveCells(ca,O,Q)},!0,K);K=null}else if("organic"==U||"auto"==U&&ca.length>d.length){B.view.validate();var la=new mxFastOrganicLayout(B);la.forceConstant=3*C;la.resetEdges=!1;var ua=la.isVertexIgnored;la.isVertexIgnored=function(a){return ua.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ma=new mxParallelEdgeLayout(B);
 ma.spacing=I;this.executeLayout(function(){la.execute(B.getDefaultParent());ra()},!0,K);K=null}this.hideDialog()}finally{B.model.endUpdate()}null!=K&&K()}}catch(ta){this.handleError(ta)}};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,480,130,!0,!0);a.init()};var m=
 EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.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)};
@@ -8534,39 +8534,39 @@ k.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,funct
 c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutureCellForEdit(c.model,a,d.source.id);e!=d.source&&(d.source=e)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==c){a.contains(f.previous)&&(d=f.child);
 break}}return d};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length;c++){var d=a;this.currentPage!=this.pages[c]&&(d=this.createTemporaryGraph(a.getStylesheet()),d.model.setRoot(this.pages[c].root));b+=this.pages[c].getName()+" "+d.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b=
 {},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<img src="/images/spin.gif">';var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var l=g[a];if("R"==l.substring(0,1)){var m=
-JSON.parse(decodeURIComponent(l.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(D){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},function(){this.handleError(null,mxResources.get("errorGettingConfLibs",null,"An error occured while getting Confluence libraries list"))});
-c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,
+JSON.parse(decodeURIComponent(l.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(E){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},function(){this.handleError(null,mxResources.get("errorGettingConfLibs",null,"An error occured while getting Confluence libraries list"))});
+c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,
 mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}));this.showDialog(c.container,340,375,!0,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],
 "*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,d,e){c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:d,error:e});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,
 msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),
 e.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,e);else{var f=this[c].apply(this,e);b([f])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(z){b(null,"Invalid Call: An error occured, "+z.message)}}})();EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};
-EditorUi.prototype.patchPages=function(a,c,b,d,e){var g={},l=[],m={},n={},q={},f={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var k in d[EditorUi.DIFF_UPDATE])g[k]=d[EditorUi.DIFF_UPDATE][k];if(null!=c[EditorUi.DIFF_REMOVE])for(d=0;d<c[EditorUi.DIFF_REMOVE].length;d++)n[c[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(d=0;d<c[EditorUi.DIFF_INSERT].length;d++)m[c[EditorUi.DIFF_INSERT][d].previous]=c[EditorUi.DIFF_INSERT][d];if(null!=c[EditorUi.DIFF_UPDATE])for(k in c[EditorUi.DIFF_UPDATE])d=
+EditorUi.prototype.patchPages=function(a,c,b,d,g){var e={},l=[],m={},n={},q={},f={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var k in d[EditorUi.DIFF_UPDATE])e[k]=d[EditorUi.DIFF_UPDATE][k];if(null!=c[EditorUi.DIFF_REMOVE])for(d=0;d<c[EditorUi.DIFF_REMOVE].length;d++)n[c[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(d=0;d<c[EditorUi.DIFF_INSERT].length;d++)m[c[EditorUi.DIFF_INSERT][d].previous]=c[EditorUi.DIFF_INSERT][d];if(null!=c[EditorUi.DIFF_UPDATE])for(k in c[EditorUi.DIFF_UPDATE])d=
 c[EditorUi.DIFF_UPDATE][k],null!=d.previous&&(f[d.previous]=k);if(null!=a){var p="";for(d=0;d<a.length;d++){var t=a[d].getId();q[t]=a[d];null!=f[p]||n[t]||null!=c[EditorUi.DIFF_UPDATE]&&null!=c[EditorUi.DIFF_UPDATE][t]&&null!=c[EditorUi.DIFF_UPDATE][t].previous||(f[p]=t);p=t}}var u={},y=mxUtils.bind(this,function(a){var d=null!=a?a.getId():"";if(null!=a&&!u[d]){u[d]=!0;l.push(a);var k=null!=c[EditorUi.DIFF_UPDATE]?c[EditorUi.DIFF_UPDATE][d]:null;null!=k&&(this.updatePageRoot(a),null!=k.name&&a.setName(k.name),
-null!=k.view&&this.patchViewState(a,k.view),null!=k.cells&&this.patchPage(a,k.cells,g[a.getId()],e),!b||null==k.cells&&null==k.view||(a.needsUpdate=!0))}a=f[d];null!=a&&(delete f[d],y(q[a]));a=m[d];null!=a&&(delete m[d],z(a))}),z=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=q[a.getId()];null==c?y(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});y();for(k in f)y(q[f[k]]),
+null!=k.view&&this.patchViewState(a,k.view),null!=k.cells&&this.patchPage(a,k.cells,e[a.getId()],g),!b||null==k.cells&&null==k.view||(a.needsUpdate=!0))}a=f[d];null!=a&&(delete f[d],y(q[a]));a=m[d];null!=a&&(delete m[d],z(a))}),z=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=q[a.getId()];null==c?y(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});y();for(k in f)y(q[f[k]]),
 delete f[k];for(k in m)z(m[k]),delete m[k];return l};EditorUi.prototype.patchViewState=function(a,c){if(null!=a.viewState&&null!=c){a==this.currentPage&&(a.viewState=this.editor.graph.getViewState());for(var b in c)a.viewState[b]=JSON.parse(c[b]);a==this.currentPage&&this.editor.graph.setViewState(a.viewState)}};
-EditorUi.prototype.createParentLookup=function(a,c){function b(a){var b=d[a];null==b&&(b={inserted:[],moved:{}},d[a]=b);return b}var d={};if(null!=c[EditorUi.DIFF_INSERT])for(var e=0;e<c[EditorUi.DIFF_INSERT].length;e++){var g=c[EditorUi.DIFF_INSERT][e],l=null!=g.parent?g.parent:"",m=null!=g.previous?g.previous:"";b(l).inserted[m]=g}if(null!=c[EditorUi.DIFF_UPDATE])for(var n in c[EditorUi.DIFF_UPDATE])g=c[EditorUi.DIFF_UPDATE][n],null!=g.previous&&(l=g.parent,null==l&&(e=a.getCell(n),null!=e&&(e=
-a.getParent(e),null!=e&&(l=e.getId()))),null!=l&&(b(l).moved[g.previous]=n));return d};
-EditorUi.prototype.patchPage=function(a,c,b,d){var e=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),g=this.createParentLookup(e,c);e.beginUpdate();try{var l=e.updateEdgeParent,m=new mxDictionary,n=[];e.updateEdgeParent=function(a,b){!m.get(a)&&d&&(m.put(a,!0),n.push(a))};var q=g[""],f=null!=q&&null!=q.inserted?q.inserted[""]:null,k=null;null!=f&&(k=this.getCellForJson(f));if(null==k){var p=null!=q&&null!=q.moved?q.moved[""]:null;null!=p&&(k=e.getCell(p))}null!=k&&(e.setRoot(k),
-a.root=k);this.patchCellRecursive(a,e,e.root,g,c);if(null!=c[EditorUi.DIFF_REMOVE])for(var t=0;t<c[EditorUi.DIFF_REMOVE].length;t++){var u=e.getCell(c[EditorUi.DIFF_REMOVE][t]);null!=u&&e.remove(u)}if(null!=c[EditorUi.DIFF_UPDATE]){var y=null!=b&&null!=b.cells?b.cells[EditorUi.DIFF_UPDATE]:null;for(p in c[EditorUi.DIFF_UPDATE])this.patchCell(e,e.getCell(p),c[EditorUi.DIFF_UPDATE][p],null!=y?y[p]:null)}if(null!=c[EditorUi.DIFF_INSERT])for(t=0;t<c[EditorUi.DIFF_INSERT].length;t++)f=c[EditorUi.DIFF_INSERT][t],
-u=e.getCell(f.id),null!=u&&(e.setTerminal(u,e.getCell(f.source),!0),e.setTerminal(u,e.getCell(f.target),!1));e.updateEdgeParent=l;if(d&&0<n.length)for(t=0;t<n.length;t++)e.contains(n[t])&&e.updateEdgeParent(n[t])}finally{e.endUpdate()}};
-EditorUi.prototype.patchCellRecursive=function(a,c,b,d,e){if(null!=b){for(var g=d[b.getId()],l=null!=g&&null!=g.inserted?g.inserted:{},g=null!=g&&null!=g.moved?g.moved:{},m=0,n=c.getChildCount(b),q="",f=0;f<n;f++){var k=c.getChildAt(b,f).getId();null==g[q]&&(null==e[EditorUi.DIFF_UPDATE]||null==e[EditorUi.DIFF_UPDATE][k]||null==e[EditorUi.DIFF_UPDATE][k].previous&&null==e[EditorUi.DIFF_UPDATE][k].parent)&&(g[q]=k);q=k}n=mxUtils.bind(this,function(f,g){var k=null!=f?f.getId():"";if(null!=f&&g){var l=
-c.getCell(k);null!=l&&l!=f&&(f=null)}null!=f&&(c.getChildAt(b,m)!=f&&c.add(b,f,m),this.patchCellRecursive(a,c,f,d,e),m++);return k});for(q=[null];0<q.length;)if(f=q.shift(),f=n(null!=f?f.child:null,null!=f?f.insert:!1),k=g[f],null!=k&&(delete g[f],q.push({child:c.getCell(k)})),k=l[f],null!=k&&(delete l[f],q.push({child:this.getCellForJson(k),insert:!0})),0==q.length){for(f in g)q.push({child:c.getCell(g[f])}),delete g[f];for(f in l)q.push({child:this.getCellForJson(l[f]),insert:!0}),delete l[f]}}};
+EditorUi.prototype.createParentLookup=function(a,c){function b(a){var b=d[a];null==b&&(b={inserted:[],moved:{}},d[a]=b);return b}var d={};if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++){var e=c[EditorUi.DIFF_INSERT][g],l=null!=e.parent?e.parent:"",m=null!=e.previous?e.previous:"";b(l).inserted[m]=e}if(null!=c[EditorUi.DIFF_UPDATE])for(var n in c[EditorUi.DIFF_UPDATE])e=c[EditorUi.DIFF_UPDATE][n],null!=e.previous&&(l=e.parent,null==l&&(g=a.getCell(n),null!=g&&(g=
+a.getParent(g),null!=g&&(l=g.getId()))),null!=l&&(b(l).moved[e.previous]=n));return d};
+EditorUi.prototype.patchPage=function(a,c,b,d){var g=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),e=this.createParentLookup(g,c);g.beginUpdate();try{var l=g.updateEdgeParent,m=new mxDictionary,n=[];g.updateEdgeParent=function(a,b){!m.get(a)&&d&&(m.put(a,!0),n.push(a))};var q=e[""],f=null!=q&&null!=q.inserted?q.inserted[""]:null,k=null;null!=f&&(k=this.getCellForJson(f));if(null==k){var p=null!=q&&null!=q.moved?q.moved[""]:null;null!=p&&(k=g.getCell(p))}null!=k&&(g.setRoot(k),
+a.root=k);this.patchCellRecursive(a,g,g.root,e,c);if(null!=c[EditorUi.DIFF_REMOVE])for(var t=0;t<c[EditorUi.DIFF_REMOVE].length;t++){var u=g.getCell(c[EditorUi.DIFF_REMOVE][t]);null!=u&&g.remove(u)}if(null!=c[EditorUi.DIFF_UPDATE]){var y=null!=b&&null!=b.cells?b.cells[EditorUi.DIFF_UPDATE]:null;for(p in c[EditorUi.DIFF_UPDATE])this.patchCell(g,g.getCell(p),c[EditorUi.DIFF_UPDATE][p],null!=y?y[p]:null)}if(null!=c[EditorUi.DIFF_INSERT])for(t=0;t<c[EditorUi.DIFF_INSERT].length;t++)f=c[EditorUi.DIFF_INSERT][t],
+u=g.getCell(f.id),null!=u&&(g.setTerminal(u,g.getCell(f.source),!0),g.setTerminal(u,g.getCell(f.target),!1));g.updateEdgeParent=l;if(d&&0<n.length)for(t=0;t<n.length;t++)g.contains(n[t])&&g.updateEdgeParent(n[t])}finally{g.endUpdate()}};
+EditorUi.prototype.patchCellRecursive=function(a,c,b,d,g){if(null!=b){for(var e=d[b.getId()],l=null!=e&&null!=e.inserted?e.inserted:{},e=null!=e&&null!=e.moved?e.moved:{},m=0,n=c.getChildCount(b),q="",f=0;f<n;f++){var k=c.getChildAt(b,f).getId();null==e[q]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][k]||null==g[EditorUi.DIFF_UPDATE][k].previous&&null==g[EditorUi.DIFF_UPDATE][k].parent)&&(e[q]=k);q=k}n=mxUtils.bind(this,function(e,f){var k=null!=e?e.getId():"";if(null!=e&&f){var l=
+c.getCell(k);null!=l&&l!=e&&(e=null)}null!=e&&(c.getChildAt(b,m)!=e&&c.add(b,e,m),this.patchCellRecursive(a,c,e,d,g),m++);return k});for(q=[null];0<q.length;)if(f=q.shift(),f=n(null!=f?f.child:null,null!=f?f.insert:!1),k=e[f],null!=k&&(delete e[f],q.push({child:c.getCell(k)})),k=l[f],null!=k&&(delete l[f],q.push({child:this.getCellForJson(k),insert:!0})),0==q.length){for(f in e)q.push({child:c.getCell(e[f])}),delete e[f];for(f in l)q.push({child:this.getCellForJson(l[f]),insert:!0}),delete l[f]}}};
 EditorUi.prototype.patchCell=function(a,c,b,d){if(null!=c&&null!=b){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in b?a.setValue(c,b.value):null!=b.xmlValue&&a.setValue(c,mxUtils.parseXml(b.xmlValue).documentElement);null!=d&&null!=d.style||null==b.style||a.setStyle(c,b.style);null!=b.visible&&a.setVisible(c,1==b.visible);null!=b.collapsed&&a.setCollapsed(c,1==b.collapsed);null!=b.vertex&&(c.vertex=1==b.vertex);null!=b.edge&&(c.edge=1==b.edge);null!=b.connectable&&(c.connectable=
-1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var e in b)this.cellProperties[e]||(c[e]=b[e])}};
-EditorUi.prototype.getPagesForNode=function(a,c){var b=this.editor.extractGraphModel(a,!0);null!=b&&(a=b);var b=a.getElementsByTagName(c||"diagram"),d=[];if(0<b.length)for(var e=0;e<b.length;e++){var g=new DiagramPage(b[e]);this.updatePageRoot(g);d.push(g)}else"mxGraphModel"==a.nodeName&&(g=new DiagramPage(a.ownerDocument.createElement("diagram")),g.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(g.node,Graph.compressNode(a)),d.push(g));return d};
-EditorUi.prototype.diffPages=function(a,c){for(var b=[],d=[],e={},g={},l={},m=null,n=0;n<c.length;n++)g[c[n].getId()]={page:c[n],prev:m},m=c[n];m=null;for(n=0;n<a.length;n++){var q=a[n].getId(),f=g[q];if(null==f)d.push(q);else{var k=this.diffPage(a[n],f.page),p={};0<Object.keys(k).length&&(p.cells=k);k=this.diffViewState(a[n],f.page);0<Object.keys(k).length&&(p.view=k);if((null!=f.prev?null==m:null!=m)||null!=m&&null!=f.prev&&m.getId()!=f.prev.getId())p.previous=null!=f.prev?f.prev.getId():"";null!=
-f.page.getName()&&a[n].getName()!=f.page.getName()&&(p.name=f.page.getName());0<Object.keys(p).length&&(l[q]=p)}delete g[a[n].getId()];m=a[n]}for(q in g)f=g[q],b.push({data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});0<Object.keys(l).length&&(e[EditorUi.DIFF_UPDATE]=l);0<d.length&&(e[EditorUi.DIFF_REMOVE]=d);0<b.length&&(e[EditorUi.DIFF_INSERT]=b);return e};
-EditorUi.prototype.createCellLookup=function(a,c,b){b=null!=b?b:{};b[a.getId()]={cell:a,prev:c};var d=a.getChildCount();c=null;for(var e=0;e<d;e++){var g=a.getChildAt(e);this.createCellLookup(g,c,b);c=g}return b};
-EditorUi.prototype.diffCellRecursive=function(a,c,b,d,e){d=null!=d?d:{};var g=b[a.getId()];delete b[a.getId()];if(null==g)e.push(a.getId());else{var l=this.diffCell(a,g.cell);if(null!=l.parent||(null!=g.prev?null==c:null!=c)||null!=c&&null!=g.prev&&c.getId()!=g.prev.getId())l.previous=null!=g.prev?g.prev.getId():"";0<Object.keys(l).length&&(d[a.getId()]=l)}g=a.getChildCount();c=null;for(l=0;l<g;l++){var m=a.getChildAt(l);this.diffCellRecursive(m,c,b,d,e);c=m}return d};
-EditorUi.prototype.diffPage=function(a,c){var b=[],d=[],e={};this.updatePageRoot(a);this.updatePageRoot(c);var g=this.createCellLookup(c.root),l=this.diffCellRecursive(a.root,null,g,l,d),m;for(m in g){var n=g[m];b.push(this.getJsonForCell(n.cell,n.prev))}0<Object.keys(l).length&&(e[EditorUi.DIFF_UPDATE]=l);0<d.length&&(e[EditorUi.DIFF_REMOVE]=d);0<b.length&&(e[EditorUi.DIFF_INSERT]=b);return e};
-EditorUi.prototype.diffViewState=function(a,c){var b=a.viewState,d=c.viewState,e={};c==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=b&&null!=d)for(var g in this.viewStateProperties){var l=JSON.stringify(b[g]),m=JSON.stringify(d[g]);l!=m&&(e[g]=m)}return e};
+1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var g in b)this.cellProperties[g]||(c[g]=b[g])}};
+EditorUi.prototype.getPagesForNode=function(a,c){var b=this.editor.extractGraphModel(a,!0);null!=b&&(a=b);var b=a.getElementsByTagName(c||"diagram"),d=[];if(0<b.length)for(var g=0;g<b.length;g++){var e=new DiagramPage(b[g]);this.updatePageRoot(e);d.push(e)}else"mxGraphModel"==a.nodeName&&(e=new DiagramPage(a.ownerDocument.createElement("diagram")),e.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(e.node,Graph.compressNode(a)),d.push(e));return d};
+EditorUi.prototype.diffPages=function(a,c){for(var b=[],d=[],g={},e={},l={},m=null,n=0;n<c.length;n++)e[c[n].getId()]={page:c[n],prev:m},m=c[n];m=null;for(n=0;n<a.length;n++){var q=a[n].getId(),f=e[q];if(null==f)d.push(q);else{var k=this.diffPage(a[n],f.page),p={};0<Object.keys(k).length&&(p.cells=k);k=this.diffViewState(a[n],f.page);0<Object.keys(k).length&&(p.view=k);if((null!=f.prev?null==m:null!=m)||null!=m&&null!=f.prev&&m.getId()!=f.prev.getId())p.previous=null!=f.prev?f.prev.getId():"";null!=
+f.page.getName()&&a[n].getName()!=f.page.getName()&&(p.name=f.page.getName());0<Object.keys(p).length&&(l[q]=p)}delete e[a[n].getId()];m=a[n]}for(q in e)f=e[q],b.push({data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});0<Object.keys(l).length&&(g[EditorUi.DIFF_UPDATE]=l);0<d.length&&(g[EditorUi.DIFF_REMOVE]=d);0<b.length&&(g[EditorUi.DIFF_INSERT]=b);return g};
+EditorUi.prototype.createCellLookup=function(a,c,b){b=null!=b?b:{};b[a.getId()]={cell:a,prev:c};var d=a.getChildCount();c=null;for(var g=0;g<d;g++){var e=a.getChildAt(g);this.createCellLookup(e,c,b);c=e}return b};
+EditorUi.prototype.diffCellRecursive=function(a,c,b,d,g){d=null!=d?d:{};var e=b[a.getId()];delete b[a.getId()];if(null==e)g.push(a.getId());else{var l=this.diffCell(a,e.cell);if(null!=l.parent||(null!=e.prev?null==c:null!=c)||null!=c&&null!=e.prev&&c.getId()!=e.prev.getId())l.previous=null!=e.prev?e.prev.getId():"";0<Object.keys(l).length&&(d[a.getId()]=l)}e=a.getChildCount();c=null;for(l=0;l<e;l++){var m=a.getChildAt(l);this.diffCellRecursive(m,c,b,d,g);c=m}return d};
+EditorUi.prototype.diffPage=function(a,c){var b=[],d=[],g={};this.updatePageRoot(a);this.updatePageRoot(c);var e=this.createCellLookup(c.root),l=this.diffCellRecursive(a.root,null,e,l,d),m;for(m in e){var n=e[m];b.push(this.getJsonForCell(n.cell,n.prev))}0<Object.keys(l).length&&(g[EditorUi.DIFF_UPDATE]=l);0<d.length&&(g[EditorUi.DIFF_REMOVE]=d);0<b.length&&(g[EditorUi.DIFF_INSERT]=b);return g};
+EditorUi.prototype.diffViewState=function(a,c){var b=a.viewState,d=c.viewState,g={};c==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=b&&null!=d)for(var e in this.viewStateProperties){var l=JSON.stringify(b[e]),m=JSON.stringify(d[e]);l!=m&&(g[e]=m)}return g};
 EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,b=a.value;null!=a.xmlValue&&(b=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(b,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var d in a)this.cellProperties[d]||(c[d]=a[d]);return c};
 EditorUi.prototype.getJsonForCell=function(a,c){var b={id:a.getId()};a.vertex&&(b.vertex=1);a.edge&&(b.edge=1);a.connectable||(b.connectable=0);null!=a.parent&&(b.parent=a.parent.getId());null!=c&&(b.previous=c.getId());null!=a.source&&(b.source=a.source.getId());null!=a.target&&(b.target=a.target.getId());null!=a.style&&(b.style=a.style);null!=a.geometry&&(b.geometry=mxUtils.getXml(this.codec.encode(a.geometry)));a.collapsed&&(b.collapsed=1);a.visible||(b.visible=0);null!=a.value&&("object"===typeof a.value&&
 "number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?b.xmlValue=mxUtils.getXml(a.value):b.value=a.value);for(var d in a)this.cellProperties[d]||"function"===typeof a[d]||(b[d]=a[d]);return b};
 EditorUi.prototype.diffCell=function(a,c){function b(a){return null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute}var d={};a.vertex!=c.vertex&&(d.vertex=c.vertex?1:0);a.edge!=c.edge&&(d.edge=c.edge?1:0);a.connectable!=c.connectable&&(d.connectable=c.connectable?1:0);if((null!=a.parent?null==c.parent:null!=c.parent)||null!=a.parent&&null!=c.parent&&a.parent.getId()!=c.parent.getId())d.parent=null!=c.parent?c.parent.getId():"";
 if((null!=a.source?null==c.source:null!=c.source)||null!=a.source&&null!=c.source&&a.source.getId()!=c.source.getId())d.source=null!=c.source?c.source.getId():"";if((null!=a.target?null==c.target:null!=c.target)||null!=a.target&&null!=c.target&&a.target.getId()!=c.target.getId())d.target=null!=c.target?c.target.getId():"";b(a.value)&&b(c.value)?a.value.isEqualNode(c.value)||(d.xmlValue=mxUtils.getXml(c.value)):a.value!=c.value&&(b(c.value)?d.xmlValue=mxUtils.getXml(c.value):d.value=null!=c.value?
-c.value:null);a.style!=c.style&&(d.style=c.style);a.visible!=c.visible&&(d.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(d.collapsed=c.collapsed?1:0);if(!this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)){var e=this.codec.encode(c.geometry);null!=e&&(d.geometry=mxUtils.getXml(e))}for(var g in a)this.cellProperties[g]||"function"===typeof a[g]||"function"===typeof c[g]||a[g]==c[g]||(d[g]=void 0===c[g]?null:c[g]);for(g in c)g in a||this.cellProperties[g]||"function"===typeof a[g]||"function"===
-typeof c[g]||a[g]==c[g]||(d[g]=void 0===c[g]?null:c[g]);return d};EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var d=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,d)==JSON.stringify(c,d)};var mxSettings={currentVersion:17,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.value:null);a.style!=c.style&&(d.style=c.style);a.visible!=c.visible&&(d.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(d.collapsed=c.collapsed?1:0);if(!this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)){var g=this.codec.encode(c.geometry);null!=g&&(d.geometry=mxUtils.getXml(g))}for(var e in a)this.cellProperties[e]||"function"===typeof a[e]||"function"===typeof c[e]||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);for(e in c)e in a||this.cellProperties[e]||"function"===typeof a[e]||"function"===
+typeof c[e]||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);return d};EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var d=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,d)==JSON.stringify(c,d)};var mxSettings={currentVersion:17,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},isCreateTarget:function(){return mxSettings.settings.createTarget},setCreateTarget:function(a){mxSettings.settings.createTarget=a},getPageFormat:function(){return mxSettings.settings.pageFormat},setPageFormat:function(a){mxSettings.settings.pageFormat=
@@ -8597,64 +8597,64 @@ DrawioFileSync.prototype.isValidState=function(){return this.ui.getCurrentFile()
 DrawioFileSync.prototype.fileChangedNotify=function(){if(this.isValidState())if(this.file.savingFile)this.remoteFileChanged=!0;else var a=this.fileChanged(mxUtils.bind(this,function(a){this.updateStatus()}),mxUtils.bind(this,function(a){this.file.handleFileError(a)}),mxUtils.bind(this,function(){return!this.file.savingFile&&this.notifyThread!=a}))};
 DrawioFileSync.prototype.fileChanged=function(a,c,b){var d=window.setTimeout(mxUtils.bind(this,function(){null!=b&&b()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(d){null!=b&&b()||(this.isValidState()?this.catchup(d,a,c,b):null!=c&&c())}),c):null!=c&&c())}),0);return this.notifyThread=d};
 DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorEtag(a,this.file.getCurrentEtag()),this.updateDescriptor(a),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(a){this.file.inConflictState=!0;this.file.handleFileError(a)}))};DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
-DrawioFileSync.prototype.catchup=function(a,c,b,d){if(null==d||!d()){var e=this.file.getDescriptorSecret(a),g=this.file.getDescriptorEtag(a),l=this.file.getCurrentEtag();if(l==g)null!=c&&c();else if(this.isValidState()){var m=0,n=!1,q=mxUtils.bind(this,function(){if(null==d||!d())if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=!1;this.reload(c,b,d)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+
-"&from="+encodeURIComponent(l)+"&to="+encodeURIComponent(g)+(null!=e?"&secret="+encodeURIComponent(e):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var g=null,p=[];if(200<=e.getStatus()&&299>=e.getStatus()&&0<e.getText().length)try{var y=JSON.parse(e.getText());if(null!=y&&0<y.length)for(var z=0;z<y.length;z++){var v=this.stringToObject(y[z]);
+DrawioFileSync.prototype.catchup=function(a,c,b,d){if(null==d||!d()){var g=this.file.getDescriptorSecret(a),e=this.file.getDescriptorEtag(a),l=this.file.getCurrentEtag();if(l==e)null!=c&&c();else if(this.isValidState()){var m=0,n=!1,q=mxUtils.bind(this,function(){if(null==d||!d())if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=!1;this.reload(c,b,d)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+
+"&from="+encodeURIComponent(l)+"&to="+encodeURIComponent(e)+(null!=g?"&secret="+encodeURIComponent(g):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var g=null,p=[];if(200<=e.getStatus()&&299>=e.getStatus()&&0<e.getText().length)try{var y=JSON.parse(e.getText());if(null!=y&&0<y.length)for(var z=0;z<y.length;z++){var v=this.stringToObject(y[z]);
 if(v.v>DrawioFileSync.PROTOCOL){n=!0;p=[];break}else if(v.v===DrawioFileSync.PROTOCOL&&null!=v.d)g=v.d.checksum,p.push(v.d.patch);else{n=!0;p=[];break}}}catch(x){p=[],null!=window.console&&"1"==urlParams.test&&console.log(x)}try{0<p.length?(this.file.stats.cacheHits++,this.merge(p,g,a,c,b,d)):m<=this.maxCacheReadyRetries&&!n&&401!=e.getStatus()?(m++,this.file.stats.cacheMiss++,window.setTimeout(q,(m+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,b,d))}catch(x){null!=b&&b(x)}}else null!=
 b&&b()}))}else null!=b&&b()});window.setTimeout(q,this.cacheReadyDelay)}else null!=b&&b()}};DrawioFileSync.prototype.reload=function(a,c,b,d){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),b,d)};
-DrawioFileSync.prototype.merge=function(a,c,b,d,e,g){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var l=this.file.ignorePatches(a),m=this.file.getDescriptorEtag(b);if(!l){for(g=0;g<a.length;g++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
-a[g]);var n=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentEtag(),"to",m,"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==n,c);if(null!=c&&c!=n){var q=this.ui.hashValue(this.file.getCurrentEtag()),f=this.ui.hashValue(m);this.file.checksumError(e,a,"From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nCurrent: "+n,m,"merge");return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?
-this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.backupPatch=null;null!=d&&d()}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=e&&e(t);try{if(this.file.errorReportsEnabled)q=this.ui.hashValue(this.file.getCurrentEtag()),f=this.ui.hashValue(m),this.file.sendErrorReport("Error in merge","From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,
+DrawioFileSync.prototype.merge=function(a,c,b,d,g,e){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var l=this.file.ignorePatches(a),m=this.file.getDescriptorEtag(b);if(!l){for(e=0;e<a.length;e++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
+a[e]);var n=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentEtag(),"to",m,"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==n,c);if(null!=c&&c!=n){var q=this.ui.hashValue(this.file.getCurrentEtag()),f=this.ui.hashValue(m);this.file.checksumError(g,a,"From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nCurrent: "+n,m,"merge");return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?
+this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.backupPatch=null;null!=d&&d()}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=g&&g(t);try{if(this.file.errorReportsEnabled)q=this.ui.hashValue(this.file.getCurrentEtag()),f=this.ui.hashValue(m),this.file.sendErrorReport("Error in merge","From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,
 null,2)),t);else{var k=this.file.getCurrentUser(),p=null!=k?k.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),p,t)}}catch(u){}}};
 DrawioFileSync.prototype.descriptorChanged=function(a){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var c=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),b=this.file.getCurrentEtag(),d=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(a)+"&to="+encodeURIComponent(b)+"&msg="+encodeURIComponent(c)+"&data="+encodeURIComponent(d));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++}this.updateStatus()};
 DrawioFileSync.prototype.objectToString=function(a){a=Graph.compress(JSON.stringify(a));null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.encrypt(a,this.key).toString());return a};DrawioFileSync.prototype.stringToObject=function(a){null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.decrypt(a,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(a))};
-DrawioFileSync.prototype.fileSaved=function(a,c,b,d){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var e=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);d=this.ui.getHashValueForPages(a);e=this.ui.diffPages(e,a);c=this.file.getDescriptorEtag(c);
-var g=this.file.getCurrentEtag(),l=this.objectToString(this.createMessage({patch:e,checksum:d})),m=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),n=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=l.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(c)+"&to="+encodeURIComponent(g)+"&msg="+encodeURIComponent(m)+(null!=n?"&secret="+encodeURIComponent(n):"")+(l.length<this.maxCacheEntrySize?
-"&data="+encodeURIComponent(l):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",c,"to",g,l.length,"bytes","diff",e,"checksum",d)}this.file.shadowPages=a;null!=b&&b()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a};
+DrawioFileSync.prototype.fileSaved=function(a,c,b,d){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var g=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);d=this.ui.getHashValueForPages(a);g=this.ui.diffPages(g,a);c=this.file.getDescriptorEtag(c);
+var e=this.file.getCurrentEtag(),l=this.objectToString(this.createMessage({patch:g,checksum:d})),m=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),n=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=l.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(c)+"&to="+encodeURIComponent(e)+"&msg="+encodeURIComponent(m)+(null!=n?"&secret="+encodeURIComponent(n):"")+(l.length<this.maxCacheEntrySize?
+"&data="+encodeURIComponent(l):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",c,"to",e,l.length,"bytes","diff",g,"checksum",d)}this.file.shadowPages=a;null!=b&&b()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a};
 DrawioFileSync.prototype.createMessage=function(a){return{v:DrawioFileSync.PROTOCOL,d:a,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(a,c,b){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,c,b):this.fileChanged(c,b)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=b&&b({message:mxResources.get("timeout")}))};
 DrawioFileSync.prototype.stop=function(){null!=this.pusher&&(EditorUi.debug("Sync.stop",[this]),null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null);this.updateOnlineState();this.updateStatus()};
 DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var a=this.file.getCurrentUser(),c={a:"leave"};null!=a&&(c.name=a.displayName,c.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(c))));this.file.stats.msgSent++}this.stop();null!=this.updateStatusThread&&(window.clearInterval(this.updateStatusThread),this.updateStatusThread=null);null!=this.onlineListener&&(mxEvent.removeListener(window,"online",this.onlineListener),
 this.onlineListener=null);null!=this.visibleListener&&(mxEvent.removeListener(document,"visibilitychange",this.visibleListener),this.visibleListener=null);null!=this.activityListener&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener),mxEvent.removeListener(document,"keypress",this.activityListener),mxEvent.removeListener(window,"focus",this.activityListener),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.removeListener(document,"touchstart",this.activityListener),
 mxEvent.removeListener(document,"touchmove",this.activityListener)),this.activityListener=null);null!=this.collaboratorsElement&&(this.collaboratorsElement.parentNode.removeChild(this.collaboratorsElement),this.collaboratorsElement=null)};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#ffffff"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#ffffff"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="#ffffff"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="#ffffff"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="white"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="#ffffff"/></add></mxStylesheet>').documentElement;
 Graph.prototype.defaultThemes.darkTheme=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#2a2a2a"/><add as="strokeColor" value="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="#2a2a2a"/></add></mxStylesheet>').documentElement;function mxAsyncCanvas(a){mxAbstractCanvas2D.call(this);this.htmlCanvas=a;a.images=a.images||[];a.subCanvas=a.subCanvas||[]}mxUtils.extend(mxAsyncCanvas,mxAbstractCanvas2D);mxAsyncCanvas.prototype.htmlCanvas=null;mxAsyncCanvas.prototype.canvasIndex=0;mxAsyncCanvas.prototype.waitCounter=0;mxAsyncCanvas.prototype.onComplete=null;mxAsyncCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
-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,c,b,d,e){};
+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,c,b,d,g){};
 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,c,b,d){};mxAsyncCanvas.prototype.roundrect=function(a,c,b,d,e,g){};mxAsyncCanvas.prototype.ellipse=function(a,c,b,d){};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,c,b,d,e,g,l,m){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,c,b,d,e,g,l,m,n,q,f,k){if(null!=e&&0!=e.length&&(a=this.state.scale,"html"==n&&"function"===typeof html2canvas)){this.incWaitCounter();var p=this.canvasIndex++;html2canvas(e,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[p]=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,b,d,e){return b+b+d+d+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++};
+mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,c,b,d){};mxAsyncCanvas.prototype.roundrect=function(a,c,b,d,g,e){};mxAsyncCanvas.prototype.ellipse=function(a,c,b,d){};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,c,b,d,g,e,l,m){g=this.rewriteImageSource(g);a=this.htmlCanvas.images[g];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[g]=a,a.src=g)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
+mxAsyncCanvas.prototype.text=function(a,c,b,d,g,e,l,m,n,q,f,k){if(null!=g&&0!=g.length&&(a=this.state.scale,"html"==n&&"function"===typeof html2canvas)){this.incWaitCounter();var p=this.canvasIndex++;html2canvas(g,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[p]=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,b,d,g){return b+b+d+d+g+g});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,c){this.state.dx+=a;this.state.dy+=c;this.ctx.translate(a,c)};
-mxJsCanvas.prototype.rotate=function(a,c,b,d,e){d-=this.state.dx;e-=this.state.dy;this.ctx.translate(d,e);(c||b)&&this.ctx.scale(c?-1:1,b?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-d,-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,c,b,d,e,g,l,m,n){b=this.ctx.createLinearGradient(0,d,0,d+g);d=this.state;d.fillColor=a;d.fillAlpha=null!=m?m:1;d.gradientColor=c;d.gradientAlpha=null!=n?n:1;d.gradientDirection=l;a=this.hexToRgb(a);c=this.hexToRgb(c);null!=a&&b.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+d.fillAlpha+")");null!=c&&b.addColorStop(1,"rgba("+c.r+","+c.g+","+c.b+","+d.gradientAlpha+")");this.ctx.fillStyle=b};
+mxJsCanvas.prototype.rotate=function(a,c,b,d,g){d-=this.state.dx;g-=this.state.dy;this.ctx.translate(d,g);(c||b)&&this.ctx.scale(c?-1:1,b?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-d,-g)};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,c,b,d,g,e,l,m,n){b=this.ctx.createLinearGradient(0,d,0,d+e);d=this.state;d.fillColor=a;d.fillAlpha=null!=m?m:1;d.gradientColor=c;d.gradientAlpha=null!=n?n:1;d.gradientDirection=l;a=this.hexToRgb(a);c=this.hexToRgb(c);null!=a&&b.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+d.fillAlpha+")");null!=c&&b.addColorStop(1,"rgba("+c.r+","+c.g+","+c.b+","+d.gradientAlpha+")");this.ctx.fillStyle=b};
 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 c=0;c<a.length;c++)a[c]=parseInt(a[c],10);this.setLineDash(a)}else this.setLineDash([0])};
 mxJsCanvas.prototype.setLineDash=function(a){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(a)}catch(c){}};mxJsCanvas.prototype.setDashPattern=function(a){this.state.dashPattern=a;if(this.state.dashed){a=a.split(" ");for(var c=0;c<a.length;c++)a[c]=parseInt(a[c],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 c=null!=this.state.shadowAlpha?this.state.shadowAlpha:1;a=this.hexToRgb(a);this.ctx.shadowColor="rgba("+a.r+","+a.g+","+a.b+","+c+")"}};mxJsCanvas.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a;this.setShadowColor(this.state.shadowColor)};
 mxJsCanvas.prototype.setShadowOffset=function(a,c){this.state.shadowDx=a;this.state.shadowDy=c;this.state.shadow&&(this.ctx.shadowOffsetX=a,this.ctx.shadowOffsetY=c)};mxJsCanvas.prototype.moveTo=function(a,c){this.ctx.moveTo(a,c);this.lastMoveX=a;this.lastMoveY=c};mxJsCanvas.prototype.lineTo=function(a,c){this.ctx.lineTo(a,c);this.lastMoveX=a;this.lastMoveY=c};mxJsCanvas.prototype.quadTo=function(a,c,b,d){this.ctx.quadraticCurveTo(a,c,b,d);this.lastMoveX=b;this.lastMoveY=d};
-mxJsCanvas.prototype.arcTo=function(a,c,b,d,e,g,l){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,c,b,d,e,g,l);if(null!=a)for(c=0;c<a.length;c+=6)this.curveTo(a[c],a[c+1],a[c+2],a[c+3],a[c+4],a[c+5])};mxJsCanvas.prototype.curveTo=function(a,c,b,d,e,g){this.ctx.bezierCurveTo(a,c,b,d,e,g);this.lastMoveX=e;this.lastMoveY=g};mxJsCanvas.prototype.rect=function(a,c,b,d){this.begin();this.moveTo(a,c);this.lineTo(a+b,c);this.lineTo(a+b,c+d);this.lineTo(a,c+d);this.close()};
-mxJsCanvas.prototype.roundrect=function(a,c,b,d,e,g){this.begin();this.moveTo(a+e,c);this.lineTo(a+b-e,c);this.quadTo(a+b,c,a+b,c+g);this.lineTo(a+b,c+d-g);this.quadTo(a+b,c+d,a+b-e,c+d);this.lineTo(a+e,c+d);this.quadTo(a,c+d,a,c+d-g);this.lineTo(a,c+g);this.quadTo(a,c,a+e,c)};mxJsCanvas.prototype.ellipse=function(a,c,b,d){this.ctx.save();this.ctx.translate(a+b/2,c+d/2);this.ctx.scale(b/2,d/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};
+mxJsCanvas.prototype.arcTo=function(a,c,b,d,g,e,l){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,c,b,d,g,e,l);if(null!=a)for(c=0;c<a.length;c+=6)this.curveTo(a[c],a[c+1],a[c+2],a[c+3],a[c+4],a[c+5])};mxJsCanvas.prototype.curveTo=function(a,c,b,d,g,e){this.ctx.bezierCurveTo(a,c,b,d,g,e);this.lastMoveX=g;this.lastMoveY=e};mxJsCanvas.prototype.rect=function(a,c,b,d){this.begin();this.moveTo(a,c);this.lineTo(a+b,c);this.lineTo(a+b,c+d);this.lineTo(a,c+d);this.close()};
+mxJsCanvas.prototype.roundrect=function(a,c,b,d,g,e){this.begin();this.moveTo(a+g,c);this.lineTo(a+b-g,c);this.quadTo(a+b,c,a+b,c+e);this.lineTo(a+b,c+d-e);this.quadTo(a+b,c+d,a+b-g,c+d);this.lineTo(a+g,c+d);this.quadTo(a,c+d,a,c+d-e);this.lineTo(a,c+e);this.quadTo(a,c,a+g,c)};mxJsCanvas.prototype.ellipse=function(a,c,b,d){this.ctx.save();this.ctx.translate(a+b/2,c+d/2);this.ctx.scale(b/2,d/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,c,b,d,e,g,l,m){e=this.rewriteImageSource(e);e=this.images[e];if(null!=e&&0<e.height&&0<e.width){var n=this.ctx;n.save();if(g){g=e.width;var q=e.height,f=Math.min(b/g,d/q);a+=(b-g*f)/2;c+=(d-q*f)/2;b=g*f;d=q*f}l&&(n.translate(2*a+b,0),n.scale(-1,1));m&&(n.translate(0,2*c+d),n.scale(1,-1));n.drawImage(e,a,c,b,d);n.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
+mxJsCanvas.prototype.image=function(a,c,b,d,g,e,l,m){g=this.rewriteImageSource(g);g=this.images[g];if(null!=g&&0<g.height&&0<g.width){var n=this.ctx;n.save();if(e){e=g.width;var q=g.height,f=Math.min(b/e,d/q);a+=(b-e*f)/2;c+=(d-q*f)/2;b=e*f;d=q*f}l&&(n.translate(2*a+b,0),n.scale(-1,1));m&&(n.translate(0,2*c+d),n.scale(1,-1));n.drawImage(g,a,c,b,d);n.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,c=this.ctx.shadowOffsetX,b=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=c;this.ctx.shadowOffsetY=b}else this.ctx.fill(),this.ctx.stroke()};
-mxJsCanvas.prototype.text=function(a,c,b,d,e,g,l,m,n,q,f,k){if(null!=e&&0!=e.length){b=this.state.scale;0!=k&&(this.ctx.translate(Math.round(a),Math.round(c)),this.ctx.rotate(k*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-c)));if("html"==n){e=this.subCanvas[this.canvasIndex++];n=e.height;k=e.width;switch(l){case mxConstants.ALIGN_MIDDLE:c-=n/2/b;break;case mxConstants.ALIGN_BOTTOM:c-=n/b}switch(g){case mxConstants.ALIGN_CENTER:a-=k/2/b;break;case mxConstants.ALIGN_RIGHT:a-=k/b}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(c)-.5,Math.round(e.width/b),Math.round(e.height/b))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(e.width/b),Math.round(e.height/b)));this.ctx.scale(1/b,1/b);this.ctx.drawImage(e,
-Math.round(a*b),Math.round(c*b))}else{this.ctx.save();this.updateFont();k=document.createElement("div");k.innerHTML=e;k.style.position="absolute";k.style.top="-9999px";k.style.left="-9999px";k.style.fontFamily=this.state.fontFamily;k.style.fontWeight="bold";k.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(k);n=[k.offsetWidth,k.offsetHeight];document.body.removeChild(k);e=e.split("\n");k=n[1];this.ctx.textBaseline="top";n=c;switch(l){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
-"middle";c-=(e.length-1)*k/2;n=c-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",c-=k*(e.length-1),n=c-this.state.fontSize}l=[];k=[];for(b=0;b<e.length;b++)k[b]=a,l[b]=this.ctx.measureText(e[b]).width,null!=g&&g!=mxConstants.ALIGN_LEFT&&(k[b]-=l[b],g==mxConstants.ALIGN_CENTER&&(k[b]+=l[b]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=k[0];g=l[0];for(b=1;b<e.length;b++)a=Math.min(a,k[b]),g=Math.max(g,l[b]);this.ctx.save();
-a=Math.round(a)-.5;n=Math.round(n)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,n,g,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,n,g,this.state.fontSize*mxConstants.LINE_HEIGHT*e.length));this.ctx.restore()}for(b=0;b<e.length;b++)this.ctx.fillText(e[b],k[b],c),c+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};
+mxJsCanvas.prototype.text=function(a,c,b,d,g,e,l,m,n,q,f,k){if(null!=g&&0!=g.length){b=this.state.scale;0!=k&&(this.ctx.translate(Math.round(a),Math.round(c)),this.ctx.rotate(k*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-c)));if("html"==n){g=this.subCanvas[this.canvasIndex++];n=g.height;k=g.width;switch(l){case mxConstants.ALIGN_MIDDLE:c-=n/2/b;break;case mxConstants.ALIGN_BOTTOM:c-=n/b}switch(e){case mxConstants.ALIGN_CENTER:a-=k/2/b;break;case mxConstants.ALIGN_RIGHT:a-=k/b}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(c)-.5,Math.round(g.width/b),Math.round(g.height/b))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(g.width/b),Math.round(g.height/b)));this.ctx.scale(1/b,1/b);this.ctx.drawImage(g,
+Math.round(a*b),Math.round(c*b))}else{this.ctx.save();this.updateFont();k=document.createElement("div");k.innerHTML=g;k.style.position="absolute";k.style.top="-9999px";k.style.left="-9999px";k.style.fontFamily=this.state.fontFamily;k.style.fontWeight="bold";k.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(k);n=[k.offsetWidth,k.offsetHeight];document.body.removeChild(k);g=g.split("\n");k=n[1];this.ctx.textBaseline="top";n=c;switch(l){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
+"middle";c-=(g.length-1)*k/2;n=c-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",c-=k*(g.length-1),n=c-this.state.fontSize}l=[];k=[];for(b=0;b<g.length;b++)k[b]=a,l[b]=this.ctx.measureText(g[b]).width,null!=e&&e!=mxConstants.ALIGN_LEFT&&(k[b]-=l[b],e==mxConstants.ALIGN_CENTER&&(k[b]+=l[b]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=k[0];e=l[0];for(b=1;b<g.length;b++)a=Math.min(a,k[b]),e=Math.max(e,l[b]);this.ctx.save();
+a=Math.round(a)-.5;n=Math.round(n)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,n,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(a,n,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));this.ctx.restore()}for(b=0;b<g.length;b++)this.ctx.fillText(g[b],k[b],c),c+=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,c){mxEventSource.call(this);this.ui=a;this.cookieName=c;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),sessionStorage.removeItem("."+this.cookieName);else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie=this.cookieName+"=; expires="+a.toUTCString()}};
 DrawioClient.prototype.getPersistentToken=function(a){var c=null;isLocalStorage&&(c=localStorage.getItem("."+this.cookieName),null==c&&a&&(c=sessionStorage.getItem("."+this.cookieName)));if(null==c&&"undefined"!=typeof Storage){var b=document.cookie;a=this.cookieName+"=";var d=b.indexOf(a);0<=d&&(d+=a.length,c=b.indexOf(";",d),0>c?c=b.length:postCookie=b.substring(c),c=b.substring(d,c),c=0<c.length?c:null,null!=c&&isLocalStorage&&(b=new Date,b.setYear(b.getFullYear()-1),document.cookie=a+"; expires="+
-b.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+10);b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+b.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()};DrawioUser=function(a,c,b,d,e){this.id=a;this.email=c;this.displayName=b;this.pictureUrl=d;this.locale=e};DriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.desc=b};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted};
+b.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+10);b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+b.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()};DrawioUser=function(a,c,b,d,g){this.id=a;this.email=c;this.displayName=b;this.pictureUrl=d;this.locale=g};DriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.desc=b};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted};
 DriveFile.prototype.isConflict=function(a){return null!=a&&null!=a.error&&412==a.error.code};DriveFile.prototype.getCurrentUser=function(){return null!=this.ui.drive?this.ui.drive.user:null};DriveFile.prototype.getMode=function(){return App.MODE_GOOGLE};
 DriveFile.prototype.getPublicUrl=function(a){gapi.client.drive.permissions.list({fileId:this.desc.id}).execute(mxUtils.bind(this,function(c){if(null!=c&&null!=c.items)for(var b=0;b<c.items.length;b++)if("anyoneWithLink"===c.items[b].id||"anyone"===c.items[b].id){a(this.desc.webContentLink);return}a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};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,c,b,d,e){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(null,a,c,b,d,e)};
-DriveFile.prototype.saveFile=function(a,c,b,d,e,g){try{if(!this.isEditable())null!=b&&b();else if(!this.savingFile){var l=mxUtils.bind(this,function(a,g){try{var m=this.desc,f=this.isModified();this.setModified(!1);this.savingFile=!0;var k=this.isModified;this.isModified=function(){return!0};this.ui.drive.saveFile(this,g,mxUtils.bind(this,function(a,e){try{this.isModified=k,this.savingFile=!1,0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.min(8E3,Math.max(this.saveDelay+
+DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.save=function(a,c,b,d,g){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,c,b,d,g)}),b,d,g])};
+DriveFile.prototype.saveFile=function(a,c,b,d,g,e){try{if(!this.isEditable())null!=b&&b();else if(!this.savingFile){var l=mxUtils.bind(this,function(a,e){try{var m=this.desc,f=this.isModified();this.setModified(!1);this.savingFile=!0;var k=this.isModified;this.isModified=function(){return!0};this.ui.drive.saveFile(this,e,mxUtils.bind(this,function(a,e){try{this.isModified=k,this.savingFile=!1,0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.min(8E3,Math.max(this.saveDelay+
 500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(e,m,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b(a)}),d)):(this.setModified(f||this.isModified()),null!=d&&d(a))}catch(u){if(this.setModified(f||this.isModified()),null!=d)d(u);else throw u;}}),mxUtils.bind(this,function(b,c){try{this.savingFile=!1,this.isModified=k,this.setModified(f||this.isModified()),this.isConflict(b)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(c,mxUtils.bind(this,
-function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(b)}catch(u){if(this.setModified(f||this.isModified()),null!=d)d(u);else throw u;}}),e,e,a)}catch(p){if(null!=d)d(p);else throw p;}});l(g,c)}}catch(m){if(null!=d)d(m);else throw m;}};
+function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(b)}catch(u){if(this.setModified(f||this.isModified()),null!=d)d(u);else throw u;}}),g,g,a)}catch(p){if(null!=d)d(p);else throw p;}});l(e,c)}}catch(m){if(null!=d)d(m);else throw m;}};
 DriveFile.prototype.copyFile=function(a,c){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,c)}catch(b){c(b)}}),c,!0)};
 DriveFile.prototype.makeCopy=function(a,c,b){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,b),mxUtils.bind(this,function(b){this.desc=b;this.ui.spinner.stop();this.setModified(!1);this.backupPatch=null;this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();a()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=c&&c()}))};DriveFile.prototype.saveAs=function(a,c,b){this.ui.drive.copyFile(this.getId(),a,c,b)};
-DriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(e){this.hasSameExtension(a,this.getTitle())?(this.desc=e,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(e)):(this.desc=e,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
+DriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.desc=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(g)):(this.desc=g,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
 DriveFile.prototype.move=function(a,c,b){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=c&&c(a)}),b)};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(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&this.desc.editable};
 DriveFile.prototype.isSyncSupported=function(){return!0};DriveFile.prototype.isRevisionHistorySupported=function(){return!0};
 DriveFile.prototype.getRevisions=function(a,c){this.ui.drive.executeRequest(gapi.client.drive.revisions.list({fileId:this.getId()}),mxUtils.bind(this,function(b){for(var c=0;c<b.items.length;c++)mxUtils.bind(this,function(a){a.title=a.originalFilename;a.getXml=mxUtils.bind(this,function(b,c){this.ui.drive.getXmlFile(a,mxUtils.bind(this,function(a){b(a.getData())}),c)});a.getUrl=mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+a.id+"&chrome=0&nav=1&layers=1&edit=_blank"+
@@ -8670,142 +8670,143 @@ DriveClient.prototype.setUserId=function(a,c){if(c)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 c=document.cookie.split(";"),b=0;b<c.length;b++){var d=mxUtils.trim(c[b]);if("GUID="==d.substring(0,5)){a=d.substring(5);break}}null!=a&&isLocalStorage&&(c=new Date,c.setYear(c.getFullYear()-1),document.cookie="GUID=; expires="+c.toUTCString(),localStorage.setItem(".guid",a))}return a};
 DriveClient.prototype.execute=function(a){var c=mxUtils.bind(this,function(b){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();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("help"),mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,c)};
-DriveClient.prototype.executeRequest=function(a,c,b){try{var d=!0,e=null,g=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var l=mxUtils.bind(this,function(){try{this.requestThread=null,this.currentRequest=a,null!=e&&window.clearTimeout(e),e=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout),a.execute(mxUtils.bind(this,function(m){try{if(window.clearTimeout(e),d)if(null!=m&&null==m.error)null!=c&&c(m);else{var n=
+DriveClient.prototype.executeRequest=function(a,c,b){try{var d=!0,g=null,e=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var l=mxUtils.bind(this,function(){try{this.requestThread=null,this.currentRequest=a,null!=g&&window.clearTimeout(g),g=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout),a.execute(mxUtils.bind(this,function(m){try{if(window.clearTimeout(g),d)if(null!=m&&null==m.error)null!=c&&c(m);else{var n=
 null!=m&&null!=m.error?null!=m.error.data?m.error.data:m.error.errors:null,q=null!=n&&0<n.length?n[0].reason:null;null==b||null==m||null==m.error||-1!=m.error.code&&(403!=m.error.code||"domainPolicy"!=q&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=q)?403==m.error.code&&null!=this.user||401==m.error.code&&null!=this.user&&"authError"==q?null!=b&&b(m):this.execute(l):null!=m&&null!=m.error&&412!=
-m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==a&&g<this.maxRetries?(g++,this.requestThread=window.setTimeout(l,Math.round(Math.pow(2,g)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=b&&b(m):b(m)}}catch(f){if(null!=b)b(f);else throw f;}}))}catch(m){if(null!=b)b(m);else throw m;}});null==gapi.auth.getToken()?this.execute(l):l()}catch(m){if(null!=b)b(m);else throw m;}};
-DriveClient.prototype.authorize=function(a,c,b,d){try{var e=this.getUserId();null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(e=this.ui.stateArg.userId);if(a&&null==e)null!=b&&b();else{var g={scope:this.scopes,client_id:this.clientId};a&&null!=e?(g.immediate=!0,g.user_id=e):(g.immediate=!1,g.authuser=-1);gapi.auth.authorize(g,mxUtils.bind(this,function(g){try{null!=g&&null==g.error?null!=this.user&&a&&this.user.id==e?null!=c&&c():this.updateUser(c,b,d):null!=b&&b(g),this.resetTokenRefresh(g)}catch(m){if(null!=
+m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==a&&e<this.maxRetries?(e++,this.requestThread=window.setTimeout(l,Math.round(Math.pow(2,e)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=b&&b(m):b(m)}}catch(f){if(null!=b)b(f);else throw f;}}))}catch(m){if(null!=b)b(m);else throw m;}});null==gapi.auth.getToken()?this.execute(l):l()}catch(m){if(null!=b)b(m);else throw m;}};
+DriveClient.prototype.authorize=function(a,c,b,d){try{var g=this.getUserId();null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(g=this.ui.stateArg.userId);if(a&&null==g)null!=b&&b();else{var e={scope:this.scopes,client_id:this.clientId};a&&null!=g?(e.immediate=!0,e.user_id=g):(e.immediate=!1,e.authuser=-1);gapi.auth.authorize(e,mxUtils.bind(this,function(e){try{null!=e&&null==e.error?null!=this.user&&a&&this.user.id==g?null!=c&&c():this.updateUser(c,b,d):null!=b&&b(e),this.resetTokenRefresh(e)}catch(m){if(null!=
 b)b(m);else throw m;}}))}}catch(l){if(null!=b)b(l);else throw l;}};
 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 c=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();c&&this.fireEvent(new mxEventObject("disconnected"))})):a()};
 DriveClient.prototype.updateUser=function(a,c,b){try{var d=gapi.auth.getToken().access_token;this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token="+d,mxUtils.bind(this,function(d){var e=JSON.parse(d);this.executeRequest(gapi.client.drive.about.get(),mxUtils.bind(this,function(c){var d=mxResources.get("notAvailable"),g=d,l=null;null!=c&&null!=c.user&&(d=c.user.emailAddress,g=c.user.displayName,l=null!=c.user.picture?c.user.picture.url:null);this.setUser(new DrawioUser(e.id,
-d,g,l,e.locale));this.setUserId(e.id,b);null!=a&&a()}),c)}),c)}catch(e){if(null!=c)c(e);else throw e;}};DriveClient.prototype.copyFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(gapi.client.drive.files.copy({fileId:a,fields:this.allFields,supportsTeamDrives:!0,resource:{title:c,properties:[{key:"channel",value:Editor.guid()}]}}),b,d)};DriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),b,d)};
+d,g,l,e.locale));this.setUserId(e.id,b);null!=a&&a()}),c)}),c)}catch(g){if(null!=c)c(g);else throw g;}};DriveClient.prototype.copyFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(gapi.client.drive.files.copy({fileId:a,fields:this.allFields,supportsTeamDrives:!0,resource:{title:c,properties:[{key:"channel",value:Editor.guid()}]}}),b,d)};DriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),b,d)};
 DriveClient.prototype.moveFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:c}]}),b,d)};DriveClient.prototype.createDriveRequest=function(a,c){return gapi.client.request({path:"/drive/v2/files/"+a,method:"PUT",params:{uploadType:"multipart",supportsTeamDrives:!0},headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(c)})};DriveClient.prototype.getLibrary=function(a,c,b){return this.getFile(a,c,b,!0,!0)};
-DriveClient.prototype.loadDescriptor=function(a,c,b,d){this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:null!=d?d:this.allFields,supportsTeamDrives:!0}),c,b)};DriveClient.prototype.getCustomProperty=function(a,c){var b=a.properties,d=null;if(null!=b)for(var e=0;e<b.length;e++)if(b[e].key==c){d=b[e].value;break}return d};
-DriveClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;e=null!=e?e:!1;null!=urlParams.rev?this.executeRequest(gapi.client.drive.revisions.get({fileId:a,revisionId:urlParams.rev,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d.title=d.originalFilename;d.headRevisionId=d.id;d.id=a;this.getXmlFile(d,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var g=/\.png$/i.test(a.title);if(/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&
-g){var m=a.downloadUrl+"&access_token="+gapi.auth.getToken().access_token;this.ui.convertFile(m,a.title,a.mimeType,this.extension,c,b)}else d||e||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,e):this.isGoogleRealtimeMimeType(a.mimeType)?this.convertRealtimeFile(a,c,b):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(n){if(null!=b)b(n);else throw n;}}),b)};
+DriveClient.prototype.loadDescriptor=function(a,c,b,d){this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:null!=d?d:this.allFields,supportsTeamDrives:!0}),c,b)};DriveClient.prototype.getCustomProperty=function(a,c){var b=a.properties,d=null;if(null!=b)for(var g=0;g<b.length;g++)if(b[g].key==c){d=b[g].value;break}return d};
+DriveClient.prototype.getFile=function(a,c,b,d,g){d=null!=d?d:!1;g=null!=g?g:!1;null!=urlParams.rev?this.executeRequest(gapi.client.drive.revisions.get({fileId:a,revisionId:urlParams.rev,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d.title=d.originalFilename;d.headRevisionId=d.id;d.id=a;this.getXmlFile(d,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var e=/\.png$/i.test(a.title);if(/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&
+e){var m=a.downloadUrl+"&access_token="+gapi.auth.getToken().access_token;this.ui.convertFile(m,a.title,a.mimeType,this.extension,c,b)}else d||g||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,g):this.isGoogleRealtimeMimeType(a.mimeType)?this.convertRealtimeFile(a,c,b):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(n){if(null!=b)b(n);else throw n;}}),b)};
 DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
-DriveClient.prototype.getRealtimeData=function(a,c,b,d){this.executeRequest(gapi.client.drive.realtime.get({fileId:a,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d=null!=d.result?d.result.data:null;null!=d&&null!=d.value&&null!=d.value.diagrams?c(d):null!=b&&b({message:"realtime.get returned invalid data for "+a})}),mxUtils.bind(this,function(e){null==d&&(d=0);3>d?window.setTimeout(mxUtils.bind(this,function(){this.getRealtimeData(a,c,b,d+1)}),100*(d+1)):null!=b&&b({message:"realtime.get failed for "+
+DriveClient.prototype.getRealtimeData=function(a,c,b,d){this.executeRequest(gapi.client.drive.realtime.get({fileId:a,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d=null!=d.result?d.result.data:null;null!=d&&null!=d.value&&null!=d.value.diagrams?c(d):null!=b&&b({message:"realtime.get returned invalid data for "+a})}),mxUtils.bind(this,function(g){null==d&&(d=0);3>d?window.setTimeout(mxUtils.bind(this,function(){this.getRealtimeData(a,c,b,d+1)}),100*(d+1)):null!=b&&b({message:"realtime.get failed for "+
 a})}))};DriveClient.prototype.loadRealtime=function(a,c,b){"1"==urlParams.ignoremime||"420247213240"!=this.appId||"application/vnd.jgraph.mxfile.realtime"!=a.mimeType&&"application/mxr"!=a.mimeType?c():this.redirectToNewApp(b,a.id)};
-DriveClient.prototype.getXmlFile=function(a,c,b,d,e){try{var g=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+g,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||e)a.mimeType!=this.libraryMimeType||e?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{var g=!1;if(/\.png$/i.test(a.title)){var l=d.lastIndexOf(",");if(0<l){var q=this.ui.extractGraphModelFromPng(d.substring(l+
-1));if(null!=q&&0<q.length)d=q;else try{var q=d.substring(l+1),f=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(q):atob(q),k=this.ui.editor.extractGraphModel(mxUtils.parseXml(f).documentElement,!0);null==k||0<k.getElementsByTagName("parsererror").length?g=!0:d=f}catch(p){g=!0}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(f=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f));c(g?new LocalFile(this.ui,d,a.title,!0):new DriveFile(this.ui,d,a))}}catch(p){if(null!=
+DriveClient.prototype.getXmlFile=function(a,c,b,d,g){try{var e=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+e,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||g)a.mimeType!=this.libraryMimeType||g?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{var e=!1;if(/\.png$/i.test(a.title)){var l=d.lastIndexOf(",");if(0<l){var q=this.ui.extractGraphModelFromPng(d.substring(l+
+1));if(null!=q&&0<q.length)d=q;else try{var q=d.substring(l+1),f=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(q):atob(q),k=this.ui.editor.extractGraphModel(mxUtils.parseXml(f).documentElement,!0);null==k||0<k.getElementsByTagName("parsererror").length?e=!0:d=f}catch(p){e=!0}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(f=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f));c(e?new LocalFile(this.ui,d,a.title,!0):new DriveFile(this.ui,d,a))}}catch(p){if(null!=
 b)b(p);else throw p;}}),b,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))}catch(l){if(null!=b)b(l);else throw l;}};
-DriveClient.prototype.saveFile=function(a,c,b,d,e,g,l,m){var n=mxUtils.bind(this,function(b){try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(z){}if(null!=d)d(b);else throw b;});try{if(a.isEditable()&&null!=a.desc){var q=(new Date).getTime(),
-f=a.desc.modifiedDate,k=a.desc.headRevisionId,p=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var t=mxUtils.bind(this,function(e,u,v){try{var x=null,t=!1,y={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)&&(y.mimeType=this.xmlMimeType,x=a.desc,t=c=!0);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&m.push({key:"channel",value:Editor.guid(32)}),
-null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",value:Editor.guid(32)}));v||(null!=e||g||(e=this.placeholderThumbnail,u=this.placeholderMimeType),null!=e&&null!=u&&(y.thumbnail={image:e,mimeType:u}));var F=a.getData(),A=mxUtils.bind(this,function(e){try{if(a.saveDelay=(new Date).getTime()-q,0>=(new Date(e.modifiedDate)).getTime()-(new Date(f)).getTime()||c&&k==e.headRevisionId){d({message:mxResources.get("errorSavingFile")});try{EditorUi.sendReport("Critical: Error saving to Google Drive "+
-(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+" "+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nOld Rev="+k+" "+f+"\nNew Rev="+e.headRevisionId+" "+e.modifiedDate),EditorUi.logError("Critical: Error saving to Google Drive",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(C){}}else{b(e,F);if(null!=x){this.executeRequest(gapi.client.drive.revisions.get({fileId:x.id,revisionId:x.headRevisionId,supportsTeamDrives:!0}),
-mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:x.id,revisionId:x.headRevisionId,resource:a}))})));try{EditorUi.logEvent({category:"RT-CONVERT-"+a.convertedFrom,action:"from-"+x.id+"."+x.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?this.user.id:"unknown-user"})}catch(C){}}try{EditorUi.logEvent({category:"SAVE-GOOGLE-"+a.desc.id,action:"from-"+k+"."+f+"-to-"+e.headRevisionId+"."+e.modifiedDate,
-label:null!=this.user?this.user.id:"unknown-user"})}catch(C){}}}catch(C){n(C)}}),z=mxUtils.bind(this,function(b,f){try{null!=m&&(y.properties=m);var g=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),k=0,v=mxUtils.bind(this,function(e){try{var l=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),y,b,c||e||l,f,e?null:g,t),A,mxUtils.bind(this,
-function(b){try{a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){try{if(null!=c&&c.etag==g)if(k<this.maxRetries)k++,window.setTimeout(v,2*k*this.coolOff*(1+.1*(Math.random()-.5)));else{v(!0);try{EditorUi.sendReport("Warning: Stale Etag Overwrite "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:
-"unknown")),EditorUi.logError("Warning: Stale Etag Overwrite",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(U){}}else null!=d&&d(b,c)}catch(U){n(U)}}),mxUtils.bind(this,function(){null!=d&&d(b)})):d(b)}catch(T){n(T)}}))}catch(O){n(O)}});if(p&&null==e){var q=new Image;q.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/q.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(q.height*a);b.getContext("2d").drawImage(q,
-0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");y.thumbnail={image:c,mimeType:"image/png"};v(!1)}catch(T){v(!1)}});q.src="data:image/png;base64,"+b}else v(!1)}catch(M){n(M)}});p?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){z(a,!0)}),d,this.ui.getCurrentFile()!=a?F:null):z(F,!1)}catch(I){n(I)}}),u=mxUtils.bind(this,function(){(g||p||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&
-"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(v){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");t(b,"image/png")}catch(v){n(v)}})))&&t(null,null,a.constructor!=DriveLibrary)});e||!c?u():this.verifyMimeType(a.getId(),u,!0)}else this.ui.editor.graph.reset(),null!=d&&d({message:mxResources.get("readOnly")})}catch(y){n(y)}};
-DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(b||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(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=
+DriveClient.prototype.saveFile=function(a,c,b,d,g,e,l,m){var n=mxUtils.bind(this,function(b){if(null!=d)d(b);else throw b;try{EditorUi.logEvent({category:"FAIL-SAVE-GOOGLE-"+a.desc.id+"."+a.desc.headRevisionId+"."+a.desc.modifiedDate,action:"error-"+a.getErrorMessage(b),label:null!=this.user?this.user.id:"unknown-user"})}catch(v){}}),q=mxUtils.bind(this,function(b){n(b);try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+
+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(v){}});try{if(a.isEditable()&&null!=a.desc){var f=(new Date).getTime(),k=a.desc.modifiedDate,p=a.desc.headRevisionId,t=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());g=null!=g?g:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;e=null!=e?e:!1;var u=mxUtils.bind(this,function(d,g,x){try{var v=null,
+u=!1,y={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)&&(y.mimeType=this.xmlMimeType,v=a.desc,u=c=!0);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&m.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",value:Editor.guid(32)}));x||(null!=d||e||(d=this.placeholderThumbnail,g=this.placeholderMimeType),null!=d&&null!=g&&(y.thumbnail={image:d,mimeType:g}));var A=
+a.getData(),z=mxUtils.bind(this,function(d){try{if(a.saveDelay=(new Date).getTime()-f,0>=(new Date(d.modifiedDate)).getTime()-(new Date(k)).getTime()||c&&p==d.headRevisionId){n({message:mxResources.get("errorSavingFile")});try{EditorUi.sendReport("Critical: Error saving to Google Drive "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+" "+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nOld Rev="+p+" "+k+"\nNew Rev="+d.headRevisionId+" "+d.modifiedDate),
+EditorUi.logError("Critical: Error saving to Google Drive",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(F){}}else{b(d,A);if(null!=v){this.executeRequest(gapi.client.drive.revisions.get({fileId:v.id,revisionId:v.headRevisionId,supportsTeamDrives:!0}),mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:v.id,revisionId:v.headRevisionId,resource:a}))})));try{EditorUi.logEvent({category:"RT-CONVERT-"+
+a.convertedFrom,action:"from-"+v.id+"."+v.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?this.user.id:"unknown-user"})}catch(F){}}try{EditorUi.logEvent({category:"SAVE-GOOGLE-"+a.desc.id+"."+p+"."+k,action:"saved-"+d.headRevisionId+"."+d.modifiedDate,label:null!=this.user?this.user.id:"unknown-user"})}catch(F){}}}catch(F){q(F)}}),I=mxUtils.bind(this,function(b,e){try{null!=m&&(y.properties=m);var f=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?
+null:a.getCurrentEtag(),g=0,k=mxUtils.bind(this,function(d){try{var l=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),y,b,c||d||l,e,d?null:f,u),z,mxUtils.bind(this,function(b){try{a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){try{if(null!=c&&c.etag==f)if(g<this.maxRetries)g++,
+window.setTimeout(k,2*g*this.coolOff*(1+.1*(Math.random()-.5)));else{k(!0);try{EditorUi.sendReport("Warning: Stale Etag Overwrite "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")),EditorUi.logError("Warning: Stale Etag Overwrite "+a.desc.id,null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(W){}}else null!=n&&n(b,c)}catch(W){q(W)}}),mxUtils.bind(this,function(){null!=
+n&&n(b)})):n(b)}catch(U){q(U)}}))}catch(T){q(T)}});if(t&&null==d){var v=new Image;v.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/v.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(v.height*a);b.getContext("2d").drawImage(v,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");y.thumbnail={image:c,mimeType:"image/png"};k(!1)}catch(U){k(!1)}});v.src="data:image/png;base64,"+b}else k(!1)}catch(O){q(O)}});
+t?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){I(a,!0)}),n,this.ui.getCurrentFile()!=a?A:null):I(A,!1)}catch(C){q(C)}}),y=mxUtils.bind(this,function(){(e||t||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(x){}b=null==b||b.length>this.maxThumbnailSize?
+null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");u(b,"image/png")}catch(x){q(x)}})))&&u(null,null,a.constructor!=DriveLibrary)});g||!c?y():this.verifyMimeType(a.getId(),y,!0)}else this.ui.editor.graph.reset(),null!=n&&n({message:mxResources.get("readOnly")})}catch(z){q(z)}};
+DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var g=(new Date).getTime();if(b||g-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=g,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=
 c&&c()})))};
 DriveClient.prototype.redirectToNewApp=function(a,c){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+this.newAppHostname+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#G"+c,d=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null!=a?this.ui.confirm(mxResources.get("redirectToNewApp"),d,mxUtils.bind(this,function(){this.redirectDialogShowing=
-!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DriveClient.prototype.insertFile=function(a,c,b,d,e,g,l){g=null!=g?g:this.xmlMimeType;a={mimeType:g,title:a};null!=b&&(a.parents=[{kind:"drive#fileLink",id:b}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,l),mxUtils.bind(this,function(a){g==this.libraryMimeType?d(new DriveLibrary(this.ui,c,a)):0==a?null!=e&&e({message:mxResources.get("errorSavingFile")}):d(new DriveFile(this.ui,c,a))}),e)};
-DriveClient.prototype.createUploadRequest=function(a,c,b,d,e,g,l){e=null!=e?e:!1;var m={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=g&&(m["If-Match"]=g);a={path:"/upload/drive/v2/files"+(null!=a?"/"+a:""),method:null!=a?"PUT":"POST",params:{uploadType:"multipart"},headers:m,body:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+
-(null!=b?e?b:Base64.encode(b):"")+"\r\n---------314159265358979323846--"};d||(a.params.newRevision=!1);l&&(a.params.pinned=!0);a.params.supportsTeamDrives=!0;a.params.fields=this.allFields;return gapi.client.request(a)};
-DriveClient.prototype.pickFile=function(a,c){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(){try{this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,d=c?"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[d].setVisible(!1))});if(null==this[d]||this[d+"Token"]!=a){this[d+"Token"]=a;var g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),l=(new google.picker.DocsView).setIncludeFolders(!0),m=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(g.setMimeTypes("*/*"),l.setMimeTypes("*/*"),m.setMimeTypes("*/*")):
-(g.setMimeTypes(this.mimeTypes),l.setMimeTypes(this.mimeTypes),m.setMimeTypes(this.mimeTypes));this[d]=(new google.picker.PickerBuilder).setOAuthToken(this[d+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(g).addView(l).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).addView(n).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[d].setVisible(!0)}catch(q){this.ui.spinner.stop(),this.ui.handleError(q)}}))};
+!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DriveClient.prototype.insertFile=function(a,c,b,d,g,e,l){e=null!=e?e:this.xmlMimeType;a={mimeType:e,title:a};null!=b&&(a.parents=[{kind:"drive#fileLink",id:b}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,l),mxUtils.bind(this,function(a){e==this.libraryMimeType?d(new DriveLibrary(this.ui,c,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):d(new DriveFile(this.ui,c,a))}),g)};
+DriveClient.prototype.createUploadRequest=function(a,c,b,d,g,e,l){g=null!=g?g:!1;var m={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=e&&(m["If-Match"]=e);a={path:"/upload/drive/v2/files"+(null!=a?"/"+a:""),method:null!=a?"PUT":"POST",params:{uploadType:"multipart"},headers:m,body:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+
+(null!=b?g?b:Base64.encode(b):"")+"\r\n---------314159265358979323846--"};d||(a.params.newRevision=!1);l&&(a.params.pinned=!0);a.params.supportsTeamDrives=!0;a.params.fields=this.allFields;return gapi.client.request(a)};
+DriveClient.prototype.pickFile=function(a,c){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(){try{this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,d=c?"genericPicker":"filePicker",g=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==
+mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",g),this[d].setVisible(!1))});if(null==this[d]||this[d+"Token"]!=a){this[d+"Token"]=a;var e=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),l=(new google.picker.DocsView).setIncludeFolders(!0),m=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(e.setMimeTypes("*/*"),l.setMimeTypes("*/*"),m.setMimeTypes("*/*")):
+(e.setMimeTypes(this.mimeTypes),l.setMimeTypes(this.mimeTypes),m.setMimeTypes(this.mimeTypes));this[d]=(new google.picker.PickerBuilder).setOAuthToken(this[d+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(e).addView(l).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).addView(n).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
+"click",g);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",g);this[d].setVisible(!0)}catch(q){this.ui.spinner.stop(),this.ui.handleError(q)}}))};
 DriveClient.prototype.pickFolder=function(a,c){this.folderPickerCallback=a;var b=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,b=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",b),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||
 this.folderPickerToken!=a){this.folderPickerToken=a;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),l=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),m=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");
 this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(l).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
 "click",b);this.folderPickerCallback(a)})).build()}mxEvent.addListener(document,"click",b);this.folderPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))}catch(d){this.ui.handleError(d)}});c?b():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){b()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)};
 DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==
-mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))}),b=gapi.auth.getToken().access_token;if(null==this.libraryPicker||this.libraryPickerToken!=b){this.libraryPickerToken=b;var d=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),e=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+
-",application/xml,text/plain,application/octet-stream"),g=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),l=(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(e).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(l).setCallback(mxUtils.bind(this,
+mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))}),b=gapi.auth.getToken().access_token;if(null==this.libraryPicker||this.libraryPickerToken!=b){this.libraryPickerToken=b;var d=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),g=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+
+",application/xml,text/plain,application/octet-stream"),e=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),l=(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(g).addView(e).addView(google.picker.ViewId.RECENTLY_PICKED).addView(l).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)}catch(m){this.ui.spinner.stop(),this.ui.handleError(m)}}))};
 DriveClient.prototype.showPermissions=function(a){var c=mxUtils.bind(this,function(){var b=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(b.container,360,190,!0,!0);b.init()});this.sharingFailed?c():this.checkToken(mxUtils.bind(this,function(){try{var b=new gapi.drive.share.ShareClient(this.appId);
 b.setOAuthToken(gapi.auth.getToken().access_token);b.setItemIds([a]);b.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,d=0;d<a.length;d++)for(var l=0;l<a[d].addedNodes.length;l++){var m=a[d].addedNodes[l];"BUTTON"==m.nodeName&&"ok"==m.getAttribute("name")&&null!=m.parentNode&&null!=m.parentNode.parentNode&&"dialog"==m.parentNode.parentNode.getAttribute("role")?
 (this.sharingFailed=!0,m.click(),c(),b=!0):"DIV"==m.nodeName&&"shr-q-shr-r-shr-xb"==m.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(d){this.ui.handleError(d)}}))};DriveClient.prototype.getRealtimeAge=function(a,c){var b=null!=c&&null!=c.value&&null!=c.value.modifiedDate?c.value.modifiedDate.json:null,d=0;null!=b&&0<b&&(b=new Date(b),d=(new Date(a.modifiedDate)).getTime()-b.getTime());return d};
-DriveClient.prototype.convertRealtimeFile=function(a,c,b){var d=mxUtils.bind(this,function(a){a.convertedFrom="xml";c(a)}),e=mxUtils.bind(this,function(a){a.convertedFrom="json";c(a)});this.getRealtimeData(a.id,mxUtils.bind(this,function(c){try{3E5>this.getRealtimeAge(a,c)?e(new DriveFile(this.ui,mxUtils.getXml(this.convertJsonToXml(c)),a)):this.getXmlFile(a,d,mxUtils.bind(this,function(){try{e(new DriveFile(this.ui,mxUtils.getXml(this.convertJsonToXml(c)),a))}catch(l){this.getXmlFile(a,d,b)}}))}catch(l){this.getXmlFile(a,
-d,b)}}),mxUtils.bind(this,function(){this.getXmlFile(a,d,b)}))};DriveClient.prototype.convertJsonToXml=function(a,c){if(null==a.value||null==a.value.diagrams)throw Error("Invalid JSON: no diagrams in root map");for(var b=mxUtils.createXmlDocument().createElement("mxfile"),d=a.value.diagrams.value,e=0;e<d.length;e++)try{var g=this.decodeJsonPage(d[e].value,b.ownerDocument.createElement("diagram"),c);b.appendChild(g)}catch(l){throw Error("Error on page "+e+": "+l.stack);}return b};
-DriveClient.prototype.decodeJsonPage=function(a,c,b){if(null==a)throw Error("Invalid JSON: json for page is null");var d=new mxCodec,e=this.createJsonCell(a.root,d);if(null==e)throw Error("Invalid JSON: no root cell for page");d=d.encode(new mxGraphModel(e));this.decodeJsonViewState(a,d);b?c.appendChild(d):mxUtils.setTextContent(c,Graph.compressNode(d));null!=a.id?c.setAttribute("id",a.id.json):c.setAttribute("id",Editor.guid());null!=a.name&&c.setAttribute("name",a.name.json);return c};
+DriveClient.prototype.convertRealtimeFile=function(a,c,b){var d=mxUtils.bind(this,function(a){a.convertedFrom="xml";c(a)}),g=mxUtils.bind(this,function(a){a.convertedFrom="json";c(a)});this.getRealtimeData(a.id,mxUtils.bind(this,function(c){try{3E5>this.getRealtimeAge(a,c)?g(new DriveFile(this.ui,mxUtils.getXml(this.convertJsonToXml(c)),a)):this.getXmlFile(a,d,mxUtils.bind(this,function(){try{g(new DriveFile(this.ui,mxUtils.getXml(this.convertJsonToXml(c)),a))}catch(l){this.getXmlFile(a,d,b)}}))}catch(l){this.getXmlFile(a,
+d,b)}}),mxUtils.bind(this,function(){this.getXmlFile(a,d,b)}))};DriveClient.prototype.convertJsonToXml=function(a,c){if(null==a.value||null==a.value.diagrams)throw Error("Invalid JSON: no diagrams in root map");for(var b=mxUtils.createXmlDocument().createElement("mxfile"),d=a.value.diagrams.value,g=0;g<d.length;g++)try{var e=this.decodeJsonPage(d[g].value,b.ownerDocument.createElement("diagram"),c);b.appendChild(e)}catch(l){throw Error("Error on page "+g+": "+l.stack);}return b};
+DriveClient.prototype.decodeJsonPage=function(a,c,b){if(null==a)throw Error("Invalid JSON: json for page is null");var d=new mxCodec,g=this.createJsonCell(a.root,d);if(null==g)throw Error("Invalid JSON: no root cell for page");d=d.encode(new mxGraphModel(g));this.decodeJsonViewState(a,d);b?c.appendChild(d):mxUtils.setTextContent(c,Graph.compressNode(d));null!=a.id?c.setAttribute("id",a.id.json):c.setAttribute("id",Editor.guid());null!=a.name&&c.setAttribute("name",a.name.json);return c};
 DriveClient.prototype.decodeJsonViewState=function(a,c){var b=null!=a.pageFormat?a.pageFormat.json:null;null!=b&&0<b.length&&(b=b.split(","),1<b.length&&(c.setAttribute("pageWidth",b[0]),c.setAttribute("pageHeight",b[1])));b=null!=a.backgroundColor?a.backgroundColor.json:null;null!=b&&0<b.length&&c.setAttribute("background",b);b=null!=a.backgroundImage?a.backgroundImage.json:null;null!=b&&0<b.length&&c.setAttribute("backgroundImage",b);c.setAttribute("fold",null!=a.foldingEnabled?a.foldingEnabled.json:
 "0");c.setAttribute("pageScale",null!=a.pageScale?a.pageScale.json:mxGraph.prototype.pageScale);c.setAttribute("math",null!=a.mathEnabled?a.mathEnabled.json:"0");c.setAttribute("shadow",null!=a.shadowVisible?a.shadowVisible.json:"0");return c};
-DriveClient.prototype.createJsonCell=function(a,c){if(null!=a&&null!=a.id){var b=a.value,d=this.jsonToCell(b,c);c.putObject(a.id,d);d.source=null!=b.source?this.createJsonCell(b.source,c):null;d.target=null!=b.target?this.createJsonCell(b.target,c):null;this.createJsonCell(b.parent,c);for(var e=0;e<b.children.value.length;e++){var g=this.createJsonCell(b.children.value[e],c);if(null!=g)d.insert(g);else throw Error("Invalid JSON: no child "+e+" for cell "+a.id);}return d}return null!=a&&null!=a.ref?
+DriveClient.prototype.createJsonCell=function(a,c){if(null!=a&&null!=a.id){var b=a.value,d=this.jsonToCell(b,c);c.putObject(a.id,d);d.source=null!=b.source?this.createJsonCell(b.source,c):null;d.target=null!=b.target?this.createJsonCell(b.target,c):null;this.createJsonCell(b.parent,c);for(var g=0;g<b.children.value.length;g++){var e=this.createJsonCell(b.children.value[g],c);if(null!=e)d.insert(e);else throw Error("Invalid JSON: no child "+g+" for cell "+a.id);}return d}return null!=a&&null!=a.ref?
 c.objects[a.ref]:null};
 DriveClient.prototype.jsonToCell=function(a,c){var b=new mxCell;b.id=a.cellId.json;b.vertex="vertex"==a.type.json;b.edge="edge"==a.type.json;b.connectable="0"!=a.connectable.json;b.collapsed="1"==a.collapsed.json;b.visible="0"!=a.visible.json;b.style=null!=a.style?a.style.json:null;b.value=null!=a.xmlValue?mxUtils.parseXml(a.xmlValue.json).documentElement:null!=a.value?a.value.json:null;b.geometry=null!=a.geometry?c.decode(mxUtils.parseXml(a.geometry.json).documentElement):null;return b};
 DriveClient.prototype.checkRealtimeFiles=function(a){this.executeRequest(gapi.client.drive.files.list({maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){null!=c&&(null!=c.nextPageToken||null!=c.items&&0<c.items.length)&&a()}))};
 DriveClient.prototype.convertRealtimeFiles=function(){var a=document.createElement("div");a.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:8px;background:#ffffff;z-index:2;overflow:auto;white-space:nowrap;line-height:1.5em;";document.body.appendChild(a);var c=Date.now(),b=mxUtils.bind(this,function(b,c){a.innerHTML+=b+(c?"":"<br>");a.scrollTop=a.scrollHeight});b("draw.io ("+EditorUi.VERSION+") is searching files to be converted...");this.ui.spinner.spin(document.body,
-"Searching files...")?this.checkToken(mxUtils.bind(this,function(){var a=(new Date).getDay(),e=6===a||0===a?1E3:5E3,g={},l=0,m=0,n=0,q=0,f=0,k=0,p=0,t=0,u=mxUtils.bind(this,function(){this.ui.spinner.stop();b("<br>Conversion complete. Successfully converted "+l+" file(s).",!0);0<p?b(" Failed to convert "+p+' file(s).<br><br><b>ACTION REQUIRED:</b><br><ul><li>Click <a target="_blank" href="https://drive.google.com/drive/u/0/search?q=type:application/vnd.jgraph.mxfile.realtime">here</a> to list all affected files</li><li>Open each file in turn by right-clicking the file and selecting open with draw.io</li><li>Open each file in turn. When loaded, select File->Save</li></ul>'):
+"Searching files...")?this.checkToken(mxUtils.bind(this,function(){var a=(new Date).getDay(),g=6===a||0===a?1E3:2E3,e={},l=0,m=0,n=0,q=0,f=0,k=0,p=0,t=0,u=mxUtils.bind(this,function(){this.ui.spinner.stop();b("<br>Conversion complete. Successfully converted "+l+" file(s).",!0);0<p?b(" Failed to convert "+p+' file(s).<br><br><b>ACTION REQUIRED:</b><br><ul><li>Click <a target="_blank" href="https://drive.google.com/drive/u/0/search?q=type:application/vnd.jgraph.mxfile.realtime">here</a> to list all affected files</li><li>Open each file in turn by right-clicking the file and selecting open with draw.io</li><li>Open each file in turn. When loaded, select File->Save</li></ul>'):
 b("<br><br>This window can now be closed.");try{var a=Date.now()-c;EditorUi.logEvent({category:"AUTO-CONVERT",action:"total-"+t+"-xml-"+n+"-json-"+m+"-done-"+l+"-fail-"+p+"-load-"+q+"-save-"+k+"-invalid-"+f+"-dt-"+Math.round(a/1E3),label:null!=this.user?this.user.id:"unknown-user"})}catch(v){}}),y=function(a){return null==a?"":null!=a.message?a.message:null!=a.error&&null!=a.error.message?a.error.message:""};this.executeRequest(gapi.client.drive.files.list({maxResults:1E4,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",
-includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){this.ui.spinner.stop();t=null!=a&&null!=a.items?a.items.length:0;if(this.ui.spinner.spin(document.body,"Converting "+t+" file(s)")){b("Found "+t+" file(s). This will take up to "+Math.ceil(t*(e+3E3)/6E4)+" minute(s). <b>Please do not close this window!</b><br>");var c=0,d=mxUtils.bind(this,function(a,v){var x={maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0};
+includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){this.ui.spinner.stop();t=null!=a&&null!=a.items?a.items.length:0;if(this.ui.spinner.spin(document.body,"Converting "+t+" file(s)")){b("Found "+t+" file(s). This will take up to "+Math.ceil(t*(g+3E3)/6E4)+" minute(s). <b>Please do not close this window!</b><br>");var c=0,d=mxUtils.bind(this,function(a,v){var x={maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0};
 null!=a&&(x.pageToken=a);this.executeRequest(gapi.client.drive.files.list(x),mxUtils.bind(this,function(a){var x=mxUtils.bind(this,function(){null!=a.nextPageToken?d(a.nextPageToken):null!=a.nextPageToken?d(a.nextPageToken):u()});if(null==a||null!=a.items&&0!=a.items.length||null==a.nextPageToken)if(null!=a&&null!=a.items&&0<a.items.length){var A=a.items[0].id;this.ui.spinner.stop();c++;this.ui.spinner.spin(document.body,"Converting file "+c+" of "+t)&&(b("Converting "+c+" of "+t+': "'+mxUtils.htmlEntities(a.items[0].title)+
-'" ('+A+")... ",!0),window.setTimeout(mxUtils.bind(this,function(){if(null==g[A]){var a=g[A]=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;q++;b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout);this.getFile(A,mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d.constructor==DriveFile?("json"==d.convertedFrom?m++:n++,a=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;k++;b('<img src="'+this.ui.editor.graph.warningImage.src+
+'" ('+A+")... ",!0),window.setTimeout(mxUtils.bind(this,function(){if(null==e[A]){var a=e[A]=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;q++;b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout);this.getFile(A,mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d.constructor==DriveFile?("json"==d.convertedFrom?m++:n++,a=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;k++;b('<img src="'+this.ui.editor.graph.warningImage.src+
 '" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout),this.saveFile(d,null,mxUtils.bind(this,function(){window.clearTimeout(c);a&&(l++,b('OK <img src="'+Editor.checkmarkImage+'" border="0" valign="middle"/>'),x())}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,k++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+d),x())}))):(p++,f++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Invalid file'),
-x()))}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,q++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+d),x())}))}else this.ui.spinner.stop(),b("Search returned duplicate file "+A+". Exiting.<br><br>This window can now be closed.")}),null!=v?v:e))}else u();else d(a.nextPageToken,1E4)}))});d()}}))})):(this.ui.spinner.stop(),b("Busy. <br><br>This window can now be closed."))};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};
+x()))}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,q++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+d),x())}))}else this.ui.spinner.stop(),b("Search returned duplicate file "+A+". Exiting.<br><br>This window can now be closed.")}),null!=v?v:g))}else u();else d(a.nextPageToken,1E4)}))});d()}}))})):(this.ui.spinner.stop(),b("Busy. <br><br>This window can now be closed."))};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};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.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};
-DropboxFile.prototype.getRevisions=function(a,c){var b=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});b.then(mxUtils.bind(this,function(b){try{for(var d=[],g=b.entries.length-1;0<=g;g--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+
-a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[g]);a(d)}catch(l){c(l)}}));b["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,b){this.doSave(this.getTitle(),c,b)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};
+DropboxFile.prototype.getRevisions=function(a,c){var b=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});b.then(mxUtils.bind(this,function(b){try{for(var d=[],e=b.entries.length-1;0<=e;e--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+
+a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[e]);a(d)}catch(l){c(l)}}));b["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,b){this.doSave(this.getTitle(),c,b)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};
 DropboxFile.prototype.doSave=function(a,c,b){var d=this.stat.name;this.stat.name=a;DrawioFile.prototype.save.apply(this,arguments);this.stat.name=d;this.saveFile(a,!1,c,b)};
-DropboxFile.prototype.saveFile=function(a,c,b,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(c=mxUtils.bind(this,function(c){if(c){this.savingFile=!0;var e=this.isModified,l=this.isModified(),m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return l}});m();var n=mxUtils.bind(this,function(c){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a,c,mxUtils.bind(this,function(a){this.savingFile=
-!1;this.isModified=e;this.stat=a;this.contentChanged();null!=b&&b()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(l||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){m();b()}}d(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){n(this.ui.base64ToBlob(a,"image/png"))}),d,this.ui.getCurrentFile()!=this?this.getData():null):n(this.getData())}else null!=
+DropboxFile.prototype.saveFile=function(a,c,b,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(c=mxUtils.bind(this,function(c){if(c){this.savingFile=!0;var e=this.isModified,g=this.isModified(),m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}});m();var n=mxUtils.bind(this,function(c){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a,c,mxUtils.bind(this,function(a){this.savingFile=
+!1;this.isModified=e;this.stat=a;this.contentChanged();null!=b&&b()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){m();b()}}d(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){n(this.ui.base64ToBlob(a,"image/png"))}),d,this.ui.getCurrentFile()!=this?this.getData():null):n(this.getData())}else null!=
 d&&d()}),this.getTitle()==a?c(!0):this.ui.dropbox.checkExists(a,c)):null!=b&&b()};DropboxFile.prototype.rename=function(a,c,b){this.ui.dropbox.renameFile(this,a,mxUtils.bind(this,function(d){this.hasSameExtension(a,this.getTitle())?(this.stat=d,this.descriptorChanged(),null!=c&&c()):(this.stat=d,this.descriptorChanged(),this.save(!0,c,b))}),b)};DropboxLibrary=function(a,c,b){DropboxFile.call(this,a,c,b)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};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=".drawio";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,c,b){var d=!0,e=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),g=this.client.usersGetCurrentAccount();g.then(mxUtils.bind(this,function(b){window.clearTimeout(e);d&&(this.setUser(new DrawioUser(b.account_id,b.email,b.name.display_name)),a())}));g["catch"](mxUtils.bind(this,function(g){window.clearTimeout(e);d&&(null==g||401!==g.status||b?c({message:mxResources.get("accessDenied")}):(this.setUser(null),
+DropboxClient.prototype.updateUser=function(a,c,b){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),e=this.client.usersGetCurrentAccount();e.then(mxUtils.bind(this,function(b){window.clearTimeout(g);d&&(this.setUser(new DrawioUser(b.account_id,b.email,b.name.display_name)),a())}));e["catch"](mxUtils.bind(this,function(e){window.clearTimeout(g);d&&(null==e||401!==e.status||b?c({message:mxResources.get("accessDenied")}):(this.setUser(null),
 this.client.setAccessToken(null),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)))}))};
-DropboxClient.prototype.authenticate=function(a,c){if(null==window.onDropboxCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,g){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(l,m){if(d){window.onDropboxCallback=null;d=!1;try{null==l?c({message:mxResources.get("accessDenied"),retry:b}):(null!=g&&g(),this.client.setAccessToken(l),
-this.setUser(null),e&&this.setPersistentToken(l),a())}catch(n){c(n)}finally{null!=m&&m.close()}}else null!=m&&m.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onDropboxCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};
-DropboxClient.prototype.executePromise=function(a,c,b){var d=mxUtils.bind(this,function(g){var l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;b({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(m);l&&null!=c&&c(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);l&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null),
-g?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},b)})}):this.authenticate(function(){d(!0)},b)))}))}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},b,a):d(a)});null===this.client.getAccessToken()?this.authenticate(function(){e(!0)},b):e(!1)};DropboxClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
-DropboxClient.prototype.getFile=function(a,c,b,d){d=null!=d?d:!1;var e=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&e){var g=mxUtils.bind(this,function(){var d=a.split("/");this.ui.convertFile(a,0<d.length?d[d.length-1]:a,null,this.extension,c,b)});null!=this.token?g():this.authenticate(g,b)}else g={path:"/"+a},null!=urlParams.rev&&(g.rev=urlParams.rev),this.readFile(g,mxUtils.bind(this,function(b,g){var l=e?b.lastIndexOf(","):
--1,m=null;0<l&&(l=this.ui.extractGraphModelFromPng(b.substring(l+1)),null!=l&&0<l.length?b=l:m=new LocalFile(this,b,a,!0));c(null!=m?m:d?new DropboxLibrary(this.ui,b,g):new DropboxFile(this.ui,b,g))}),b,e)};
-DropboxClient.prototype.readFile=function(a,c,b,d){var e=mxUtils.bind(this,function(l){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),q=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});q.then(mxUtils.bind(this,function(a){}));q["catch"](function(a){window.clearTimeout(n);m&&null!=a&&409==a.status&&(m=!1,b({message:mxResources.get("fileNotFound")}))});q=this.client.filesDownload(a);q.then(mxUtils.bind(this,
-function(a){window.clearTimeout(n);if(m){m=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(b){c(e.result,a)});d?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(p){b(p)}}}));q["catch"](mxUtils.bind(this,function(a){window.clearTimeout(n);m&&(m=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),l?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){g(!0)},
-b)})}):this.authenticate(function(){e(!0)},b)))}))}),g=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){g(!0)},b,a):e(a)});null===this.client.getAccessToken()?this.authenticate(function(){g(!0)},b):g(!1)};
+DropboxClient.prototype.authenticate=function(a,c){if(null==window.onDropboxCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(l,m){if(d){window.onDropboxCallback=null;d=!1;try{null==l?c({message:mxResources.get("accessDenied"),retry:b}):(null!=e&&e(),this.client.setAccessToken(l),
+this.setUser(null),g&&this.setPersistentToken(l),a())}catch(n){c(n)}finally{null!=m&&m.close()}}else null!=m&&m.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onDropboxCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};
+DropboxClient.prototype.executePromise=function(a,c,b){var d=mxUtils.bind(this,function(e){var l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;b({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(m);l&&null!=c&&c(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);l&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null),
+e?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){g(!0)},b)})}):this.authenticate(function(){d(!0)},b)))}))}),g=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){g(!0)},b,a):d(a)});null===this.client.getAccessToken()?this.authenticate(function(){g(!0)},b):g(!1)};DropboxClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
+DropboxClient.prototype.getFile=function(a,c,b,d){d=null!=d?d:!1;var g=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&g){var e=mxUtils.bind(this,function(){var d=a.split("/");this.ui.convertFile(a,0<d.length?d[d.length-1]:a,null,this.extension,c,b)});null!=this.token?e():this.authenticate(e,b)}else e={path:"/"+a},null!=urlParams.rev&&(e.rev=urlParams.rev),this.readFile(e,mxUtils.bind(this,function(b,e){var l=g?b.lastIndexOf(","):
+-1,m=null;0<l&&(l=this.ui.extractGraphModelFromPng(b.substring(l+1)),null!=l&&0<l.length?b=l:m=new LocalFile(this,b,a,!0));c(null!=m?m:d?new DropboxLibrary(this.ui,b,e):new DropboxFile(this.ui,b,e))}),b,g)};
+DropboxClient.prototype.readFile=function(a,c,b,d){var g=mxUtils.bind(this,function(l){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),q=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});q.then(mxUtils.bind(this,function(a){}));q["catch"](function(a){window.clearTimeout(n);m&&null!=a&&409==a.status&&(m=!1,b({message:mxResources.get("fileNotFound")}))});q=this.client.filesDownload(a);q.then(mxUtils.bind(this,
+function(a){window.clearTimeout(n);if(m){m=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(b){c(e.result,a)});d?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(p){b(p)}}}));q["catch"](mxUtils.bind(this,function(a){window.clearTimeout(n);m&&(m=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),l?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},
+b)})}):this.authenticate(function(){g(!0)},b)))}))}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},b,a):g(a)});null===this.client.getAccessToken()?this.authenticate(function(){e(!0)},b):e(!1)};
 DropboxClient.prototype.checkExists=function(a,c,b){var d=this.client.filesGetMetadata({path:"/"+a.toLowerCase(),include_deleted:!1});this.executePromise(d,mxUtils.bind(this,function(d){b?c(!1,!0,d):this.ui.confirm(mxResources.get("replaceIt",[a]),function(){c(!0,!0,d)},function(){c(!1,!0,d)})}),function(a){c(!0,!1)})};
-DropboxClient.prototype.renameFile=function(a,c,b,d){if(/[\\\/:\?\*"\|]/.test(c))d({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=c){var e=a.stat.path_display.substring(1),g=e.lastIndexOf("/");0<g&&(c=e.substring(0,g+1)+c)}null!=a&&null!=c&&a.stat.path_lower.substring(1)!==c.toLowerCase()?this.checkExists(c,mxUtils.bind(this,function(e,g,n){e?(e=mxUtils.bind(this,function(e){e=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+c,autorename:!1});this.executePromise(e,
+DropboxClient.prototype.renameFile=function(a,c,b,d){if(/[\\\/:\?\*"\|]/.test(c))d({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=c){var g=a.stat.path_display.substring(1),e=g.lastIndexOf("/");0<e&&(c=g.substring(0,e+1)+c)}null!=a&&null!=c&&a.stat.path_lower.substring(1)!==c.toLowerCase()?this.checkExists(c,mxUtils.bind(this,function(e,g,n){e?(e=mxUtils.bind(this,function(e){e=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+c,autorename:!1});this.executePromise(e,
 b,d)}),g&&n.path_lower.substring(1)!==c.toLowerCase()?(g=this.client.filesDelete({path:"/"+c.toLowerCase()}),this.executePromise(g,e,d)):e()):d()})):d({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(a,c,b,d){this.insertFile(a,c,b,d,!0)};
-DropboxClient.prototype.insertFile=function(a,c,b,d,e){e=null!=e?e:!1;this.checkExists(a,mxUtils.bind(this,function(g){g?this.saveFile(a,c,mxUtils.bind(this,function(a){e?b(new DropboxLibrary(this.ui,c,a)):b(new DropboxFile(this.ui,c,a))}),d):d()}))};
-DropboxClient.prototype.saveFile=function(a,c,b,d,e){/[\\\/:\?\*"\|]/.test(a)?d({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=c.length?d({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=e?e:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([c],{type:"text/plain"})}),this.executePromise(a,b,d))};
-DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),d=c[0].link.indexOf(this.appPath);if(0<d){var e=decodeURIComponent(c[0].link.substring(d+this.appPath.length-1));this.readFile({path:e},mxUtils.bind(this,function(d,l){if(null!=l&&l.id==c[0].id)try{this.ui.spinner.stop(),
-a(e.substring(1),new DropboxLibrary(this.ui,d,l))}catch(m){this.ui.handleError(m)}else this.createLibrary(c[0],a,b)}),b)}else this.createLibrary(c[0],a,b)}})})};
-DropboxClient.prototype.createLibrary=function(a,c,b){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(d){this.insertFile(a.name,d,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),c(a.getHash().substring(1),a)}catch(g){b(g)}}),b,!0)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};
-DropboxClient.prototype.pickFile=function(a,c){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,c){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):c.getHash(),null,c)}),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")))if(c)this.ui.spinner.stop(),a(b[0].link);else{var d=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)}),g=/\.png$/i.test(b[0].name);if(/\.vsdx$/i.test(b[0].name)||/\.gliffy$/i.test(b[0].name)||!this.ui.useCanvasForExport&&g)e(b[0].link);else{var l=b[0].link.indexOf(this.appPath);if(0<l){var m=decodeURIComponent(b[0].link.substring(l+this.appPath.length-1));this.readFile({path:m},mxUtils.bind(this,function(c,l){if(null!=l&&l.id==b[0].id){var f=g?c.lastIndexOf(","):-1;this.ui.spinner.stop();var k=null;0<f&&(f=this.ui.extractGraphModelFromPng(c.substring(f+
-1)),null!=f&&0<f.length?c=f:k=new LocalFile(this,c,m,!0));a(m.substring(1),null!=k?k:new DropboxFile(this.ui,c,l))}else this.createFile(b[0],e,d)}),d,g)}else this.createFile(b[0],e,d)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
-DropboxClient.prototype.createFile=function(a,c,b){var d=/(\.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 g=d?e.lastIndexOf(","):-1;0<g&&(g=this.ui.extractGraphModelFromPng(e.substring(g+1)),null!=g&&0<g.length&&(e=g));this.insertFile(a.name,e,mxUtils.bind(this,function(b){c(a.name,b)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):
+DropboxClient.prototype.insertFile=function(a,c,b,d,g){g=null!=g?g:!1;this.checkExists(a,mxUtils.bind(this,function(e){e?this.saveFile(a,c,mxUtils.bind(this,function(a){g?b(new DropboxLibrary(this.ui,c,a)):b(new DropboxFile(this.ui,c,a))}),d):d()}))};
+DropboxClient.prototype.saveFile=function(a,c,b,d,g){/[\\\/:\?\*"\|]/.test(a)?d({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=c.length?d({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=g?g:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([c],{type:"text/plain"})}),this.executePromise(a,b,d))};
+DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),d=c[0].link.indexOf(this.appPath);if(0<d){var g=decodeURIComponent(c[0].link.substring(d+this.appPath.length-1));this.readFile({path:g},mxUtils.bind(this,function(d,l){if(null!=l&&l.id==c[0].id)try{this.ui.spinner.stop(),
+a(g.substring(1),new DropboxLibrary(this.ui,d,l))}catch(m){this.ui.handleError(m)}else this.createLibrary(c[0],a,b)}),b)}else this.createLibrary(c[0],a,b)}})})};
+DropboxClient.prototype.createLibrary=function(a,c,b){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(d){this.insertFile(a.name,d,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),c(a.getHash().substring(1),a)}catch(e){b(e)}}),b,!0)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};
+DropboxClient.prototype.pickFile=function(a,c){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,c){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):c.getHash(),null,c)}),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")))if(c)this.ui.spinner.stop(),a(b[0].link);else{var d=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),g=mxUtils.bind(this,
+function(b,c){this.ui.spinner.stop();a(b,c)}),e=/\.png$/i.test(b[0].name);if(/\.vsdx$/i.test(b[0].name)||/\.gliffy$/i.test(b[0].name)||!this.ui.useCanvasForExport&&e)g(b[0].link);else{var l=b[0].link.indexOf(this.appPath);if(0<l){var m=decodeURIComponent(b[0].link.substring(l+this.appPath.length-1));this.readFile({path:m},mxUtils.bind(this,function(c,l){if(null!=l&&l.id==b[0].id){var f=e?c.lastIndexOf(","):-1;this.ui.spinner.stop();var k=null;0<f&&(f=this.ui.extractGraphModelFromPng(c.substring(f+
+1)),null!=f&&0<f.length?c=f:k=new LocalFile(this,c,m,!0));a(m.substring(1),null!=k?k:new DropboxFile(this.ui,c,l))}else this.createFile(b[0],g,d)}),d,e)}else this.createFile(b[0],g,d)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
+DropboxClient.prototype.createFile=function(a,c,b){var d=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(g){null!=g&&0<g.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var e=d?g.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(g.substring(e+1)),null!=e&&0<e.length&&(g=e));this.insertFile(a.name,g,mxUtils.bind(this,function(b){c(a.name,b)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):
 (this.ui.spinner.stop(),b({message:mxResources.get("errorLoadingFile")}))}),b,d)};OneDriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getId=function(){return this.getIdOf(this.meta)};OneDriveFile.prototype.getParentId=function(){return this.getIdOf(this.meta,!0)};OneDriveFile.prototype.getIdOf=function(a,c){return(null!=a.parentReference&&null!=a.parentReference.driveId?a.parentReference.driveId+"/":"")+(null!=c?a.parentReference.id:a.id)};
 OneDriveFile.prototype.getChannelId=function(){return"W-"+DrawioFile.prototype.getChannelId.apply(this,arguments)};OneDriveFile.prototype.getHash=function(){return"W"+encodeURIComponent(this.getId())};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.isSyncSupported=function(){return!0};
 OneDriveFile.prototype.getSize=function(){return this.meta.size};OneDriveFile.prototype.isConflict=function(a){return null!=a&&(412==a.getStatus()||409==a.getStatus())};OneDriveFile.prototype.getCurrentUser=function(){return null!=this.ui.oneDrive?this.ui.oneDrive.user:null};
 OneDriveFile.prototype.loadDescriptor=function(a,c){this.ui.oneDrive.executeRequest(this.ui.oneDrive.getItemURL(this.getId()),mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):null!=c&&c()}),c)};OneDriveFile.prototype.getLatestVersion=function(a,c){this.ui.oneDrive.getFile(this.getId(),a,c)};OneDriveFile.prototype.getDescriptor=function(){return this.meta};OneDriveFile.prototype.setDescriptor=function(a){this.meta=a};
 OneDriveFile.prototype.getDescriptorSecret=function(a){return null!=a.file&&null!=a.file.hashes&&null!=a.file.hashes.quickXorHash?a.file.hashes.quickXorHash:null};OneDriveFile.prototype.getDescriptorEtag=function(a){return a.eTag};OneDriveFile.prototype.setDescriptorEtag=function(a,c){a.eTag=c};
 OneDriveFile.prototype.loadPatchDescriptor=function(a,c){var b=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(b+"?select=etag,file",mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):c(this.ui.oneDrive.parseRequestText(b))}),c)};
-OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,c,b,d,e){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(this.getTitle(),!1,c,b,d,e)};
-OneDriveFile.prototype.saveAs=function(a,c,b){var d=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=d;this.saveFile(a,!1,c,b)};OneDriveFile.prototype.doSave=function(a,c,b,d,e){this.saveFile(a,!1,c,b,d,e)};
-OneDriveFile.prototype.saveFile=function(a,c,b,d,e,g){if(!this.isEditable())null!=b&&b();else if(!this.savingFile)if(this.getTitle()==a){var l=mxUtils.bind(this,function(){var a=g||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),c=this.meta,e=this.isModified,f=this.isModified();this.savingFile=!0;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});k();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,
-function(a,f){this.isModified=e;this.savingFile=!1;this.meta=a;this.fileSaved(f,c,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(a,b){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());if(this.isConflict(b))this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l()}),100+500*Math.random())}),mxUtils.bind(this,
+OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,c,b,d,g){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,c,b,d,g)}),b,d,g])};
+OneDriveFile.prototype.saveAs=function(a,c,b){var d=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=d;this.saveFile(a,!1,c,b)};OneDriveFile.prototype.doSave=function(a,c,b,d,g){this.saveFile(a,!1,c,b,d,g)};
+OneDriveFile.prototype.saveFile=function(a,c,b,d,g,e){if(!this.isEditable())null!=b&&b();else if(!this.savingFile)if(this.getTitle()==a){var l=mxUtils.bind(this,function(){var a=e||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),c=this.meta,g=this.isModified,f=this.isModified();this.savingFile=!0;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});k();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,
+function(a,e){this.isModified=g;this.savingFile=!1;this.meta=a;this.fileSaved(e,c,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(a,b){this.savingFile=!1;this.isModified=g;this.setModified(f||this.isModified());if(this.isConflict(b))this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l()}),100+500*Math.random())}),mxUtils.bind(this,
 function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d();else if(null!=d){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){k();c()}}d(a)}}),a)});l()}else this.savingFile=!0,this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=b&&b();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))};
-OneDriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(e){this.hasSameExtension(a,this.getTitle())?(this.meta=e,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(e)):(this.meta=e,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
+OneDriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.meta=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(g)):(this.meta=g,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
 OneDriveFile.prototype.move=function(a,c,b){this.ui.oneDrive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=c&&c(a)}),b)};OneDriveLibrary=function(a,c,b){OneDriveFile.call(this,a,c,b)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a){DrawioClient.call(this,a,"oneDriveAuthInfo");a=JSON.parse(this.token);null!=a&&(this.token=a.access_token,this.endpointHint=a.endpointHint,this.tokenExpiresOn=a.expiresOn,a=(this.tokenExpiresOn-Date.now())/1E3,this.resetTokenRefresh(600>a?1:a))};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 files.readwrite.all offline_access";OneDriveClient.prototype.redirectUri="https://"+window.location.hostname+"/microsoft";OneDriveClient.prototype.pickerRedirectUri="https://"+window.location.hostname+"/onedrive3.html";OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.extension=".drawio";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";
 OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(a){if(null==a||""===a)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(a))return!1;return!0};
 OneDriveClient.prototype.get=function(a,c,b){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(c,b);return a};
-OneDriveClient.prototype.updateUser=function(a,c,b){var d=!0,e=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(g){window.clearTimeout(e);d&&(200>g.getStatus()||300<=g.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):(g=JSON.parse(g.getText()),this.setUser(new DrawioUser(g.id,null,g.displayName)),
+OneDriveClient.prototype.updateUser=function(a,c,b){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(e){window.clearTimeout(g);d&&(200>e.getStatus()||300<=e.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):(e=JSON.parse(e.getText()),this.setUser(new DrawioUser(e.id,null,e.displayName)),
 a()))}),c)};OneDriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<a&&(this.tokenRefreshInterval=1E3*a,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0)}),900*a))};
-OneDriveClient.prototype.authenticate=function(a,c,b){if(null==window.onOneDriveCallback){var d=mxUtils.bind(this,function(){var e=!0,g=JSON.parse(this.getPersistentToken(!0));null!=g?(new mxXmlRequest(this.redirectUri+"?refresh_token="+g.refresh_token,null,"GET")).send(mxUtils.bind(this,function(e){200<=e.getStatus()&&299>=e.getStatus()?(e=JSON.parse(e.getText()),this.token=e.access_token,e.access_token=e.access_token,e.refresh_token=e.refresh_token,e.expiresOn=Date.now()+1E3*e.expires_in,this.tokenExpiresOn=
-e.expiresOn,this.setPersistentToken(JSON.stringify(e),!e.remember),this.resetTokenRefresh(e.expires_in),a()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=e.getStatus()||b?c({message:mxResources.get("accessDenied"),retry:d}):d())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,g){var l="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes),
-l=window.open(l,"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!=l&&(window.onOneDriveCallback=mxUtils.bind(this,function(l,f){if(e){window.onOneDriveCallback=null;e=!1;try{null==l?c({message:mxResources.get("accessDenied"),retry:d}):(null!=g&&g(),this.setUser(null),this.token=l.access_token,l.expiresOn=Date.now()+1E3*
-l.expires_in,this.tokenExpiresOn=l.expiresOn,l.remember=b,this.setPersistentToken(JSON.stringify(l),!b),this.resetTokenRefresh(l.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){a()}),c))}catch(k){c(k)}finally{null!=f&&f.close()}}else null!=f&&f.close()}),l.focus())}),mxUtils.bind(this,function(){e&&(window.onOneDriveCallback=null,e=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})};
-OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(b){try{if(200<=b.getStatus()&&299>=b.getStatus()){var d=JSON.parse(b.getText());0<d.webUrl.indexOf(".sharepoint.com")?this.endpointHint=d.webUrl:this.endpointHint=this.defEndpointHint;var e=JSON.parse(this.getPersistentToken(!0));null!=e&&(e.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(e),!e.remember));a();return}}catch(g){}c({message:mxResources.get("unknownError")+
+OneDriveClient.prototype.authenticate=function(a,c,b){if(null==window.onOneDriveCallback){var d=mxUtils.bind(this,function(){var g=!0,e=JSON.parse(this.getPersistentToken(!0));null!=e?(new mxXmlRequest(this.redirectUri+"?refresh_token="+e.refresh_token,null,"GET")).send(mxUtils.bind(this,function(e){200<=e.getStatus()&&299>=e.getStatus()?(e=JSON.parse(e.getText()),this.token=e.access_token,e.access_token=e.access_token,e.refresh_token=e.refresh_token,e.expiresOn=Date.now()+1E3*e.expires_in,this.tokenExpiresOn=
+e.expiresOn,this.setPersistentToken(JSON.stringify(e),!e.remember),this.resetTokenRefresh(e.expires_in),a()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=e.getStatus()||b?c({message:mxResources.get("accessDenied"),retry:d}):d())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,e){var l="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes),
+l=window.open(l,"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!=l&&(window.onOneDriveCallback=mxUtils.bind(this,function(l,f){if(g){window.onOneDriveCallback=null;g=!1;try{null==l?c({message:mxResources.get("accessDenied"),retry:d}):(null!=e&&e(),this.setUser(null),this.token=l.access_token,l.expiresOn=Date.now()+1E3*
+l.expires_in,this.tokenExpiresOn=l.expiresOn,l.remember=b,this.setPersistentToken(JSON.stringify(l),!b),this.resetTokenRefresh(l.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){a()}),c))}catch(k){c(k)}finally{null!=f&&f.close()}}else null!=f&&f.close()}),l.focus())}),mxUtils.bind(this,function(){g&&(window.onOneDriveCallback=null,g=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})};
+OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(b){try{if(200<=b.getStatus()&&299>=b.getStatus()){var d=JSON.parse(b.getText());0<d.webUrl.indexOf(".sharepoint.com")?this.endpointHint=d.webUrl:this.endpointHint=this.defEndpointHint;var g=JSON.parse(this.getPersistentToken(!0));null!=g&&(g.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(g),!g.remember));a();return}}catch(e){}c({message:mxResources.get("unknownError")+
 " (Code: "+b.getStatus()+")"})}),c)};
-OneDriveClient.prototype.executeRequest=function(a,c,b){var d=mxUtils.bind(this,function(e){var g=!0,l=window.setTimeout(mxUtils.bind(this,function(){g=!1;b({code:App.ERROR_TIMEOUT,retry:d})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(l);g&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(a)):e||401!==a.getStatus()&&400!==a.getStatus()?b(this.parseRequestText(a)):this.authenticate(function(){d(!0)},
-b,e))}),b)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){d(!0)},b):d(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var c=a.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:a}};
+OneDriveClient.prototype.executeRequest=function(a,c,b){var d=mxUtils.bind(this,function(g){var e=!0,l=window.setTimeout(mxUtils.bind(this,function(){e=!1;b({code:App.ERROR_TIMEOUT,retry:d})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(l);e&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(a)):g||401!==a.getStatus()&&400!==a.getStatus()?b(this.parseRequestText(a)):this.authenticate(function(){d(!0)},
+b,g))}),b)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){d(!0)},b):d(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var c=a.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:a}};
 OneDriveClient.prototype.getItemURL=function(a,c){var b=a.split("/");return 1<b.length?(c?"":this.baseUrl)+"/drives/"+b[0]+"/items/"+b[1]:(c?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!1,!0)};
-OneDriveClient.prototype.getFile=function(a,c,b,d,e){e=null!=e?e:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var d=JSON.parse(a.getText()),g=/\.png$/i.test(d.name);if(/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&g)this.ui.convertFile(d["@microsoft.graph.downloadUrl"],d.name,null!=d.file?d.file.mimeType:null,this.extension,c,b);else{var n=!0,q=window.setTimeout(mxUtils.bind(this,function(){n=
-!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(d["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){window.clearTimeout(q);if(n){var b=g?a.lastIndexOf(","):-1,f=null;0<b?(b=this.ui.extractGraphModelFromPng(a.substring(b+1)),null!=b&&0<b.length?a=b:f=new LocalFile(this.ui,a,d.name,!0)):"data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)&&(a=a.substring(22),a=window.atob&&!mxClient.IS_SF?atob(a):Base64.decode(a));null!=f?c(f):e?c(new OneDriveLibrary(this.ui,a,d)):c(new OneDriveFile(this.ui,
-a,d))}}),mxUtils.bind(this,function(a){window.clearTimeout(q);n&&b(this.parseRequestText(a))}),g||null!=d.file&&null!=d.file.mimeType&&"image/"==d.file.mimeType.substring(0,6))}}else b(this.parseRequestText(a))}),b)};
-OneDriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&(this.isValidFilename(c)?this.checkExists(a.getParentId(),c,!1,mxUtils.bind(this,function(e){e?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:c}),"PATCH","application/json",b,d):d()})):d({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};
-OneDriveClient.prototype.moveFile=function(a,c,b,d){c=this.getItemRef(c);var e=this.getItemRef(a);c.driveId!=e.driveId?d({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:c}),"PATCH","application/json",b,d)};OneDriveClient.prototype.insertLibrary=function(a,c,b,d,e){this.insertFile(a,c,b,d,!0,e)};
-OneDriveClient.prototype.insertFile=function(a,c,b,d,e,g){this.isValidFilename(a)?(e=null!=e?e:!1,this.checkExists(g,a,!0,mxUtils.bind(this,function(l){l?(l="/me/drive/root",null!=g&&(l=this.getItemURL(g,!0)),l=this.baseUrl+l+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(l,c,"PUT",null,mxUtils.bind(this,function(a){e?b(new OneDriveLibrary(this.ui,c,a)):b(new OneDriveFile(this.ui,c,a))}),d)):d()}))):d({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"):
+OneDriveClient.prototype.getFile=function(a,c,b,d,g){g=null!=g?g:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var d=JSON.parse(a.getText()),e=/\.png$/i.test(d.name);if(/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&e)this.ui.convertFile(d["@microsoft.graph.downloadUrl"],d.name,null!=d.file?d.file.mimeType:null,this.extension,c,b);else{var n=!0,q=window.setTimeout(mxUtils.bind(this,function(){n=
+!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(d["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){window.clearTimeout(q);if(n){var b=e?a.lastIndexOf(","):-1,f=null;0<b?(b=this.ui.extractGraphModelFromPng(a.substring(b+1)),null!=b&&0<b.length?a=b:f=new LocalFile(this.ui,a,d.name,!0)):"data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)&&(a=a.substring(22),a=window.atob&&!mxClient.IS_SF?atob(a):Base64.decode(a));null!=f?c(f):g?c(new OneDriveLibrary(this.ui,a,d)):c(new OneDriveFile(this.ui,
+a,d))}}),mxUtils.bind(this,function(a){window.clearTimeout(q);n&&b(this.parseRequestText(a))}),e||null!=d.file&&null!=d.file.mimeType&&"image/"==d.file.mimeType.substring(0,6))}}else b(this.parseRequestText(a))}),b)};
+OneDriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&(this.isValidFilename(c)?this.checkExists(a.getParentId(),c,!1,mxUtils.bind(this,function(g){g?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:c}),"PATCH","application/json",b,d):d()})):d({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};
+OneDriveClient.prototype.moveFile=function(a,c,b,d){c=this.getItemRef(c);var g=this.getItemRef(a);c.driveId!=g.driveId?d({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:c}),"PATCH","application/json",b,d)};OneDriveClient.prototype.insertLibrary=function(a,c,b,d,g){this.insertFile(a,c,b,d,!0,g)};
+OneDriveClient.prototype.insertFile=function(a,c,b,d,g,e){this.isValidFilename(a)?(g=null!=g?g:!1,this.checkExists(e,a,!0,mxUtils.bind(this,function(l){l?(l="/me/drive/root",null!=e&&(l=this.getItemURL(e,!0)),l=this.baseUrl+l+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(l,c,"PUT",null,mxUtils.bind(this,function(a){g?b(new OneDriveLibrary(this.ui,c,a)):b(new OneDriveFile(this.ui,c,a))}),d)):d()}))):d({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"):
 mxResources.get("oneDriveInvalidDeviceName")})};
-OneDriveClient.prototype.checkExists=function(a,c,b,d){var e="/me/drive/root";null!=a&&(e=this.getItemURL(a,!0));this.executeRequest(this.baseUrl+e+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(a){404==a.getStatus()?d(!0):b?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){d(!0)},function(){d(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)}))}),function(a){d(!1)},
-!0)};OneDriveClient.prototype.saveFile=function(a,c,b,d){var e=a.getData(),g=mxUtils.bind(this,function(g){var l=this.getItemURL(a.getId())+"/content/";this.writeFile(l,g,"PUT",null,mxUtils.bind(this,function(a){c(a,e)}),b,d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){g(this.ui.base64ToBlob(a,"image/png"))}),b,this.ui.getCurrentFile()!=a?e:null):g(e)};
-OneDriveClient.prototype.writeFile=function(a,c,b,d,e,g,l){if(null!=a&&null!=c){var m=mxUtils.bind(this,function(n){var q=!0,f=window.setTimeout(mxUtils.bind(this,function(){q=!1;g({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout),k=new mxXmlRequest(a,c,b);k.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Content-Type",d||" ");a.setRequestHeader("Authorization","Bearer "+this.token);null!=l&&a.setRequestHeader("If-Match",l)});k.send(mxUtils.bind(this,function(a){window.clearTimeout(f);
-q&&(200<=a.getStatus()&&299>=a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),e(JSON.parse(a.getText()))):n||401!==a.getStatus()?g(this.parseRequestText(a),a):this.authenticate(function(){m(!0)},g,n))}),mxUtils.bind(this,function(a){window.clearTimeout(f);q&&g(this.parseRequestText(a))}))});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){m(!0)},g):m(!1)}else g({message:mxResources.get("unknownError")})};
+OneDriveClient.prototype.checkExists=function(a,c,b,d){var g="/me/drive/root";null!=a&&(g=this.getItemURL(a,!0));this.executeRequest(this.baseUrl+g+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(a){404==a.getStatus()?d(!0):b?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){d(!0)},function(){d(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)}))}),function(a){d(!1)},
+!0)};OneDriveClient.prototype.saveFile=function(a,c,b,d){var g=a.getData(),e=mxUtils.bind(this,function(e){var l=this.getItemURL(a.getId())+"/content/";this.writeFile(l,e,"PUT",null,mxUtils.bind(this,function(a){c(a,g)}),b,d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,"image/png"))}),b,this.ui.getCurrentFile()!=a?g:null):e(g)};
+OneDriveClient.prototype.writeFile=function(a,c,b,d,g,e,l){if(null!=a&&null!=c){var m=mxUtils.bind(this,function(n){var q=!0,f=window.setTimeout(mxUtils.bind(this,function(){q=!1;e({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout),k=new mxXmlRequest(a,c,b);k.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Content-Type",d||" ");a.setRequestHeader("Authorization","Bearer "+this.token);null!=l&&a.setRequestHeader("If-Match",l)});k.send(mxUtils.bind(this,function(a){window.clearTimeout(f);
+q&&(200<=a.getStatus()&&299>=a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),g(JSON.parse(a.getText()))):n||401!==a.getStatus()?e(this.parseRequestText(a),a):this.authenticate(function(){m(!0)},e,n))}),mxUtils.bind(this,function(a){window.clearTimeout(f);q&&e(this.parseRequestText(a))}))});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){m(!0)},e):m(!1)}else e({message:mxResources.get("unknownError")})};
 OneDriveClient.prototype.parseRequestText=function(a){var c={message:mxResources.get("unknownError")};try{c=JSON.parse(a.getText())}catch(b){}return c};OneDriveClient.prototype.pickLibrary=function(a){this.pickFile(function(c){a(c)})};
 OneDriveClient.prototype.pickFolder=function(a,c){var b=mxUtils.bind(this,function(b){var c=mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(b){a(b);mxClient.IS_IE11&&(this.token=b.accessToken)}),cancel:mxUtils.bind(this,function(){}),
 error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})});b?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){a({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})}),c,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){b(!1)}),this.emptyFn):b(c)};
@@ -8813,67 +8814,68 @@ OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,func
 (mxClient.IS_IE11&&(this.token=b.accessToken),a(OneDriveFile.prototype.getIdOf(b.value[0]),b))}),cancel:mxUtils.bind(this,function(){}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){c();this.ui.hideDialog()}))).container,
 300,140,!0,!0)}),this.emptyFn):c()};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,c,b){DrawioFile.call(this,a,c);this.meta=b};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.getId=function(){return 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.getHash=function(){return encodeURIComponent("H"+this.getId())};
 GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(c){a(200<=c.getStatus()&&299>=c.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.isConflict=function(a){return null!=a&&409==a.status};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.getLatestVersion=function(a,c){this.ui.gitHub.getFile(this.getId(),a,c)};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,c){a.sha=c};GitHubFile.prototype.save=function(a,c,b,d,e,g){this.doSave(this.getTitle(),c,b,d,e,g)};
-GitHubFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};GitHubFile.prototype.doSave=function(a,c,b,d,e,g){var l=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=l;this.saveFile(a,!1,c,b,d,e,g)};
-GitHubFile.prototype.saveFile=function(a,c,b,d,e,g,l){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var m=mxUtils.bind(this,function(c){if(this.getTitle()==a){var e=this.getCurrentEtag(),f=this.data,k=this.isModified,l=this.isModified();this.savingFile=!0;var m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return l}});m();this.ui.gitHub.saveFile(this,mxUtils.bind(this,function(a){this.isModified=k;this.savingFile=!1;this.meta.sha=a.content.sha;
-this.meta.html_url=a.content.html_url;this.meta.download_url=a.content.download_url;this.fileSaved(f,e,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=k;this.setModified(l||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=d&&d({commitMessage:c});else if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){m();b()}}d(a)}}),g,c)}else this.savingFile=!0,this.ui.pickFolder(App.MODE_GITHUB,
+GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(a,c){this.ui.gitHub.getFile(this.getId(),a,c)};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,c){a.sha=c};GitHubFile.prototype.save=function(a,c,b,d,g,e){this.doSave(this.getTitle(),c,b,d,g,e)};
+GitHubFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};GitHubFile.prototype.doSave=function(a,c,b,d,g,e){var l=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=l;this.saveFile(a,!1,c,b,d,g,e)};
+GitHubFile.prototype.saveFile=function(a,c,b,d,g,e,l){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var m=mxUtils.bind(this,function(c){if(this.getTitle()==a){var g=this.getCurrentEtag(),f=this.data,k=this.isModified,l=this.isModified();this.savingFile=!0;var m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return l}});m();this.ui.gitHub.saveFile(this,mxUtils.bind(this,function(a){this.isModified=k;this.savingFile=!1;this.meta.sha=a.content.sha;
+this.meta.html_url=a.content.html_url;this.meta.download_url=a.content.download_url;this.fileSaved(f,g,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=k;this.setModified(l||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=d&&d({commitMessage:c});else if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){m();b()}}d(a)}}),e,c)}else this.savingFile=!0,this.ui.pickFolder(App.MODE_GITHUB,
 mxUtils.bind(this,function(e){this.ui.gitHub.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=b&&b();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,e,c)}))});null!=l?m(l):this.ui.gitHub.showCommitDialog(this.meta.name,null==this.meta.sha||this.meta.isNew,mxUtils.bind(this,function(a){m(a)}),d)}else null!=b&&b()};GitHubLibrary=function(a,c,b){GitHubFile.call(this,a,c,b)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};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=".drawio";GitHubClient.prototype.baseUrl="https://api.github.com";GitHubClient.prototype.maxFileSize=1E6;
-GitHubClient.prototype.updateUser=function(a,c,b){var d=!0,e=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(g){window.clearTimeout(e);d&&(401===g.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):200>g.getStatus()||300<=g.getStatus()?c({message:mxResources.get("accessDenied")}):
-(g=JSON.parse(g.getText()),this.setUser(new DrawioUser(g.id,g.email,g.name)),a()))}))};
-GitHubClient.prototype.authenticate=function(a,c){if(null==window.onGitHubCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,g){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(l,m){if(d)if(window.onGitHubCallback=null,d=!1,null==l)c({message:mxResources.get("accessDenied"),retry:b});else{var n=mxUtils.bind(this,function(){var b=
-!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+l,mxUtils.bind(this,function(f){window.clearTimeout(d);if(b)try{if(200>f.getStatus()||300<=f.getStatus())c({message:mxResources.get("cannotLogin")});else{null!=g&&g();var k=f.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){c(t)}finally{null!=m&&
+GitHubClient.prototype.updateUser=function(a,c,b){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(e){window.clearTimeout(g);d&&(401===e.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):200>e.getStatus()||300<=e.getStatus()?c({message:mxResources.get("accessDenied")}):
+(e=JSON.parse(e.getText()),this.setUser(new DrawioUser(e.id,e.email,e.name)),a()))}))};
+GitHubClient.prototype.authenticate=function(a,c){if(null==window.onGitHubCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(l,m){if(d)if(window.onGitHubCallback=null,d=!1,null==l)c({message:mxResources.get("accessDenied"),retry:b});else{var n=mxUtils.bind(this,function(){var b=
+!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+l,mxUtils.bind(this,function(f){window.clearTimeout(d);if(b)try{if(200>f.getStatus()||300<=f.getStatus())c({message:mxResources.get("cannotLogin")});else{null!=e&&e();var k=f.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);g&&this.setPersistentToken(this.token);a()}}catch(t){c(t)}finally{null!=m&&
 m.close()}}))});n()}else null!=m&&m.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onGitHubCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(a,c){try{var b=JSON.parse(a.getText());null!=b&&null!=b.message&&(c=b.message)}catch(d){}return c};
-GitHubClient.prototype.executeRequest=function(a,c,b,d){var e=mxUtils.bind(this,function(l){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout),q=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+q)};a.send(mxUtils.bind(this,function(){window.clearTimeout(n);if(m)if(200<=a.getStatus()&&299>=a.getStatus()||d&&404==a.getStatus())c(a);else if(401===a.getStatus())l?b({message:mxResources.get("accessDenied"),
-retry:mxUtils.bind(this,function(){this.authenticate(function(){g(!0)},b)})}):this.authenticate(function(){e(!0)},b);else if(403===a.getStatus()){var f=!1;try{var k=JSON.parse(a.getText());null!=k&&null!=k.errors&&0<k.errors.length&&(f="too_large"==k.errors[0].code)}catch(p){}b({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?b({message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()?b({status:409}):b({message:this.getErrorMessage(a,
-mxResources.get("error")+" "+a.getStatus())})}),b)}),g=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){g(!0)},b,a):e(a)});null==this.token?this.authenticate(function(){g(!0)},b):g(!1)};GitHubClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
-GitHubClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;var g=a.split("/"),l=g[0],m=g[1],n=g[2];a=g.slice(3,g.length).join("/");g=/\.png$/i.test(a);!e&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&g)?null!=this.token?(e=this.baseUrl+"/repos/"+l+"/"+m+"/contents/"+a+"?ref="+n+"&token="+this.token,g=a.split("/"),this.ui.convertFile(e,0<g.length?g[g.length-1]:a,null,this.extension,c,b)):b({message:mxResources.get("accessDenied")}):(e="&t="+(new Date).getTime(),
-a=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+m+"/contents/"+a+"?ref="+n+e,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{c(this.createGitHubFile(l,m,n,JSON.parse(a.getText()),d))}catch(f){b(f)}}),b))};
-GitHubClient.prototype.createGitHubFile=function(a,c,b,d,e){a={org:a,repo:c,ref:b,name:d.name,path:d.path,sha:d.sha,html_url:d.html_url,download_url:d.download_url};c=d.content;"base64"===d.encoding&&("PG14ZmlsZS"==c.substring(0,10)?c=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c):/\.jpe?g$/i.test(d.name)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(d.name)?c="data:image/gif;base64,"+c:/\.png$/i.test(d.name)?(d=this.ui.extractGraphModelFromPng(c),c=null!=d&&0<d.length?d:"data:image/png;base64,"+
-c):c=Base64.decode(c));return e?new GitHubLibrary(this.ui,c,a):new GitHubFile(this.ui,c,a)};GitHubClient.prototype.insertLibrary=function(a,c,b,d,e){this.insertFile(a,c,b,d,!0,e,!1)};
-GitHubClient.prototype.insertFile=function(a,c,b,d,e,g,l){e=null!=e?e:!1;g=g.split("/");var m=g[0],n=g[1],q=g[2],f=g.slice(3,g.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(m+"/"+n+"/"+q+"/"+f,!0,mxUtils.bind(this,function(g,p){g?e?(l||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,n,q,f,a,c,p,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());b(this.createGitHubFile(m,n,q,c.content,e))}catch(z){d(z)}}),d)}),d)):b(new GitHubFile(this.ui,
-c,{org:m,repo:n,ref:q,name:a,path:f,sha:p,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,c,b,d){var e=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(c?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){e();b(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
-GitHubClient.prototype.writeFile=function(a,c,b,d,e,g,l,m,n){g.length>=this.maxFileSize?n({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(g.length)+" / 1 MB)"}):(b={path:d,branch:decodeURIComponent(b),message:e,content:g},null!=l&&(b.sha=l),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+d,JSON.stringify(b),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){m(a)}),n))};
-GitHubClient.prototype.checkExists=function(a,c,b){this.getFile(a,mxUtils.bind(this,function(d){if(c&&null!=d.meta){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();b(!0,d.meta.sha)},function(){e();b(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)})}),mxUtils.bind(this,function(a){b(!0)}),null,!0)};
-GitHubClient.prototype.saveFile=function(a,c,b,d,e){var g=a.meta.org,l=a.meta.repo,m=a.meta.ref,n=a.meta.path,q=mxUtils.bind(this,function(d,f){this.writeFile(g,l,m,n,e,f,d,mxUtils.bind(this,function(b){delete a.meta.isNew;c(JSON.parse(b.getText()))}),mxUtils.bind(this,function(a){b(a)}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(n)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){q(a.meta.sha,b)}),b,this.ui.getCurrentFile()!=a?a.getData():null):q(a.meta.sha,
-Base64.encode(a.getData()))});d?this.getFile(g+"/"+l+"/"+encodeURIComponent(m)+"/"+n,mxUtils.bind(this,function(b){a.meta.sha=b.meta.sha;f()}),b):f()};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,c){var b=null,d=null,e=null,g=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="224px";var m=document.createElement("h3");mxUtils.write(m,mxResources.get(a?"selectFile":"selectFolder"));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(m);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.overflow="auto";n.style.lineHeight="1.2em";
-n.style.height="194px";l.appendChild(n);var q=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(e)+"/"+g)}));this.ui.showDialog(q.container,340,270,!0,!0);a&&q.okButton.parentNode.removeChild(q.okButton);var f=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}),k=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom=
-"8px";c.appendChild(f(b+"/"+d,mxUtils.bind(this,function(){g=null;v()})));a||(mxUtils.write(c," / "),c.appendChild(f(decodeURIComponent(e),mxUtils.bind(this,function(){g=null;z()}))));if(null!=g&&0<g.length){var k=g.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(f(k[a],mxUtils.bind(this,function(){g=k.slice(0,a+1).join("/");t()})))})(a)}n.appendChild(c)}),p=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();
-null!=this.getUser()?(g=e=d=b=null,v()):this.ui.hideDialog()}))}),t=mxUtils.bind(this,function(){var l=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/contents/"+g+"?ref="+encodeURIComponent(e),null,"GET");q.okButton.removeAttribute("disabled");n.innerHTML="";this.ui.spinner.spin(n,mxResources.get("loading"));this.executeRequest(l,mxUtils.bind(this,function(l){k();this.ui.spinner.stop();var m=JSON.parse(l.getText());n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){if(""==g)g=null,v();else{var a=
-g.split("/");g=a.slice(0,a.length-1).join("/");t()}})));mxUtils.br(n);null==m||0==m.length?mxUtils.write(n,mxResources.get("noFiles")):(l=mxUtils.bind(this,function(k){for(var l=0;l<m.length;l++)mxUtils.bind(this,function(l){k==("dir"==l.type)&&(n.appendChild(f(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(g=l.path,t()):a&&"file"==l.type&&(this.ui.hideDialog(),c(b+"/"+d+"/"+encodeURIComponent(e)+"/"+l.path))}))),mxUtils.br(n))})(m[l])}),l(!0),a&&l(!1))}),p,!0)}),u=null,
+GitHubClient.prototype.executeRequest=function(a,c,b,d){var g=mxUtils.bind(this,function(l){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),q=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+q)};a.send(mxUtils.bind(this,function(){window.clearTimeout(n);if(m)if(200<=a.getStatus()&&299>=a.getStatus()||d&&404==a.getStatus())c(a);else if(401===a.getStatus())l?b({message:mxResources.get("accessDenied"),
+retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},b)})}):this.authenticate(function(){g(!0)},b);else if(403===a.getStatus()){var f=!1;try{var k=JSON.parse(a.getText());null!=k&&null!=k.errors&&0<k.errors.length&&(f="too_large"==k.errors[0].code)}catch(p){}b({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?b({message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()?b({status:409}):b({message:this.getErrorMessage(a,
+mxResources.get("error")+" "+a.getStatus())})}),b)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},b,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},b):e(!1)};GitHubClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
+GitHubClient.prototype.getFile=function(a,c,b,d,g){d=null!=d?d:!1;var e=a.split("/"),l=e[0],m=e[1],n=e[2];a=e.slice(3,e.length).join("/");e=/\.png$/i.test(a);!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&e)?null!=this.token?(g=this.baseUrl+"/repos/"+l+"/"+m+"/contents/"+a+"?ref="+n+"&token="+this.token,e=a.split("/"),this.ui.convertFile(g,0<e.length?e[e.length-1]:a,null,this.extension,c,b)):b({message:mxResources.get("accessDenied")}):(g="&t="+(new Date).getTime(),
+a=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+m+"/contents/"+a+"?ref="+n+g,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{c(this.createGitHubFile(l,m,n,JSON.parse(a.getText()),d))}catch(f){b(f)}}),b))};
+GitHubClient.prototype.createGitHubFile=function(a,c,b,d,g){a={org:a,repo:c,ref:b,name:d.name,path:d.path,sha:d.sha,html_url:d.html_url,download_url:d.download_url};c=d.content;"base64"===d.encoding&&("PG14ZmlsZS"==c.substring(0,10)?c=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c):/\.jpe?g$/i.test(d.name)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(d.name)?c="data:image/gif;base64,"+c:/\.png$/i.test(d.name)?(d=this.ui.extractGraphModelFromPng(c),c=null!=d&&0<d.length?d:"data:image/png;base64,"+
+c):c=Base64.decode(c));return g?new GitHubLibrary(this.ui,c,a):new GitHubFile(this.ui,c,a)};GitHubClient.prototype.insertLibrary=function(a,c,b,d,g){this.insertFile(a,c,b,d,!0,g,!1)};
+GitHubClient.prototype.insertFile=function(a,c,b,d,g,e,l){g=null!=g?g:!1;e=e.split("/");var m=e[0],n=e[1],q=e[2],f=e.slice(3,e.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(m+"/"+n+"/"+q+"/"+f,!0,mxUtils.bind(this,function(e,p){e?g?(l||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,n,q,f,a,c,p,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());b(this.createGitHubFile(m,n,q,c.content,g))}catch(z){d(z)}}),d)}),d)):b(new GitHubFile(this.ui,
+c,{org:m,repo:n,ref:q,name:a,path:f,sha:p,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,c,b,d){var g=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(c?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){g();b(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
+GitHubClient.prototype.writeFile=function(a,c,b,d,g,e,l,m,n){e.length>=this.maxFileSize?n({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"}):(b={path:d,branch:decodeURIComponent(b),message:g,content:e},null!=l&&(b.sha=l),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+d,JSON.stringify(b),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){m(a)}),n))};
+GitHubClient.prototype.checkExists=function(a,c,b){this.getFile(a,mxUtils.bind(this,function(d){if(c&&null!=d.meta){var g=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){g();b(!0,d.meta.sha)},function(){g();b(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)})}),mxUtils.bind(this,function(a){b(!0)}),null,!0)};
+GitHubClient.prototype.saveFile=function(a,c,b,d,g){var e=a.meta.org,l=a.meta.repo,m=a.meta.ref,n=a.meta.path,q=mxUtils.bind(this,function(d,f){this.writeFile(e,l,m,n,g,f,d,mxUtils.bind(this,function(b){delete a.meta.isNew;c(JSON.parse(b.getText()))}),mxUtils.bind(this,function(a){b(a)}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(n)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){q(a.meta.sha,b)}),b,this.ui.getCurrentFile()!=a?a.getData():null):q(a.meta.sha,
+Base64.encode(a.getData()))});d?this.getFile(e+"/"+l+"/"+encodeURIComponent(m)+"/"+n,mxUtils.bind(this,function(b){a.meta.sha=b.meta.sha;f()}),b):f()};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,c){var b=null,d=null,g=null,e=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="224px";var m=document.createElement("h3");mxUtils.write(m,mxResources.get(a?"selectFile":"selectFolder"));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(m);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.overflow="auto";n.style.lineHeight="1.2em";
+n.style.height="194px";l.appendChild(n);var q=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(q.container,340,270,!0,!0);a&&q.okButton.parentNode.removeChild(q.okButton);var f=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}),k=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom=
+"8px";c.appendChild(f(b+"/"+d,mxUtils.bind(this,function(){e=null;v()})));a||(mxUtils.write(c," / "),c.appendChild(f(decodeURIComponent(g),mxUtils.bind(this,function(){e=null;z()}))));if(null!=e&&0<e.length){var k=e.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(f(k[a],mxUtils.bind(this,function(){e=k.slice(0,a+1).join("/");t()})))})(a)}n.appendChild(c)}),p=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();
+null!=this.getUser()?(e=g=d=b=null,v()):this.ui.hideDialog()}))}),t=mxUtils.bind(this,function(){var l=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/contents/"+e+"?ref="+encodeURIComponent(g),null,"GET");q.okButton.removeAttribute("disabled");n.innerHTML="";this.ui.spinner.spin(n,mxResources.get("loading"));this.executeRequest(l,mxUtils.bind(this,function(l){k();this.ui.spinner.stop();var m=JSON.parse(l.getText());n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){if(""==e)e=null,v();else{var a=
+e.split("/");e=a.slice(0,a.length-1).join("/");t()}})));mxUtils.br(n);null==m||0==m.length?mxUtils.write(n,mxResources.get("noFiles")):(l=mxUtils.bind(this,function(k){for(var l=0;l<m.length;l++)mxUtils.bind(this,function(l){k==("dir"==l.type)&&(n.appendChild(f(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(e=l.path,t()):a&&"file"==l.type&&(this.ui.hideDialog(),c(b+"/"+d+"/"+encodeURIComponent(g)+"/"+l.path))}))),mxUtils.br(n))})(m[l])}),l(!0),a&&l(!1))}),p,!0)}),u=null,
 y=null,z=mxUtils.bind(this,function(a){null==a&&(n.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/branches?per_page=100&page="+a,null,"GET");q.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u);u=document.createElement("a");u.style.display="block";u.setAttribute("href","javascript:void(0);");mxUtils.write(u,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(n,
-"scroll",y);z(a+1)});mxEvent.addListener(u,"click",l);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(k(!0),n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){g=null;v()}))),mxUtils.br(n));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(n,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){n.appendChild(f(a.name,mxUtils.bind(this,function(){e=a.name;g="";t()})));mxUtils.br(n)})(b[c]);100==b.length&&(n.appendChild(u),
+"scroll",y);z(a+1)});mxEvent.addListener(u,"click",l);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(k(!0),n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){e=null;v()}))),mxUtils.br(n));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(n,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){n.appendChild(f(a.name,mxUtils.bind(this,function(){g=a.name;e="";t()})));mxUtils.br(n)})(b[c]);100==b.length&&(n.appendChild(u),
 y=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&l()},mxEvent.addListener(n,"scroll",y))}}),p)}),v=mxUtils.bind(this,function(a){null==a&&(n.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");q.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u);u=document.createElement("a");u.style.display="block";u.setAttribute("href","javascript:void(0);");
 mxUtils.write(u,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(n,"scroll",y);v(a+1)});mxEvent.addListener(u,"click",k);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(n,mxResources.get("noFiles"));else{1==a&&(n.appendChild(f(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 c=a.split("/");if(1<c.length){a=c[0];var f=c[1];3>c.length?(b=a,d=f,g=e=null,z()):this.ui.spinner.spin(n,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+f+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();b=a.meta.org;d=a.meta.repo;e=decodeURIComponent(a.meta.ref);g="";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(n),mxUtils.br(n));for(var l=0;l<c.length;l++)mxUtils.bind(this,function(a){n.appendChild(f(a.full_name,mxUtils.bind(this,function(){b=a.owner.login;d=a.name;e=a.default_branch;g="";t()})));mxUtils.br(n)})(c[l])}100==c.length&&(n.appendChild(u),y=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",
+function(a){if(null!=a){var c=a.split("/");if(1<c.length){a=c[0];var f=c[1];3>c.length?(b=a,d=f,e=g=null,z()):this.ui.spinner.spin(n,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+f+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();b=a.meta.org;d=a.meta.repo;g=decodeURIComponent(a.meta.ref);e="";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(n),mxUtils.br(n));for(var l=0;l<c.length;l++)mxUtils.bind(this,function(a){n.appendChild(f(a.full_name,mxUtils.bind(this,function(){b=a.owner.login;d=a.name;g=a.default_branch;e="";t()})));mxUtils.br(n)})(c[l])}100==c.length&&(n.appendChild(u),y=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",
 y))}),p)});v()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b;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.getSize=function(){return this.meta.bytes};
 TrelloFile.prototype.save=function(a,c,b){this.doSave(this.getTitle(),c,b)};TrelloFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};TrelloFile.prototype.doSave=function(a,c,b){var d=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=d;this.saveFile(a,!1,c,b)};
-TrelloFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable())if(this.savingFile)null!=d&&(this.saveNeededCounter++,d({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,g=this.isModified(),l=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}});l();this.ui.trello.saveFile(this,mxUtils.bind(this,function(g){this.savingFile=!1;this.isModified=e;this.meta=g;this.contentChanged();null!=b&&b();0<this.saveNeededCounter&&
-(this.saveNeededCounter--,this.saveFile(a,c,b,d))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){l();b()}}d(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!=b&&b();this.ui.fileLoaded(e);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,
+TrelloFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable())if(this.savingFile)null!=d&&(this.saveNeededCounter++,d({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.getTitle()==a){var g=this.isModified,e=this.isModified(),l=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return e}});l();this.ui.trello.saveFile(this,mxUtils.bind(this,function(e){this.savingFile=!1;this.isModified=g;this.meta=e;this.contentChanged();null!=b&&b();0<this.saveNeededCounter&&
+(this.saveNeededCounter--,this.saveFile(a,c,b,d))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(e||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){l();b()}}d(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!=b&&b();this.ui.fileLoaded(e);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,
 c,b,d))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,e)}));else null!=b&&b()};TrelloLibrary=function(a,c,b){TrelloFile.call(this,a,c,b)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};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,c,b){b&&this.logout();b=mxUtils.bind(this,function(b,e){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:b?"never":"1hour",success:function(){null!=e&&e();a()},error:function(){null!=e&&e();null!=c&&c(mxResources.get("loggedOut"))}})});this.isAuthorized()?b(!0):this.ui.showAuthDialog(this,!0,b)};TrelloClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!1,!0)};
-TrelloClient.prototype.getFile=function(a,c,b,d,e){e=null!=e?e:!1;var g=mxUtils.bind(this,function(){var d=a.split(this.SEPARATOR),m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);Trello.cards.get(d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(d){window.clearTimeout(n);if(m){var f=/\.png$/i.test(d.name);/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&f?this.ui.convertFile(PROXY_URL+"?url="+
-encodeURIComponent(d.url),d.name,d.mimeType,this.extension,c,b):(m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(d.url),mxUtils.bind(this,function(b){window.clearTimeout(n);if(m){d.compoundId=a;var g=f?b.lastIndexOf(","):-1;0<g&&(g=this.ui.extractGraphModelFromPng(b.substring(g+1)),null!=g&&0<g.length&&(b=g));e?c(new TrelloLibrary(this.ui,b,d)):c(new TrelloFile(this.ui,b,d))}}),mxUtils.bind(this,
-function(a,c){window.clearTimeout(n);m&&(401==c.status?this.authenticate(g,b,!0):b())}),f||null!=d.mimeType&&"image/"==d.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(n);m&&(401==a.status?this.authenticate(g,b,!0):b())}))});this.authenticate(g,b)};TrelloClient.prototype.insertLibrary=function(a,c,b,d,e){this.insertFile(a,c,b,d,!0,e)};
-TrelloClient.prototype.insertFile=function(a,c,b,d,e,g){e=null!=e?e:!1;var l=mxUtils.bind(this,function(){var l=mxUtils.bind(this,function(l){this.writeFile(a,l,g,mxUtils.bind(this,function(a){e?b(new TrelloLibrary(this.ui,c,a)):b(new TrelloFile(this.ui,c,a))}),d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){l(this.ui.base64ToBlob(a,"image/png"))}),d,c):l(c)});this.authenticate(l,d)};
-TrelloClient.prototype.saveFile=function(a,c,b){var d=a.meta.compoundId.split(this.SEPARATOR),e=mxUtils.bind(this,function(e){this.writeFile(a.meta.name,e,d[0],function(a){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){c(a)}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(g,b,!0):b()}))},b)}),g=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"))}),b,this.ui.getCurrentFile()!=a?a.getData():null):e(a.getData())});this.authenticate(g,b)};
-TrelloClient.prototype.writeFile=function(a,c,b,d,e){if(null!=a&&null!=c)if(c.length>=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 10 MB)"});else{var g=mxUtils.bind(this,function(){var l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;e({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout),n=new FormData;n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof c?new Blob([c]):c,a);n.append("name",
-a);var q=new XMLHttpRequest;q.responseType="json";q.onreadystatechange=mxUtils.bind(this,function(){if(4===q.readyState&&(window.clearTimeout(m),l))if(200==q.status){var a=q.response;a.compoundId=b+this.SEPARATOR+a.id;d(a)}else 401==q.status?this.authenticate(g,e,!0):e()});q.open("POST",this.baseUrl+"cards/"+b+"/attachments");q.send(n)});this.authenticate(g,e)}else e({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
+TrelloClient.prototype.authenticate=function(a,c,b){b&&this.logout();b=mxUtils.bind(this,function(b,g){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:b?"never":"1hour",success:function(){null!=g&&g();a()},error:function(){null!=g&&g();null!=c&&c(mxResources.get("loggedOut"))}})});this.isAuthorized()?b(!0):this.ui.showAuthDialog(this,!0,b)};TrelloClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!1,!0)};
+TrelloClient.prototype.getFile=function(a,c,b,d,g){g=null!=g?g:!1;var e=mxUtils.bind(this,function(){var d=a.split(this.SEPARATOR),m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);Trello.cards.get(d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(d){window.clearTimeout(n);if(m){var f=/\.png$/i.test(d.name);/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&f?this.ui.convertFile(PROXY_URL+"?url="+
+encodeURIComponent(d.url),d.name,d.mimeType,this.extension,c,b):(m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(d.url),mxUtils.bind(this,function(b){window.clearTimeout(n);if(m){d.compoundId=a;var e=f?b.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(b.substring(e+1)),null!=e&&0<e.length&&(b=e));g?c(new TrelloLibrary(this.ui,b,d)):c(new TrelloFile(this.ui,b,d))}}),mxUtils.bind(this,
+function(a,c){window.clearTimeout(n);m&&(401==c.status?this.authenticate(e,b,!0):b())}),f||null!=d.mimeType&&"image/"==d.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(n);m&&(401==a.status?this.authenticate(e,b,!0):b())}))});this.authenticate(e,b)};TrelloClient.prototype.insertLibrary=function(a,c,b,d,g){this.insertFile(a,c,b,d,!0,g)};
+TrelloClient.prototype.insertFile=function(a,c,b,d,g,e){g=null!=g?g:!1;var l=mxUtils.bind(this,function(){var l=mxUtils.bind(this,function(l){this.writeFile(a,l,e,mxUtils.bind(this,function(a){g?b(new TrelloLibrary(this.ui,c,a)):b(new TrelloFile(this.ui,c,a))}),d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){l(this.ui.base64ToBlob(a,"image/png"))}),d,c):l(c)});this.authenticate(l,d)};
+TrelloClient.prototype.saveFile=function(a,c,b){var d=a.meta.compoundId.split(this.SEPARATOR),g=mxUtils.bind(this,function(g){this.writeFile(a.meta.name,g,d[0],function(a){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){c(a)}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(e,b,!0):b()}))},b)}),e=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){g(this.ui.base64ToBlob(a,
+"image/png"))}),b,this.ui.getCurrentFile()!=a?a.getData():null):g(a.getData())});this.authenticate(e,b)};
+TrelloClient.prototype.writeFile=function(a,c,b,d,g){if(null!=a&&null!=c)if(c.length>=this.maxFileSize)g({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 10 MB)"});else{var e=mxUtils.bind(this,function(){var l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;g({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),n=new FormData;n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof c?new Blob([c]):c,a);n.append("name",
+a);var q=new XMLHttpRequest;q.responseType="json";q.onreadystatechange=mxUtils.bind(this,function(){if(4===q.readyState&&(window.clearTimeout(m),l))if(200==q.status){var a=q.response;a.compoundId=b+this.SEPARATOR+a.id;d(a)}else 401==q.status?this.authenticate(e,g,!0):g()});q.open("POST",this.baseUrl+"cards/"+b+"/attachments");q.send(n)});this.authenticate(e,g)}else g({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,c){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,c){var b=null,d="@me",e=0,g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,a?mxResources.get("selectFile"):mxResources.get("selectCard"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(l);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.height=
-"194px";g.appendChild(m);g=new CustomDialog(this.ui,g);this.ui.showDialog(g.container,340,270,!0,!0);g.okButton.parentNode.removeChild(g.okButton);var n=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}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),f=mxUtils.bind(this,function(){e=0;m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(b+"/attachments",{fields:"id,name,previews"},
+TrelloClient.prototype.showTrelloDialog=function(a,c){var b=null,d="@me",g=0,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,a?mxResources.get("selectFile"):mxResources.get("selectCard"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(l);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.height=
+"194px";e.appendChild(m);e=new CustomDialog(this.ui,e);this.ui.showDialog(e.container,340,270,!0,!0);e.okButton.parentNode.removeChild(e.okButton);var n=mxUtils.bind(this,function(a,b,c){g++;var d=document.createElement("div");d.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;background:"+(0==g%2?"#eee":"#fff");var e=document.createElement("a");e.setAttribute("href","javascript:void(0);");if(null!=c){var f=document.createElement("img");f.src=c.url;f.width=c.width;f.height=
+c.height;f.style="border: 1px solid black;margin:5px;vertical-align:middle";e.appendChild(f)}mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d.appendChild(e);return d}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),f=mxUtils.bind(this,function(){g=0;m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(b+"/attachments",{fields:"id,name,previews"},
 mxUtils.bind(this,function(a){this.ui.spinner.stop();m.appendChild(n("../ [Up]",mxUtils.bind(this,function(){t()})));mxUtils.br(m);null==a||0==a.length?mxUtils.write(m,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){m.appendChild(n(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();c(b+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[d])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,q,!0):
-null!=q&&q(b)}))});a()}),k=null,p=null,t=mxUtils.bind(this,function(g){null==g&&(e=0,m.innerHTML="",g=1);this.ui.spinner.spin(m,mxResources.get("loading"));null!=k&&null!=k.parentNode&&k.parentNode.removeChild(k);k=document.createElement("a");k.style.display="block";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",p);t(g+1)});mxEvent.addListener(k,"click",l);var u=mxUtils.bind(this,function(){Trello.get("search",
-{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:g-1},mxUtils.bind(this,function(e){this.ui.spinner.stop();e=null!=e?e.cards:null;if(null==e||0==e.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==g&&(m.appendChild(n(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(d=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(m));for(var v=0;v<e.length;v++)mxUtils.bind(this,function(d){m.appendChild(n(d.name,mxUtils.bind(this,function(){a?(b=d.id,f()):(this.ui.hideDialog(),c(d.id))})))})(e[v]);100==e.length&&(m.appendChild(k),p=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&l()},mxEvent.addListener(m,"scroll",p))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(u,q,!0):null!=q&&q({message:a.responseText})}))});u()});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()};App=function(a,c,b){EditorUi.call(this,a,c,null!=b?b:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&a.isModified()&&null!=this.drive&&EditorUi.logEvent({category:"Unload-Modified",action:a.getId(),label:null!=this.drive.user?this.drive.user.id:"unknown-user"})}));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,b,c){var d=null;try{d=window.open(a)}catch(m){}null==d||void 0===d?this.showDialog((new PopupDialog(this,a,b,c)).container,320,140,!0,!0):null!=b&&b()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});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(d){null!=window.console&&console.log("Plugin Error:",d,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="js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"js/onedrive/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.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";
-App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="client,drive-share";
+null!=q&&q(b)}))});a()}),k=null,p=null,t=mxUtils.bind(this,function(e){null==e&&(g=0,m.innerHTML="",e=1);this.ui.spinner.spin(m,mxResources.get("loading"));null!=k&&null!=k.parentNode&&k.parentNode.removeChild(k);k=document.createElement("a");k.style.display="block";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",p);t(e+1)});mxEvent.addListener(k,"click",l);var u=mxUtils.bind(this,function(){Trello.get("search",
+{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:e-1},mxUtils.bind(this,function(g){this.ui.spinner.stop();g=null!=g?g.cards:null;if(null==g||0==g.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==e&&(m.appendChild(n(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(d=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(m));for(var v=0;v<g.length;v++)mxUtils.bind(this,function(d){m.appendChild(n(d.name,mxUtils.bind(this,function(){a?(b=d.id,f()):(this.ui.hideDialog(),c(d.id))})))})(g[v]);100==g.length&&(m.appendChild(k),p=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&l()},mxEvent.addListener(m,"scroll",p))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(u,q,!0):null!=q&&q({message:a.responseText})}))});u()});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()};App=function(a,c,b){EditorUi.call(this,a,c,null!=b?b:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&a.isModified()&&null!=this.drive&&EditorUi.logEvent({category:"DISCARD-SAVE-GOOGLE-"+a.getId()+"."+a.desc.headRevisionId+"."+a.desc.modifiedDate,action:"time-"+(new Date).toISOString()+"-saved-"+(null!=a.lastSaved?a.lastSaved.toISOString():
+"never"),label:null!=this.drive.user?this.drive.user.id:"unknown-user"})}));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,b,c){var d=null;try{d=window.open(a)}catch(q){}null==d||void 0===d?this.showDialog((new PopupDialog(this,a,b,c)).container,320,140,!0,!0):null!=b&&b()});var d=mxClipboard.copy,g=this;mxClipboard.copy=function(a,b){var c=null;try{c=d.apply(this,arguments)}catch(n){g.handleError(n)}return c};this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&
+window.openFile.cancel(!0);this.handleError(a)});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(e){null!=window.console&&console.log("Plugin Error:",e,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="js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"js/onedrive/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.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="client,drive-share";
 App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",ac148:"/plugins/cConf-1-4-8.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.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",f5:"/plugins/rackF5.js",tickets:"/plugins/tickets.js",flow:"/plugins/flow.js",webcola:"/plugins/webcola/webcola.js",rnd:"/plugins/random.js",page:"/plugins/page.js",gd:"/plugins/googledrive.js"};
 App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var c=document.cookie.split(";"),b=0;b<c.length;b++){var d=mxUtils.trim(c[b]);if("MODE="==d.substring(0,5)){a=d.substring(5);break}}null!=a&&isLocalStorage&&(c=new Date,c.setYear(c.getFullYear()-1),document.cookie="MODE=; expires="+c.toUTCString(),localStorage.setItem(".mode",a))}return a};
@@ -8886,9 +8888,9 @@ null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.em
 "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&&(EditorUi.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))},function(a){a=document.getElementById("geStatus");
 null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";b(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function d(){mxResources.loadDefaultBundle=!1;b(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,e){EditorUi.logError(a,b,c,d,e)};if("1"==urlParams.embed||
-"1"==urlParams.lightbox){var e=document.getElementById("geInfo");null!=e&&e.parentNode.removeChild(e)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.offline||"1"==urlParams.appcache)mxscript("js/shapes.min.js"),mxscript("js/stencils.min.js"),mxscript("js/extensions.min.js"),e=document.createElement("iframe"),e.setAttribute("width","0"),e.setAttribute("height",
-"0"),e.setAttribute("src","offline.html"),document.body.appendChild(e);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var e=null!=mxSettings.settings?mxSettings.getPlugins():null,g=urlParams.p;App.initPluginCallback();null!=g&&App.loadPlugins(g.split(";"));if(null!=e&&0<e.length&&"0"!=urlParams.plugins){for(var g=window.location.protocol+"//"+window.location.host,l=!0,m=0;m<e.length&&l;m++)"/"!=e[m].charAt(0)&&
-e[m].substring(0,g.length)!=g&&(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",[e.join("\n")]).replace(/\\n/g,"\n")))for(m=0;m<e.length;m++)try{null==App.pluginsLoaded[e[m]]&&(App.pluginsLoaded[e[m]]=!0,mxscript(e[m]))}catch(f){}}}"function"===typeof window.DriveClient&&
+"1"==urlParams.lightbox){var g=document.getElementById("geInfo");null!=g&&g.parentNode.removeChild(g)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.offline||"1"==urlParams.appcache)mxscript("js/shapes.min.js"),mxscript("js/stencils.min.js"),mxscript("js/extensions.min.js"),g=document.createElement("iframe"),g.setAttribute("width","0"),g.setAttribute("height",
+"0"),g.setAttribute("src","offline.html"),document.body.appendChild(g);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var g=null!=mxSettings.settings?mxSettings.getPlugins():null,e=urlParams.p;App.initPluginCallback();null!=e&&App.loadPlugins(e.split(";"));if(null!=g&&0<g.length&&"0"!=urlParams.plugins){for(var e=window.location.protocol+"//"+window.location.host,l=!0,m=0;m<g.length&&l;m++)"/"!=g[m].charAt(0)&&
+g[m].substring(0,e.length)!=e&&(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",[g.join("\n")]).replace(/\\n/g,"\n")))for(m=0;m<g.length;m++)try{null==App.pluginsLoaded[g[m]]&&(App.pluginsLoaded[g[m]]=!0,mxscript(g[m]))}catch(f){}}}"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();if("1"==urlParams.configure){var n=window.opener||window.parent,q=function(a){if(a.source==n)try{var b=
 JSON.parse(a.data);null!=b&&"configure"==b.action&&(mxEvent.removeListener(window,"message",q),Editor.configure(b.config,!0),mxSettings.load(),d())}catch(p){null!=window.console&&console.log("Error in configuration: "+p)}};mxEvent.addListener(window,"message",q);n.postMessage(JSON.stringify({event:"configure"}),"*")}else d()};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==";
@@ -8900,20 +8902,20 @@ App.prototype.formatShowImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgo
 "/format-show.png";
 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";"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.pluginsLoaded={};App.loadPlugins=function(a,c){for(var b=0;b<a.length;b++)if(null!=a[b]&&0<a[b].length)try{var d=App.pluginRegistry[a[b]];null!=d?null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,"undefined"===typeof window.drawDevUrl?c?mxinclude(d):mxscript(d):c?mxinclude(d):mxscript(drawDevUrl+d)):null!=window.console&&console.log("Unknown plugin:",a[b])}catch(e){null!=window.console&&console.log("Error loading plugin:",a[b],e)}};
+App.pluginsLoaded={};App.loadPlugins=function(a,c){for(var b=0;b<a.length;b++)if(null!=a[b]&&0<a[b].length)try{var d=App.pluginRegistry[a[b]];null!=d?null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,"undefined"===typeof window.drawDevUrl?c?mxinclude(d):mxscript(d):c?mxinclude(d):mxscript(drawDevUrl+d)):null!=window.console&&console.log("Unknown plugin:",a[b])}catch(g){null!=window.console&&console.log("Error loading plugin:",a[b],g)}};
 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 c=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=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var b=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.drive.checkRealtimeFiles(mxUtils.bind(this,function(){var a=(new Date).getDay();if(6===a||0===a||.6<Math.random()){var b=document.createElement("div");b.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";b.className="geStatusAlert";mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(b.style,"transition","all 1s ease");b.style.whiteSpace="nowrap";b.innerHTML=
-'<a href="https://desk.draw.io/support/solutions/articles/16000092210" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;"><img src="'+this.editor.graph.warningImage.src+'" border="0" style="margin-top:-4px;margin-right:2px;" valign="middle"/>&nbsp;You need to take action to convert legacy files. Click here.&nbsp;<img src="'+this.editor.graph.warningImage.src+'" border="0" style="margin-top:-4px;margin-left:2px;" valign="middle"/></a>';a=document.createElement("img");
-a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("close"));a.style.position="absolute";a.style.cursor="pointer";a.style.right="10px";a.style.top="12px";b.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){b.parentNode.removeChild(b);this.hideFooter()}));document.body.appendChild(b);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),1500)}}))}));this.fireEvent(new mxEventObject("clientLoaded",
-"client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:"+App.GOOGLE_APIS,mxUtils.bind(this,function(b){null!=gapi.client&&gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null!=gapi.client.drive&&a()}))}))})),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=b)});b()}if("1"!=urlParams.embed||"1"==urlParams.db){var d=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=d)});d()}if("1"!=urlParams.embed){if(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,!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var e=!0,g=window.setTimeout(mxUtils.bind(this,function(){e=!1;EditorUi.logEvent({category:"Cache",action:"alive",label:408})}),this.timeout),l=(new Date).getTime();
-mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(a){window.clearTimeout(g);e&&EditorUi.logEvent({category:"Cache",action:"alive",label:a.getStatus()+"."+((new Date).getTime()-l)})}))}}else 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};
+this.checkLicense();this.drive.checkRealtimeFiles(mxUtils.bind(this,function(){var a=document.createElement("div");a.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";a.className="geStatusAlert";mxUtils.setPrefixedStyle(a.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(a.style,"transition","all 1s ease");a.style.whiteSpace="nowrap";a.innerHTML='<a href="https://desk.draw.io/support/solutions/articles/16000092210" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;"><img src="'+
+this.editor.graph.warningImage.src+'" border="0" style="margin-top:-4px;margin-right:2px;" valign="middle"/>&nbsp;You need to take action to convert legacy files. Click here.&nbsp;<img src="'+this.editor.graph.warningImage.src+'" border="0" style="margin-top:-4px;margin-left:2px;" valign="middle"/></a>';var b=document.createElement("img");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("close"));b.style.position="absolute";b.style.cursor="pointer";b.style.right=
+"10px";b.style.top="12px";a.appendChild(b);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){a.parentNode.removeChild(a);this.hideFooter()}));document.body.appendChild(a);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(a.style,"transform","translate(-50%,0%)")}),1500)}))}));this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:"+App.GOOGLE_APIS,mxUtils.bind(this,
+function(b){null!=gapi.client&&gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null!=gapi.client.drive&&a()}))}))})),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=b)});b()}if("1"!=urlParams.embed||"1"==urlParams.db){var d=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=d)});d()}if("1"!=urlParams.embed){if(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,!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var g=!0,e=window.setTimeout(mxUtils.bind(this,function(){g=!1;EditorUi.logEvent({category:"Cache",action:"alive",label:408})}),this.timeout),l=(new Date).getTime();mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(a){window.clearTimeout(e);g&&EditorUi.logEvent({category:"Cache",action:"alive",label:a.getStatus()+
+"."+((new Date).getTime()-l)})}))}}else 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.getPusher=function(){null==this.pusher&&"function"===typeof window.Pusher&&(this.pusher=new Pusher(App.PUSHER_KEY,{cluster:App.PUSHER_CLUSTER,encrypted:!0}));return this.pusher};
 App.prototype.checkLicense=function(){var a=this.drive.getUser(),c=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=c){var b=c.lastIndexOf("@"),d=c;0<=b&&(d=c.substring(b+1),c=this.crc32(c.substring(0,b))+"@"+d);mxUtils.post("/license","domain="+encodeURIComponent(d)+"&email="+encodeURIComponent(c)+"&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 c=JSON.parse(b);null!=c&&this.handleLicense(c,d)}}}catch(m){}}))}};App.prototype.handleLicense=function(a,c){null!=a&&null!=a.plugins&&App.loadPlugins(a.plugins.split(";"),!0)};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?a.getData():this.getFileData(!0)};
@@ -8922,18 +8924,18 @@ App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var c
 App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(c){}};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.isChromelessView()){if(a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
 App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,c=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=c&&(a=(null!=c.getTitle()?c.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],c,b=0;256>b;b++){c=b;for(var d=0;8>d;d++)c=c&1?3988292384^c>>>1:c>>>1;a[b]=c}return a};
-App.prototype.getThumbnail=function(a,c){var b=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var d=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),e=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}if(mxClient.IS_CHROMEAPP||!d.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
+App.prototype.getThumbnail=function(a,c){var b=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var d=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,e=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?e.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(e.root)}if(mxClient.IS_CHROMEAPP||!d.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
 function(a){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);c(a)}),a,this.thumbImageCache,"#ffffff",function(){c()},null,null,null,null,null,null,d),b=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var l=document.createElement("canvas"),m=d.getGraphBounds(),n=a/m.width,n=Math.min(1,Math.min(3*a/(4*m.height),n)),q=Math.floor(m.x),f=Math.floor(m.y);l.setAttribute("width",Math.ceil(n*(m.width+4)));l.setAttribute("height",Math.ceil(n*(m.height+4)));var k=l.getContext("2d");
 k.scale(n,n);k.translate(-q,-f);var p=d.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";k.save();k.fillStyle=p;k.fillRect(q,f,Math.ceil(m.width+4),Math.ceil(m.height+4));k.restore();var t=new mxJsCanvas(l),u=new mxAsyncCanvas(this.thumbImageCache);t.images=this.thumbImageCache.images;var y=new mxImageExport;y.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())};y.drawText=function(a,
 b){};y.drawState(d.getView().getState(d.model.root),u);u.finish(mxUtils.bind(this,function(){y.drawState(d.getView().getState(d.model.root),t);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);c(l)}));b=!0}}catch(z){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}return b};
 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(c,b){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var d=this.getCurrentFile();c=null!=d?d.getMode():c;c==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):c==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),
-this.appIcon.style.cursor="pointer"):c==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")}if(b)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var e=new Date;e.setYear(e.getFullYear()+1);document.cookie="MODE="+c+"; expires="+e.toUTCString()}}catch(g){}}})();
+this.appIcon.style.cursor="pointer"):c==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")}if(b)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var g=new Date;g.setYear(g.getFullYear()+1);document.cookie="MODE="+c+"; expires="+g.toUTCString()}}catch(e){}}})();
 App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var c=this.getCurrentFile(),b=null!=c?c.getMode():null;b==App.MODE_GOOGLE?null!=c&&null!=c.desc&&null!=c.desc.parents&&0<c.desc.parents.length&&!mxEvent.isShiftDown(a)?this.openLink("https://drive.google.com/drive/folders/"+c.desc.parents[0].id):null!=c&&null!=c.getId()?this.openLink("https://drive.google.com/open?id="+c.getId()):this.openLink("https://drive.google.com/?authuser=0"):b==App.MODE_DROPBOX?this.openLink("https://www.dropbox.com/"):
 b==App.MODE_ONEDRIVE?this.openLink("https://onedrive.live.com/"):b==App.MODE_TRELLO?this.openLink("https://trello.com/"):b==App.MODE_GITHUB&&(null!=c&&c.constructor==GitHubFile?this.openLink(c.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));if(null!=a&&1<a.length&&"T"==a.charAt(0)){var c=a.indexOf("#");0<c&&(a=a.substring(0,c))}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 c=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(c.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,c,e){this.spinner.stop();null==c&&(c=urlParams.title,e=!0,c=null!=c?decodeURIComponent(c):this.defaultFilename);0<(this.useCanvasForExport?
--1:".png"==c.substring(c.length-4))&&(c=c.substring(0,c.length-4)+".xml");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,c):new LocalFile(this,a,c,e))}))}}catch(b){}};
+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 c=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(c.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,c,g){this.spinner.stop();null==c&&(c=urlParams.title,g=!0,c=null!=c?decodeURIComponent(c):this.defaultFilename);0<(this.useCanvasForExport?
+-1:".png"==c.substring(c.length-4))&&(c=c.substring(0,c.length-4)+".xml");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,c):new LocalFile(this,a,c,g))}))}}catch(b){}};
 App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:"+App.GOOGLE_APIS,mxUtils.bind(this,function(c){null==gapi.client?(this.mode=this.drive=null,a()):gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null==gapi.client.drive&&(this.mode=this.drive=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(){"1"==urlParams["convert-realtime"]?(this.spinner.stop(),this.confirm("You are about to convert realtime files",mxUtils.bind(this,function(){this.drive.convertRealtimeFiles()}),mxUtils.bind(this,function(){this.start()}))):this.start()}))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})};
@@ -8948,8 +8950,8 @@ b&&a(c)})))}}else if(null==this.dialog)if("1"==urlParams.demo)c=Editor.useLocalS
 c=Editor.useLocalStorage;this.createFile(this.defaultFilename,n,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=c&&0<c.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=
 this.getSearch(["create","title"]))}),d=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 c=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,!0,null,!0);Editor.useLocalStorage=c}else this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,this.getFileData(!0),null,b,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c,null,null,null,this.editor.fileExtensions);this.showDialog(b.container,400,a>c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,
-8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}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(e){this.handleError(e)}};
+8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(g){this.handleError(g,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}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(g){this.handleError(g)}};
 App.prototype.showSplash=function(a){var c=this.getServiceCount(!0,!0),b=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>c||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.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},
 mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&b();else{a=4==c?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();b()}),a);this.showDialog(d.container,3>a?260:300,4<=c?420:300,!0,!1);d.init()}};
 App.prototype.addLanguageMenu=function(a,c){var b=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){b=document.createElement("div");b.setAttribute("title",mxResources.get("language"));b.className="geIcon geSprite geSprite-globe";b.style.position="absolute";b.style.cursor="pointer";b.style.bottom="20px";b.style.right="20px";if(c){b.style.direction="rtl";b.style.textAlign="right";b.style.right="24px";var d=document.createElement("span");d.style.display="inline-block";
@@ -8957,32 +8959,32 @@ d.style.fontSize="12px";d.style.margin="5px 24px 0 0";d.style.color="gray";mxUti
 c.popup(d.x,d.y+b.offsetHeight,null,a);this.setCurrentMenu(c)}));a.appendChild(b)}return b};
 App.prototype.pickFile=function(a){try{if(a=null!=a?a:this.mode,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 c=this.getPeerForMode(a);if(null!=c)c.pickFile();else if(a==App.MODE_DEVICE&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,
 "change",mxUtils.bind(this,function(){null!=b.files&&this.openFiles(b.files)}));b.click()}else{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 e=this.dialog,g=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;g.apply(e,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(l){this.handleError(l)}};
+new StorageFile(this,b,c):new LocalFile(this,b,c))}));var g=this.dialog,e=g.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(g,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(l){this.handleError(l)}};
 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 c=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!=c&&c.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"))&&c.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 b=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(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=b;window.openFile=null})}else{var d=document.createElement("input");
 d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if(null!=d.files)for(var a=0;a<d.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)})(d.files[a])}));d.click()}};
-App.prototype.saveLibrary=function(a,c,b,d,e,g,l){try{d=null!=d?d:this.mode;e=null!=e?e:!1;g=null!=g?g:!1;var m=this.createLibraryDataFromImages(c),n=mxUtils.bind(this,function(a){this.spinner.stop();null!=l&&l();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==b&&d==App.MODE_DEVICE&&(b=new LocalLibrary(this,m,a));if(null==b)this.pickFolder(d,mxUtils.bind(this,function(b){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?
+App.prototype.saveLibrary=function(a,c,b,d,g,e,l){try{d=null!=d?d:this.mode;g=null!=g?g:!1;e=null!=e?e:!1;var m=this.createLibraryDataFromImages(c),n=mxUtils.bind(this,function(a){this.spinner.stop();null!=l&&l();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==b&&d==App.MODE_DEVICE&&(b=new LocalLibrary(this,m,a));if(null==b)this.pickFolder(d,mxUtils.bind(this,function(b){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?
 this.drive.insertFile(a,m,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,this.drive.libraryMimeType):d==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,c)}),n,b):d==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,c)}),n,b):d==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,c)}),n,b):d==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,c)}),n,b):d==App.MODE_BROWSER?(b=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,c)}),n)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(e||this.spinner.spin(document.body,mxResources.get("saving"))){b.setData(m);var q=mxUtils.bind(this,
-function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);g||this.libraryLoaded(b,c);null!=l&&l()}),n)});if(a!=b.getTitle()){var f=b.getHash();b.rename(a,mxUtils.bind(this,function(a){b.constructor!=LocalLibrary&&f!=b.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(b.getHash()));this.removeLibrarySidebar(f);q()}),n)}else q()}}catch(k){this.handleError(k)}};
-App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();this.getCurrentFile()==b||b.isModified()||(b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==b.getTitle()||null==this.mode){var e=null!=b.getTitle()?b.getTitle():this.defaultFilename,g=!mxClient.IS_IOS||!navigator.standalone,l=this.mode,m=this.getServiceCount(!0);
-isLocalStorage&&m++;var n=4>=m?2:6<m?4:3,e=new CreateDialog(this,e,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,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),null,!0)):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
-this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,g,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,n,null,null,null,this.editor.fileExtensions);this.showDialog(e.container,460,m>n?390:270,!0,!0);e.init()}else this.save(b.getTitle(),
+this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_BROWSER?(b=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,c)}),n)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(g||this.spinner.spin(document.body,mxResources.get("saving"))){b.setData(m);var q=mxUtils.bind(this,
+function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);e||this.libraryLoaded(b,c);null!=l&&l()}),n)});if(a!=b.getTitle()){var f=b.getHash();b.rename(a,mxUtils.bind(this,function(a){b.constructor!=LocalLibrary&&f!=b.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(b.getHash()));this.removeLibrarySidebar(f);q()}),n)}else q()}}catch(k){this.handleError(k)}};
+App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();this.getCurrentFile()==b||b.isModified()||(b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==b.getTitle()||null==this.mode){var g=null!=b.getTitle()?b.getTitle():this.defaultFilename,e=!mxClient.IS_IOS||!navigator.standalone,l=this.mode,m=this.getServiceCount(!0);
+isLocalStorage&&m++;var n=4>=m?2:6<m?4:3,g=new CreateDialog(this,g,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,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),null,!0)):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
+this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):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,n,null,null,null,this.editor.fileExtensions);this.showDialog(g.container,460,m>n?390:270,!0,!0);g.init()}else this.save(b.getTitle(),
 d)}};
-App.prototype.loadTemplate=function(a,c,b,d){var e=!1,g=a;this.editor.isCorsEnabledForUrl(g)||(g="t="+(new Date).getTime(),g=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+g,e=!0);var l=null!=d?d:a;this.loadUrl(g,mxUtils.bind(this,function(d){try{var g=e?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(g))this.importVisio(this.base64ToBlob(d.substring(d.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&(new XMLHttpRequest).upload&&
-this.isRemoteFileFormat(g,l))this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(g))this.convertLucidChart(g,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(l)||this.isPngData(g))g=this.extractGraphModelFromPng(d);c(g)}}catch(q){b(q)}}),b,/(\.png)($|\?)/i.test(l)||
-/(\.v(dx|sdx?))($|\?)/i.test(l),null,null,e)};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,c,b,d,e,g,l,m){d=m?null:null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var n=mxUtils.bind(this,function(){this.spinner.stop()}),q=mxUtils.bind(this,function(a){n();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(d==App.MODE_GOOGLE&&null!=this.drive)null==l&&null!=this.stateArg&&null!=this.stateArg.folderId&&(l=this.stateArg.folderId),
-this.drive.insertFile(a,c,l,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q);else if(d==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q,!1,l);else if(d==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q,!1,l);else if(d==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,
-b,g,e)}),q);else if(d==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q,!1,l);else if(d==App.MODE_BROWSER){n();var f=mxUtils.bind(this,function(){var d=new StorageFile(this,c,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,b,g,e)}),q)});null==localStorage.getItem(a)?f():this.confirm(mxResources.get("replaceIt",[a]),f,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else n(),
-this.fileCreated(new LocalFile(this,c,a,null==d),b,g,e)}catch(k){n(),this.handleError(k)}}};
-App.prototype.fileCreated=function(a,c,b,d){var e=window.location.pathname;null!=c&&0<c.length&&(e+="?libs="+c);e=this.getUrl(e);a.getMode()!=App.MODE_DEVICE&&(e+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var g=a.getData(),g=0<g.length?this.editor.extractGraphModel(mxUtils.parseXml(g).documentElement,!0):null,l=window.location.protocol+"//"+window.location.hostname+e,m=g,n=null;null!=g&&/\.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(g,n,a,l));null!=n&&n.container.parentNode.removeChild(n.container);var q=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(){q();var f=this.getCurrentFile();null==b&&null!=f&&(b=!f.isModified()&&null==f.getMode());var g=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);b&&a.addAllSavedStatus();null!=c&&this.sidebar.showEntries(c)}),l=mxUtils.bind(this,
-function(){b||null==f||!f.isModified()?g():this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=d&&d();null==b||b?l():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=d&&d(),window.openWindow(e,null,l))});a.constructor==LocalFile?f():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){f()}),mxUtils.bind(this,
+App.prototype.loadTemplate=function(a,c,b,d){var g=!1,e=a;this.editor.isCorsEnabledForUrl(e)||(e="t="+(new Date).getTime(),e=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+e,g=!0);var l=null!=d?d:a;this.loadUrl(e,mxUtils.bind(this,function(d){try{var e=g?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(e))this.importVisio(this.base64ToBlob(d.substring(d.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&(new XMLHttpRequest).upload&&
+this.isRemoteFileFormat(e,l))this.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(e))this.convertLucidChart(e,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(l)||this.isPngData(e))e=this.extractGraphModelFromPng(d);c(e)}}catch(q){b(q)}}),b,/(\.png)($|\?)/i.test(l)||
+/(\.v(dx|sdx?))($|\?)/i.test(l),null,null,g)};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,c,b,d,g,e,l,m){d=m?null:null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var n=mxUtils.bind(this,function(){this.spinner.stop()}),q=mxUtils.bind(this,function(a){n();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(d==App.MODE_GOOGLE&&null!=this.drive)null==l&&null!=this.stateArg&&null!=this.stateArg.folderId&&(l=this.stateArg.folderId),
+this.drive.insertFile(a,c,l,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,e,g)}),q);else if(d==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,e,g)}),q,!1,l);else if(d==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,e,g)}),q,!1,l);else if(d==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,
+b,e,g)}),q);else if(d==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,e,g)}),q,!1,l);else if(d==App.MODE_BROWSER){n();var f=mxUtils.bind(this,function(){var d=new StorageFile(this,c,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,b,e,g)}),q)});null==localStorage.getItem(a)?f():this.confirm(mxResources.get("replaceIt",[a]),f,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else n(),
+this.fileCreated(new LocalFile(this,c,a,null==d),b,e,g)}catch(k){n(),this.handleError(k)}}};
+App.prototype.fileCreated=function(a,c,b,d){var g=window.location.pathname;null!=c&&0<c.length&&(g+="?libs="+c);g=this.getUrl(g);a.getMode()!=App.MODE_DEVICE&&(g+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var e=a.getData(),e=0<e.length?this.editor.extractGraphModel(mxUtils.parseXml(e).documentElement,!0):null,l=window.location.protocol+"//"+window.location.hostname+g,m=e,n=null;null!=e&&/\.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(e,n,a,l));null!=n&&n.container.parentNode.removeChild(n.container);var q=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(){q();var e=this.getCurrentFile();null==b&&null!=e&&(b=!e.isModified()&&null==e.getMode());var f=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);b&&a.addAllSavedStatus();null!=c&&this.sidebar.showEntries(c)}),l=mxUtils.bind(this,
+function(){b||null==e||!e.isModified()?f():this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=d&&d();null==b||b?l():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=d&&d(),window.openWindow(g,null,l))});a.constructor==LocalFile?f():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){f()}),mxUtils.bind(this,
 function(a){q();this.handleError(a)}))}};
-App.prototype.loadFile=function(a,c,b,d,e){this.hideDialog();var g=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 e=localStorage.getItem(a);if(null!=e)this.fileLoaded(new StorageFile(this,e,a)),null!=d&&d();else throw{message:mxResources.get("fileNotFound")};}catch(p){this.handleError(p,
+App.prototype.loadFile=function(a,c,b,d,g){this.hideDialog();var e=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 e=localStorage.getItem(a);if(null!=e)this.fileLoaded(new StorageFile(this,e,a)),null!=d&&d();else throw{message:mxResources.get("fileNotFound")};}catch(p){this.handleError(p,
 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!=b)this.spinner.stop(),this.fileLoaded(b),null!=d&&d();else if("S"==a.charAt(0)){this.spinner.stop();try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))),
 d,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0))this.spinner.stop(),e=decodeURIComponent(a.substring(1)),"<"!=e.charAt(0)&&(e=Graph.decompress(e)),e=new LocalFile(this,e,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),e.getHash=function(){return a},this.fileLoaded(e),null!=d&&d();else if("U"==a.charAt(0)){var g=decodeURIComponent(a.substring(1)),
 f=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+a,c,null,mxUtils.bind(this,function(){var b=this.getCurrentFile();null!=b&&this.editor.chromeless&&!this.editor.editable&&(b.getHash=function(){return"G"+a},window.location.hash="#"+b.getHash());
@@ -8990,31 +8992,31 @@ null!=d&&d()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxReso
 ".png"===e||".drawio"===e)&&(c=d+e)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||f()}}),mxUtils.bind(this,function(){f()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else if(e=null,"G"==a.charAt(0)?e=this.drive:"D"==a.charAt(0)?e=this.dropbox:
 "W"==a.charAt(0)?e=this.oneDrive:"H"==a.charAt(0)?e=this.gitHub:"T"==a.charAt(0)&&(e=this.trello),null==e)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{var k=a.charAt(0);a=decodeURIComponent(a.substring(1));e.getFile(a,mxUtils.bind(this,function(b){this.spinner.stop();this.fileLoaded(b);b=this.getCurrentFile();null==b?(window.location.hash=
 "",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(b.getHash=function(){return k+a},window.location.hash="#"+b.getHash()):window.location.hash=b.getHash();null!=d&&d()}),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()}))}))}}),
-l=this.getCurrentFile(),m=mxUtils.bind(this,function(){e||null==l||!l.isModified()?g():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=l&&(window.location.hash=l.getHash())}),g,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?m():null!=l&&l.isModified()&&!c?window.openWindow(this.getUrl()+"#"+a,null,m):m()};
+l=this.getCurrentFile(),m=mxUtils.bind(this,function(){g||null==l||!l.isModified()?e():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=l&&(window.location.hash=l.getHash())}),e,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?m():null!=l&&l.isModified()&&!c?window.openWindow(this.getUrl()+"#"+a,null,m):m()};
 App.prototype.getLibraryStorageHint=function(a){var c=a.getTitle();a.constructor!=LocalLibrary&&(c+="\n"+a.getHash());a.constructor==DriveLibrary?c+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?c+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?c+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?c+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?c+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?c+=" ("+
 mxResources.get("browser")+")":a.constructor==LocalLibrary&&(c+=" ("+mxResources.get("device")+")");return c};
-App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a,c){c||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),c=mxUtils.bind(this,function(b,c){var d=0,g=[],l=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var a=b.length-1;0<=a;a--)null!=g[a]&&this.loadLibrary(g[a]);null!=c&&c()}});if(null!=b)for(var m=0;m<b.length;m++){var n=encodeURIComponent(decodeURIComponent(b[m]));mxUtils.bind(this,
-function(b,c){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){d++;var e=mxUtils.bind(this,function(a){delete this.pendingLibraries[b];g[c]=a;d--;l()}),f=mxUtils.bind(this,function(c){a(b,c);d--;l()});this.pendingLibraries[b]=!0;var m=b.substring(0,1);if("L"==m)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var a=decodeURIComponent(b.substring(1));this.getLocalData(a,mxUtils.bind(this,function(b){".scratchpad"==a&&
-null==b&&(b=this.emptyLibraryXml);null!=b?e(new StorageLibrary(this,b,a)):f()}))}catch(x){f()}}),0);else if("U"==m){var n=decodeURIComponent(b.substring(1));if(!this.isOffline()){m=n;this.editor.isCorsEnabledForUrl(m)||(m="t="+(new Date).getTime(),m=PROXY_URL+"?url="+encodeURIComponent(n)+"&"+m);try{mxUtils.get(m,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{e(new UrlLibrary(this,a.getText(),n))}catch(x){f()}else f()}),function(){f()})}catch(v){f()}}}else if("R"==m){if(m=
-decodeURIComponent(b.substring(1)),!this.isOffline())try{var m=JSON.parse(m),q={id:m[0],title:m[1],downloadUrl:m[2]};this.remoteInvoke("getFileContent",[q.downloadUrl],null,mxUtils.bind(this,function(a){try{e(new RemoteLibrary(this,a,q))}catch(x){f()}}),function(){f()})}catch(v){f()}}else{var z=null;"G"==m?null!=this.drive&&null!=this.drive.user&&(z=this.drive):"H"==m?null!=this.gitHub&&null!=this.gitHub.getUser()&&(z=this.gitHub):"T"==m?null!=this.trello&&this.trello.isAuthorized()&&(z=this.trello):
-"D"==m?null!=this.dropbox&&null!=this.dropbox.getUser()&&(z=this.dropbox):"W"==m&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(z=this.oneDrive);null!=z?z.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(x){f()}}),function(a){f()}):f(!0)}}})(n,m)}l()});c(mxSettings.getCustomLibraries(),function(){c((urlParams.clibs||"").split(";"))})}};
+App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a,c){c||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),c=mxUtils.bind(this,function(b,c){var d=0,e=[],l=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var a=b.length-1;0<=a;a--)null!=e[a]&&this.loadLibrary(e[a]);null!=c&&c()}});if(null!=b)for(var m=0;m<b.length;m++){var n=encodeURIComponent(decodeURIComponent(b[m]));mxUtils.bind(this,
+function(b,c){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){d++;var f=mxUtils.bind(this,function(a){delete this.pendingLibraries[b];e[c]=a;d--;l()}),g=mxUtils.bind(this,function(c){a(b,c);d--;l()});this.pendingLibraries[b]=!0;var m=b.substring(0,1);if("L"==m)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var a=decodeURIComponent(b.substring(1));this.getLocalData(a,mxUtils.bind(this,function(b){".scratchpad"==a&&
+null==b&&(b=this.emptyLibraryXml);null!=b?f(new StorageLibrary(this,b,a)):g()}))}catch(x){g()}}),0);else if("U"==m){var n=decodeURIComponent(b.substring(1));if(!this.isOffline()){m=n;this.editor.isCorsEnabledForUrl(m)||(m="t="+(new Date).getTime(),m=PROXY_URL+"?url="+encodeURIComponent(n)+"&"+m);try{mxUtils.get(m,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{f(new UrlLibrary(this,a.getText(),n))}catch(x){g()}else g()}),function(){g()})}catch(v){g()}}}else if("R"==m){if(m=
+decodeURIComponent(b.substring(1)),!this.isOffline())try{var m=JSON.parse(m),q={id:m[0],title:m[1],downloadUrl:m[2]};this.remoteInvoke("getFileContent",[q.downloadUrl],null,mxUtils.bind(this,function(a){try{f(new RemoteLibrary(this,a,q))}catch(x){g()}}),function(){g()})}catch(v){g()}}else{var z=null;"G"==m?null!=this.drive&&null!=this.drive.user&&(z=this.drive):"H"==m?null!=this.gitHub&&null!=this.gitHub.getUser()&&(z=this.gitHub):"T"==m?null!=this.trello&&this.trello.isAuthorized()&&(z=this.trello):
+"D"==m?null!=this.dropbox&&null!=this.dropbox.getUser()&&(z=this.dropbox):"W"==m&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(z=this.oneDrive);null!=z?z.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{f(a)}catch(x){g()}}),function(a){g()}):g(!0)}}})(n,m)}l()});c(mxSettings.getCustomLibraries(),function(){c((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",this.shareButton.setAttribute("title",mxResources.get("share")),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,c){var b=this.getCurrentFile(),d=mxResources.get("saving");if(null!=b&&this.spinner.spin(document.body,d)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.bind(this,function(){b.handleFileSuccess(!0);null!=c&&c()}),e=mxUtils.bind(this,function(a){b.handleFileError(a,!0)});try{a==b.getTitle()?b.save(!0,d,e):b.saveAs(a,d,e)}catch(g){b.handleFileError(g,!0)}}};
-App.prototype.pickFolder=function(a,c,b,d,e){b=null!=b?b:!0;var g=this.spinner.pause();b&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){g();if(a.action==google.picker.Action.PICKED){var b=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(b=a.docs[0].id);c(b)}}),e):b&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){g();null!=a&&null!=a.value&&0<a.value.length&&(a=OneDriveFile.prototype.getIdOf(a.value[0]),
-c(a))}),d):b&&a==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){g();c(a)})):b&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){g();c(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
-App.prototype.exportFile=function(a,c,b,d,e,g){e==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):e==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(c,a,g,mxUtils.bind(this,function(a){this.spinner.stop()}),
-mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),b,d):e==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,g):e==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(c,a,mxUtils.bind(this,
-function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,g,d):e==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,g):e==App.MODE_BROWSER&&(b=mxUtils.bind(this,function(){localStorage.setItem(c,a)}),null==localStorage.getItem(c)?
+App.prototype.save=function(a,c){var b=this.getCurrentFile(),d=mxResources.get("saving");if(null!=b&&this.spinner.spin(document.body,d)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.bind(this,function(){b.handleFileSuccess(!0);null!=c&&c()}),g=mxUtils.bind(this,function(a){b.handleFileError(a,!0)});try{a==b.getTitle()?b.save(!0,d,g):b.saveAs(a,d,g)}catch(e){b.handleFileError(e,!0)}}};
+App.prototype.pickFolder=function(a,c,b,d,g){b=null!=b?b:!0;var e=this.spinner.pause();b&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){e();if(a.action==google.picker.Action.PICKED){var b=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(b=a.docs[0].id);c(b)}}),g):b&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){e();null!=a&&null!=a.value&&0<a.value.length&&(a=OneDriveFile.prototype.getIdOf(a.value[0]),
+c(a))}),d):b&&a==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):b&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
+App.prototype.exportFile=function(a,c,b,d,g,e){g==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):g==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(c,a,e,mxUtils.bind(this,function(a){this.spinner.stop()}),
+mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),b,d):g==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(c,a,mxUtils.bind(this,
+function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,e,d):g==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_BROWSER&&(b=mxUtils.bind(this,function(){localStorage.setItem(c,a)}),null==localStorage.getItem(c)?
 b():this.confirm(mxResources.get("replaceIt",[c]),b))};
 App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var c=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,c);this.fname.setAttribute("title",c+" - "+mxResources.get("rename"))}var c=this.editor.graph,b=a.isEditable()&&!a.invalidChecksum;c.isEnabled()&&!b&&c.reset();c.setEnabled(b);null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?
 window.location.hash=a:0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null!=this.format&&this.editor.graph.isSelectionEmpty()&&this.format.refresh()};
-App.prototype.showAuthDialog=function(a,c,b,d){var e=this.spinner.pause();this.showDialog((new AuthDialog(this,a,c,mxUtils.bind(this,function(a){try{null!=b&&b(a,mxUtils.bind(this,function(){this.hideDialog();e()}))}catch(l){this.editor.setStatus(mxUtils.htmlEntities(l.message))}}))).container,300,c?180:140,!0,!0,mxUtils.bind(this,function(a){null!=d&&d();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
-App.prototype.convertFile=function(a,c,b,d,e,g){var l=c;/\.svg$/i.test(l)||(l=l.substring(0,c.lastIndexOf("."))+d);var m=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(m=!0);if(/\.v(dx|sdx?)$/i.test(c)&&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(){if(200<=n.status&&299>=n.status){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.importVisio(a,mxUtils.bind(this,function(a){e(new LocalFile(this,a,l,!0))}),g,c)}else null!=g&&g({message:mxResources.get("errorLoadingFile")})});n.onerror=g;n.send()}else{var q=mxUtils.bind(this,function(b){try{/\.png$/i.test(c)?(temp=this.extractGraphModelFromPng(b),null!=temp?e(new LocalFile(this,temp,l,!0)):e(new LocalFile(this,b,c,!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?e(new LocalFile(this,a.responseText,l,!0)):null!=g&&g({message:mxResources.get("errorLoadingFile")}))}),c):e(new LocalFile(this,b,l,!0))}catch(k){null!=g&&g(k)}});b=/\.png$/i.test(c)||/\.jpe?g$/i.test(c)||null!=b&&"image/"==b.substring(0,6);m?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&
-299>=a.getStatus()){if(null!=e){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(c)?"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));q(b)}}else null!=g&&g({code:App.ERROR_UNKNOWN})}),function(){null!=g&&g({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=g&&g({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,q,g,b)}};
+App.prototype.showAuthDialog=function(a,c,b,d){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,c,mxUtils.bind(this,function(a){try{null!=b&&b(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(l){this.editor.setStatus(mxUtils.htmlEntities(l.message))}}))).container,300,c?180:140,!0,!0,mxUtils.bind(this,function(a){null!=d&&d();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
+App.prototype.convertFile=function(a,c,b,d,g,e){var l=c;/\.svg$/i.test(l)||(l=l.substring(0,c.lastIndexOf("."))+d);var m=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(m=!0);if(/\.v(dx|sdx?)$/i.test(c)&&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(){if(200<=n.status&&299>=n.status){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.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,l,!0))}),e,c)}else null!=e&&e({message:mxResources.get("errorLoadingFile")})});n.onerror=e;n.send()}else{var q=mxUtils.bind(this,function(b){try{/\.png$/i.test(c)?(temp=this.extractGraphModelFromPng(b),null!=temp?g(new LocalFile(this,temp,l,!0)):g(new LocalFile(this,b,c,!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?g(new LocalFile(this,a.responseText,l,!0)):null!=e&&e({message:mxResources.get("errorLoadingFile")}))}),c):g(new LocalFile(this,b,l,!0))}catch(k){null!=e&&e(k)}});b=/\.png$/i.test(c)||/\.jpe?g$/i.test(c)||null!=b&&"image/"==b.substring(0,6);m?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&
+299>=a.getStatus()){if(null!=g){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(c)?"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));q(b)}}else null!=e&&e({code:App.ERROR_UNKNOWN})}),function(){null!=e&&e({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=e&&e({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,q,e,b)}};
 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.height=this.menubarHeight-16+"px";this.appIcon.style.margin="8px 0px 8px 8px";this.appIcon.style.borderRadius="4px";"dark"!=uiTheme&&(this.appIcon.style.backgroundColor="#f08705");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?
@@ -9049,7 +9051,7 @@ mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});a.is
 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:8px;cursor:help;";
 var c=document.createElement("img");mxUtils.setOpacity(c,50);c.style.height="16px";c.style.width="16px";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,c){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(c))};
-var c=Menus.prototype.init;Menus.prototype.init=function(){c.apply(this,arguments);var a=this.editorUi,d=a.editor.graph,e=mxUtils.bind(d,d.isEnabled),g=("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"==
+var c=Menus.prototype.init;Menus.prototype.init=function(){c.apply(this,arguments);var a=this.editorUi,d=a.editor.graph,g=mxUtils.bind(d,d.isEnabled),e=("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),n=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);
 mxClient.IS_SVG||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,l,m,n){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));a.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var b=new NewDialog(a,null,!1,function(b){a.hideDialog();if(null!=b){var c=a.editor.graph.getFreeInsertPoint();d.setSelectionCells(a.importXml(b,Math.max(c.x,20),Math.max(c.y,20),!0));d.scrollCellToVisible(d.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));
@@ -9063,7 +9065,7 @@ a.getBaseFilename(k),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" conten
 null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});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();null!=b&&b.isRevisionHistorySupported()?
 a.spinner.spin(document.body,mxResources.get("loading"))&&b.getRevisions(mxUtils.bind(this,function(b){a.spinner.stop();b=new RevisionDialog(a,b);a.showDialog(b.container,640,480,!0,!0);b.init()}),mxUtils.bind(this,function(b){a.handleError(b)})):a.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");var q=a.actions.addAction("synchronize",function(){a.synchronizeCurrentFile("none"==
 DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(q.label=mxResources.get("refresh"));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),null,!0))});"undefined"!==typeof MathJax&&(q=a.actions.addAction("mathematicalTypesetting",
-function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)}),q.setToggleAction(!0),q.setSelectedCallback(function(){return a.isMathEnabled()}),q.isEnabled=e);if(isLocalStorage||mxClient.IS_CHROMEAPP)q=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var f=
+function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)}),q.setToggleAction(!0),q.setSelectedCallback(function(){return a.isMathEnabled()}),q.isEnabled=g);if(isLocalStorage||mxClient.IS_CHROMEAPP)q=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var f=
 a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});f.setToggleAction(!0);f.setSelectedCallback(function(){return f.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,200,250,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var k="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 targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing 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<k.length;f++){var g=k[f],l=a.copiedStyle[g];e.style[g]!=l&&d.setCellStyles(g,l,[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,
@@ -9088,7 +9090,7 @@ mxUtils.bind(this,function(){var a=d.getGraphBounds(),b=d.view.translate,c=d.vie
 !0,null!=e[a]){for(;0<e[a].length;){var d=e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var l=d[k];if(null!=l.id&&0<l.id.length)if(null==a[l.id]){a[l.id]=l.id;var m=l.getAttribute("parent");null==m?null!=f?mxLog.debug(c+": Multiple roots: "+l.id):f=l.id:(null==e[m]&&(e[m]=[]),e[m].push(l.id))}else g[l.id]=l.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),
 mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null==f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",e)))};"<"!=b.charAt(0)&&(b=Graph.decompress(b),mxLog.debug("See console for uncompressed XML"),console.log("xml",b));var d=mxUtils.parseXml(b),e=a.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=a.getHashValueForPages(e);mxLog.debug("Checksum: ",
 f)}catch(I){mxLog.debug("Error: ",I.message)}else mxLog.debug("No pages found for checksum");var g=d.getElementsByTagName("root");for(b=0;b<g.length;b++)c(g[b]);mxLog.show()}catch(I){a.handleError(I),console.error(I)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()})),a.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=a.pages){var b=new TextareaDialog(a,"Paste Data:","",function(b){if(0<b.length)try{console.log(JSON.stringify(a.diffPages(a.pages,
-a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null,2))}catch(D){a.handleError(D),console.error(D)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),
+a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null,2))}catch(E){a.handleError(E),console.error(E)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.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 l=e.restore;e.restore=function(){g--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);m.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)})),a.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==a.drive?a.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):a.drive.execute(mxUtils.bind(this,function(){var b=prompt("File ID","");if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b+"/realtime?supportsTeamDrives=true",null,"GET");c.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,
 arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)};c.send(function(c){a.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?a.saveLocalFile(c.getText(),"json-"+b+".txt","text/plain"):a.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),a.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",
@@ -9107,18 +9109,18 @@ q.setToggleAction(!0),q.setSelectedCallback(function(){return null!=a.scratchpad
 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_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.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c="data:image/"==b.getData().substring(0,11)?k(b.getTitle()):"text/xml";/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");
-f(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var f=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)),l=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,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,
+(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function f(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c="data:image/"==b.getData().substring(0,11)?k(b.getTitle()):"text/xml";/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");
+g(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var g=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)),l=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,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,
 function(f,m,n){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/n)):1;a.importFile(b,c,k,l,Math.round(m*f),Math.round(n*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;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,k,l,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(){e(a.drive)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
-"...",null,function(){e(a.oneDrive)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},
-c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},c):n&&"function"===typeof window.TrelloClient&&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.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!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){f(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))}))).isEnabled=e;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},
+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(){f(a.drive)},c):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
+"...",null,function(){f(a.oneDrive)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){f(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){f(a.gitHub)},
+c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){f(a.trello)},c):n&&"function"===typeof window.TrelloClient&&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.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!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){g(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))}))).isEnabled=g;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},
 c);"kennedy"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),
 null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,Editor.checkmarkImage)})));q=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&&a!=b.getTitle()&&
 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},null,null,
-null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,340,90,!0,!0);c.init()}}));q.isEnabled=function(){return this.enabled&&e.apply(this,arguments)};q.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);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,
+null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,340,90,!0,!0);c.init()}}));q.isEnabled=function(){return this.enabled&&g.apply(this,arguments)};q.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);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.saveAs(c,mxUtils.bind(this,function(c){b.desc=c;b.save(!1,mxUtils.bind(this,function(){a.spinner.stop();b.setModified(!1);b.addAllSavedStatus()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):a.createFile(c,a.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,a.editor.fileExtensions),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();if(b.getMode()==App.MODE_GOOGLE||b.getMode()==App.MODE_ONEDRIVE){var c=!1;if(b.getMode()==App.MODE_GOOGLE&&null!=b.desc.parents)for(var d=0;d<b.desc.parents.length;d++)if(b.desc.parents[d].isRoot){c=!0;break}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)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",
@@ -9126,21 +9128,21 @@ mxUtils.bind(this,function(){try{var b=a.getCurrentFile();null!=b&&a.drive.showP
 urlParams.embed||a.isOffline()||this.addMenuItems(b,["-","googleDocs","googleSlides"],c)})));var u=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);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)},y=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.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};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,l,m,n){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));a.actions.put("insertText",new Action(mxResources.get("text"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(y("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=e;a.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=e;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=e;a.actions.put("insertRhombus",
-new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=e;var z=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):u(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&
+"+Shift+X").isEnabled=g;a.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=g;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=g;a.actions.put("insertRhombus",
+new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=g;var z=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):u(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&
 !a.isOffline()&&this.addMenuItems(b,["insertTemplate","-"],c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);z(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){z(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));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):g&&"function"===
+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):e&&"function"===
 typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},
 c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+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.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&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);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))}));Editor.enableCustomLibraries&&(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):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+
+c):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+
 "...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+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.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):
 n&&"function"===typeof window.TrelloClient&&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);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):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+
+typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+
 " ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+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.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},
 c):n&&"function"===typeof window.TrelloClient&&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);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.editor.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"))},function(){a.spinner.stop();
+"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.editor.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));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confCloud",null,"Confluence Cloud")+"...",null,function(){a.showRemotelyStoredLibrary(mxResources.get("confCloudLibs",null,"Confluence Cloud Libraries"))},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 editGeometry - 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||EditorUi.isElectronApp)&&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);(!a.isOffline()||
@@ -9156,7 +9158,7 @@ b,c);null!=d&&d.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revision
 function RenamePage(a,c,b){this.ui=a;this.page=c;this.previous=this.name=b}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,c,b){this.ui=a;this.oldIndex=c;this.newIndex=b}
 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,c,b){this.ui=a;this.previousPage=this.page=c;this.neverShown=!0;null!=c&&(this.neverShown=null==c.viewState,this.ui.updatePageRoot(c),null!=b&&(c.viewState=b,this.neverShown=!1))}
 SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,c=this.ui.editor,b=c.graph,d=Graph.compressNode(c.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=b.getViewState();a.root=b.model.root;null!=a.model&&a.model.rootChanged(a.root);b.view.clear(a.root,!0);b.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;b.model.prefix=Editor.guid()+"-";b.model.rootChanged(a.root);
-b.setViewState(a.viewState);b.gridEnabled=b.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);c.updateGraphComponents();b.view.validate();b.sizeDidChange();this.neverShown&&(this.neverShown=!1,b.selectUnlockedLayer());c.graph.fireEvent(new mxEventObject(mxEvent.ROOT));c.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,c,b,d,e){SelectPage.call(this,a,b);this.relatedPage=c;this.index=d;this.previousIndex=null;this.noSelect=e}
+b.setViewState(a.viewState);b.gridEnabled=b.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);c.updateGraphComponents();b.view.validate();b.sizeDidChange();this.neverShown&&(this.neverShown=!1,b.selectUnlockedLayer());c.graph.fireEvent(new mxEventObject(mxEvent.ROOT));c.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,c,b,d,g){SelectPage.call(this,a,b);this.relatedPage=c;this.index=d;this.previousIndex=null;this.noSelect=g}
 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;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};EditorUi.prototype.tabContainerHeight=38;
 EditorUi.prototype.getSelectedPageIndex=function(){var a=null;if(null!=this.pages&&null!=this.currentPage)for(var c=0;c<this.pages.length;c++)if(this.pages[c]==this.currentPage){a=c;break}return a};EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var c=0;c<this.pages.length;c++)if(this.pages[c].getId()==a)return this.pages[c];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,c=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height;this.tabContainer.style.height=
@@ -9164,8 +9166,8 @@ null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.page
 (a.container.scrollLeft=a.view.translate.x*a.view.scale+c.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+c.viewState.scrollTop),b=c);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?1!=MathJax.Hub.queue.pending||null==this.editor||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){null!=this.editor&&this.editor.graph.refresh()})):"undefined"===typeof Editor.MathJaxClear||
 null!=this.editor&&this.editor.graph.mathEnabled||Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var c=b.getProperty("edit").changes,e=0;e<c.length;e++)if(c[e]instanceof SelectPage||c[e]instanceof RenamePage||c[e]instanceof MovePage||c[e]instanceof mxRootChange){d();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
 EditorUi.prototype.restoreViewState=function(a,c,b){a=null!=a?this.getPageById(a.getId()):null;var d=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,c):(d.setViewState(c),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+c.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+c.scrollTop,d.restoreSelection(b))};
-Graph.prototype.createViewState=function(a){var c=a.getAttribute("page"),b=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),e=parseFloat(a.getAttribute("pageHeight")),g=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.isLightboxView()?!1:null!=c?"0"!=c:this.defaultPageVisible,background:null!=g&&0<g.length?g:null,backgroundImage:null!=l?new mxImage(l.src,l.width,l.height):null,pageScale:isNaN(b)?mxGraph.prototype.pageScale:b,pageFormat:isNaN(d)||isNaN(e)?mxSettings.getPageFormat():new mxRectangle(0,0,d,e),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),
+Graph.prototype.createViewState=function(a){var c=a.getAttribute("page"),b=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),g=parseFloat(a.getAttribute("pageHeight")),e=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.isLightboxView()?!1:null!=c?"0"!=c:this.defaultPageVisible,background:null!=e&&0<e.length?e:null,backgroundImage:null!=l?new mxImage(l.src,l.width,l.height):null,pageScale:isNaN(b)?mxGraph.prototype.pageScale:b,pageFormat:isNaN(d)||isNaN(g)?mxSettings.getPageFormat():new mxRectangle(0,0,d,g),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),
 selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}};
 Graph.prototype.saveViewState=function(a,c,b){b||(c.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),c.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),c.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),c.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),c.setAttribute("connect",null==a||a.connect?"1":"0"),c.setAttribute("arrows",null==a||a.arrows?"1":"0"),c.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),c.setAttribute("fold",
 null==a||a.foldingEnabled?"1":"0"));c.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);b=null!=a?a.pageFormat:mxSettings.getPageFormat();null!=b&&(c.setAttribute("pageWidth",b.width),c.setAttribute("pageHeight",b.height));null!=a&&null!=a.background&&c.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));c.setAttribute("math",null!=a&&a.mathEnabled?"1":"0");c.setAttribute("shadow",
@@ -9177,16 +9179,16 @@ a.pageFormat,this.view.currentRoot=a.currentRoot,this.defaultParent=a.defaultPar
 (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.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),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;this.fireEvent(new mxEventObject("viewStateChanged","state",a))};
 EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var c=this.editor.extractGraphModel(a.node);if(null!=c){a.graphModelNode=c;a.viewState=this.editor.graph.createViewState(c);var b=new mxCodec(c.ownerDocument);a.root=b.decode(c).root}else a.root=this.editor.graph.model.createRoot()}else null==a.viewState&&(null==a.graphModelNode&&(c=this.editor.extractGraphModel(a.node),null!=c&&(a.graphModelNode=c)),null!=a.graphModelNode&&(a.viewState=this.editor.graph.createViewState(a.graphModelNode)));
-return a};EditorUi.prototype.selectPage=function(a,c,b){try{this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c=null!=c?c:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var e=new SelectPage(this,a,b);e.execute();d.add(e);d.notify();this.editor.graph.tooltipHandler.hide();c||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}catch(g){this.handleError(g)}};
+return a};EditorUi.prototype.selectPage=function(a,c,b){try{this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c=null!=c?c:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var g=new SelectPage(this,a,b);g.execute();d.add(g);d.notify();this.editor.graph.tooltipHandler.hide();c||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}catch(e){this.handleError(e)}};
 EditorUi.prototype.selectNextPage=function(a){var c=this.currentPage;null!=c&&null!=this.pages&&(c=mxUtils.indexOf(this.pages,c),a?this.selectPage(this.pages[mxUtils.mod(c+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(c-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(a,c){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage();c=null!=c?c:this.pages.length;var b=new ChangePage(this,a,a,c);this.editor.graph.model.execute(b)}return a};
 EditorUi.prototype.createPage=function(a){var c=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"));c.setName(null!=a?a:this.createPageName());return c};EditorUi.prototype.createPageName=function(){for(var a={},c=0;c<this.pages.length;c++){var b=this.pages[c].getName();null!=b&&0<b.length&&(a[b]=b)}c=this.pages.length;do b=mxResources.get("pageWithNumber",[++c]);while(null!=a[b]);return b};
-EditorUi.prototype.removePage=function(a){try{var c=this.editor.graph,b=mxUtils.indexOf(this.pages,a);if(c.isEnabled()&&0<=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(b==this.pages.length-1?b--:b++,d=this.pages[b]):1>=this.pages.length&&(d=this.insertPage(),c.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));c.model.execute(new ChangePage(this,a,d))}finally{c.model.endUpdate()}}}catch(e){this.handleError(e)}return a};
-EditorUi.prototype.duplicatePage=function(a,c){var b=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var e=a.node.cloneNode(!1);e.removeAttribute("id");b=new DiagramPage(e);b.root=d.cloneCell(d.model.root);b.viewState=d.getViewState();b.viewState.scale=1;b.viewState.scrollLeft=null;b.viewState.scrollTop=null;b.viewState.currentRoot=null;b.viewState.defaultParent=null;b.setName(c);b=this.insertPage(b,mxUtils.indexOf(this.pages,a)+1)}}catch(g){this.handleError(g)}return b};
+EditorUi.prototype.removePage=function(a){try{var c=this.editor.graph,b=mxUtils.indexOf(this.pages,a);if(c.isEnabled()&&0<=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(b==this.pages.length-1?b--:b++,d=this.pages[b]):1>=this.pages.length&&(d=this.insertPage(),c.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));c.model.execute(new ChangePage(this,a,d))}finally{c.model.endUpdate()}}}catch(g){this.handleError(g)}return a};
+EditorUi.prototype.duplicatePage=function(a,c){var b=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var g=a.node.cloneNode(!1);g.removeAttribute("id");b=new DiagramPage(g);b.root=d.cloneCell(d.model.root);b.viewState=d.getViewState();b.viewState.scale=1;b.viewState.scrollLeft=null;b.viewState.scrollTop=null;b.viewState.currentRoot=null;b.viewState.defaultParent=null;b.setName(c);b=this.insertPage(b,mxUtils.indexOf(this.pages,a)+1)}}catch(e){this.handleError(e)}return b};
 EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var c=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(c.container,300,80,!0,!0);c.init()}return a};EditorUi.prototype.movePage=function(a,c){this.editor.graph.model.execute(new MovePage(this,a,c))};
 EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.className="geTabContainer";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,c=document.createElement("div");c.style.position="relative";c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";c.style.verticalAlign="top";c.style.height=this.tabContainer.style.height;c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.fontSize="13px";c.style.marginLeft="30px";for(var b=this.editor.isChromelessView()?29:59,d=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-b)/this.pages.length)+1),e=null,g=0;g<this.pages.length;g++)mxUtils.bind(this,function(b,d){this.pages[b]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):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/>"),e=b):mxEvent.consume(c)}));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&&b!=e&&this.movePage(e,b);a.stopPropagation();a.preventDefault()}));c.appendChild(d)})(g,this.createTabForPage(this.pages[g],d,this.pages[g]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(c);d=this.createPageMenuTab();
+b)/this.pages.length)+1),g=null,e=0;e<this.pages.length;e++)mxUtils.bind(this,function(b,d){this.pages[b]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):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/>"),g=b):mxEvent.consume(c)}));mxEvent.addListener(d,"dragend",mxUtils.bind(this,function(a){g=
+null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=g&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=g&&b!=g&&this.movePage(g,b);a.stopPropagation();a.preventDefault()}));c.appendChild(d)})(e,this.createTabForPage(this.pages[e],d,this.pages[e]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(c);d=this.createPageMenuTab();
 this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(c.clientWidth>this.tabContainer.clientWidth-b){null!=d&&(d.style.position="absolute",d.style.right="0px",c.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 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));c.style.width=n+"px";mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){c.scrollLeft-=Math.max(20,n-20);mxUtils.setOpacity(l,0<c.scrollLeft?100:50);mxUtils.setOpacity(m,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(l,0<c.scrollLeft?100:
 50);mxUtils.setOpacity(m,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.addListener(m,"click",mxUtils.bind(this,function(a){c.scrollLeft+=Math.max(20,n-20);mxUtils.setOpacity(l,0<c.scrollLeft?100:50);mxUtils.setOpacity(m,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
@@ -9196,16 +9198,16 @@ EditorUi.prototype.createControlTab=function(a,c){var b=this.createTab(!0);b.sty
 EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;margin-top:5px;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.marginLeft="0px";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var c=
 0;c<this.pages.length;c++)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)})(c);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var d=this.currentPage;null!=d&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,
 function(){this.removePage(d)}),b),a.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(d,d.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(d,mxResources.get("copyOf",[d.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 c=
-mxEvent.getClientX(a),e=mxEvent.getClientY(a);b.popup(c,e,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,c,b){b=this.createTab(b);var d=a.getName()||mxResources.get("untitled"),e=a.getId();b.setAttribute("title",d+(null!=e?" ("+e+")":""));mxUtils.write(b,d);b.style.maxWidth=c+"px";b.style.width=c+"px";this.addTabListeners(a,b);42<c&&(b.style.textOverflow="ellipsis");return b};
-EditorUi.prototype.addTabListeners=function(a,c){mxEvent.disableContextMenu(c);var b=this.editor.graph;mxEvent.addListener(c,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,e=!1;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(c){d=null!=this.currentMenu;e=a==this.currentPage;b.isMouseDown||e||this.selectPage(a)}),null,mxUtils.bind(this,function(g){if(b.isEnabled()&&!b.isMouseDown&&(mxEvent.isTouchEvent(g)&&e||mxEvent.isPopupTrigger(g))){b.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(g)||!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 m=mxEvent.getClientX(g),n=mxEvent.getClientY(g);l.popup(m,n,null,g);this.setCurrentMenu(l,c)}mxEvent.consume(g)}}))};
+mxEvent.getClientX(a),g=mxEvent.getClientY(a);b.popup(c,g,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,c,b){b=this.createTab(b);var d=a.getName()||mxResources.get("untitled"),g=a.getId();b.setAttribute("title",d+(null!=g?" ("+g+")":""));mxUtils.write(b,d);b.style.maxWidth=c+"px";b.style.width=c+"px";this.addTabListeners(a,b);42<c&&(b.style.textOverflow="ellipsis");return b};
+EditorUi.prototype.addTabListeners=function(a,c){mxEvent.disableContextMenu(c);var b=this.editor.graph;mxEvent.addListener(c,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,g=!1;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(c){d=null!=this.currentMenu;g=a==this.currentPage;b.isMouseDown||g||this.selectPage(a)}),null,mxUtils.bind(this,function(e){if(b.isEnabled()&&!b.isMouseDown&&(mxEvent.isTouchEvent(e)&&g||mxEvent.isPopupTrigger(e))){b.popupMenuHandler.hideMenu();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(e)||!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 m=mxEvent.getClientX(e),n=mxEvent.getClientY(e);l.popup(m,n,null,e);this.setCurrentMenu(l,c)}mxEvent.consume(e)}}))};
 EditorUi.prototype.createPageMenu=function(a,c){return mxUtils.bind(this,function(b,d){b.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);b.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);b.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,c)}),d);b.addSeparator(d);b.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
 mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){a=d.oldIndex;d.oldIndex=d.newIndex;d.newIndex=a;return d};mxCodecRegistry.register(a)})();
 (function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){a=d.previous;d.previous=d.name;d.name=a;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),c="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,e){e.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(e.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&e.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(c,
-a)?b:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,e));return e};a.beforeDecode=function(a,c,e){e.ui=a.ui;e.relatedPage=e.ui.getPageById(c.getAttribute("relatedPage"));if(null==e.relatedPage){var b=c.ownerDocument.createElement("diagram");b.setAttribute("id",c.getAttribute("relatedPage"));b.setAttribute("name",c.getAttribute("name"));e.relatedPage=new DiagramPage(b);b=c.getAttribute("viewState");null!=b&&(e.relatedPage.viewState=JSON.parse(b),c.removeAttribute("viewState"));
-c=c.cloneNode(!0);b=c.firstChild;if(null!=b)for(e.relatedPage.root=a.decodeCell(b,!1),e=b.nextSibling,b.parentNode.removeChild(b),b=e;null!=b;){e=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var d=b.getAttribute("id");null==a.lookup(d)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=e}}return c};a.afterDecode=function(a,c,e){e.index=e.previousIndex;return e};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";EditorUi.prototype.altShiftActions[68]=
+(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),c="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,g){g.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(g.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&g.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(c,
+a)?b:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,g));return g};a.beforeDecode=function(a,c,g){g.ui=a.ui;g.relatedPage=g.ui.getPageById(c.getAttribute("relatedPage"));if(null==g.relatedPage){var b=c.ownerDocument.createElement("diagram");b.setAttribute("id",c.getAttribute("relatedPage"));b.setAttribute("name",c.getAttribute("name"));g.relatedPage=new DiagramPage(b);b=c.getAttribute("viewState");null!=b&&(g.relatedPage.viewState=JSON.parse(b),c.removeAttribute("viewState"));
+c=c.cloneNode(!0);b=c.firstChild;if(null!=b)for(g.relatedPage.root=a.decodeCell(b,!1),g=b.nextSibling,b.parentNode.removeChild(b),b=g;null!=b;){g=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var d=b.getAttribute("id");null==a.lookup(d)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=g}}return c};a.afterDecode=function(a,c,g){g.index=g.previousIndex;return g};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";EditorUi.prototype.altShiftActions[68]=
 "selectDescendants";var c=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,b,d,m,n){b=null!=b?b:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var e=d.slice(),f=[],g=0;g<d.length;g++){var l=this.view.getState(d[g]),t=null!=l?l.style:this.getCellStyle(d[g]);"1"==mxUtils.getValue(t,"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=e;d=c.apply(this,arguments)}finally{this.model.endUpdate()}return d};var b=EditorUi.prototype.init;EditorUi.prototype.init=function(){b.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return y.isVertex(a)&&c(a)}function c(a){var b=!1;null!=a&&(a=y.getParent(a),b=u.view.getState(a),u.view.getState(a),b="tree"==(null!=
 b?b.style:u.getCellStyle(a)).containerType);return b}function d(a){var b=!1;null!=a&&(a=y.getParent(a),b=u.view.getState(a),u.view.getState(a),b=null!=(null!=b?b.style:u.getCellStyle(a)).childLayout);return b}function m(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==
@@ -9223,16 +9225,16 @@ a=u.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(u.mod
 t.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");t.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+D");var v=u.removeCells;
 u.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];y.isEdge(g)&&c(g)&&(e.push(g),g=y.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)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
 d))};var x=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 k=x.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=u.getIncomingEdges(k[e]),g=u.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,
-u.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var D=u.moveCells;u.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])||u.model.isEdge(a[q])&&null==u.model.getTerminal(a[q],!0)){f=u.model.getParent(a[q]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var v=
-u.getIncomingEdges(a[0]);if(0<v.length){var t=u.view.getState(u.model.getTerminal(v[0],!0));if(null!=t){var y=u.view.getState(m);null!=y&&(c=(y.getCenterX()-t.getCenterX())/u.view.scale,d=(y.getCenterY()-t.getCenterY())/u.view.scale)}}}}l=D.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])&&(v=u.getIncomingEdges(a[q]),0<v.length))if(!e)b(m)&&
+u.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var E=u.moveCells;u.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])||u.model.isEdge(a[q])&&null==u.model.getTerminal(a[q],!0)){f=u.model.getParent(a[q]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var v=
+u.getIncomingEdges(a[0]);if(0<v.length){var t=u.view.getState(u.model.getTerminal(v[0],!0));if(null!=t){var y=u.view.getState(m);null!=y&&(c=(y.getCenterX()-t.getCenterX())/u.view.scale,d=(y.getCenterY()-t.getCenterY())/u.view.scale)}}}}l=E.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])&&(v=u.getIncomingEdges(a[q]),0<v.length))if(!e)b(m)&&
 0>mxUtils.indexOf(a,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==u.getIncomingEdges(l[q]).length){n=m;if(null==n||n==u.model.getParent(a[q]))n=u.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,u.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var J=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=u.model,g=null;f.beginUpdate();try{if(g=J.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=u.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var F={88:t.actions.get("selectChildren"),84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},A=t.onKeyDown;t.onKeyDown=function(a){try{if(u.isEnabled()&&!u.isEditing()&&b(u.getSelectionCell())&&1==u.getSelectionCount()){var c=null;0<u.getIncomingEdges(u.getSelectionCell()).length&&
-(9==a.which?c=mxEvent.isShiftDown(a)?q(u.getSelectionCell()):f(u.getSelectionCell()):13==a.which&&(c=n(u.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&u.model.isEdge(c[0])?u.setSelectionCell(u.model.getTerminal(c[0],!1)):u.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(u.view.getState(u.getSelectionCell())),u.startEditingAtCell(u.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=F[a.keyCode];
-null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(u.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(u.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(u.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(u.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(M){console.log("error",M)}mxEvent.isConsumed(a)||A.apply(this,arguments)};var E=u.connectVertex;u.connectVertex=
-function(a,c,d,e,g,k){var l=u.getIncomingEdges(a);return b(a)&&0<l.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?f(a):e==g?q(a):n(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):E.call(this,a,c,d,e,g,k)};u.getSubtree=function(a){var c=[a];b(a)&&!d(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 I=
+null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=u.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var G={88:t.actions.get("selectChildren"),84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},A=t.onKeyDown;t.onKeyDown=function(a){try{if(u.isEnabled()&&!u.isEditing()&&b(u.getSelectionCell())&&1==u.getSelectionCount()){var c=null;0<u.getIncomingEdges(u.getSelectionCell()).length&&
+(9==a.which?c=mxEvent.isShiftDown(a)?q(u.getSelectionCell()):f(u.getSelectionCell()):13==a.which&&(c=n(u.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&u.model.isEdge(c[0])?u.setSelectionCell(u.model.getTerminal(c[0],!1)):u.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(u.view.getState(u.getSelectionCell())),u.startEditingAtCell(u.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=G[a.keyCode];
+null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(u.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(u.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(u.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(u.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(M){console.log("error",M)}mxEvent.isConsumed(a)||A.apply(this,arguments)};var D=u.connectVertex;u.connectVertex=
+function(a,c,d,e,g,k){var l=u.getIncomingEdges(a);return b(a)&&0<l.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?f(a):e==g?q(a):n(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):D.call(this,a,c,d,e,g,k)};u.getSubtree=function(a){var c=[a];b(a)&&!d(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 I=
 mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){I.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),
+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 F=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){F.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.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;");
@@ -9247,20 +9249,20 @@ c.insertEdge(e,!0);d.insertEdge(e,!1);var f=new mxCell("Division",new mxGeometry
 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 c=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,
-0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");d.geometry.setTerminalPoint(new mxPoint(110,-40),!0);d.geometry.relative=!0;d.edge=!0;c.insertEdge(d,!1);return sb.createVertexTemplateFromCells([b,d,a,c],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new e(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&&
-a.formatWindow.window.fit()}function c(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new e(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;cusor:pointer;";
+0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");d.geometry.setTerminalPoint(new mxPoint(110,-40),!0);d.geometry.relative=!0;d.edge=!0;c.insertEdge(d,!1);return sb.createVertexTemplateFromCells([b,d,a,c],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new g(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&&
+a.formatWindow.window.fit()}function c(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new g(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;cusor:pointer;";
 g.className="geTitle";b.appendChild(g);return g}var d=document.createElement("div");d.style.cssText="position:absolute;left:0;right:0;border-top:1px solid lightgray;height:24px;bottom:31px;text-align:center;cursor:pointer;padding:6px 0 0 0;";d.className="geTitle";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var e=new Menubar(a,b);if(!Editor.enableCustomLibraries||
 "1"==urlParams.embed&&"1"!=urlParams.libraries)d.style.bottom="0";else if(null!=a.actions.get("newLibrary")){d=document.createElement("div");d.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;";d.className="geTitle";var f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("newLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,
 "click",a.actions.get("newLibrary").funct);d=document.createElement("div");d.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;";d.className="geTitle";f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("openLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=
 c("newLibrary",mxResources.get("newLibrary")),d.style.left="0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.left="50%";b.appendChild(a.sidebar.container);b.style.overflow="hidden";return b});a.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());
 a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var d=document.createElement("style");d.type="text/css";d.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }html body a.geMenuItem { opacity: 0.75; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton { opacity: 0.3; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity:0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }"+
-(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(y){}var e=function(a,b,c,d,e,f,g){var k=document.createElement("div");k.className="geSidebarContainer";k.style.position="absolute";k.style.width="100%";k.style.height="100%";k.style.border="1px solid whiteSmoke";k.style.overflowX="hidden";k.style.overflowY="auto";g(k);this.window=new mxWindow(b,k,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(y){}var g=function(a,b,c,d,e,f,g){var k=document.createElement("div");k.className="geSidebarContainer";k.style.position="absolute";k.style.width="100%";k.style.height="100%";k.style.border="1px solid whiteSmoke";k.style.overflowX="hidden";k.style.overflowY="auto";g(k);this.window=new mxWindow(b,k,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
 this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.setLocation=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};mxClient.IS_SF&&
 (this.window.div.onselectstart=mxUtils.bind(this,function(b){null==b&&(b=window.event);return null!=b&&a.isSelectionAllowed(b)}))};Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;
 mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR=
 "#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=35;mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";Format.prototype.inactiveTabBackgroundColor=
-"#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!0;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var g=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=
-function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");g.apply(this,arguments)};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var m=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,c){null!=c.shortcut&&900>b&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",
+"#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!0;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var e=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=
+function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");e.apply(this,arguments)};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var m=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,c){null!=c.shortcut&&900>b&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",
 c.shortcut):m.apply(this,arguments)};var n=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){n.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="display:inline-block;position:relative;margin-right:4px;cursor:pointer;";a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height=
 "24px";a.style.width="24px";a.style.cssFloat="right";a.setAttribute("title",mxResources.get("changeUser"))}};var q=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){q.apply(this,arguments);if(null!=this.shareButton){var a=this.shareButton;a.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.shareImage+")";a.style.backgroundPosition=
 "center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height="24px";a.style.width="24px"}};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer){var a=document.createElement("div");a.style.display="inline-block";a.style.position="relative";a.style.marginTop="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="1"==urlParams.saveAndExit?
@@ -9306,13 +9308,13 @@ k.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;he
 B.style.overflow="hidden";B.style.visibility="hidden";B.style.textAlign="center";B.style.color="#000";B.style.fontSize="12px";B.style.color="#707070";B.style.width="59px";B.style.cursor="pointer";B.style.borderTop="1px solid lightgray";B.style.borderLeft="1px solid lightgray";B.style.height=parseInt(k.tabContainerHeight)-1+"px";B.style.lineHeight=parseInt(k.tabContainerHeight)+1+"px";t.appendChild(B);H=mxUtils.bind(this,function(){B.innerHTML=Math.round(100*k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,
 H);k.editor.addListener("resetGraphView",H);k.editor.addListener("pageSelected",H);var K=k.setGraphEnabled;k.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(B.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}t.appendChild(k.tabContainer);t.appendChild(m);t.appendChild(k.diagramContainer);g.appendChild(t);k.updateTabContainer();var M=null;f();mxEvent.addListener(window,
 "resize",function(){f();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}};
-(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,g,l){var d=c.y,e=c.x,q=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var k=this,p=new mxCellState,t=this.graph.getView().scale,u=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+e;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var y=[],z=[],v=0;v<this.states.length;v++){var x=this.states[v];x instanceof mxCellState&&(l||!this.graph.isCellSelected(x.cell))&&((p.x>=x.x&&p.x<=x.x+x.width||x.x>=p.x&&x.x<=p.x+p.width)&&(p.y>
-x.y+x.height+4||p.y+p.height+4<x.y)?y.push(x):(p.y>=x.y&&p.y<=x.y+x.height||x.y>=p.y&&x.y<=p.y+p.height)&&(p.x>x.x+x.width+4||p.x+p.width+4<x.x)&&z.push(x))}var D=0,J=0,F=x=0,A=0,E=0,I=0,C=0,G=5*t;if(1<y.length){y.push(p);y.sort(function(a,b){return a.y-b.y});var H=!1,v=p==y[0],t=p==y[y.length-1];if(!v&&!t)for(v=1;v<y.length-1;v++)if(p==y[v]){t=y[v-1];v=y[v+1];x=J=F=(v.y-t.y-t.height-p.height)/2;break}for(v=0;v<y.length-1;v++){var t=y[v],B=y[v+1],K=p==t||p==B,B=B.y-t.y-t.height,H=H|p==t;if(0==J&&
-0==D)J=B,D=1;else if(Math.abs(J-B)<=(K||1==v&&H?u:0))D+=1;else if(1<D&&H){y=y.slice(0,v+1);break}else if(3<=y.length-v&&!H)D=0,x=J=0!=F?F:0,y.splice(0,0==v?1:v),v=-1;else break;0!=x||K||(J=x=B)}3==y.length&&y[1]==p&&(x=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});H=!1;v=p==z[0];t=p==z[z.length-1];if(!v&&!t)for(v=1;v<z.length-1;v++)if(p==z[v]){t=z[v-1];v=z[v+1];I=E=C=(v.x-t.x-t.width-p.width)/2;break}for(v=0;v<z.length-1;v++){t=z[v];B=z[v+1];K=p==t||p==B;B=B.x-t.x-t.width;H|=p==
-t;if(0==E&&0==A)E=B,A=1;else if(Math.abs(E-B)<=(K||1==v&&H?u:0))A+=1;else if(1<A&&H){z=z.slice(0,v+1);break}else if(3<=z.length-v&&!H)A=0,I=E=0!=C?C:0,z.splice(0,0==v?1:v),v=-1;else break;0!=I||K||(E=I=B)}3==z.length&&z[1]==p&&(I=0)}u=function(a,b,c,d){var e=[],f;d?(d=G,f=0):(d=0,f=G);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
-mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(k.graph.getView().getOverlayPane());return a};E=function(a,b){if(a&&null!=k.guidesArrHor)for(var c=0;c<k.guidesArrHor.length;c++)k.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=k.guidesArrVer)for(c=0;c<k.guidesArrVer.length;c++)k.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];C=k.guidesArrHor;q=[];e=0;v=z[0]==p?1:0;H=z[v].y+z[v].height;if(0<I)for(v=0;v<z.length-1;v++)t=
-z[v],B=z[v+1],p==t?(e=B.x-t.width-I,q.push(new mxPoint(e+t.width+G,H)),q.push(new mxPoint(B.x-G,H))):p==B?(q.push(new mxPoint(t.x+t.width+G,H)),e=t.x+t.width+I,q.push(new mxPoint(e-G,H))):(q.push(new mxPoint(t.x+t.width+G,H)),q.push(new mxPoint(B.x-G,H)));else t=z[0],v=z[2],e=t.x+t.width+(v.x-t.x-t.width-p.width)/2,q.push(new mxPoint(t.x+t.width+G,H)),q.push(new mxPoint(e-G,H)),q.push(new mxPoint(e+p.width+G,H)),q.push(new mxPoint(v.x-G,H));for(v=0;v<q.length;v+=2)z=q[v],I=q[v+1],z=u(z,I,null!=C?
-C[v/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(v=q.length/2;null!=C&&v<C.length;v++)C[v].destroy();k.guidesArrHor=A;e-=b.x;q=!0}else E(!0);if(1<D&&D==y.length-1){A=[];C=k.guidesArrVer;f=[];d=0;v=y[0]==p?1:0;D=y[v].x+y[v].width;if(0<x)for(v=0;v<y.length-1;v++)t=y[v],B=y[v+1],p==t?(d=B.y-t.height-x,f.push(new mxPoint(D,d+t.height+G)),f.push(new mxPoint(D,B.y-G))):p==B?(f.push(new mxPoint(D,t.y+t.height+G)),d=t.y+t.height+x,f.push(new mxPoint(D,d-G))):(f.push(new mxPoint(D,t.y+
-t.height+G)),f.push(new mxPoint(D,B.y-G)));else t=y[0],v=y[2],d=t.y+t.height+(v.y-t.y-t.height-p.height)/2,f.push(new mxPoint(D,t.y+t.height+G)),f.push(new mxPoint(D,d-G)),f.push(new mxPoint(D,d+p.height+G)),f.push(new mxPoint(D,v.y-G));for(v=0;v<f.length;v+=2)z=f[v],I=f[v+1],z=u(z,I,null!=C?C[v/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(v=f.length/2;null!=C&&v<C.length;v++)C[v].destroy();k.guidesArrVer=A;d-=b.y;f=!0}else E(!1,!0)}if(q||f)return p=new mxPoint(e,d),y=a.call(this,
-b,p,g,l),q&&!f?p.y=y.y:f&&!q&&(p.x=y.x),y.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),y.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;E(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
-d)for(l=0;l<d.length;l++)d[l].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var g=0;g<a.length;g++)a[g].destroy();this.guidesArrVer=null}if(null!=c){for(g=0;g<c.length;g++)c[g].destroy();this.guidesArrHor=null}}})();
+(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,l){var d=c.y,g=c.x,q=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var k=this,p=new mxCellState,t=this.graph.getView().scale,u=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+g;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var y=[],z=[],v=0;v<this.states.length;v++){var x=this.states[v];x instanceof mxCellState&&(l||!this.graph.isCellSelected(x.cell))&&((p.x>=x.x&&p.x<=x.x+x.width||x.x>=p.x&&x.x<=p.x+p.width)&&(p.y>
+x.y+x.height+4||p.y+p.height+4<x.y)?y.push(x):(p.y>=x.y&&p.y<=x.y+x.height||x.y>=p.y&&x.y<=p.y+p.height)&&(p.x>x.x+x.width+4||p.x+p.width+4<x.x)&&z.push(x))}var E=0,J=0,G=x=0,A=0,D=0,I=0,C=0,F=5*t;if(1<y.length){y.push(p);y.sort(function(a,b){return a.y-b.y});var H=!1,v=p==y[0],t=p==y[y.length-1];if(!v&&!t)for(v=1;v<y.length-1;v++)if(p==y[v]){t=y[v-1];v=y[v+1];x=J=G=(v.y-t.y-t.height-p.height)/2;break}for(v=0;v<y.length-1;v++){var t=y[v],B=y[v+1],K=p==t||p==B,B=B.y-t.y-t.height,H=H|p==t;if(0==J&&
+0==E)J=B,E=1;else if(Math.abs(J-B)<=(K||1==v&&H?u:0))E+=1;else if(1<E&&H){y=y.slice(0,v+1);break}else if(3<=y.length-v&&!H)E=0,x=J=0!=G?G:0,y.splice(0,0==v?1:v),v=-1;else break;0!=x||K||(J=x=B)}3==y.length&&y[1]==p&&(x=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});H=!1;v=p==z[0];t=p==z[z.length-1];if(!v&&!t)for(v=1;v<z.length-1;v++)if(p==z[v]){t=z[v-1];v=z[v+1];I=D=C=(v.x-t.x-t.width-p.width)/2;break}for(v=0;v<z.length-1;v++){t=z[v];B=z[v+1];K=p==t||p==B;B=B.x-t.x-t.width;H|=p==
+t;if(0==D&&0==A)D=B,A=1;else if(Math.abs(D-B)<=(K||1==v&&H?u:0))A+=1;else if(1<A&&H){z=z.slice(0,v+1);break}else if(3<=z.length-v&&!H)A=0,I=D=0!=C?C:0,z.splice(0,0==v?1:v),v=-1;else break;0!=I||K||(D=I=B)}3==z.length&&z[1]==p&&(I=0)}u=function(a,b,c,d){var e=[],f;d?(d=F,f=0):(d=0,f=F);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
+mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(k.graph.getView().getOverlayPane());return a};D=function(a,b){if(a&&null!=k.guidesArrHor)for(var c=0;c<k.guidesArrHor.length;c++)k.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=k.guidesArrVer)for(c=0;c<k.guidesArrVer.length;c++)k.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];C=k.guidesArrHor;q=[];g=0;v=z[0]==p?1:0;H=z[v].y+z[v].height;if(0<I)for(v=0;v<z.length-1;v++)t=
+z[v],B=z[v+1],p==t?(g=B.x-t.width-I,q.push(new mxPoint(g+t.width+F,H)),q.push(new mxPoint(B.x-F,H))):p==B?(q.push(new mxPoint(t.x+t.width+F,H)),g=t.x+t.width+I,q.push(new mxPoint(g-F,H))):(q.push(new mxPoint(t.x+t.width+F,H)),q.push(new mxPoint(B.x-F,H)));else t=z[0],v=z[2],g=t.x+t.width+(v.x-t.x-t.width-p.width)/2,q.push(new mxPoint(t.x+t.width+F,H)),q.push(new mxPoint(g-F,H)),q.push(new mxPoint(g+p.width+F,H)),q.push(new mxPoint(v.x-F,H));for(v=0;v<q.length;v+=2)z=q[v],I=q[v+1],z=u(z,I,null!=C?
+C[v/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(v=q.length/2;null!=C&&v<C.length;v++)C[v].destroy();k.guidesArrHor=A;g-=b.x;q=!0}else D(!0);if(1<E&&E==y.length-1){A=[];C=k.guidesArrVer;f=[];d=0;v=y[0]==p?1:0;E=y[v].x+y[v].width;if(0<x)for(v=0;v<y.length-1;v++)t=y[v],B=y[v+1],p==t?(d=B.y-t.height-x,f.push(new mxPoint(E,d+t.height+F)),f.push(new mxPoint(E,B.y-F))):p==B?(f.push(new mxPoint(E,t.y+t.height+F)),d=t.y+t.height+x,f.push(new mxPoint(E,d-F))):(f.push(new mxPoint(E,t.y+
+t.height+F)),f.push(new mxPoint(E,B.y-F)));else t=y[0],v=y[2],d=t.y+t.height+(v.y-t.y-t.height-p.height)/2,f.push(new mxPoint(E,t.y+t.height+F)),f.push(new mxPoint(E,d-F)),f.push(new mxPoint(E,d+p.height+F)),f.push(new mxPoint(E,v.y-F));for(v=0;v<f.length;v+=2)z=f[v],I=f[v+1],z=u(z,I,null!=C?C[v/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(v=f.length/2;null!=C&&v<C.length;v++)C[v].destroy();k.guidesArrVer=A;d-=b.y;f=!0}else D(!1,!0)}if(q||f)return p=new mxPoint(g,d),y=a.call(this,
+b,p,e,l),q&&!f?p.y=y.y:f&&!q&&(p.x=y.x),y.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),y.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;D(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
+d)for(l=0;l<d.length;l++)d[l].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var e=0;e<a.length;e++)a[e].destroy();this.guidesArrVer=null}if(null!=c){for(e=0;e<c.length;e++)c[e].destroy();this.guidesArrHor=null}}})();
diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js
index 7c9f8b9f0..8f51b0a6c 100644
--- a/src/main/webapp/js/diagramly/App.js
+++ b/src/main/webapp/js/diagramly/App.js
@@ -25,8 +25,11 @@ App = function(editor, container, lightbox)
 			
 			if (file != null && file.constructor == DriveFile && file.isModified() && this.drive != null)
 			{
-				EditorUi.logEvent({category: 'Unload-Modified', action: file.getId(), label:
-					(this.drive.user != null) ? this.drive.user.id : 'unknown-user'});	
+				EditorUi.logEvent({category: 'DISCARD-SAVE-GOOGLE-' + file.getId() + '.' +
+					file.desc.headRevisionId + '.' + file.desc.modifiedDate,
+					action: 'time-' + new Date().toISOString() + '-saved-' +
+					((file.lastSaved != null) ? file.lastSaved.toISOString() : 'never'),
+					label: (this.drive.user != null) ? this.drive.user.id : 'unknown-user'});
 			}
 		});
 	}
@@ -65,7 +68,27 @@ App = function(editor, container, lightbox)
 			pre();
 		}
 	});
+
+	// Handles cloning errors when copying cells
+	var clipboardCopy = mxClipboard.copy;
+	var self = this;
 	
+	mxClipboard.copy = function(graph, cells)
+	{
+		var result = null;
+		
+		try
+		{
+			result = clipboardCopy.apply(this, arguments);
+		}
+		catch (e)
+		{
+			self.handleError(e);
+		}
+		
+		return result;
+	},
+
 	// Initial state for toolbar items is disabled
 	this.updateDocumentTitle();
 	this.updateUi();
@@ -1020,49 +1043,43 @@ App.prototype.init = function()
 						
 						this.drive.checkRealtimeFiles(mxUtils.bind(this, function()
 						{
-							var day = new Date().getDay();
-							var isWeekend = (day === 6) || (day === 0);
+							var footer = document.createElement('div');
+							footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
+								'white-space:nowrap;left:50%;bottom:2px;';
+							footer.className = 'geStatusAlert';
+							
+							mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
+							mxUtils.setPrefixedStyle(footer.style, 'transition', 'all 1s ease');
+							footer.style.whiteSpace = 'nowrap';
+							footer.innerHTML = '<a href="https://desk.draw.io/support/solutions/articles/16000092210" ' +
+								'target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
+								'<img src="' + this.editor.graph.warningImage.src + '" border="0" style="margin-top:-4px;margin-right:2px;" valign="middle"/>&nbsp;' +
+								'You need to take action to convert legacy files. Click here.&nbsp;' +
+								'<img src="' + this.editor.graph.warningImage.src + '" border="0" style="margin-top:-4px;margin-left:2px;" valign="middle"/></a>';
+							
+							var img = document.createElement('img');
+							
+							img.setAttribute('src', Dialog.prototype.closeImage);
+							img.setAttribute('title', mxResources.get('close'));
+							img.style.position = 'absolute';
+							img.style.cursor = 'pointer';
+							img.style.right = '10px';
+							img.style.top = '12px';
+
+							footer.appendChild(img);
+
+							mxEvent.addListener(img, 'click', mxUtils.bind(this, function()
+							{
+								footer.parentNode.removeChild(footer);
+								this.hideFooter();
+							}));
+							
+							document.body.appendChild(footer);
 							
-							if (isWeekend || Math.random() > 0.6)
+							window.setTimeout(mxUtils.bind(this, function()
 							{
-								var footer = document.createElement('div');
-								footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
-									'white-space:nowrap;left:50%;bottom:2px;';
-								footer.className = 'geStatusAlert';
-								
-								mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
-								mxUtils.setPrefixedStyle(footer.style, 'transition', 'all 1s ease');
-								footer.style.whiteSpace = 'nowrap';
-								footer.innerHTML = '<a href="https://desk.draw.io/support/solutions/articles/16000092210" ' +
-									'target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
-									'<img src="' + this.editor.graph.warningImage.src + '" border="0" style="margin-top:-4px;margin-right:2px;" valign="middle"/>&nbsp;' +
-									'You need to take action to convert legacy files. Click here.&nbsp;' +
-									'<img src="' + this.editor.graph.warningImage.src + '" border="0" style="margin-top:-4px;margin-left:2px;" valign="middle"/></a>';
-								
-								var img = document.createElement('img');
-								
-								img.setAttribute('src', Dialog.prototype.closeImage);
-								img.setAttribute('title', mxResources.get('close'));
-								img.style.position = 'absolute';
-								img.style.cursor = 'pointer';
-								img.style.right = '10px';
-								img.style.top = '12px';
-	
-								footer.appendChild(img);
-	
-								mxEvent.addListener(img, 'click', mxUtils.bind(this, function()
-								{
-									footer.parentNode.removeChild(footer);
-									this.hideFooter();
-								}));
-								
-								document.body.appendChild(footer);
-								
-								window.setTimeout(mxUtils.bind(this, function()
-								{
-									mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)');
-								}), 1500);
-							}
+								mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)');
+							}), 1500);
 						}));
 					}))
 					
diff --git a/src/main/webapp/js/diagramly/DrawioFile.js b/src/main/webapp/js/diagramly/DrawioFile.js
index ddafffa39..3649a2651 100644
--- a/src/main/webapp/js/diagramly/DrawioFile.js
+++ b/src/main/webapp/js/diagramly/DrawioFile.js
@@ -120,10 +120,10 @@ DrawioFile.prototype.changeListenerEnabled = true;
 DrawioFile.prototype.lastAutosaveRevision = null;
 
 /**
- * Sets the delay between revisions when using autosave. Default is 0 which
- * creates a revision on every autosave.
+ * Sets the delay between revisions when using autosave. Default is 300000
+ * ie 5 mins. Set this to 0 to create a revision on every autosave.
  */
-DrawioFile.prototype.maxAutosaveRevisionDelay = 0;
+DrawioFile.prototype.maxAutosaveRevisionDelay = 300000;
 
 /**
  * Specifies if notify events should be ignored.
@@ -461,12 +461,9 @@ DrawioFile.prototype.checksumError = function(error, patches, details, etag, fun
 					this.ui.getPagesForNode(
 					mxUtils.parseXml(file.data).documentElement)), 25000) : 'n/a';
 				
-				this.sendErrorReport(
-					'Checksum Error in ' + functionName,
-					((details != null) ? (details) : '') +
-					'\n\nPatches:\n' + json +
-					((remote != null) ? ('\n\nRemote:\n' + remote) : ''),
-					null, 70000);
+				this.sendErrorReport('Checksum Error in ' + functionName + ' ' + this.getId(),
+					((details != null) ? (details) : '') +  '\n\nPatches:\n' + json +
+					((remote != null) ? ('\n\nRemote:\n' + remote) : ''), null, 70000);
 			});
 	
 			if (etag == null)
@@ -734,7 +731,6 @@ DrawioFile.prototype.patch = function(patches, resolver)
 				}
 				else
 				{
-					
 					graph.view.validate();
 				}
 				
@@ -751,33 +747,52 @@ DrawioFile.prototype.patch = function(patches, resolver)
  */
 DrawioFile.prototype.save = function(revision, success, error, unloading, overwrite, manual)
 {
-	if (!this.isEditable())
+	try
 	{
-		if (error != null)
+		if (!this.isEditable())
 		{
-			error({message: mxResources.get('readOnly')});
+			if (error != null)
+			{
+				error({message: mxResources.get('readOnly')});
+			}
+			else
+			{
+				throw new Error(mxResources.get('readOnly'));
+			}
+		}
+		else if (!overwrite && this.invalidChecksum)
+		{
+			if (error != null)
+			{
+				error({message: mxResources.get('checksum')});
+			}
+			else
+			{
+				throw new Error(mxResources.get('checksum'));
+			}
 		}
 		else
 		{
-			throw new Error(mxResources.get('readOnly'));
+			this.updateFileData();
+			this.clearAutosave();
+			
+			if (success != null)
+			{
+				success();
+			}
 		}
 	}
-	else if (!overwrite && this.invalidChecksum)
+	catch (e)
 	{
 		if (error != null)
 		{
-			error({message: mxResources.get('checksum')});
+			error(e);
 		}
 		else
 		{
-			throw new Error(mxResources.get('checksum'));
+			throw e;
 		}
 	}
-	else
-	{
-		this.updateFileData();
-		this.clearAutosave();
-	}
 };
 
 /**
diff --git a/src/main/webapp/js/diagramly/DriveClient.js b/src/main/webapp/js/diagramly/DriveClient.js
index 5da29362f..49c57fc45 100644
--- a/src/main/webapp/js/diagramly/DriveClient.js
+++ b/src/main/webapp/js/diagramly/DriveClient.js
@@ -1044,10 +1044,37 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
  * @param {number} dx X-coordinate of the translation.
  * @param {number} dy Y-coordinate of the translation.
  */
-DriveClient.prototype.saveFile = function(file, revision, success, error, noCheck, unloading, overwrite, properties)
+DriveClient.prototype.saveFile = function(file, revision, success, errFn, noCheck, unloading, overwrite, properties)
 {
+	var error = mxUtils.bind(this, function(e)
+	{
+		if (errFn != null)
+		{
+			errFn(e);
+		}
+		else
+		{
+			throw e;
+		}
+		
+		// Logs failed save
+		try
+		{
+			EditorUi.logEvent({category: 'FAIL-SAVE-GOOGLE-' + file.desc.id  + '.' +
+				file.desc.headRevisionId + '.' + file.desc.modifiedDate,
+				action: 'error-' + file.getErrorMessage(e),
+				label: (this.user != null) ? this.user.id : 'unknown-user'});
+		}
+		catch (e)
+		{
+			// ignore
+		}
+	});
+	
 	var criticalError = mxUtils.bind(this, function(e)
 	{
+		error(e);
+
 		try
 		{
 			EditorUi.logError(e.message, null, null, e);
@@ -1064,15 +1091,6 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
 		{
 			// ignore
 		}
-
-		if (error != null)
-		{
-			error(e);
-		}
-		else
-		{
-			throw e;
-		}
 	});
 	
 	try
@@ -1084,7 +1102,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
 			var head0 = file.desc.headRevisionId;
 			var saveAsPng = this.ui.useCanvasForExport && /(\.png)$/i.test(file.getTitle());
 			noCheck = (noCheck != null) ? noCheck : (!this.ui.isLegacyDriveDomain() || urlParams['ignoremime'] == '1');
-	
+			
 			// NOTE: Unloading arg is currently ignored, saving during unload/beforeUnload is not possible using
 			// asynchronous code, which is needed to create the thumbnail, or asynchronous requests which is the only
 			// way to execute the gapi request below.
@@ -1240,10 +1258,10 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
 								// Logs successful save
 								try
 								{
-									EditorUi.logEvent({category: 'SAVE-GOOGLE-' + file.desc.id,
-										action: 'from-' + head0 + '.' + mod0 +
-										'-to-' + resp.headRevisionId + '.' + resp.modifiedDate,
-										label: (this.user != null) ? this.user.id : 'unknown-user'});
+									EditorUi.logEvent({category: 'SAVE-GOOGLE-' + file.desc.id +
+										'.' + head0 + '.' + mod0, action: 'saved-' + resp.headRevisionId +
+										'.' + resp.modifiedDate, label: (this.user != null) ?
+										this.user.id : 'unknown-user'});
 								}
 								catch (e)
 								{
@@ -1322,7 +1340,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
 																		'\n\nBrowser=' + navigator.userAgent +
 																		'\nFile=' + file.desc.id + '.' + file.desc.headRevisionId +
 																		'\nUser=' + ((this.user != null) ? this.user.id : 'unknown'));
-																	EditorUi.logError('Warning: Stale Etag Overwrite',
+																	EditorUi.logError('Warning: Stale Etag Overwrite ' + file.desc.id,
 																		null, file.desc.id + '.' + file.desc.headRevisionId,
 																		(this.user != null) ? this.user.id : 'unknown');
 																}
@@ -2460,7 +2478,7 @@ DriveClient.prototype.convertRealtimeFiles = function()
 			var day = new Date().getDay();
 			var isWeekend = (day === 6) || (day === 0);
 			var q = 'mimeType=\'application/vnd.jgraph.mxfile.realtime\'';
-			var convertDelay = (isWeekend) ? 1000 : 5000;
+			var convertDelay = (isWeekend) ? 1000 : 2000;
 			var convertedIds = {};
 			var converted = 0;
 			var fromJson = 0;
diff --git a/src/main/webapp/js/diagramly/DriveFile.js b/src/main/webapp/js/diagramly/DriveFile.js
index fa81551d3..924369a84 100644
--- a/src/main/webapp/js/diagramly/DriveFile.js
+++ b/src/main/webapp/js/diagramly/DriveFile.js
@@ -133,9 +133,10 @@ DriveFile.prototype.isMovable = function()
  */
 DriveFile.prototype.save = function(revision, success, error, unloading, overwrite)
 {
-	DrawioFile.prototype.save.apply(this, arguments);
-	
-	this.saveFile(null, revision, success, error, unloading, overwrite);
+	DrawioFile.prototype.save.apply(this, [revision, mxUtils.bind(this, function()
+	{
+		this.saveFile(null, revision, success, error, unloading, overwrite);
+	}), error, unloading, overwrite]);
 };
 
 /**
diff --git a/src/main/webapp/js/diagramly/OneDriveFile.js b/src/main/webapp/js/diagramly/OneDriveFile.js
index e45c750c1..a7f2a29be 100644
--- a/src/main/webapp/js/diagramly/OneDriveFile.js
+++ b/src/main/webapp/js/diagramly/OneDriveFile.js
@@ -263,9 +263,10 @@ OneDriveFile.prototype.getLastModifiedDate = function()
  */
 OneDriveFile.prototype.save = function(revision, success, error, unloading, overwrite)
 {
-	DrawioFile.prototype.save.apply(this, arguments);
-	
-	this.saveFile(this.getTitle(), false, success, error, unloading, overwrite);
+	DrawioFile.prototype.save.apply(this, [revision, mxUtils.bind(this, function()
+	{
+		this.saveFile(this.getTitle(), false, success, error, unloading, overwrite);
+	}), error, unloading, overwrite]);
 };
 
 /**
diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js
index 63a9a57d6..286ad9cdc 100644
--- a/src/main/webapp/js/viewer.min.js
+++ b/src/main/webapp/js/viewer.min.js
@@ -2679,7 +2679,7 @@ function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.s
 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,c,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,c,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,c,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=c;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.shadowData=this.data=b||"";this.shadowPages=null;this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";
-DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=0;DrawioFile.prototype.inConflictState=!1;
+DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;
 DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};
 DrawioFile.prototype.updateFile=function(a,b,e,c){null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():null!=k?this.mergeFile(k,a,b,c):this.reloadFile(a,b))}catch(m){null!=b&&b(m)}}),b))};
 DrawioFile.prototype.mergeFile=function(a,b,e,c){var k=!0;try{this.stats.fileMerged++;var m=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),q=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=q&&0<q.length){this.shadowPages=q;this.backupPatch=this.isModified()?this.ui.diffPages(m,this.ui.pages):null;var t=[this.ui.diffPages(null!=c?c:m,this.shadowPages)];if(!this.ignorePatches(t)){var v=this.ui.patchPages(m,
@@ -2689,7 +2689,7 @@ null!=e&&e(x);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error i
 DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var c=0;c<a.length;c++){var k=b.encode(new mxGraphModel(a[c].root));"1"!=urlParams.dev&&(k=this.ui.anonymizeNode(k,!0));k.setAttribute("id",a[c].getId());a[c].viewState&&this.ui.editor.graph.saveViewState(a[c].viewState,k,!0);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
 DrawioFile.prototype.compressReportData=function(a,b,e){b=null!=b?b:1E4;null!=e&&null!=a&&a.length>e?a=a.substring(0,e)+"[...]":null!=a&&a.length>b&&(a=Graph.compress(a)+"\n");return a};
 DrawioFile.prototype.checksumError=function(a,b,e,c,k){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var m=mxUtils.bind(this,function(a){var c=this.compressReportData(JSON.stringify(b,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
-25E3):"n/a";this.sendErrorReport("Checksum Error in "+k,(null!=e?e:"")+"\n\nPatches:\n"+c+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==c?m(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==c?m(a):m(null)}),function(){})}else{var q=this.getCurrentUser(),t=null!=q?q.id:"unknown";EditorUi.logError("Checksum Error in "+k,null,this.getMode()+"."+this.getId(),t)}}catch(v){}};
+25E3):"n/a";this.sendErrorReport("Checksum Error in "+k+" "+this.getId(),(null!=e?e:"")+"\n\nPatches:\n"+c+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==c?m(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==c?m(a):m(null)}),function(){})}else{var q=this.getCurrentUser(),t=null!=q?q.id:"unknown";EditorUi.logError("Checksum Error in "+k,null,this.getMode()+"."+this.getId(),t)}}catch(v){}};
 DrawioFile.prototype.sendErrorReport=function(a,b,e,c){try{var k=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),m=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),q=this.getCurrentUser(),t=null!=q?this.ui.hashValue(q.id):"unknown",v=null!=this.sync?this.sync.clientId:"no sync",A=this.getTitle(),d=A.lastIndexOf("."),q="xml";0<d&&(q=A.substring(d));var f=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+
 navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+q+")\nUser="+t+" ("+v+")\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+(null!=e?"\n\nError: "+
 e.message:"")+"\n\nStack:\n"+f+"\n\nShadow:\n"+k+"\n\nData:\n"+m,c)}catch(g){}};
@@ -2699,14 +2699,14 @@ DrawioFile.prototype.ignorePatches=function(a){for(var b=!0,e=0;e<a.length&&b;e+
 DrawioFile.prototype.patch=function(a,b){var e=this.ui.editor.undoManager,c=e.history.slice(),k=e.indexOfNextAdd,m=this.ui.editor.graph;m.container.style.visibility="hidden";var q=this.changeListenerEnabled;this.changeListenerEnabled=!1;var t=m.foldingEnabled,v=m.mathEnabled,A=m.cellRenderer.redraw;m.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());A.apply(this,arguments)};m.model.beginUpdate();try{for(var d=
 0;d<a.length;d++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[d],!0,b,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{m.container.style.visibility="";m.model.endUpdate();m.cellRenderer.redraw=A;this.changeListenerEnabled=q;e.history=c;e.indexOfNextAdd=k;e.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)v!=
 m.mathEnabled?(this.ui.editor.updateGraphComponents(),m.refresh()):(t!=m.foldingEnabled?m.view.revalidate():m.view.validate(),m.sizeDidChange());this.ui.updateTabContainer()}};
-DrawioFile.prototype.save=function(a,b,e,c,k,m){if(this.isEditable())if(!k&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave();else if(null!=e)e({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));};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,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.inConflictState&&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.isChromelessView()||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.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};
-DrawioFile.prototype.getRevisions=function(a,b){a(null)};DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.patchDescriptor=function(a,b){this.setDescriptorEtag(a,this.getDescriptorEtag(b))};
-DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};
-DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,b){};
-DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
+DrawioFile.prototype.save=function(a,b,e,c,k,m){try{if(this.isEditable())if(!k&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=b&&b();else if(null!=e)e({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(q){if(null!=e)e(q);else throw q;}};
+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,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.inConflictState&&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.isChromelessView()||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.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,b){a(null)};
+DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.patchDescriptor=function(a,b){this.setDescriptorEtag(a,this.getDescriptorEtag(b))};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};
+DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};
+DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,b){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
 DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(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.fileChanged()}),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.addAllSavedStatus=function(a){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(a=null!=a?a:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+a+'">'+a+"</div>"),a=this.ui.statusContainer.getElementsByTagName("div"),0<a.length&&this.isRevisionHistorySupported()&&(a[0].style.cursor="pointer",a[0].style.textDecoration="underline",mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))};
diff --git a/src/main/webapp/plugins/explore.js b/src/main/webapp/plugins/explore.js
index 5098cd330..09fba5881 100644
--- a/src/main/webapp/plugins/explore.js
+++ b/src/main/webapp/plugins/explore.js
@@ -358,7 +358,8 @@ Draw.loadPlugin(function(ui)
 		ui.editor.graph.click = function(me)
 		{
 			if (ui.editor.graph.model.isVertex(me.getCell()) &&
-				ui.editor.graph.model.getEdgeCount(me.getCell()) > 0)
+				ui.editor.graph.model.getEdgeCount(me.getCell()) > 0 &&
+				this.getLinkForCell(me.getCell()) == null)
 			{
 				exploreFromHere(me.getCell());
 			}
-- 
GitLab