diff --git a/ChangeLog b/ChangeLog
index 70215e5e..ffd198b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+30-OCT-2017: 7.6.7
+
+- Ignores invalid sources in embed mode
+- Fixes auth flow in Trello Power-Up
+
30-OCT-2017: 7.6.6
- Uses mxGraph 3.7.6 beta 9
diff --git a/VERSION b/VERSION
index 9e707b9f..56d17257 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.6.6
\ No newline at end of file
+7.6.7
\ No newline at end of file
diff --git a/war/cache.manifest b/war/cache.manifest
index 9529a5ca..bf158a71 100644
--- a/war/cache.manifest
+++ b/war/cache.manifest
@@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 10/30/2017 09:17 AM
+# 10/30/2017 12:32 PM
app.html
index.html?offline=1
diff --git a/war/js/app.min.js b/war/js/app.min.js
index e953b80e..25000f77 100644
--- a/war/js/app.min.js
+++ b/war/js/app.min.js
@@ -6539,7 +6539,7 @@ R.setAttribute("min","1");R.setAttribute("type","number");R.style.width="40px";W
P.appendChild(W);P.appendChild(K);N.appendChild(X);N.appendChild(Q);N.appendChild(Y);L.appendChild(P);L.appendChild(N);q.appendChild(L);k.appendChild(q);g.appendChild(k);k=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));k.appendChild(m);m=document.createElement("div");m.style.marginBottom="12px";var T=PageSetupDialog.addPageFormatPanel(m,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);
k.appendChild(m);m=document.createElement("span");mxUtils.write(m,mxResources.get("pageScale"));k.appendChild(m);var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","100 %");S.style.width="60px";k.appendChild(S);g.appendChild(k);m=document.createElement("div");m.style.cssText="text-align:right;margin:62px 0 0 0;";k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&m.appendChild(k);a.isOffline()||
(q=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),q.className="geBtn",m.appendChild(q));PrintDialog.previewEnabled&&(q=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),q.className="geBtn",m.appendChild(q));q=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});q.className="geBtn gePrimaryBtn";m.appendChild(q);a.editor.cancelFirst||m.appendChild(k);
-g.appendChild(m);this.container=g}})();(function(){EditorUi.VERSION="7.6.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='';EditorUi.prototype.emptyLibraryXml="[]";
+g.appendChild(m);this.container=g}})();(function(){EditorUi.VERSION="7.6.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='';EditorUi.prototype.emptyLibraryXml="[]";
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;
EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b,
0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=c&&6')))}catch(p){}try{a=document.createElement("canvas");a.width=a.height=1;var c=
@@ -6591,10 +6591,10 @@ w:c.width,h:c.height};null!=h&&(a.title=h);b.push(a);F(d);null!=g&&null!=g.paren
c.y-=n.view.translate.y;C(b,c)}mxEvent.consume(a)});e.style.border="3px solid transparent";mxEvent.addGestureListeners(e,function(){},mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="hidden",null!=g?g.style.border="3px dotted rgb(254, 137, 12)":e.style.border="3px dotted rgb(254, 137, 12)",e.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!1),
null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(e.style.border="3px solid transparent",null!=g&&(g.style.border="3px dotted lightGray"),e.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,D(a),mxEvent.consume(a))}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){n.isMouseDown&&
null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",e.style.border="3px solid transparent",e.style.cursor="",n.autoScroll=!0,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!0),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),null!=g&&(g.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=g?g.style.border="3px dotted rgb(254, 137, 12)":e.style.border="3px dotted rgb(254, 137, 12)";
-a.dataTransfer.dropEffect="copy";e.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){e.style.border="3px solid transparent";e.style.cursor="";null!=g&&(g.style.border="3px dotted lightGray");0=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),
+null!=g&&null!=g.parentNode&&0=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),
mxEvent.addListener(e,"dragleave",function(a){null!=g?g.style.border="3px dotted lightGray":(e.style.border="3px solid transparent",e.style.cursor="");a.stopPropagation();a.preventDefault()}));k=k.cloneNode(!1);k.setAttribute("src",IMAGE_PATH+"/edit.gif");k.setAttribute("title",mxResources.get("edit"));f.insertBefore(k,f.firstChild);mxEvent.addListener(k,"click",B);mxEvent.addListener(e,"dblclick",function(a){mxEvent.getSource(a)==e&&B(a)});k=k.cloneNode(!1);k.setAttribute("src",Editor.plusImage);
k.setAttribute("title",mxResources.get("add"));f.insertBefore(k,f.firstChild);this.isOffline()||".scratchpad"!=a.title||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink("https://desk.draw.io/support/solutions/articles/16000042367");mxEvent.consume(a)})),f.insertBefore(c,f.firstChild));var E=null;mxEvent.addListener(k,
"click",D)}m.appendChild(f);m.style.paddingRight=18*f.childNodes.length+"px"}};"1"==urlParams.offline?EditorUi.prototype.footerHeight=4:("atlas"==uiTheme?("undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=
@@ -6667,15 +6667,15 @@ g=null;if(null!=c&&0\n\n')+mxUtils.getXml(a))}));else return(d?"":'\n\n')+
mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,f,k,l,n){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,n)}catch(y){"Invalid image"==y.message?this.downloadFile(n):this.handleError(y)}}),null,
-this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,k)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},f=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f=a.getStatus()){if(null!=
-b){var d=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e=a.getStatus()?q("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=
-h.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,B);B=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==
-A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),0c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=l;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,B);B=null}this.hideDialog()}finally{y.model.endUpdate()}null!=B&&B()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b=
-"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.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,420,120,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
-null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
-b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
-e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
-b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
-this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);
-a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
-this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var d=applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
-"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case d.DOWNLOADING:b='';break;case d.UPDATEREADY:b='';break;case d.OBSOLETE:b='';break;default:b=''}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
-EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
-this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
-this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=
-c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);n.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=a.editor.graph;
-if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=g.getGraphBounds(),l=Math.floor(h.width*e/g.view.scale),m=Math.floor(h.height*e/g.view.scale);k.length<=MAX_REQUEST_SIZE&&l*mscreen.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},
+f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
+JSON.parse(h)}catch(G){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
+value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(G){k.postMessage(JSON.stringify({event:"draft",
+error:G.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
+return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
+null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var n=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(n);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
+h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),t=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,
+function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=h.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,B);B=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),
+0c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*
+n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=l;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,B);B=null}this.hideDialog()}finally{y.model.endUpdate()}null!=B&&B()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.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,420,120,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
+0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
+arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
+function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
+mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
+"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=
+("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
+this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var d=
+applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
+mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case d.DOWNLOADING:b='';break;case d.UPDATEREADY:b='';break;case d.OBSOLETE:b='';break;default:b=''}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",
+b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;
+EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);
+this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
+this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var n=EditorUi.prototype.destroy;
+EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);n.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,
+e,f)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=g.getGraphBounds(),l=Math.floor(h.width*e/g.view.scale),n=Math.floor(h.height*e/g.view.scale);k.length<=MAX_REQUEST_SIZE&&l*nscreen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
@@ -6982,8 +6981,8 @@ DriveClient.prototype.loadRealtime=function(a,b,d){if("1"==urlParams.ignoremime|
function(a){window.clearTimeout(f);e&&b(a)}))});c()}else b();else this.redirectToNewApp(d,a.id)};
DriveClient.prototype.getXmlFile=function(a,b,d,c,e,f){var k=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+k,mxUtils.bind(this,function(k){if(null==k)c({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||f)a.mimeType!=this.libraryMimeType||f?d(new DriveLibrary(this.ui,k,a)):c({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var l=k.lastIndexOf(",");0this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");l(b,"image/png")}))||l(null,null,a.constructor!=DriveLibrary)});e||!b?n():this.verifyMimeType(a.getId(),n,!0)}else this.ui.editor.graph.reset(),null!=c&&c({message:mxResources.get("readOnly")})};
DriveClient.prototype.verifyMimeType=function(a,b,d,c){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(d||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(d){this.checkingMimeType=!1;null!=d&&"application/vnd.jgraph.mxfile.realtime"==d.mimeType?this.redirectToNewApp(c,a):null!=
b&&b()})))};
@@ -7067,7 +7066,7 @@ this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFi
GitHubClient.prototype.updateUser=function(a,b,d){var c=!0,e=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(f){window.clearTimeout(e);c&&(401===f.getStatus()?d?b({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,b,!0)}),b)):200>f.getStatus()||300<=f.getStatus()?b({message:mxResources.get("accessDenied")}):
(f=JSON.parse(f.getText()),this.setUser(new DrawioUser(f.id,f.email,f.name)),a()))}))};
GitHubClient.prototype.authenticate=function(a,b){if(null==window.onGitHubCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,l){if(c)if(window.onGitHubCallback=null,c=!1,null==k)b({message:mxResources.get("accessDenied"),retry:d});else{var n=mxUtils.bind(this,function(){var c=
-!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(g){window.clearTimeout(d);if(c)try{if(200>g.getStatus()||300<=g.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=f&&f();var k=g.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){b(t)}finally{null!=l&&
+!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(g){window.clearTimeout(d);if(c)try{if(200>g.getStatus()||300<=g.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=f&&f();var h=g.getText();this.token=h.substring(h.indexOf("=")+1,h.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){b(t)}finally{null!=l&&
l.close()}}))});n()}else null!=l&&l.close()}):b({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){c&&(window.onGitHubCallback=null,c=!1,b({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else b({code:App.ERROR_BUSY})};
GitHubClient.prototype.executeRequest=function(a,b,d){var c=mxUtils.bind(this,function(f){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),n=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+n)};a.send(mxUtils.bind(this,function(){window.clearTimeout(l);if(k)if(200<=a.getStatus()&&299>=a.getStatus())b(a);else if(401===a.getStatus())f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){c(!0)},d);else if(403===a.getStatus()){var h=!1;try{var g=JSON.parse(a.getText());null!=g&&null!=g.errors&&0=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;e({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),n=new FormData;
-n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof b?new Blob([b]):b,a);n.append("name",a);var h=new XMLHttpRequest;h.responseType="json";h.onreadystatechange=mxUtils.bind(this,function(){if(4===h.readyState&&(window.clearTimeout(l),k))if(200==h.status){var a=h.response;a.compoundId=d+this.SEPARATOR+a.id;c(a)}else e()});h.open("POST",this.baseUrl+"cards/"+d+"/attachments");h.send(n)}),error:e})});f()}else e({message:mxResources.get("unknownError")})};
-TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};TrelloClient.prototype.pickFolder=function(a){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})};
-TrelloClient.prototype.pickFile=function(a,b){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})};
+TrelloClient.prototype.saveFile=function(a,b,d){var c=a.meta.compoundId.split(this.SEPARATOR),e=mxUtils.bind(this,function(e){Trello.del("cards/"+c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(){this.writeFile(a.meta.name,e,c[0],b,d)}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(f,d,!0):d()}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,"image/png"))}),
+d,this.ui.getCurrentFile()!=a?a.getData():null):e(a.getData())});this.authenticate(f,d)};
+TrelloClient.prototype.writeFile=function(a,b,d,c,e){if(null!=a&&null!=b)if(b.length>=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;e({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),n=new FormData;n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof b?new Blob([b]):b,a);n.append("name",
+a);var h=new XMLHttpRequest;h.responseType="json";h.onreadystatechange=mxUtils.bind(this,function(){if(4===h.readyState&&(window.clearTimeout(l),k))if(200==h.status){var a=h.response;a.compoundId=d+this.SEPARATOR+a.id;c(a)}else 401==h.status?this.authenticate(f,e,!0):e()});h.open("POST",this.baseUrl+"cards/"+d+"/attachments");h.send(n)});this.authenticate(f,e)}else e({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
+TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};TrelloClient.prototype.pickFile=function(a,b){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};
TrelloClient.prototype.showTrelloDialog=function(a,b){var d=null,c=null,e=0,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.height="224px";var k=document.createElement("h3");mxUtils.write(k,a?mxResources.get("selectFile"):mxResources.get("selectCard"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="auto";l.style.height="194px";
f.appendChild(l);f=new CustomDialog(this.ui,f);this.ui.showDialog(f.container,340,270,!0,!0);f.okButton.parentNode.removeChild(f.okButton);var n=mxUtils.bind(this,function(a,b,c){e++;var d=document.createElement("div");d.style="width:100%;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}),h=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),g=mxUtils.bind(this,function(){e=0;l.innerHTML="";this.ui.spinner.spin(l,mxResources.get("loading"));Trello.cards.get(d+"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(a){this.ui.spinner.stop();l.appendChild(n("../ [Up]",mxUtils.bind(this,function(){t()})));
@@ -7117,7 +7115,7 @@ mxUtils.br(l);null==a||0==a.length?mxUtils.write(l,mxResources.get("noFiles")):m
m=document.createElement("a");m.style.display="block";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(l,"scroll",p);t(f+1)});mxEvent.addListener(m,"click",k);Trello.get("search",{query:null!=c?c:"is:open",cards_limit:100,cards_page:f-1},mxUtils.bind(this,function(e){this.ui.spinner.stop();e=null!=e?e.cards:null;if(null==e||0==e.length)null!=c&&(l.appendChild(n(mxResources.get("clearFilter"),mxUtils.bind(this,
function(){c=null;t()}))),mxUtils.br(l)),mxUtils.write(l,mxResources.get("noFiles"));else{1==f&&(null!=c?l.appendChild(n(mxResources.get("clearFilter"),mxUtils.bind(this,function(){c=null;t()}))):l.appendChild(n(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"is:open",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(c=a,t())}),mxResources.get("cardName"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(l));for(var h=0;h=l.scrollHeight-l.offsetHeight&&k()},mxEvent.addListener(l,"scroll",p))}}),h)});t()};TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};
-TrelloClient.prototype.logout=function(){Trello.deauthorize()};function ChatWindow(a,b,d,c,e,f,k,l){this.editorUi=a;this.doc=l.doc;this.rtModel=l.rt;this.chatHistory=l.chatHistory;this.chatMap=l.chatMap;this.configCollabInfo();d=document.createElement("div");d.id="mainDiv";l=document.createElement("div");l.style.padding="3px";d.appendChild(l);var n=document.createElement("div");n.style.paddingLeft="3px";n.style.paddingRight="15px";a.editor.graph.isEnabled()&&d.appendChild(n);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
+TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};function ChatWindow(a,b,d,c,e,f,k,l){this.editorUi=a;this.doc=l.doc;this.rtModel=l.rt;this.chatHistory=l.chatHistory;this.chatMap=l.chatMap;this.configCollabInfo();d=document.createElement("div");d.id="mainDiv";l=document.createElement("div");l.style.padding="3px";d.appendChild(l);var n=document.createElement("div");n.style.paddingLeft="3px";n.style.paddingRight="15px";a.editor.graph.isEnabled()&&d.appendChild(n);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
this.chatArea.style.overflowX="hidden";this.chatArea.style.overflowY="auto";this.chatArea.style.width="98%";this.chatArea.style.resize="none";l.appendChild(this.chatArea);this.chatLineArea=document.createElement("textarea");this.chatLineArea.style.resize="none";this.chatLineArea.rows=1;this.chatLineArea.onkeydown=mxUtils.bind(this,function(a){13==(a.keyCode||window.event.keyCode)&&""!=this.chatLineArea.value&&this.sendMessage()});this.sendBtn=document.createElement("button");this.sendBtn.style.cssFloat=
"right";this.sendBtn.style.styleFloat="right";mxUtils.write(this.sendBtn,mxResources.get("sendMessage"));mxEvent.addListener(this.sendBtn,"click",mxUtils.bind(this,function(a){""!=this.chatLineArea.value&&this.sendMessage()}));n.appendChild(this.chatLineArea);n.appendChild(this.sendBtn);this.window=new mxWindow(b,d,c,e,f,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!0);this.window.setScrollable(!0);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
this.handleResize();this.window.addListener(mxEvent.RESIZE,mxUtils.bind(this,this.handleResize));this.window.addListener(mxEvent.MAXIMIZE,mxUtils.bind(this,this.handleResize));this.window.addListener(mxEvent.NORMALIZE,mxUtils.bind(this,this.handleResize));if(null!=this.chatHistory){for(a=Math.max(0,this.chatHistory.length-this.chatHistoryShow);a=a&&w.y+w.height<=p&&w.y>=c&&w.x+w.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
+e.getChildAt(f,O),u=this.view.getState(q);if(null!=u&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var w=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(u=mxUtils.getBoundingBox(u,w));(e.isEdge(q)||e.isVertex(q))&&u.x>=a&&u.y+u.height<=p&&u.y>=c&&u.x+u.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
!1:G.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();F=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=F?this.addSelectionCells(F):1c&&b[d].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;
@@ -2426,8 +2426,8 @@ x.prototype.redrawPath=function(a,c,b,d,f){c=mxUtils.getValue(this.style,mxConst
0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],this.isRounded,b,!0)};mxCellRenderer.prototype.defaultShapes.hexagon=y;mxUtils.extend(v,mxRectangleShape);v.prototype.isHtmlAllowed=function(){return!1};v.prototype.paintForeground=function(a,c,b,d,f){var g=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+g);a.lineTo(c+d/2,b+f-g);a.moveTo(c+g,b+f/2);a.lineTo(c+d-g,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.plus=
v;var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,d,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var g=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
0);c+=g;b+=g;d-=2*g;f-=2*g;0=a.getStatus()){if(null!=
-b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=
-h.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==
-z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),0c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b=
-"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!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)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
-b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
-e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
-b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
-this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
-a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
-this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
-"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case e.DOWNLOADING:b='';break;case e.UPDATEREADY:b='';break;case e.OBSOLETE:b='';break;default:b=''}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
-EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
-this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
-this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=
-d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;
-if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=h.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),
+0c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*
+r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
+b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!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)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
+arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
+function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
+mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
+"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=
+("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
+this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
+applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
+mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case e.DOWNLOADING:b='';break;case e.UPDATEREADY:b='';break;case e.OBSOLETE:b='';break;default:b=''}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
+b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;
+EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);
+this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
+this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;
+EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,
+h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n';EditorUi.prototype.emptyLibraryXml="[]";
+d.appendChild(e);this.container=d}})();(function(){EditorUi.VERSION="7.6.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='';EditorUi.prototype.emptyLibraryXml="[]";
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;
EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),f=new Image;f.onload=function(){try{a.getContext("2d").drawImage(f,
0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=c&&6')))}catch(t){}try{a=document.createElement("canvas");a.width=a.height=1;var b=
@@ -6675,7 +6675,7 @@ k=parseInt(f.getAttribute("width")),n=parseInt(f.getAttribute("height"));m=null!
this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;f.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(y,f,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(f))}))});this.loadFonts(e)}catch(C){null!=g&&g(C)}}),d,w)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;a.convert=function(c){null!=c&&("http://"!=
c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,k){for(var g=a.getElementsByTagName(d),n=0;n=a.getStatus()){if(null!=
-b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e=a.getStatus()?t("data:image/png;base64,"+a.getText()):q(null)}),mxUtils.bind(this,function(){q(null)}))}}else{null!=
-n.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,E);E=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==
-A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),0c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=m;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,E);E=null}this.hideDialog()}finally{y.model.endUpdate()}null!=E&&E()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b=
-"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
-null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
-b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=
-f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
-b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
-this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
-a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
-this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
-"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case e.DOWNLOADING:b='';break;case e.UPDATEREADY:b='';break;case e.OBSOLETE:b='';break;default:b=''}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
-EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
-this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
-this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=
-d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,g,h){var c=a.editor.graph;
-if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,g,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),l=c.getGraphBounds(),n=Math.floor(l.width*g/c.view.scale),k=Math.floor(l.height*g/c.view.scale);f.length<=MAX_REQUEST_SIZE&&n*kscreen.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},
+g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(J){}return a}if(f.source==(window.opener||window.parent)){var n=f.data;if("json"==urlParams.proto){try{n=
+JSON.parse(n)}catch(G){n=null}if(null==n)return;if("dialog"==n.action){this.showError(null!=n.titleKey?mxResources.get(n.titleKey):n.title,null!=n.messageKey?mxResources.get(n.messageKey):n.message,null!=n.buttonKey?mxResources.get(n.buttonKey):n.button);null!=n.modified&&(this.editor.modified=n.modified);return}if("prompt"==n.action){this.spinner.stop();var k=new FilenameDialog(this,n.defaultValue||"",null!=n.okKey?mxResources.get(n.okKey):null,function(a){null!=a&&h.postMessage(JSON.stringify({event:"prompt",
+value:a,message:n}),"*")},null!=n.titleKey?mxResources.get(n.titleKey):n.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==n.action){k=null;k="data:image/png;base64,"==n.xml.substring(0,22)?this.extractGraphModelFromPng(n.xml):g(n.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[n.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"edit",message:n}),"*")}),mxUtils.bind(this,
+function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"discard",message:n}),"*")}),n.editKey?mxResources.get(n.editKey):null,n.discardKey?mxResources.get(n.discardKey):null,n.ignore?mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"ignore",message:n}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(G){h.postMessage(JSON.stringify({event:"draft",
+error:G.toString(),message:n}),"*")}return}if("template"==n.action){this.spinner.stop();k=new NewDialog(this,!1,null!=n.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=n.callback?h.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();
+return}if("status"==n.action){null!=n.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(n.messageKey))):null!=n.message&&this.editor.setStatus(mxUtils.htmlEntities(n.message));null!=n.modified&&(this.editor.modified=n.modified);return}if("spinner"==n.action){var l=null!=n.messageKey?mxResources.get(n.messageKey):n.message;null==n.show||n.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==n.action){if("png"==n.format||"xmlpng"==n.format){if(null==n.spin&&
+null==n.spinKey||this.spinner.spin(document.body,null!=n.spinKey?mxResources.get(n.spinKey):n.spin)){var m=null!=n.xml?n.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=n.format;b.message=n;b.data=a;b.xml=encodeURIComponent(m);h.postMessage(JSON.stringify(b),"*")}),q=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
+n.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),u=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,
+function(a){q(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){q(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==n.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):q(null)}),mxUtils.bind(this,function(){q(null)}))}}else{null!=n.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,E);E=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),
+0c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*
+n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=m;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,E);E=null}this.hideDialog()}finally{y.model.endUpdate()}null!=E&&E()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
+b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
+0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
+arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
+function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=
+mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
+"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=
+("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
+this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
+applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
+mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case e.DOWNLOADING:b='';break;case e.UPDATEREADY:b='';break;case e.OBSOLETE:b='';break;default:b=''}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
+b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;
+EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);
+this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
+this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var p=EditorUi.prototype.destroy;
+EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,g,h){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,
+g,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),l=c.getGraphBounds(),n=Math.floor(l.width*g/c.view.scale),k=Math.floor(l.height*g/c.view.scale);f.length<=MAX_REQUEST_SIZE&&n*kscreen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
diff --git a/war/js/diagramly/EditorUi.js b/war/js/diagramly/EditorUi.js
index ced11b3d..69eadbf5 100644
--- a/war/js/diagramly/EditorUi.js
+++ b/war/js/diagramly/EditorUi.js
@@ -5011,50 +5011,50 @@
{
if (req.getStatus() >= 200 && req.getStatus() <= 299)
{
- if (success != null)
- {
- var data = req.getText();
-
- // Returns PNG as base64 encoded data URI
- if (binary)
- {
- // NOTE: This requires BinaryToArray VB script in the page
- if ((document.documentMode == 9 || document.documentMode == 10) &&
- typeof window.mxUtilsBinaryToArray !== 'undefined')
+ if (success != null)
+ {
+ var data = req.getText();
+
+ // Returns PNG as base64 encoded data URI
+ if (binary)
{
- var bin = mxUtilsBinaryToArray(req.request.responseBody).toArray();
- var tmp = new Array(bin.length);
-
- for (var i = 0; i < bin.length; i++)
+ // NOTE: This requires BinaryToArray VB script in the page
+ if ((document.documentMode == 9 || document.documentMode == 10) &&
+ typeof window.mxUtilsBinaryToArray !== 'undefined')
{
- tmp[i] = String.fromCharCode(bin[i]);
+ var bin = mxUtilsBinaryToArray(req.request.responseBody).toArray();
+ var tmp = new Array(bin.length);
+
+ for (var i = 0; i < bin.length; i++)
+ {
+ tmp[i] = String.fromCharCode(bin[i]);
+ }
+
+ data = tmp.join('');
}
- data = tmp.join('');
+ // LATER: Could be JPG but modern browsers
+ // ignore the mime type in the data URI
+ dataUriPrefix = (dataUriPrefix != null) ? dataUriPrefix : 'data:image/png;base64,';
+ data = dataUriPrefix + this.base64Encode(data);
}
-
- // LATER: Could be JPG but modern browsers
- // ignore the mime type in the data URI
- dataUriPrefix = (dataUriPrefix != null) ? dataUriPrefix : 'data:image/png;base64,';
- data = dataUriPrefix + this.base64Encode(data);
- }
-
- success(data);
- }
+
+ success(data);
+ }
}
else if (error != null)
- {
- error({code: App.ERROR_UNKNOWN});
- }
+ {
+ error({code: App.ERROR_UNKNOWN}, req);
+ }
}), function()
{
- if (error != null)
- {
- error({code: App.ERROR_UNKNOWN});
- }
+ if (error != null)
+ {
+ error({code: App.ERROR_UNKNOWN});
+ }
}, binary, this.timeout, function()
{
- if (retry && error != null)
+ if (retry && error != null)
{
error({code: App.ERROR_TIMEOUT, retry: fn});
}
@@ -8236,9 +8236,9 @@
// Receives XML message from opener and puts it into the graph
mxEvent.addListener(window, 'message', mxUtils.bind(this, function(evt)
{
- // Ignores messages from Google APIs (use evt.source == parent || opener?)
- if (/https:\/\/.*\.googleapis\.com$/.test(evt.origin) ||
- /https:\/\/.*\.google\.com$/.test(evt.origin))
+ var validSource = window.opener || window.parent;
+
+ if (evt.source != validSource)
{
return;
}
diff --git a/war/js/diagramly/TrelloClient.js b/war/js/diagramly/TrelloClient.js
index 5fae27e1..353804ae 100644
--- a/war/js/diagramly/TrelloClient.js
+++ b/war/js/diagramly/TrelloClient.js
@@ -32,8 +32,13 @@ TrelloClient.prototype.extension = '.xml'; //TODO export to png
* Authorizes the client, used with methods that can be called without a user click and popup blockers will interfere
* Show the AuthDialog to work around the popup blockers if the file is opened directly
*/
-TrelloClient.prototype.authenticate = function(success, error)
+TrelloClient.prototype.authenticate = function(success, error, force)
{
+ if (force)
+ {
+ this.logout();
+ }
+
var callback = mxUtils.bind(this, function(remember)
{
Trello.authorize(
@@ -45,7 +50,7 @@ TrelloClient.prototype.authenticate = function(success, error)
read: 'true',
write: 'true'
},
- expiration: remember? 'never' : '1hour',
+ expiration: remember ? 'never' : '1hour',
success: success,
error: error
});
@@ -80,75 +85,109 @@ TrelloClient.prototype.getFile = function(id, success, error, denyConvert, asLib
var callback = mxUtils.bind(this, function()
{
var ids = id.split(this.SEPARATOR);
+ var acceptResponse = true;
+
+ var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+ {
+ acceptResponse = false;
+ error({code: App.ERROR_TIMEOUT, retry: callback})
+ }), this.ui.timeout);
Trello.cards.get(ids[0] + '/attachments/' + ids[1], mxUtils.bind(this, function(meta)
{
- var binary = /\.png$/i.test(meta.name);
-
- // TODO Trello doesn't allow CORS requests to load attachments. Confirm that
- // and make sure that only a proxy technique can work!
- // Handles .vsdx, Gliffy and PNG+XML files by creating a temporary file
- if (/\.vsdx$/i.test(meta.name) || /\.gliffy$/i.test(meta.name) ||
- (!this.ui.useCanvasForExport && binary))
- {
- this.ui.convertFile(PROXY_URL + '?url=' + encodeURIComponent(meta.url), meta.name, meta.mimeType,
- this.extension, success, error);
- }
- else
- {
- var acceptResponse = true;
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ var binary = /\.png$/i.test(meta.name);
- var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+ // TODO Trello doesn't allow CORS requests to load attachments. Confirm that
+ // and make sure that only a proxy technique can work!
+ // Handles .vsdx, Gliffy and PNG+XML files by creating a temporary file
+ if (/\.vsdx$/i.test(meta.name) || /\.gliffy$/i.test(meta.name) ||
+ (!this.ui.useCanvasForExport && binary))
{
- acceptResponse = false;
- error({code: App.ERROR_TIMEOUT})
- }), this.ui.timeout);
-
- this.ui.loadUrl(PROXY_URL + '?url=' + encodeURIComponent(meta.url), mxUtils.bind(this, function(data)
+ this.ui.convertFile(PROXY_URL + '?url=' + encodeURIComponent(meta.url), meta.name, meta.mimeType,
+ this.extension, success, error);
+ }
+ else
{
- window.clearTimeout(timeoutThread);
-
- if (acceptResponse)
- {
- //keep our id which includes the cardId
- meta.compoundId = id;
-
- var index = (binary) ? data.lastIndexOf(',') : -1;
-
- if (index > 0)
- {
- var xml = this.ui.extractGraphModelFromPng(data.substring(index + 1));
-
- if (xml != null && xml.length > 0)
+ acceptResponse = true;
+
+ timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+ {
+ acceptResponse = false;
+ error({code: App.ERROR_TIMEOUT})
+ }), this.ui.timeout);
+
+ this.ui.loadUrl(PROXY_URL + '?url=' + encodeURIComponent(meta.url), mxUtils.bind(this, function(data)
+ {
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ //keep our id which includes the cardId
+ meta.compoundId = id;
+
+ var index = (binary) ? data.lastIndexOf(',') : -1;
+
+ if (index > 0)
{
- data = xml;
+ var xml = this.ui.extractGraphModelFromPng(data.substring(index + 1));
+
+ if (xml != null && xml.length > 0)
+ {
+ data = xml;
+ }
+ else
+ {
+ // TODO: Import PNG
+ }
+ }
+
+ if (asLibrary)
+ {
+ success(new TrelloLibrary(this.ui, data, meta));
}
else
{
- // TODO: Import PNG
+ success(new TrelloFile(this.ui, data, meta));
}
- }
-
- if (asLibrary)
- {
- success(new TrelloLibrary(this.ui, data, meta));
- }
- else
- {
- success(new TrelloFile(this.ui, data, meta));
- }
- }
- }), mxUtils.bind(this, function(req)
- {
- window.clearTimeout(timeoutThread);
-
- if (acceptResponse)
- {
- error();
- }
- }), binary || (meta.mimeType != null &&
- meta.mimeType.substring(0, 6) == 'image/'));
- }
+ }
+ }), mxUtils.bind(this, function(err, req)
+ {
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ if (req.status == 401)
+ {
+ this.authenticate(callback, error, true);
+ }
+ else
+ {
+ error();
+ }
+ }
+ }), binary || (meta.mimeType != null &&
+ meta.mimeType.substring(0, 6) == 'image/'));
+ }
+ }
+ }), mxUtils.bind(this, function(err)
+ {
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ if (err.status == 401)
+ {
+ this.authenticate(callback, error, true);
+ }
+ else
+ {
+ error();
+ }
+ }
}));
});
@@ -210,40 +249,42 @@ TrelloClient.prototype.saveFile = function(file, success, error)
{
// delete file first, then write it again
var ids = file.meta.compoundId.split(this.SEPARATOR);
- Trello.authorize(
+
+ var fn = mxUtils.bind(this, function(data)
{
- type: 'popup',
- name: 'draw.io',
- scope:
+ Trello.del('cards/' + ids[0] + '/attachments/' + ids[1], mxUtils.bind(this, function()
{
- read: 'true',
- write: 'true'
- },
- expiration: 'never',
- success: mxUtils.bind(this, function()
+ this.writeFile(file.meta.name, data, ids[0], success, error);
+ }), mxUtils.bind(this, function(err)
{
- var fn = mxUtils.bind(this, function(data)
+ if (err.status == 401)
+ {
+ // KNOWN: Does not wait for popup to close for callback
+ this.authenticate(callback, error, true);
+ }
+ else
+ {
+ error();
+ }
+ }));
+ });
+
+ var callback = mxUtils.bind(this, function()
+ {
+ if (this.ui.useCanvasForExport && /(\.png)$/i.test(file.meta.name))
+ {
+ this.ui.getEmbeddedPng(mxUtils.bind(this, function(data)
{
- Trello.del('cards/' + ids[0] + '/attachments/' + ids[1], mxUtils.bind(this, function()
- {
- this.writeFile(file.meta.name, data, ids[0], success, error);
- }), error);
- });
-
- if (this.ui.useCanvasForExport && /(\.png)$/i.test(file.meta.name))
- {
- this.ui.getEmbeddedPng(mxUtils.bind(this, function(data)
- {
- fn(this.ui.base64ToBlob(data, 'image/png'));
- }), error, (this.ui.getCurrentFile() != file) ? file.getData() : null);
- }
- else
- {
- fn(file.getData());
- }
- }),
- error: error
- });
+ fn(this.ui.base64ToBlob(data, 'image/png'));
+ }), error, (this.ui.getCurrentFile() != file) ? file.getData() : null);
+ }
+ else
+ {
+ fn(file.getData());
+ }
+ });
+
+ this.authenticate(callback, error);
};
/**
@@ -263,63 +304,54 @@ TrelloClient.prototype.writeFile = function(filename, data, cardId, success, err
var fn = mxUtils.bind(this, function()
{
- Trello.authorize({
- type: 'popup',
- name: 'draw.io',
- scope: {
- read: 'true',
- write: 'true'
- },
- expiration: 'never',
- success: mxUtils.bind(this, function()
- {
- var acceptResponse = true;
-
- var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
- {
- acceptResponse = false;
- error({code: App.ERROR_TIMEOUT, retry: fn});
- }), this.ui.timeout);
-
- var formData = new FormData();
- formData.append('key', Trello.key());
- formData.append('token', Trello.token());
- formData.append('file', typeof data === "string"? new Blob([data]) : data, filename);
- formData.append('name', filename);
-
- var request = new XMLHttpRequest();
- request.responseType = 'json';
-
- request.onreadystatechange = mxUtils.bind(this, function()
- {
- if (request.readyState === 4)
- {
- window.clearTimeout(timeoutThread);
-
- if (acceptResponse)
- {
- if (request.status == 200)
- {
- var fileMeta = request.response;
- fileMeta.compoundId = cardId + this.SEPARATOR + fileMeta.id
- success(fileMeta);
- }
- else
- {
- error();
- }
- }
- }
- });
-
- request.open('POST', this.baseUrl + 'cards/' + cardId + '/attachments');
- request.send(formData);
- }),
- error: error
- });
+ var acceptResponse = true;
+
+ var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+ {
+ acceptResponse = false;
+ error({code: App.ERROR_TIMEOUT, retry: fn});
+ }), this.ui.timeout);
+
+ var formData = new FormData();
+ formData.append('key', Trello.key());
+ formData.append('token', Trello.token());
+ formData.append('file', typeof data === 'string' ? new Blob([data]) : data, filename);
+ formData.append('name', filename);
+
+ var request = new XMLHttpRequest();
+ request.responseType = 'json';
+
+ request.onreadystatechange = mxUtils.bind(this, function()
+ {
+ if (request.readyState === 4)
+ {
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ if (request.status == 200)
+ {
+ var fileMeta = request.response;
+ fileMeta.compoundId = cardId + this.SEPARATOR + fileMeta.id
+ success(fileMeta);
+ }
+ else if (request.status == 401)
+ {
+ this.authenticate(fn, error, true);
+ }
+ else
+ {
+ error();
+ }
+ }
+ }
+ });
+
+ request.open('POST', this.baseUrl + 'cards/' + cardId + '/attachments');
+ request.send(formData);
});
- fn();
+ this.authenticate(fn, error);
}
else
{
@@ -340,23 +372,14 @@ TrelloClient.prototype.pickLibrary = function(fn)
*/
TrelloClient.prototype.pickFolder = function(fn)
{
- Trello.authorize({
- type: 'popup',
- name: 'draw.io',
- scope: {
- read: 'true',
- write: 'true' },
- expiration: 'never',
- success: mxUtils.bind(this, function()
- {
- //show file select
- this.showTrelloDialog(false, fn);
- }),
- error: mxUtils.bind(this, function(e)
- {
- this.ui.showError(mxResources.get('error'), e);
- })
- });
+ this.authenticate(mxUtils.bind(this, function()
+ {
+ // show file select
+ this.showTrelloDialog(false, fn);
+ }), mxUtils.bind(this, function(e)
+ {
+ this.ui.showError(mxResources.get('error'), e);
+ }));
};
/**
@@ -369,23 +392,14 @@ TrelloClient.prototype.pickFile = function(fn, returnObject)
this.ui.loadFile('T' + encodeURIComponent(id));
});
- Trello.authorize({
- type: 'popup',
- name: 'draw.io',
- scope: {
- read: 'true',
- write: 'true' },
- expiration: 'never',
- success: mxUtils.bind(this, function()
- {
- //show file select
- this.showTrelloDialog(true, fn);
- }),
- error: mxUtils.bind(this, function(e)
- {
- this.ui.showError(mxResources.get('error'), e);
- })
- });
+ this.authenticate(mxUtils.bind(this, function()
+ {
+ // show file select
+ this.showTrelloDialog(true, fn);
+ }), mxUtils.bind(this, function(e)
+ {
+ this.ui.showError(mxResources.get('error'), e);
+ }));
};
@@ -653,5 +667,6 @@ TrelloClient.prototype.isAuthorized = function()
*/
TrelloClient.prototype.logout = function()
{
+ localStorage.removeItem('trello_token');
Trello.deauthorize();
};
diff --git a/war/js/embed-static.min.js b/war/js/embed-static.min.js
index 65383be2..4dfd0d90 100644
--- a/war/js/embed-static.min.js
+++ b/war/js/embed-static.min.js
@@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;enavigator.userAgent.indexOf("MSIE")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.6.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
diff --git a/war/js/reader.min.js b/war/js/reader.min.js
index af0fc185..8ca6c1df 100644
--- a/war/js/reader.min.js
+++ b/war/js/reader.min.js
@@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;enavigator.userAgent.indexOf("MSIE")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.6.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
diff --git a/war/js/viewer.min.js b/war/js/viewer.min.js
index 35e37b57..c3d06d6d 100644
--- a/war/js/viewer.min.js
+++ b/war/js/viewer.min.js
@@ -2179,7 +2179,7 @@ this.getRubberband=function(){return g};var p=(new Date).getTime(),n=0,q=this.co
"outlineConnect","1"))&&k.apply(this,arguments)};var w=this.isToggleEvent;this.isToggleEvent=function(a){return w.apply(this,arguments)||mxEvent.isShiftDown(a)};var x=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var u=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
(u=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=u)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return y.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
var v=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return v.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,g){g=null!=g?g:[];if(0=a&&w.y+w.height<=p&&w.y>=c&&w.x+w.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
+e.getChildAt(f,O),u=this.view.getState(q);if(null!=u&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var w=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(u=mxUtils.getBoundingBox(u,w));(e.isEdge(q)||e.isVertex(q))&&u.x>=a&&u.y+u.height<=p&&u.y>=c&&u.x+u.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
!1:G.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();F=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=F?this.addSelectionCells(F):1c&&b[d].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;
@@ -2426,8 +2426,8 @@ x.prototype.redrawPath=function(a,c,b,d,f){c=mxUtils.getValue(this.style,mxConst
0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],this.isRounded,b,!0)};mxCellRenderer.prototype.defaultShapes.hexagon=y;mxUtils.extend(v,mxRectangleShape);v.prototype.isHtmlAllowed=function(){return!1};v.prototype.paintForeground=function(a,c,b,d,f){var g=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+g);a.lineTo(c+d/2,b+f-g);a.moveTo(c+g,b+f/2);a.lineTo(c+d-g,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.plus=
v;var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,d,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var g=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
0);c+=g;b+=g;d-=2*g;f-=2*g;0=a.getStatus()){if(null!=
-b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=
-h.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==
-z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),0c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b=
-"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!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)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
-b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
-a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
-e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
-b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();
-this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
-a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=
-this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
-"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case e.DOWNLOADING:b='';break;case e.UPDATEREADY:b='';break;case e.OBSOLETE:b='';break;default:b=''}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
-EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
-this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
-this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=
-d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;
-if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=h.xml&&0mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),
+0c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*
+r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.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=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
+b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!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)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
+arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
+function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
+mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
+"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=
+("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
+this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
+applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
+mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0';break;case e.DOWNLOADING:b='';break;case e.UPDATEREADY:b='';break;case e.OBSOLETE:b='';break;default:b=''}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
+b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;
+EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);
+this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
+this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;
+EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,
+h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n