From 49a5afedf0183922be51e8487bd7ae768a35e865 Mon Sep 17 00:00:00 2001 From: Gaudenz Alder <gaudenz@jgraph.com> Date: Thu, 27 Feb 2020 16:49:37 +0100 Subject: [PATCH] 12.7.9 release --- ChangeLog | 6 + VERSION | 2 +- etc/mxgraph/mxClient.js | 7 +- src/main/webapp/WEB-INF/google_old_client_id | 2 +- .../WEB-INF/google_old_client_redirect_uri | 2 +- .../WEB-INF/msgraph_old_client_redirect_uri | 2 +- src/main/webapp/js/app.min.js | 1603 +++++++++-------- src/main/webapp/js/diagramly/App.js | 69 +- .../js/diagramly/vsdx/mxVsdxCanvas2D.js | 16 +- src/main/webapp/js/extensions.min.js | 4 +- src/main/webapp/js/viewer.min.js | 7 +- src/main/webapp/service-worker.js | 4 +- 12 files changed, 898 insertions(+), 826 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78bfdf597..23109ea14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +27-FEB-2020: 12.7.9 + +- Fixes update of indicator shapes +- Uses mxGraph 4.1.1 beta 11 +- Adds diagrams.net banner + 26-FEB-2020: 12.7.8 - Adds logging for Confluence cloud errors diff --git a/VERSION b/VERSION index da224e793..7deb0410b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.7.8 \ No newline at end of file +12.7.9 \ No newline at end of file diff --git a/etc/mxgraph/mxClient.js b/etc/mxgraph/mxClient.js index 66f5f80e1..b89c7a5f1 100644 --- a/etc/mxgraph/mxClient.js +++ b/etc/mxgraph/mxClient.js @@ -534,7 +534,7 @@ mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.roun this.node.style.borderColor=b;a=document.createElement(mxClient.IS_IE6||(null==document.documentMode||8>=document.documentMode)&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&& (b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"==a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)}; function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape);mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))}; -mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection);mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; +mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1))}; mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER? a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-l):a+l;b=f==mxConstants.ALIGN_TOP?b+l:f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):b+(d-k)/2;return new mxRectangle(a,b,g,k)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))}; @@ -966,8 +966,9 @@ mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShap a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]}; mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))}; mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a), -this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points= -null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)}; +this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a), +null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e}; +mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)}; mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(a,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)}; var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1],k=!1;if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var n=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);n!=mxConstants.DIRECTION_MASK_NONE&&n!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?k=n==mxConstants.DIRECTION_MASK_WEST:(l=g.getCellGeometry(b.cell), l.relative?k=.5>=l.x:null!=c&&(k=c.x+c.width<b.x))}else return;l=!0;null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(n=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),n!=mxConstants.DIRECTION_MASK_NONE&&n!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?l=n==mxConstants.DIRECTION_MASK_WEST:(a=g.getCellGeometry(c.cell),a.relative?l=.5>=a.x:null!=b&&(l=b.x+b.width<c.x)));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),g=l?c.x:c.x+c.width,c=f.getRoutingCenterY(c), diff --git a/src/main/webapp/WEB-INF/google_old_client_id b/src/main/webapp/WEB-INF/google_old_client_id index f9f911de6..3379637d1 100644 --- a/src/main/webapp/WEB-INF/google_old_client_id +++ b/src/main/webapp/WEB-INF/google_old_client_id @@ -1 +1 @@ -850530949725.apps.googleusercontent.com/:::/671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com/:::/850530949725.apps.googleusercontent.com/:::/850530949725.apps.googleusercontent.com/:::/671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com \ No newline at end of file +Replace_with_your_own_google_client_id \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/google_old_client_redirect_uri b/src/main/webapp/WEB-INF/google_old_client_redirect_uri index aa706ecb8..ec8ee4bce 100644 --- a/src/main/webapp/WEB-INF/google_old_client_redirect_uri +++ b/src/main/webapp/WEB-INF/google_old_client_redirect_uri @@ -1 +1 @@ -https://www.draw.io/google/:::/https://www.draw.io/google/:::/https://confluence.draw.io/google/:::/https://jira.draw.io/google/:::/https://test.draw.io/google \ No newline at end of file +Replace_with_your_own_google_client_redirect_url \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/msgraph_old_client_redirect_uri b/src/main/webapp/WEB-INF/msgraph_old_client_redirect_uri index 46187f1ea..3f761e0be 100644 --- a/src/main/webapp/WEB-INF/msgraph_old_client_redirect_uri +++ b/src/main/webapp/WEB-INF/msgraph_old_client_redirect_uri @@ -1 +1 @@ -https://www.draw.io/microsoft/:::/https://confluence.draw.io/microsoft/:::/https://jira.draw.io/microsoft/:::/https://test.draw.io/microsoft \ No newline at end of file +Replace_with_your_own_microsoft_graph_client_redirect_uri \ No newline at end of file diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 9e9f9a1fd..17ba0a587 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -678,7 +678,7 @@ mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.roun this.node.style.borderColor=b;a=document.createElement(mxClient.IS_IE6||(null==document.documentMode||8>=document.documentMode)&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&& (b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"==a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)}; function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape);mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))}; -mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection);mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; +mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1))}; mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER? a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-l):a+l;b=f==mxConstants.ALIGN_TOP?b+l:f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):b+(d-k)/2;return new mxRectangle(a,b,g,k)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))}; @@ -1110,8 +1110,9 @@ mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShap a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]}; mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))}; mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a), -this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points= -null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)}; +this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a), +null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e}; +mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)}; mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(a,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)}; var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1],k=!1;if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var n=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);n!=mxConstants.DIRECTION_MASK_NONE&&n!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?k=n==mxConstants.DIRECTION_MASK_WEST:(l=g.getCellGeometry(b.cell), l.relative?k=.5>=l.x:null!=c&&(k=c.x+c.width<b.x))}else return;l=!0;null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(n=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),n!=mxConstants.DIRECTION_MASK_NONE&&n!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?l=n==mxConstants.DIRECTION_MASK_WEST:(a=g.getCellGeometry(c.cell),a.relative?l=.5>=a.x:null!=b&&(l=b.x+b.width<c.x)));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),g=l?c.x:c.x+c.width,c=f.getRoutingCenterY(c), @@ -8149,88 +8150,88 @@ this.getTagsForStencil("mxgraph.weblogos","xanga","web logos logo").join(" ")),t 74.4,43.6,"","Yahoo",null,null,this.getTagsForStencil("mxgraph.weblogos","yahoo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yahoo_2;fillColor=#65106E;strokeColor=none",80,46.6,"","Yahoo",null,null,this.getTagsForStencil("mxgraph.weblogos","yahoo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yammer;fillColor=#0093BE;strokeColor=none",.2*348,59.6,"","Yammer",null,null,this.getTagsForStencil("mxgraph.weblogos","yammer","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ "yandex",31.8,66.4,"","Yandex",null,null,this.getTagsForStencil("mxgraph.weblogos","yandex","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yelp;fillColor=#C41200;strokeColor=none",.2*317,83,"","Yelp",null,null,this.getTagsForStencil("mxgraph.weblogos","yelp","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"yoolink",79.2,79.2,"","Yoolink",null,null,this.getTagsForStencil("mxgraph.weblogos","yoolink","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youmob", 76,76.2,"","Youmob",null,null,this.getTagsForStencil("mxgraph.weblogos","youmob","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youtube;fillColor=#FF2626;gradientColor=#B5171F",.2*786,65.8,"","Youtube",null,null,this.getTagsForStencil("mxgraph.weblogos","youtube","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"youtube_2;fillColor=#FF2626;gradientColor=#B5171F",.2*232,32.6,"","Youtube",null,null,this.getTagsForStencil("mxgraph.weblogos","youtube","web logos logo").join(" "))])}})(); -DrawioFile=function(a,d){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=d||"";this.shadowPages=null;this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource); +DrawioFile=function(a,c){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=c||"";this.shadowPages=null;this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource); DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null; DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0}; -DrawioFile.prototype.synchronizeFile=function(a,d){this.savingFile?null!=d&&d({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,d):this.updateFile(a,d)}; -DrawioFile.prototype.updateFile=function(a,d,c,b){null!=c&&c()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():this.getLatestVersion(mxUtils.bind(this,function(g){try{null!=c&&c()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=g?this.mergeFile(g,a,d,b):this.reloadFile(a,d))}catch(e){null!=d&&d(e)}}),d))}; -DrawioFile.prototype.mergeFile=function(a,d,c,b){var g=!0;try{this.stats.fileMerged++;var e=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),k=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=k&&0<k.length){this.shadowPages=k;this.backupPatch=this.isModified()?this.ui.diffPages(e,this.ui.pages):null;var n=[this.ui.diffPages(null!=b?b:e,this.shadowPages)];if(!this.ignorePatches(n)){var m=this.ui.patchPages(e, -n[0]);b={};var t=this.ui.getHashValueForPages(m,b),e={},f=this.ui.getHashValueForPages(this.shadowPages,e);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",n,"checksum",f==t,t);if(null!=t&&t!=f){var l=this.compressReportData(this.getAnonymizedXmlForPages(k)),p=this.compressReportData(this.getAnonymizedXmlForPages(m)),u=this.ui.hashValue(a.getCurrentEtag()),v=this.ui.hashValue(this.getCurrentEtag());this.checksumError(c,n,"Shadow Details: "+JSON.stringify(b)+ -"\nChecksum: "+t+"\nCurrent: "+f+"\nCurrent Details: "+JSON.stringify(e)+"\nFrom: "+u+"\nTo: "+v+"\n\nFile Data:\n"+l+"\nPatched Shadow:\n"+p,null,"mergeFile");return}this.patch(n,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw g=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=d&&d()}catch(y){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged(); -null!=c&&c(y);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var q=this.getCurrentUser(),z=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,y)}}catch(C){}}}; -DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var d=new mxCodec(mxUtils.createXmlDocument()),c=d.document.createElement("mxfile");if(null!=a)for(var b=0;b<a.length;b++){var g=d.encode(new mxGraphModel(a[b].root));"1"!=urlParams.dev&&(g=this.ui.anonymizeNode(g,!0));g.setAttribute("id",a[b].getId());a[b].viewState&&this.ui.editor.graph.saveViewState(a[b].viewState,g,!0);c.appendChild(g)}return mxUtils.getPrettyXml(c)}; -DrawioFile.prototype.compressReportData=function(a,d,c){d=null!=d?d:1E4;null!=c&&null!=a&&a.length>c?a=a.substring(0,c)+"[...]":null!=a&&a.length>d&&(a=Graph.compress(a)+"\n");return a}; -DrawioFile.prototype.checksumError=function(a,d,c,b,g){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=d)for(a=0;a<d.length;a++)this.ui.anonymizePatch(d[a]);var e=mxUtils.bind(this,function(a){var b=this.compressReportData(JSON.stringify(d,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)), -25E3):"n/a";this.sendErrorReport("Checksum Error in "+g+" "+this.getHash(),(null!=c?c:"")+"\n\nPatches:\n"+b+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==b?e(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==b?e(a):e(null)}),function(){})}else{var k=this.getCurrentUser(),n=null!=k?k.id:"unknown";EditorUi.logError("Checksum Error in "+g+" "+this.getId(),null,this.getMode()+"."+this.getId(),"user_"+n+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")); +DrawioFile.prototype.synchronizeFile=function(a,c){this.savingFile?null!=c&&c({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,c):this.updateFile(a,c)}; +DrawioFile.prototype.updateFile=function(a,c,d,b){null!=d&&d()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():this.getLatestVersion(mxUtils.bind(this,function(g){try{null!=d&&d()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():null!=g?this.mergeFile(g,a,c,b):this.reloadFile(a,c))}catch(e){null!=c&&c(e)}}),c))}; +DrawioFile.prototype.mergeFile=function(a,c,d,b){var g=!0;try{this.stats.fileMerged++;var e=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),k=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=k&&0<k.length){this.shadowPages=k;this.backupPatch=this.isModified()?this.ui.diffPages(e,this.ui.pages):null;var n=[this.ui.diffPages(null!=b?b:e,this.shadowPages)];if(!this.ignorePatches(n)){var m=this.ui.patchPages(e, +n[0]);b={};var t=this.ui.getHashValueForPages(m,b),e={},f=this.ui.getHashValueForPages(this.shadowPages,e);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",n,"checksum",f==t,t);if(null!=t&&t!=f){var l=this.compressReportData(this.getAnonymizedXmlForPages(k)),p=this.compressReportData(this.getAnonymizedXmlForPages(m)),u=this.ui.hashValue(a.getCurrentEtag()),v=this.ui.hashValue(this.getCurrentEtag());this.checksumError(d,n,"Shadow Details: "+JSON.stringify(b)+ +"\nChecksum: "+t+"\nCurrent: "+f+"\nCurrent Details: "+JSON.stringify(e)+"\nFrom: "+u+"\nTo: "+v+"\n\nFile Data:\n"+l+"\nPatched Shadow:\n"+p,null,"mergeFile");return}this.patch(n,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw g=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(y){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged(); +null!=d&&d(y);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var q=this.getCurrentUser(),z=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,y)}}catch(C){}}}; +DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),d=c.document.createElement("mxfile");if(null!=a)for(var b=0;b<a.length;b++){var g=c.encode(new mxGraphModel(a[b].root));"1"!=urlParams.dev&&(g=this.ui.anonymizeNode(g,!0));g.setAttribute("id",a[b].getId());a[b].viewState&&this.ui.editor.graph.saveViewState(a[b].viewState,g,!0);d.appendChild(g)}return mxUtils.getPrettyXml(d)}; +DrawioFile.prototype.compressReportData=function(a,c,d){c=null!=c?c:1E4;null!=d&&null!=a&&a.length>d?a=a.substring(0,d)+"[...]":null!=a&&a.length>c&&(a=Graph.compress(a)+"\n");return a}; +DrawioFile.prototype.checksumError=function(a,c,d,b,g){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var e=mxUtils.bind(this,function(a){var b=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)), +25E3):"n/a";this.sendErrorReport("Checksum Error in "+g+" "+this.getHash(),(null!=d?d:"")+"\n\nPatches:\n"+b+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==b?e(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==b?e(a):e(null)}),function(){})}else{var k=this.getCurrentUser(),n=null!=k?k.id:"unknown";EditorUi.logError("Checksum Error in "+g+" "+this.getId(),null,this.getMode()+"."+this.getId(),"user_"+n+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")); try{EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+this.getHash(),action:g,label:"user_"+n+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")})}catch(m){}}}catch(m){}}; -DrawioFile.prototype.sendErrorReport=function(a,d,c,b){try{var g=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),e=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),k=this.getCurrentUser(),n=null!=k?this.ui.hashValue(k.id):"unknown",m=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",t=this.getTitle(),f=t.lastIndexOf("."),k="xml";0<f&&(k=t.substring(f));var l=null!=c?c.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+ -":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+k+")\nUser="+n+m+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=d?"\n\n"+d:"")+ -(null!=c?"\n\nError: "+c.message:"")+"\n\nStack:\n"+l+"\n\nShadow:\n"+g+"\n\nData:\n"+e,b)}catch(p){}}; -DrawioFile.prototype.reloadFile=function(a,d){try{this.ui.spinner.stop();var c=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),c=this.ui.editor.graph.getSelectionCells(),d=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(d,b,c);null!=this.backupPatch&&this.patch([this.backupPatch]);var e=this.ui.getCurrentFile();null!=e&&(e.stats= -this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),c,mxResources.get("cancel"),mxResources.get("discardChanges")):c()}catch(b){null!=d&&d(b)}};DrawioFile.prototype.copyFile=function(a,d){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))}; -DrawioFile.prototype.ignorePatches=function(a){for(var d=!0,c=0;c<a.length&&d;c++)d=d&&0==Object.keys(a[c]).length;return d}; -DrawioFile.prototype.patch=function(a,d){var c=this.ui.editor.undoManager,b=c.history.slice(),g=c.indexOfNextAdd,e=this.ui.editor.graph;e.container.style.visibility="hidden";var k=this.changeListenerEnabled;this.changeListenerEnabled=!1;var n=e.foldingEnabled,m=e.mathEnabled,t=e.cellRenderer.redraw;e.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());t.apply(this,arguments)};e.model.beginUpdate();try{for(var f= -0;f<a.length;f++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[f],!0,d,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{e.container.style.visibility="";e.model.endUpdate();e.cellRenderer.redraw=t;this.changeListenerEnabled=k;c.history=b;c.indexOfNextAdd=g;c.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)m!= +DrawioFile.prototype.sendErrorReport=function(a,c,d,b){try{var g=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),e=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),k=this.getCurrentUser(),n=null!=k?this.ui.hashValue(k.id):"unknown",m=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",t=this.getTitle(),f=t.lastIndexOf("."),k="xml";0<f&&(k=t.substring(f));var l=null!=d?d.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+ +":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+k+")\nUser="+n+m+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=c?"\n\n"+c:"")+ +(null!=d?"\n\nError: "+d.message:"")+"\n\nStack:\n"+l+"\n\nShadow:\n"+g+"\n\nData:\n"+e,b)}catch(p){}}; +DrawioFile.prototype.reloadFile=function(a,c){try{this.ui.spinner.stop();var d=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),d=this.ui.editor.graph.getSelectionCells(),c=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(c,b,d);null!=this.backupPatch&&this.patch([this.backupPatch]);var e=this.ui.getCurrentFile();null!=e&&(e.stats= +this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):d()}catch(b){null!=c&&c(b)}};DrawioFile.prototype.copyFile=function(a,c){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))}; +DrawioFile.prototype.ignorePatches=function(a){for(var c=!0,d=0;d<a.length&&c;d++)c=c&&0==Object.keys(a[d]).length;return c}; +DrawioFile.prototype.patch=function(a,c){var d=this.ui.editor.undoManager,b=d.history.slice(),g=d.indexOfNextAdd,e=this.ui.editor.graph;e.container.style.visibility="hidden";var k=this.changeListenerEnabled;this.changeListenerEnabled=!1;var n=e.foldingEnabled,m=e.mathEnabled,t=e.cellRenderer.redraw;e.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());t.apply(this,arguments)};e.model.beginUpdate();try{for(var f= +0;f<a.length;f++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[f],!0,c,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{e.container.style.visibility="";e.model.endUpdate();e.cellRenderer.redraw=t;this.changeListenerEnabled=k;d.history=b;d.indexOfNextAdd=g;d.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)m!= e.mathEnabled?(this.ui.editor.updateGraphComponents(),e.refresh()):(n!=e.foldingEnabled?e.view.revalidate():e.view.validate(),e.sizeDidChange());this.ui.updateTabContainer()}}; -DrawioFile.prototype.save=function(a,d,c,b,g,e){try{if(this.isEditable())if(!g&&this.invalidChecksum)if(null!=c)c({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=d&&d();else if(null!=c)c({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(k){if(null!=c)c(k);else throw k;}}; +DrawioFile.prototype.save=function(a,c,d,b,g,e){try{if(this.isEditable())if(!g&&this.invalidChecksum)if(null!=d)d({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=c&&c();else if(null!=d)d({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(k){if(null!=d)d(k);else throw k;}}; DrawioFile.prototype.updateFileData=function(a){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this,null!=a?!a:!this.isCompressed()))};DrawioFile.prototype.isCompressedStorage=function(){return!0};DrawioFile.prototype.isCompressed=function(){var a=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=a?"false"!=a:this.isCompressedStorage()&&Editor.compressXml}; -DrawioFile.prototype.decompress=function(){this.updateFileData(!1);null!=this.ui.fileNode&&this.ui.fileNode.setAttribute("compressed","false");this.fileChanged()};DrawioFile.prototype.compress=function(){this.updateFileData(!0);null!=this.ui.fileNode&&this.ui.fileNode.setAttribute("compressed","true");this.fileChanged()};DrawioFile.prototype.saveAs=function(a,d,c){};DrawioFile.prototype.saveFile=function(a,d,c,b){};DrawioFile.prototype.getPublicUrl=function(a){a(null)}; -DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,d,c){};DrawioFile.prototype.isMovable=function(){return!1}; -DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(a,d,c){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data}; -DrawioFile.prototype.open=function(){this.stats.opened++;var a=this.getData();if(null!=a){var d=function(a){for(var b=0;null!=a&&b<a.length;b++){var c=a[b];null!=c.id&&0==c.id.indexOf("extFont_")&&c.parentNode.removeChild(c)}};d(document.querySelectorAll("head > style[id]"));d(document.querySelectorAll("head > link[id]"));this.ui.setFileData(a);this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null)}this.installListeners();this.isSyncSupported()&&this.startSync()}; -DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,d){a(null)};DrawioFile.prototype.loadDescriptor=function(a,d){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,d){this.loadDescriptor(mxUtils.bind(this,function(c){a(c)}),d)};DrawioFile.prototype.patchDescriptor=function(a,d){this.setDescriptorEtag(a,this.getDescriptorEtag(d))}; +DrawioFile.prototype.decompress=function(){this.updateFileData(!1);null!=this.ui.fileNode&&this.ui.fileNode.setAttribute("compressed","false");this.fileChanged()};DrawioFile.prototype.compress=function(){this.updateFileData(!0);null!=this.ui.fileNode&&this.ui.fileNode.setAttribute("compressed","true");this.fileChanged()};DrawioFile.prototype.saveAs=function(a,c,d){};DrawioFile.prototype.saveFile=function(a,c,d,b){};DrawioFile.prototype.getPublicUrl=function(a){a(null)}; +DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,c,d){};DrawioFile.prototype.isMovable=function(){return!1}; +DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(a,c,d){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data}; +DrawioFile.prototype.open=function(){this.stats.opened++;var a=this.getData();if(null!=a){var c=function(a){for(var b=0;null!=a&&b<a.length;b++){var d=a[b];null!=d.id&&0==d.id.indexOf("extFont_")&&d.parentNode.removeChild(d)}};c(document.querySelectorAll("head > style[id]"));c(document.querySelectorAll("head > link[id]"));this.ui.setFileData(a);this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null)}this.installListeners();this.isSyncSupported()&&this.startSync()}; +DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,c){a(null)};DrawioFile.prototype.loadDescriptor=function(a,c){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,c){this.loadDescriptor(mxUtils.bind(this,function(d){a(d)}),c)};DrawioFile.prototype.patchDescriptor=function(a,c){this.setDescriptorEtag(a,this.getDescriptorEtag(c))}; DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null}; -DrawioFile.prototype.getLatestVersion=function(a,d){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentRevisionId=function(a){this.setDescriptorRevisionId(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentRevisionId=function(){return this.getDescriptorRevisionId(this.getDescriptor())};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())}; -DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorRevisionId=function(a,d){this.setDescriptorEtag(a,d)};DrawioFile.prototype.getDescriptorRevisionId=function(a){return this.getDescriptorEtag(a)};DrawioFile.prototype.setDescriptorEtag=function(a,d){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null}; -DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,d){var c=null!=d?d.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=c&&c.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged", +DrawioFile.prototype.getLatestVersion=function(a,c){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentRevisionId=function(a){this.setDescriptorRevisionId(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentRevisionId=function(){return this.getDescriptorRevisionId(this.getDescriptor())};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())}; +DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorRevisionId=function(a,c){this.setDescriptorEtag(a,c)};DrawioFile.prototype.getDescriptorRevisionId=function(a){return this.getDescriptorEtag(a)};DrawioFile.prototype.setDescriptorEtag=function(a,c){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null}; +DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,c){var d=null!=c?c.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=d&&d.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged", this.changeListener),this.ui.addListener("pageScaleChanged",this.changeListener),this.ui.addListener("backgroundColorChanged",this.changeListener),this.ui.addListener("backgroundImageChanged",this.changeListener),this.ui.addListener("foldingEnabledChanged",this.changeListener),this.ui.addListener("mathEnabledChanged",this.changeListener),this.ui.addListener("gridEnabledChanged",this.changeListener),this.ui.addListener("guidesEnabledChanged",this.changeListener),this.ui.addListener("pageViewChanged", this.changeListener),this.ui.addListener("connectionPointsChanged",this.changeListener),this.ui.addListener("connectionArrowsChanged",this.changeListener))}; DrawioFile.prototype.addAllSavedStatus=function(a){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(a=null!=a?a:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+a+'">'+a+"</div>"),a=this.ui.statusContainer.getElementsByTagName("div"),0<a.length&&this.isRevisionHistorySupported()&&(a[0].style.cursor="pointer",a[0].style.textDecoration="underline",mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))}; -DrawioFile.prototype.saveDraft=function(){try{null==this.draftId&&(this.draftId=Editor.guid());var a={type:"draft",created:this.created,modified:(new Date).getTime(),data:this.ui.getFileData(),title:this.getTitle(),aliveCheck:this.ui.draftAliveCheck};this.ui.setDatabaseItem(".draft_"+this.draftId,JSON.stringify(a));EditorUi.debug("draft saved",this.draftId,a)}catch(d){console.error(d),this.removeDraft()}}; +DrawioFile.prototype.saveDraft=function(){try{null==this.draftId&&(this.draftId=Editor.guid());var a={type:"draft",created:this.created,modified:(new Date).getTime(),data:this.ui.getFileData(),title:this.getTitle(),aliveCheck:this.ui.draftAliveCheck};this.ui.setDatabaseItem(".draft_"+this.draftId,JSON.stringify(a));EditorUi.debug("draft saved",this.draftId,a)}catch(c){console.error(c),this.removeDraft()}}; DrawioFile.prototype.removeDraft=function(){try{null!=this.draftId&&(this.ui.removeDatabaseItem(".draft_"+this.draftId),EditorUi.debug("draft deleted",".draft_"+this.draftId))}catch(a){}}; -DrawioFile.prototype.addUnsavedStatus=function(a){if(!this.inConflictState&&null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this)if(a instanceof Error&&null!=a.message&&""!=a.message){var d=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert" style="overflow:hidden;">'+d+" ("+mxUtils.htmlEntities(a.message)+")</div>")}else{d=this.getErrorMessage(a);if(null==d&&null!=this.lastSaved){var c=this.ui.timeSince(new Date(this.lastSaved)); -null!=c&&(d=mxResources.get("lastSaved",[c]))}null!=d&&60<d.length&&(d=d.substring(0,60)+"...");d=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":"");this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+d+"</div>");d=this.ui.statusContainer.getElementsByTagName("div");null!=d&&0<d.length?mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!= -this.ui.mode&&this.isEditable()?"save":"saveAs").funct()})):(d=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert" style="overflow:hidden;">'+d+" ("+mxUtils.htmlEntities(a.message)+")</div>"));EditorUi.enableDrafts&&null==this.getMode()&&this.saveDraft()}}; -DrawioFile.prototype.addConflictStatus=function(a,d){this.invalidChecksum&&null==d&&(d=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":""));this.ui.spinner.stop();this.clearAutosave();var c=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=c&&0<c.length?mxEvent.addListener(c[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&& +DrawioFile.prototype.addUnsavedStatus=function(a){if(!this.inConflictState&&null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this)if(a instanceof Error&&null!=a.message&&""!=a.message){var c=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="overflow:hidden;">'+c+" ("+mxUtils.htmlEntities(a.message)+")</div>")}else{c=this.getErrorMessage(a);if(null==c&&null!=this.lastSaved){var d=this.ui.timeSince(new Date(this.lastSaved)); +null!=d&&(c=mxResources.get("lastSaved",[d]))}null!=c&&60<c.length&&(c=c.substring(0,60)+"...");c=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=c&&""!=c?" ("+mxUtils.htmlEntities(c)+")":"");this.ui.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+c+"</div>");c=this.ui.statusContainer.getElementsByTagName("div");null!=c&&0<c.length?mxEvent.addListener(c[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!= +this.ui.mode&&this.isEditable()?"save":"saveAs").funct()})):(c=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="overflow:hidden;">'+c+" ("+mxUtils.htmlEntities(a.message)+")</div>"));EditorUi.enableDrafts&&null==this.getMode()&&this.saveDraft()}}; +DrawioFile.prototype.addConflictStatus=function(a,c){this.invalidChecksum&&null==c&&(c=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=c&&""!=c?" ("+mxUtils.htmlEntities(c)+")":""));this.ui.spinner.stop();this.clearAutosave();var d=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=d&&0<d.length?mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&& a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://desk.draw.io/support/solutions/articles/16000087947" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')}; -DrawioFile.prototype.showRefreshDialog=function(a,d,c){null==c&&(c=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,d)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,d)}),c),this.ui.showError(mxResources.get("error")+" ("+c+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a, -d)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,d)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))}; -DrawioFile.prototype.showCopyDialog=function(a,d,c){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,d)}),null,mxResources.get("overwrite"),c,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)}; -DrawioFile.prototype.showConflictDialog=function(a,d){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),a,null,mxResources.get("synchronize"),d,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),340,150)}; -DrawioFile.prototype.redirectToNewApp=function(a,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var c=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),b=mxResources.get("redirectToNewApp");null!=d&&(b+=" ("+d+")");var g=mxUtils.bind(this,function(){var b=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==c?window.location.reload(): -window.location.href=c});null==a&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});null!=a?this.isModified()?this.ui.confirm(b,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()}),g,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(b,g,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()})):this.ui.alert(mxResources.get("redirectToNewApp"), +DrawioFile.prototype.showRefreshDialog=function(a,c,d){null==d&&(d=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,c)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,c)}),d),this.ui.showError(mxResources.get("error")+" ("+d+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a, +c)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,c)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))}; +DrawioFile.prototype.showCopyDialog=function(a,c,d){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,c)}),null,mxResources.get("overwrite"),d,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)}; +DrawioFile.prototype.showConflictDialog=function(a,c){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),a,null,mxResources.get("synchronize"),c,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),340,150)}; +DrawioFile.prototype.redirectToNewApp=function(a,c){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var d=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),b=mxResources.get("redirectToNewApp");null!=c&&(b+=" ("+c+")");var g=mxUtils.bind(this,function(){var b=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==d?window.location.reload(): +window.location.href=d});null==a&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});null!=a?this.isModified()?this.ui.confirm(b,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()}),g,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(b,g,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()})):this.ui.alert(mxResources.get("redirectToNewApp"), g)}};DrawioFile.prototype.handleFileSuccess=function(a){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.isModified()?this.fileChanged():a?(this.isTrashed()?this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey))+" ("+mxUtils.htmlEntities(mxResources.get("fileMovedToTrash"))+")"):this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))}; -DrawioFile.prototype.handleFileError=function(a,d){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,d);else if(this.isModified()&&this.addUnsavedStatus(a),d)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var c=null!=a?null!=a.error?a.error.message:a.message:null;null!=c&&60<c.length&&(c=c.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+ -mxUtils.htmlEntities(mxResources.get("error"))+(null!=c?" ("+mxUtils.htmlEntities(c)+")":"")+"</div>")}}; -DrawioFile.prototype.handleConflictError=function(a,d){var c=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),b=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),g=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,c,b,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage))}),e=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&& -this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,c,b,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),b)});"none"==DrawioFile.SYNC?this.showCopyDialog(c,b,g):this.invalidChecksum?this.showRefreshDialog(c,b,this.getErrorMessage(a)):d?this.showConflictDialog(g,e):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument"))); -this.synchronizeFile(c,b)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval}; +DrawioFile.prototype.handleFileError=function(a,c){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,c);else if(this.isModified()&&this.addUnsavedStatus(a),c)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var d=null!=a?null!=a.error?a.error.message:a.message:null;null!=d&&60<d.length&&(d=d.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+ +mxUtils.htmlEntities(mxResources.get("error"))+(null!=d?" ("+mxUtils.htmlEntities(d)+")":"")+"</div>")}}; +DrawioFile.prototype.handleConflictError=function(a,c){var d=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),b=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),g=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,d,b,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage))}),e=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&& +this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,d,b,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),b)});"none"==DrawioFile.SYNC?this.showCopyDialog(d,b,g):this.invalidChecksum?this.showRefreshDialog(d,b,this.getErrorMessage(a)):c?this.showConflictDialog(g,e):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument"))); +this.synchronizeFile(d,b)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval}; DrawioFile.prototype.fileChanged=function(){this.lastChanged=new Date;this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart= this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())}; -DrawioFile.prototype.fileSaved=function(a,d,c,b){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=c&&c()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),d,c,b,a)}catch(k){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=b&&b(k);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,k);else{var g= +DrawioFile.prototype.fileSaved=function(a,c,d,b){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=d&&d()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),c,d,b,a)}catch(k){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=b&&b(k);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,k);else{var g= this.getCurrentUser(),e=null!=g?g.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),e,k)}}catch(n){}}}; -DrawioFile.prototype.autosave=function(a,d,c,b){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<d?a:0;this.clearAutosave();var g=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==g&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=c&&c(a)}),mxUtils.bind(this, -function(a){null!=b&&b(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=c&&c(null)}),a);this.autosaveThread=g};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)}; +DrawioFile.prototype.autosave=function(a,c,d,b){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<c?a:0;this.clearAutosave();var g=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==g&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=d&&d(a)}),mxUtils.bind(this, +function(a){null!=b&&b(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=d&&d(null)}),a);this.autosaveThread=g};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)}; DrawioFile.prototype.isAutosaveRevision=function(){var a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))}; -DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,d){if(null!=a&&null!=d){var c=a.lastIndexOf("."),b=0<c?a.substring(c):"",c=d.lastIndexOf(".");return b===(0<c?d.substring(c):"")}return a==d}; +DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,c){if(null!=a&&null!=c){var d=a.lastIndexOf("."),b=0<d?a.substring(d):"",d=c.lastIndexOf(".");return b===(0<d?c.substring(d):"")}return a==c}; DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.stats.destroyed++;this.clearAutosave();this.removeListeners();null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1}; -DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(a,d){a([])};DrawioFile.prototype.addComment=function(a,d,c){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(a,d){return new DrawioComment(this,null,a,Date.now(),Date.now(),!1,d)};LocalFile=function(a,d,c,b){DrawioFile.call(this,a,d);this.title=c;this.mode=b?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,d,c){this.saveAs(this.title,d,c)};LocalFile.prototype.saveAs=function(a,d,c){this.saveFile(a,!1,d,c)}; -LocalFile.prototype.saveFile=function(a,d,c,b){this.title=a;this.updateFileData();d=this.getData();var g=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),e=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,g?"image/png":"text/xml",g);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+ -(g?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=c&&c()});g?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):e(d)};LocalFile.prototype.rename=function(a,d,c){this.title=a;this.descriptorChanged();null!=d&&d()}; -LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};LocalLibrary=function(a,d,c){LocalFile.call(this,a,d,c)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,d,c){this.saveFile(a,!1,d,c)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,d,c){DrawioFile.call(this,a,d);this.title=c};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.autosaveDelay=2E3;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title}; -StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.save=function(a,d,c){this.saveAs(this.getTitle(),d,c)};StorageFile.prototype.saveAs=function(a,d,c){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,d,c)}; -StorageFile.prototype.saveFile=function(a,d,c,b){if(this.isEditable()){var g=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=c&&c()}))}catch(e){null!=b&&b(e)}});this.isRenamable()&&"."==a.charAt(0)&&null!=b?b({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(c){this.isRenamable()&&this.getTitle()!=a&&null!=c?this.ui.confirm(mxResources.get("replaceIt", -[a]),g,b):g()}))}else null!=c&&c()};StorageFile.prototype.rename=function(a,d,c){var b=this.getTitle();b!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(g){var e=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(b,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(b,d)}),c)});null!=g?this.ui.confirm(mxResources.get("replaceIt",[a]),e,c):e()})):d()}; -StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.getLatestVersion=function(a,d){this.ui.getLocalData(this.title,mxUtils.bind(this,function(c){a(new StorageFile(this.ui,c,this.title))}))};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,d,c){StorageFile.call(this,a,d,c)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,d,c){this.saveFile(a,!1,d,c)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title}; -StorageLibrary.prototype.isRenamable=function(a,d,c){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(a,d,c){DrawioFile.call(this,a,d);this.title=c;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(a,d,c){RemoteFile.call(this,a,d,c.title);this.libObj=c};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(a,d,c){}; -RemoteLibrary.prototype.saveAs=function(a,d,c){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(a,d,c){StorageFile.call(this,a,d,c);a=c;d=a.lastIndexOf("/");0<=d&&(a=a.substring(d+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,d,c){return!1};UrlLibrary.prototype.saveAs=function(a,d,c){};UrlLibrary.prototype.open=function(){};/* +DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(a,c){a([])};DrawioFile.prototype.addComment=function(a,c,d){c(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(a,c){return new DrawioComment(this,null,a,Date.now(),Date.now(),!1,c)};LocalFile=function(a,c,d,b){DrawioFile.call(this,a,c);this.title=d;this.mode=b?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,c,d){this.saveAs(this.title,c,d)};LocalFile.prototype.saveAs=function(a,c,d){this.saveFile(a,!1,c,d)}; +LocalFile.prototype.saveFile=function(a,c,d,b){this.title=a;this.updateFileData();c=this.getData();var g=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),e=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,g?"image/png":"text/xml",g);else if(b.length<MAX_REQUEST_SIZE){var c=a.lastIndexOf("."),c=0<c?a.substring(c+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+ +(g?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=d&&d()});g?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):e(c)};LocalFile.prototype.rename=function(a,c,d){this.title=a;this.descriptorChanged();null!=c&&c()}; +LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};LocalLibrary=function(a,c,d){LocalFile.call(this,a,c,d)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,c,d){this.saveFile(a,!1,c,d)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,c,d){DrawioFile.call(this,a,c);this.title=d};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.autosaveDelay=2E3;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title}; +StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.save=function(a,c,d){this.saveAs(this.getTitle(),c,d)};StorageFile.prototype.saveAs=function(a,c,d){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,c,d)}; +StorageFile.prototype.saveFile=function(a,c,d,b){if(this.isEditable()){var g=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=d&&d()}))}catch(e){null!=b&&b(e)}});this.isRenamable()&&"."==a.charAt(0)&&null!=b?b({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(d){this.isRenamable()&&this.getTitle()!=a&&null!=d?this.ui.confirm(mxResources.get("replaceIt", +[a]),g,b):g()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,c,d){var b=this.getTitle();b!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(g){var e=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(b,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(b,c)}),d)});null!=g?this.ui.confirm(mxResources.get("replaceIt",[a]),e,d):e()})):c()}; +StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.getLatestVersion=function(a,c){this.ui.getLocalData(this.title,mxUtils.bind(this,function(d){a(new StorageFile(this.ui,d,this.title))}))};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,c,d){StorageFile.call(this,a,c,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,c,d){this.saveFile(a,!1,c,d)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title}; +StorageLibrary.prototype.isRenamable=function(a,c,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(a,c,d){DrawioFile.call(this,a,c);this.title=d;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(a,c,d){RemoteFile.call(this,a,c,d.title);this.libObj=d};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(a,c,d){}; +RemoteLibrary.prototype.saveAs=function(a,c,d){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(a,c,d){StorageFile.call(this,a,c,d);a=d;c=a.lastIndexOf("/");0<=c&&(a=a.substring(c+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,c,d){return!1};UrlLibrary.prototype.saveAs=function(a,c,d){};UrlLibrary.prototype.open=function(){};/* mxClient.IS_IOS || */ -var StorageDialog=function(a,d,c){function b(b,p,q,e,g,B){function x(){mxEvent.addListener(k,"click",null!=B?B:function(){q!=App.MODE_GOOGLE||a.isDriveDomain()?q==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(q,m.checked);d()})):q==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(q,m.checked); -d()})):(a.setMode(q,m.checked),d()):window.location.hostname=DriveClient.prototype.newAppHostname})}++t>c&&(mxUtils.br(f),t=0);var k=document.createElement("a");k.style.overflow="hidden";k.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";k.className="geBaseButton";k.style.boxSizing="border-box";k.style.fontSize="11px";k.style.position="relative";k.style.margin="4px";k.style.marginTop="2px";k.style.padding="8px 10px 12px 10px";k.style.width="88px";k.style.height=StorageDialog.extended?"50px": +var StorageDialog=function(a,c,d){function b(b,p,q,e,g,B){function x(){mxEvent.addListener(k,"click",null!=B?B:function(){q!=App.MODE_GOOGLE||a.isDriveDomain()?q==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(q,m.checked);c()})):q==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(q,m.checked); +c()})):(a.setMode(q,m.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}++t>d&&(mxUtils.br(f),t=0);var k=document.createElement("a");k.style.overflow="hidden";k.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";k.className="geBaseButton";k.style.boxSizing="border-box";k.style.fontSize="11px";k.style.position="relative";k.style.margin="4px";k.style.marginTop="2px";k.style.padding="8px 10px 12px 10px";k.style.width="88px";k.style.height=StorageDialog.extended?"50px": "100px";k.style.whiteSpace="nowrap";k.setAttribute("title",p);mxClient.IS_QUIRKS&&(k.style.cssFloat="left",k.style.zoom="1");var u=document.createElement("div");u.style.textOverflow="ellipsis";u.style.overflow="hidden";if(null!=b){var v=document.createElement("img");v.setAttribute("src",b);v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.width=StorageDialog.extended?"24px":"60px";v.style.height=StorageDialog.extended?"24px":"60px";v.style.paddingBottom=StorageDialog.extended? -"4px":"6px";k.appendChild(v)}else u.style.paddingTop="5px",u.style.whiteSpace="normal",mxClient.IS_IOS?(k.style.padding="0px 10px 20px 10px",k.style.top="6px"):mxClient.IS_FF&&(u.style.paddingTop="0px",u.style.marginTop="-2px");StorageDialog.extended&&(k.style.paddingTop="4px",k.style.marginBottom="0px",u.display="inline-block",2==c&&(v.style.width="38px",v.style.height="38px",k.style.width="80px",k.style.height="68px"));k.appendChild(u);mxUtils.write(u,p);if(null!=g)for(b=0;b<g.length;b++)mxUtils.br(u), +"4px":"6px";k.appendChild(v)}else u.style.paddingTop="5px",u.style.whiteSpace="normal",mxClient.IS_IOS?(k.style.padding="0px 10px 20px 10px",k.style.top="6px"):mxClient.IS_FF&&(u.style.paddingTop="0px",u.style.marginTop="-2px");StorageDialog.extended&&(k.style.paddingTop="4px",k.style.marginBottom="0px",u.display="inline-block",2==d&&(v.style.width="38px",v.style.height="38px",k.style.width="80px",k.style.height="68px"));k.appendChild(u);mxUtils.write(u,p);if(null!=g)for(b=0;b<g.length;b++)mxUtils.br(u), mxUtils.write(u,g[b]);if(null!=e&&null==a[e]){v.style.visibility="hidden";mxUtils.setOpacity(u,10);var n=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});n.spin(k);var A=window.setTimeout(function(){null==a[e]&&(n.stop(),k.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,f){null!=a[e]&&f.getProperty("client")==a[e]&&(window.clearTimeout(A),mxUtils.setOpacity(u, -100),v.style.visibility="",n.stop(),x(),"drive"==e&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else x();f.appendChild(k)}c=null!=c?c:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var e=a.addLanguageMenu(g,!0);null!=e&&(e.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){e=document.createElement("a");e.setAttribute("href","https://about.draw.io/support/");e.setAttribute("title", +100),v.style.visibility="",n.stop(),x(),"drive"==e&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else x();f.appendChild(k)}d=null!=d?d:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var e=a.addLanguageMenu(g,!0);null!=e&&(e.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){e=document.createElement("a");e.setAttribute("href","https://about.draw.io/support/");e.setAttribute("title", mxResources.get("help"));e.setAttribute("target","_blank");e.style.position="absolute";e.style.userSelect="none";e.style.textDecoration="none";e.style.cursor="pointer";e.style.fontSize="12px";e.style.bottom="28px";e.style.left="26px";e.style.color="gray";var k=document.createElement("img");mxUtils.setOpacity(k,50);k.style.height="16px";k.style.width="16px";k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";e.appendChild(k); mxUtils.write(e,mxResources.get("help"));g.appendChild(e)}var n=document.createElement("div");n.style.position="absolute";n.style.cursor="pointer";n.style.fontSize="12px";n.style.bottom="28px";n.style.color="gray";n.style.userSelect="none";mxUtils.write(n,mxResources.get("decideLater"));mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)");n.style.left="50%";this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)n.style.marginLeft=-Math.round(n.clientWidth/2)+"px"};g.appendChild(n); mxEvent.addListener(n,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});e=document.createElement("div");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.style.cssFloat="left");e.style.border="1px solid #d3d3d3";e.style.borderWidth="1px 0px 1px 0px";e.style.padding="12px 0px 12px 0px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.setAttribute("checked","checked");m.defaultChecked= @@ -8243,75 +8244,75 @@ a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");v y=document.createElement("a"),y.style.cursor="pointer",y.style.fontSize="12px",y.style.color="gray",y.style.userSelect="none",mxUtils.write(y,mxResources.get("import")+": "+mxResources.get("gliffy")+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(y,"click",function(){if(null==a.storageFileInputElt){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(){null!=b.files&& (a.hideDialog(),a.openFiles(b.files,!0),b.type="",b.type="file",b.value="")});b.style.display="none";document.body.appendChild(b);a.storageFileInputElt=b}a.storageFileInputElt.click()}),u.appendChild(y),k.appendChild(u),e.style.paddingBottom="4px");e.appendChild(k);mxEvent.addListener(q,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&& (l.style.padding="8px",l.style.fontSize="9pt",l.style.marginTop="-14px",l.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",g.appendChild(l))},5E3);this.container=g};StorageDialog.extended=!1; -var SplashDialog=function(a){var d=document.createElement("div");d.style.textAlign="center";var c=a.addLanguageMenu(d,!0);null!=c&&(c.style.bottom="19px");c=null;c=a.getServiceCount();if(!a.isOffline()&&1<c){c=document.createElement("a");c.setAttribute("href","https://about.draw.io/support/");c.setAttribute("title",mxResources.get("help"));c.setAttribute("target","_blank");c.style.position="absolute";c.style.fontSize="12px";c.style.textDecoration="none";c.style.cursor="pointer";c.style.bottom="22px"; -c.style.left="26px";c.style.color="gray";var b=document.createElement("img");mxUtils.setOpacity(b,50);b.style.height="16px";b.style.width="16px";b.setAttribute("border","0");b.setAttribute("valign","bottom");b.setAttribute("src",Editor.helpImage);b.style.marginRight="2px";c.appendChild(b);mxUtils.write(c,mxResources.get("help"));d.appendChild(c)}c=document.createElement("p");c.style.fontSize="16pt";c.style.padding="0px";c.style.paddingTop="2px";c.style.margin="0px";c.style.color="gray";b=document.createElement("img"); +var SplashDialog=function(a){var c=document.createElement("div");c.style.textAlign="center";var d=a.addLanguageMenu(c,!0);null!=d&&(d.style.bottom="19px");d=null;d=a.getServiceCount();if(!a.isOffline()&&1<d){d=document.createElement("a");d.setAttribute("href","https://about.draw.io/support/");d.setAttribute("title",mxResources.get("help"));d.setAttribute("target","_blank");d.style.position="absolute";d.style.fontSize="12px";d.style.textDecoration="none";d.style.cursor="pointer";d.style.bottom="22px"; +d.style.left="26px";d.style.color="gray";var b=document.createElement("img");mxUtils.setOpacity(b,50);b.style.height="16px";b.style.width="16px";b.setAttribute("border","0");b.setAttribute("valign","bottom");b.setAttribute("src",Editor.helpImage);b.style.marginRight="2px";d.appendChild(b);mxUtils.write(d,mxResources.get("help"));c.appendChild(d)}d=document.createElement("p");d.style.fontSize="16pt";d.style.padding="0px";d.style.paddingTop="2px";d.style.margin="0px";d.style.color="gray";b=document.createElement("img"); b.setAttribute("border","0");b.setAttribute("align","absmiddle");b.style.width="40px";b.style.height="40px";b.style.marginRight="12px";b.style.paddingBottom="4px";var g="";a.mode==App.MODE_GOOGLE?(b.src=IMAGE_PATH+"/google-drive-logo.svg",g=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(b.src=IMAGE_PATH+"/dropbox-logo.svg",g=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(b.src=IMAGE_PATH+"/onedrive-logo.svg",g=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(b.src=IMAGE_PATH+ "/github-logo.svg",g=mxResources.get("github")):a.mode==App.MODE_GITLAB?(b.src=IMAGE_PATH+"/gitlab-logo.svg",g=mxResources.get("gitlab")):a.mode==App.MODE_BROWSER?(b.src=IMAGE_PATH+"/osa_database.png",g=mxResources.get("browser")):(b.src=IMAGE_PATH+"/osa_drive-harddisk.png",g=mxResources.get("device"));var e=document.createElement("div");e.style.margin="4px 0px 0px 0px";var k=document.createElement("button");k.className="geBigButton";k.style.fontSize="18px";k.style.padding="10px";k.style.width="340px"; -mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(e.style.padding="42px 0px 56px 0px",k.style.marginBottom="12px"):(c.appendChild(b),mxUtils.write(c,g),d.appendChild(c),e.style.border="1px solid #d3d3d3",e.style.borderWidth="1px 0px 1px 0px",e.style.padding="18px 0px 24px 0px",k.style.marginBottom="8px");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.style.cssFloat="left");mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("createNewDiagram"));mxEvent.addListener(k,"click", +mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(e.style.padding="42px 0px 56px 0px",k.style.marginBottom="12px"):(d.appendChild(b),mxUtils.write(d,g),c.appendChild(d),e.style.border="1px solid #d3d3d3",e.style.borderWidth="1px 0px 1px 0px",e.style.padding="18px 0px 24px 0px",k.style.marginBottom="8px");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.style.cssFloat="left");mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("createNewDiagram"));mxEvent.addListener(k,"click", function(){a.hideDialog();a.actions.get("new").funct()});e.appendChild(k);mxUtils.br(e);k=document.createElement("button");k.className="geBigButton";k.style.marginBottom="22px";k.style.fontSize="18px";k.style.padding="10px";k.style.width="340px";mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("openExistingDiagram"));mxEvent.addListener(k,"click",function(){a.actions.get("open").funct()});e.appendChild(k);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX? -mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_GITLAB?mxResources.get("gitlab"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var c=function(b){k.style.marginBottom="24px";var f=document.createElement("a");f.setAttribute("href","javascript:void(0)"); -f.style.display="inline-block";f.style.marginTop="6px";mxUtils.write(f,mxResources.get("signOut"));k.style.marginBottom="16px";e.style.paddingBottom="18px";mxEvent.addListener(f,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});e.appendChild(f)},n=null!=a.drive?a.drive.getUsersList():[];if(a.mode==App.MODE_GOOGLE&&0<n.length){c=document.createElement("span");c.style.marginTop="6px";mxUtils.write(c,mxResources.get("changeUser")+":");k.style.marginBottom="16px";e.style.paddingBottom= -"18px";e.appendChild(c);var m=document.createElement("select");m.style.marginLeft="4px";m.style.width="200px";for(c=0;c<n.length;c++)b=document.createElement("option"),mxUtils.write(b,n[c].displayName),b.value=c,m.appendChild(b),b=document.createElement("option"),b.innerHTML=" ",mxUtils.write(b,"<"+n[c].email+">"),b.setAttribute("disabled","disabled"),m.appendChild(b);b=document.createElement("option");mxUtils.write(b,mxResources.get("addAccount"));b.value=n.length;m.appendChild(b); -mxEvent.addListener(m,"change",function(){var b=m.value,f=n.length!=b;f&&a.drive.setUser(n[b]);a.drive.authorize(f,function(){a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash()},function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})},!0)});e.appendChild(m)}else a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?c(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?c(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_GITLAB&& -null!=a.gitLab?c(function(){a.gitLab.logout();a.openLink(DRAWIO_GITLAB_URL+"/users/sign_out")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&c(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&c(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")});mxUtils.br(e);c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="inline-block";c.style.marginTop="8px";mxUtils.write(c,mxResources.get("changeStorage")); -mxEvent.addListener(c,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)});e.appendChild(c)}d.appendChild(e);this.container=d},EmbedDialog=function(a,d,c,b,g,e){b=document.createElement("div");var k=/^https?:\/\//.test(d)||/^mailto:\/\//.test(d);null!=e?mxUtils.write(b,e):mxUtils.write(b,mxResources.get(5E5>d.length?k?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(b);e=document.createElement("div");e.style.position="absolute";e.style.top="30px";e.style.right="30px"; -e.style.color="gray";mxUtils.write(e,a.formatFileSize(d.length));b.appendChild(e);var n=document.createElement("textarea");n.setAttribute("autocomplete","off");n.setAttribute("autocorrect","off");n.setAttribute("autocapitalize","off");n.setAttribute("spellcheck","false");n.style.fontFamily="monospace";n.style.wordBreak="break-all";n.style.marginTop="10px";n.style.resize="none";n.style.height="150px";n.style.width="440px";n.style.border="1px solid gray";n.value=mxResources.get("updatingDocument"); -b.appendChild(n);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>d.length?(n.value=d,n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):(n.setAttribute("readonly","true"),n.value=d.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};e=document.createElement("div");e.style.position="absolute";e.style.bottom="36px";e.style.right="32px";var m=null;!EmbedDialog.showPreviewOption|| -mxClient.IS_CHROMEAPP&&!k||navigator.standalone||!(k||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(mxResources.get(5E5>d.length?"preview":"openInNewWindow"),function(){var b=5E5>d.length?n.value:d;if(null!=g)g(b);else if(k)try{var f=a.openLink(b);null!=f&&(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){null!=f&&null!=f.location.href&&f.location.href.substring(0,8)!=b.substring(0,8)&&(f.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}), -c||500)}catch(v){a.handleError({message:v.message||mxResources.get("drawingTooLarge")})}else{var e=window.open(),e=null!=e?e.document:null;null!=e?(e.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+d+"</body></html>"),e.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),m.className="geBtn",e.appendChild(m));if(!k||7500<d.length){var t=mxUtils.button(mxResources.get("download"),function(){a.hideDialog(); -a.saveData("embed.txt","txt",d,"text/plain")});t.className="geBtn";e.appendChild(t)}if(k&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>d.length){var f=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(n.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),t=document.createElement("img");t.setAttribute("src",Editor.facebookImage);t.setAttribute("width","18");t.setAttribute("height","18");t.setAttribute("border", -"0");f.appendChild(t);f.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");f.style.verticalAlign="bottom";f.style.paddingTop="4px";f.style.minWidth="46px";f.className="geBtn";e.appendChild(f)}7168>d.length&&(f=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(n.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}), +mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_GITLAB?mxResources.get("gitlab"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var d=function(b){k.style.marginBottom="24px";var f=document.createElement("a");f.setAttribute("href","javascript:void(0)"); +f.style.display="inline-block";f.style.marginTop="6px";mxUtils.write(f,mxResources.get("signOut"));k.style.marginBottom="16px";e.style.paddingBottom="18px";mxEvent.addListener(f,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});e.appendChild(f)},n=null!=a.drive?a.drive.getUsersList():[];if(a.mode==App.MODE_GOOGLE&&0<n.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");k.style.marginBottom="16px";e.style.paddingBottom= +"18px";e.appendChild(d);var m=document.createElement("select");m.style.marginLeft="4px";m.style.width="200px";for(d=0;d<n.length;d++)b=document.createElement("option"),mxUtils.write(b,n[d].displayName),b.value=d,m.appendChild(b),b=document.createElement("option"),b.innerHTML=" ",mxUtils.write(b,"<"+n[d].email+">"),b.setAttribute("disabled","disabled"),m.appendChild(b);b=document.createElement("option");mxUtils.write(b,mxResources.get("addAccount"));b.value=n.length;m.appendChild(b); +mxEvent.addListener(m,"change",function(){var b=m.value,f=n.length!=b;f&&a.drive.setUser(n[b]);a.drive.authorize(f,function(){a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash()},function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})},!0)});e.appendChild(m)}else a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?d(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?d(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_GITLAB&& +null!=a.gitLab?d(function(){a.gitLab.logout();a.openLink(DRAWIO_GITLAB_URL+"/users/sign_out")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&d(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&d(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")});mxUtils.br(e);d=document.createElement("a");d.setAttribute("href","javascript:void(0)");d.style.display="inline-block";d.style.marginTop="8px";mxUtils.write(d,mxResources.get("changeStorage")); +mxEvent.addListener(d,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)});e.appendChild(d)}c.appendChild(e);this.container=c},EmbedDialog=function(a,c,d,b,g,e){b=document.createElement("div");var k=/^https?:\/\//.test(c)||/^mailto:\/\//.test(c);null!=e?mxUtils.write(b,e):mxUtils.write(b,mxResources.get(5E5>c.length?k?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(b);e=document.createElement("div");e.style.position="absolute";e.style.top="30px";e.style.right="30px"; +e.style.color="gray";mxUtils.write(e,a.formatFileSize(c.length));b.appendChild(e);var n=document.createElement("textarea");n.setAttribute("autocomplete","off");n.setAttribute("autocorrect","off");n.setAttribute("autocapitalize","off");n.setAttribute("spellcheck","false");n.style.fontFamily="monospace";n.style.wordBreak="break-all";n.style.marginTop="10px";n.style.resize="none";n.style.height="150px";n.style.width="440px";n.style.border="1px solid gray";n.value=mxResources.get("updatingDocument"); +b.appendChild(n);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>c.length?(n.value=c,n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):(n.setAttribute("readonly","true"),n.value=c.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};e=document.createElement("div");e.style.position="absolute";e.style.bottom="36px";e.style.right="32px";var m=null;!EmbedDialog.showPreviewOption|| +mxClient.IS_CHROMEAPP&&!k||navigator.standalone||!(k||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(mxResources.get(5E5>c.length?"preview":"openInNewWindow"),function(){var b=5E5>c.length?n.value:c;if(null!=g)g(b);else if(k)try{var f=a.openLink(b);null!=f&&(null==d||0<d)&&window.setTimeout(mxUtils.bind(this,function(){null!=f&&null!=f.location.href&&f.location.href.substring(0,8)!=b.substring(0,8)&&(f.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}), +d||500)}catch(v){a.handleError({message:v.message||mxResources.get("drawingTooLarge")})}else{var e=window.open(),e=null!=e?e.document:null;null!=e?(e.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+c+"</body></html>"),e.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),m.className="geBtn",e.appendChild(m));if(!k||7500<c.length){var t=mxUtils.button(mxResources.get("download"),function(){a.hideDialog(); +a.saveData("embed.txt","txt",c,"text/plain")});t.className="geBtn";e.appendChild(t)}if(k&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>c.length){var f=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(n.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),t=document.createElement("img");t.setAttribute("src",Editor.facebookImage);t.setAttribute("width","18");t.setAttribute("height","18");t.setAttribute("border", +"0");f.appendChild(t);f.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");f.style.verticalAlign="bottom";f.style.paddingTop="4px";f.style.minWidth="46px";f.className="geBtn";e.appendChild(f)}7168>c.length&&(f=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(n.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}), t=document.createElement("img"),t.setAttribute("src",Editor.tweetImage),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("border","0"),t.style.marginBottom="5px",f.appendChild(t),f.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",e.appendChild(f))}t=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.appendChild(t);f=mxUtils.button(mxResources.get("copy"), -function(){n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>d.length?mxClient.IS_SF||null!=document.documentMode?t.className="geBtn gePrimaryBtn":(e.appendChild(f),f.className="geBtn gePrimaryBtn",t.className="geBtn"):(e.appendChild(m),t.className="geBtn",m.className="geBtn gePrimaryBtn");b.appendChild(e);this.container=b}; +function(){n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>c.length?mxClient.IS_SF||null!=document.documentMode?t.className="geBtn gePrimaryBtn":(e.appendChild(f),f.className="geBtn gePrimaryBtn",t.className="geBtn"):(e.appendChild(m),t.className="geBtn",m.className="geBtn gePrimaryBtn");b.appendChild(e);this.container=b}; EmbedDialog.showPreviewOption=!0; -var GoogleSitesDialog=function(a,d){function c(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(x.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<A.length&&(b+="&s="+A);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=l.value&&(b+="&height="+l.value);b+="&pan="+(v.checked?"1":"0");b+="&zoom="+(q.checked?"1":"0");b+="&fit="+(I.checked?"1":"0"); +var GoogleSitesDialog=function(a,c){function d(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(x.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<A.length&&(b+="&s="+A);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=l.value&&(b+="&height="+l.value);b+="&pan="+(v.checked?"1":"0");b+="&zoom="+(q.checked?"1":"0");b+="&fit="+(I.checked?"1":"0"); b+="&resize="+(C.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+m;g.mathEnabled&&(b+="&math=1");y.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));t.value=b}else D.constructor==DriveFile||D.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=D.getHash().substring(1),b=D.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!= a&&(b+="&title="+encodeURIComponent(a)),""!=l.value&&(a=parseInt(l.value)+parseInt(f.value),b+="&height="+a),t.value=b):t.value=""}var b=document.createElement("div"),g=a.editor.graph,e=g.getGraphBounds(),k=g.view.scale,n=Math.floor(e.x/k-g.view.translate.x),m=Math.floor(e.y/k-g.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var t=document.createElement("input");t.setAttribute("type","text");t.style.marginBottom="8px";t.style.marginTop="2px";t.style.width="410px"; b.appendChild(t);mxUtils.br(b);this.init=function(){t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};mxUtils.write(b,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=n;b.appendChild(f);mxUtils.write(b,mxResources.get("height")+":");var l=document.createElement("input");l.setAttribute("type", -"text");l.setAttribute("size","4");l.style.marginLeft="4px";l.value=Math.ceil(e.height/k);b.appendChild(l);mxUtils.br(b);e=document.createElement("hr");e.setAttribute("size","1");e.style.marginBottom="16px";e.style.marginTop="16px";b.appendChild(e);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","28");p.style.marginBottom="8px";p.style.marginTop="2px";p.style.width="410px";p.value=d||""; +"text");l.setAttribute("size","4");l.style.marginLeft="4px";l.value=Math.ceil(e.height/k);b.appendChild(l);mxUtils.br(b);e=document.createElement("hr");e.setAttribute("size","1");e.style.marginBottom="16px";e.style.marginTop="16px";b.appendChild(e);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","28");p.style.marginBottom="8px";p.style.marginTop="2px";p.style.width="410px";p.value=c||""; b.appendChild(p);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";b.appendChild(u);mxUtils.br(b);var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="16px";b.appendChild(v);mxUtils.write(b,mxResources.get("pan")+" ");var q=document.createElement("input"); q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="8px";b.appendChild(q);mxUtils.write(b,mxResources.get("zoom")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";z.setAttribute("title",window.location.href);b.appendChild(z);mxUtils.write(b,mxResources.get("edit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";b.appendChild(y);mxUtils.write(b, mxResources.get("asNew")+" ");mxUtils.br(b);var C=document.createElement("input");C.setAttribute("type","checkbox");C.setAttribute("checked","checked");C.defaultChecked=!0;C.style.marginLeft="16px";b.appendChild(C);mxUtils.write(b,mxResources.get("resize")+" ");var I=document.createElement("input");I.setAttribute("type","checkbox");I.style.marginLeft="8px";b.appendChild(I);mxUtils.write(b,mxResources.get("fit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft= -"8px";b.appendChild(x);mxUtils.write(b,mxResources.get("embed")+" ");var A=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(v,"change",c);mxEvent.addListener(q,"change",c);mxEvent.addListener(C,"change",c);mxEvent.addListener(I,"change",c);mxEvent.addListener(z,"change",c);mxEvent.addListener(y,"change",c);mxEvent.addListener(x,"change",c);mxEvent.addListener(l,"change",c);mxEvent.addListener(f,"change",c);mxEvent.addListener(u,"change",c);mxEvent.addListener(p,"change",c);c(); -mxEvent.addListener(t,"click",function(){t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";e.appendChild(k);b.appendChild(e);this.container=b},CreateGraphDialog=function(a,d,c){var b=document.createElement("div");b.style.textAlign= -"right";this.init=function(){var d=document.createElement("div");d.style.position="relative";d.style.border="1px solid gray";d.style.width="100%";d.style.height="360px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);b.appendChild(d);var e=new Graph(d);e.setCellsCloneable(!0);e.setPanning(!0);e.setAllowDanglingEdges(!1);e.connectionHandler.select=!1;e.view.setTranslate(20,20);e.border=20;e.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";e.cellRenderer.installCellOverlayListeners= +"8px";b.appendChild(x);mxUtils.write(b,mxResources.get("embed")+" ");var A=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(v,"change",d);mxEvent.addListener(q,"change",d);mxEvent.addListener(C,"change",d);mxEvent.addListener(I,"change",d);mxEvent.addListener(z,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(l,"change",d);mxEvent.addListener(f,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(p,"change",d);d(); +mxEvent.addListener(t,"click",function(){t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";e.appendChild(k);b.appendChild(e);this.container=b},CreateGraphDialog=function(a,c,d){var b=document.createElement("div");b.style.textAlign= +"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);b.appendChild(c);var e=new Graph(c);e.setCellsCloneable(!0);e.setPanning(!0);e.setAllowDanglingEdges(!1);e.connectionHandler.select=!1;e.view.setTranslate(20,20);e.border=20;e.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";e.cellRenderer.installCellOverlayListeners= function(a,b,f){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(f.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(f){b.fireEvent(new mxEventObject("pointerdown","event",f,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(f.node,"touchstart",function(f){b.fireEvent(new mxEventObject("pointerdown","event",f,"state",a))})};e.getAllConnectionConstraints=function(){return null};e.connectionHandler.marker.highlight.keepOnTop= -!1;e.connectionHandler.createEdgeState=function(a){a=e.createEdge(null,null,null,null,null,k);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var n=e.getDefaultParent(),m=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,f){e.connectionHandler.reset();e.clearSelection();var c=e.getCellGeometry(a),d;l(function(){d=e.insertVertex(n,null,"Entry",c.x,c.y,80,30,"rounded=1;");m(d);e.view.refresh(d); -e.insertEdge(n,null,"",a,d,k)},function(){e.scrollCellToVisible(d)})});b.addListener("pointerdown",function(a,b){var f=b.getProperty("event"),c=b.getProperty("state");e.popupMenuHandler.hideMenu();e.stopEditing(!1);var d=mxUtils.convertPoint(e.container,mxEvent.getClientX(f),mxEvent.getClientY(f));e.connectionHandler.start(c,d.x,d.y);e.isMouseDown=!0;e.isMouseTrigger=mxEvent.isMouseEvent(f);mxEvent.consume(f)});e.addCellOverlay(a,b)});e.getModel().beginUpdate();var t;try{t=e.insertVertex(n,null,"Start", -0,0,80,30,"ellipse"),m(t)}finally{e.getModel().endUpdate()}var f;"horizontalTree"==c?(f=new mxCompactTreeLayout(e),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==c?(f=new mxCompactTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==c?(f=new mxRadialTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==c?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_NORTH):"horizontalFlow"== -c?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_WEST):"organic"==c?(f=new mxFastOrganicLayout(e,!1),f.forceConstant=80):"circle"==c&&(f=new mxCircleLayout(e));if(null!=f){var l=function(a,b){e.getModel().beginUpdate();try{null!=a&&a(),f.execute(e.getDefaultParent(),t)}catch(C){throw C;}finally{var c=new mxMorphing(e);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){e.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect= -function(a,b,f,c,d){p.apply(this,arguments);l()};e.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);l()};e.connectionHandler.addListener(mxEvent.CONNECT,function(){l()})}var u=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=d.parentNode&&(e.destroy(),d.parentNode.removeChild(d));a.hideDialog()})});u.className="geBtn";a.editor.cancelFirst&&b.appendChild(u);var v=mxUtils.button(mxResources.get("insert"),function(){e.clearCellOverlays(); -var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,c=f.getBounds(b);c.x-=f.translate.x;c.y-=f.translate.y;a.editor.graph.scrollRectToVisible(c);a.editor.graph.setSelectionCells(b);null!=d.parentNode&&(e.destroy(),d.parentNode.removeChild(d));a.hideDialog()});b.appendChild(v);v.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(u)};this.container=b}; +!1;e.connectionHandler.createEdgeState=function(a){a=e.createEdge(null,null,null,null,null,k);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var n=e.getDefaultParent(),m=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,f){e.connectionHandler.reset();e.clearSelection();var d=e.getCellGeometry(a),c;l(function(){c=e.insertVertex(n,null,"Entry",d.x,d.y,80,30,"rounded=1;");m(c);e.view.refresh(c); +e.insertEdge(n,null,"",a,c,k)},function(){e.scrollCellToVisible(c)})});b.addListener("pointerdown",function(a,b){var f=b.getProperty("event"),d=b.getProperty("state");e.popupMenuHandler.hideMenu();e.stopEditing(!1);var c=mxUtils.convertPoint(e.container,mxEvent.getClientX(f),mxEvent.getClientY(f));e.connectionHandler.start(d,c.x,c.y);e.isMouseDown=!0;e.isMouseTrigger=mxEvent.isMouseEvent(f);mxEvent.consume(f)});e.addCellOverlay(a,b)});e.getModel().beginUpdate();var t;try{t=e.insertVertex(n,null,"Start", +0,0,80,30,"ellipse"),m(t)}finally{e.getModel().endUpdate()}var f;"horizontalTree"==d?(f=new mxCompactTreeLayout(e),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==d?(f=new mxCompactTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==d?(f=new mxRadialTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==d?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_NORTH):"horizontalFlow"== +d?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_WEST):"organic"==d?(f=new mxFastOrganicLayout(e,!1),f.forceConstant=80):"circle"==d&&(f=new mxCircleLayout(e));if(null!=f){var l=function(a,b){e.getModel().beginUpdate();try{null!=a&&a(),f.execute(e.getDefaultParent(),t)}catch(C){throw C;}finally{var c=new mxMorphing(e);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){e.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect= +function(a,b,f,c,d){p.apply(this,arguments);l()};e.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);l()};e.connectionHandler.addListener(mxEvent.CONNECT,function(){l()})}var u=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(e.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});u.className="geBtn";a.editor.cancelFirst&&b.appendChild(u);var v=mxUtils.button(mxResources.get("insert"),function(){e.clearCellOverlays(); +var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,d=f.getBounds(b);d.x-=f.translate.x;d.y-=f.translate.y;a.editor.graph.scrollRectToVisible(d);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(e.destroy(),c.parentNode.removeChild(c));a.hideDialog()});b.appendChild(v);v.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(u)};this.container=b}; CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==": IMAGE_PATH+"/handle-connect.png",26,26); -var BackgroundImageDialog=function(a,d){var c=document.createElement("div");c.style.whiteSpace="nowrap";var b=document.createElement("h2");mxUtils.write(b,mxResources.get("backgroundImage"));b.style.marginTop="0px";c.appendChild(b);mxUtils.write(c,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(c);var b=a.editor.graph.backgroundImage,g=document.createElement("input");g.setAttribute("type","text");g.style.marginTop="4px";g.style.marginBottom="4px";g.style.width="350px";g.value= -null!=b?b.src:"";var e=!1,k=function(){e||""==g.value||a.isOffline()?(n.value="",m.value=""):a.loadImage(mxUtils.trim(g.value),function(a){n.value=a.width;m.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));g.value="";n.value="";m.value=""})};this.init=function(){g.focus();if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=c.parentNode,f=null;mxEvent.addListener(b,"dragleave",function(a){null!= -f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(c){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(b));c.stopPropagation();c.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,f,c,d,l){g.value=a;k()},function(){}, -function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes,!0);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&(g.value=decodeURIComponent(c),k())}b.stopPropagation();b.preventDefault()}),!1)}};c.appendChild(g);mxUtils.br(c);mxUtils.br(c);mxUtils.write(c,mxResources.get("width")+":");var n=document.createElement("input"); -n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=b?b.width:"";c.appendChild(n);mxUtils.write(c,mxResources.get("height")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=b?b.height:"";c.appendChild(m);b=mxUtils.button(mxResources.get("reset"),function(){g.value="";n.value="";m.value="";e=!1});mxEvent.addListener(b,"mousedown", -function(){e=!0});mxEvent.addListener(b,"touchstart",function(){e=!0});b.className="geBtn";b.width="100";c.appendChild(b);mxUtils.br(c);mxEvent.addListener(g,"change",k);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(g.value=a.url,k()));g.focus()};b=document.createElement("div");b.style.marginTop="40px";b.style.textAlign="right";var t=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}); +var BackgroundImageDialog=function(a,c){var d=document.createElement("div");d.style.whiteSpace="nowrap";var b=document.createElement("h2");mxUtils.write(b,mxResources.get("backgroundImage"));b.style.marginTop="0px";d.appendChild(b);mxUtils.write(d,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(d);var b=a.editor.graph.backgroundImage,g=document.createElement("input");g.setAttribute("type","text");g.style.marginTop="4px";g.style.marginBottom="4px";g.style.width="350px";g.value= +null!=b?b.src:"";var e=!1,k=function(){e||""==g.value||a.isOffline()?(n.value="",m.value=""):a.loadImage(mxUtils.trim(g.value),function(a){n.value=a.width;m.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));g.value="";n.value="";m.value=""})};this.init=function(){g.focus();if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=d.parentNode,f=null;mxEvent.addListener(b,"dragleave",function(a){null!= +f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,f,d,c,l){g.value=a;k()},function(){}, +function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes,!0);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&(g.value=decodeURIComponent(d),k())}b.stopPropagation();b.preventDefault()}),!1)}};d.appendChild(g);mxUtils.br(d);mxUtils.br(d);mxUtils.write(d,mxResources.get("width")+":");var n=document.createElement("input"); +n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=b?b.width:"";d.appendChild(n);mxUtils.write(d,mxResources.get("height")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=b?b.height:"";d.appendChild(m);b=mxUtils.button(mxResources.get("reset"),function(){g.value="";n.value="";m.value="";e=!1});mxEvent.addListener(b,"mousedown", +function(){e=!0});mxEvent.addListener(b,"touchstart",function(){e=!0});b.className="geBtn";b.width="100";d.appendChild(b);mxUtils.br(d);mxEvent.addListener(g,"change",k);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(g.value=a.url,k()));g.focus()};b=document.createElement("div");b.style.marginTop="40px";b.style.textAlign="right";var t=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}); t.className="geBtn";a.editor.cancelFirst&&b.appendChild(t);if(!a.isOffline()&&"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top){var f=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}); f.className="geBtn";b.appendChild(f);null!=a.drive&&"1"==urlParams.photos&&(f=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD);a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}), -f.className="geBtn",b.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d(""!=g.value?new mxImage(mxUtils.trim(g.value),n.value,m.value):null)});f.className="geBtn gePrimaryBtn";b.appendChild(f);a.editor.cancelFirst||b.appendChild(t);c.appendChild(b);this.container=c},ParseDialog=function(a,d,c){function b(b,f){var c=b.split("\n");if("plantUmlPng"==f||"plantUmlSvg"==f||"plantUmlTxt"==f){if(a.spinner.spin(document.body,mxResources.get("inserting"))){var d=a.editor.graph, -l="plantUmlTxt"==f?"txt":"plantUmlPng"==f?"png":"svg";a.generatePlantUmlImage(b,l,function(f,c,p){a.spinner.stop();var q=null;d.getModel().beginUpdate();try{q="txt"==l?a.insertAsPreText(f,e.x,e.y):d.insertVertex(null,null,null,e.x,e.y,c,p,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(f)+";"),d.setAttributeForCell(q,"plantUmlData",JSON.stringify({data:b,format:l},null,2))}finally{d.getModel().endUpdate()}null!=q&&(d.setSelectionCell(q),d.scrollCellToVisible(q))}, -function(b){a.handleError(b)})}}else if("mermaid"==f)a.spinner.spin(document.body,mxResources.get("inserting"))&&(d=a.editor.graph,a.generateMermaidImage(b,l,function(f,c,l){a.spinner.stop();var p=null;d.getModel().beginUpdate();try{p=d.insertVertex(null,null,null,e.x,e.y,c,l,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+f+";"),d.setAttributeForCell(p,"mermaidData",JSON.stringify({data:b,config:EditorUi.defaultMermaidConfig},null,2))}finally{d.getModel().endUpdate()}null!=p&&(d.setSelectionCell(p), -d.scrollCellToVisible(p))},function(b){a.handleError(b)}));else if("table"==f){for(var p=null,g=[],k=0,x=0;x<c.length;x++){var u=mxUtils.trim(c[x]);if("create table"==u.substring(0,12).toLowerCase())u=mxUtils.trim(u.substring(12)),"("==u.charAt(u.length-1)&&(u=u.substring(0,u.lastIndexOf(" "))),p=new mxCell(u,new mxGeometry(k,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"), +f.className="geBtn",b.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c(""!=g.value?new mxImage(mxUtils.trim(g.value),n.value,m.value):null)});f.className="geBtn gePrimaryBtn";b.appendChild(f);a.editor.cancelFirst||b.appendChild(t);d.appendChild(b);this.container=d},ParseDialog=function(a,c,d){function b(b,f){var d=b.split("\n");if("plantUmlPng"==f||"plantUmlSvg"==f||"plantUmlTxt"==f){if(a.spinner.spin(document.body,mxResources.get("inserting"))){var c=a.editor.graph, +l="plantUmlTxt"==f?"txt":"plantUmlPng"==f?"png":"svg";a.generatePlantUmlImage(b,l,function(f,d,p){a.spinner.stop();var q=null;c.getModel().beginUpdate();try{q="txt"==l?a.insertAsPreText(f,e.x,e.y):c.insertVertex(null,null,null,e.x,e.y,d,p,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(f)+";"),c.setAttributeForCell(q,"plantUmlData",JSON.stringify({data:b,format:l},null,2))}finally{c.getModel().endUpdate()}null!=q&&(c.setSelectionCell(q),c.scrollCellToVisible(q))}, +function(b){a.handleError(b)})}}else if("mermaid"==f)a.spinner.spin(document.body,mxResources.get("inserting"))&&(c=a.editor.graph,a.generateMermaidImage(b,l,function(f,d,l){a.spinner.stop();var p=null;c.getModel().beginUpdate();try{p=c.insertVertex(null,null,null,e.x,e.y,d,l,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+f+";"),c.setAttributeForCell(p,"mermaidData",JSON.stringify({data:b,config:EditorUi.defaultMermaidConfig},null,2))}finally{c.getModel().endUpdate()}null!=p&&(c.setSelectionCell(p), +c.scrollCellToVisible(p))},function(b){a.handleError(b)}));else if("table"==f){for(var p=null,g=[],k=0,x=0;x<d.length;x++){var u=mxUtils.trim(d[x]);if("create table"==u.substring(0,12).toLowerCase())u=mxUtils.trim(u.substring(12)),"("==u.charAt(u.length-1)&&(u=u.substring(0,u.lastIndexOf(" "))),p=new mxCell(u,new mxGeometry(k,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"), p.vertex=!0,g.push(p),u=a.editor.graph.getPreferredSizeForCell(B),null!=u&&(p.geometry.width=u.width+10);else if(null!=p&&")"==u.charAt(0))k+=p.geometry.width+40,p=null;else if("("!=u&&null!=p&&(u=u.substring(0,","==u.charAt(u.length-1)?u.length-1:u.length),"primary key"!=u.substring(0,11).toLowerCase())){var n=u.toLowerCase().indexOf("primary key"),u=u.replace(/primary key/i,""),B=new mxCell(u,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;"); -B.vertex=!0;u=sb.cloneCell(B,0<n?"PK":"");u.connectable=!1;u.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";u.geometry.width=30;u.geometry.height=26;B.insert(u);u=a.editor.graph.getPreferredSizeForCell(B);null!=u&&p.geometry.width<u.width+10&&(p.geometry.width=Math.min(220,u.width+10));p.insert(B);p.geometry.height+=26}}0<g.length&&(d=a.editor.graph, -x=d.view,c=d.getGraphBounds(),d.setSelectionCells(d.importCells(g,Math.ceil(Math.max(0,c.x/x.scale-x.translate.x)+4*d.gridSize),Math.ceil(Math.max(0,(c.y+c.height)/x.scale-x.translate.y)+4*d.gridSize))),d.scrollCellToVisible(d.getSelectionCell()))}else if("list"==f){if(0<c.length){d=a.editor.graph;B=null;g=[];for(x=p=0;x<c.length;x++)";"!=c[x].charAt(0)&&(0==c[x].length?B=null:null==B?(B=new mxCell(c[x],new mxGeometry(p,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"), -B.vertex=!0,g.push(B),u=d.getPreferredSizeForCell(B),null!=u&&B.geometry.width<u.width+10&&(B.geometry.width=u.width+10),p+=B.geometry.width+40):"--"==c[x]?(u=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),u.vertex=!0,B.geometry.height+=u.geometry.height,B.insert(u)):0<c[x].length&&(k=new mxCell(c[x],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"), -k.vertex=!0,u=d.getPreferredSizeForCell(k),null!=u&&k.geometry.width<u.width&&(k.geometry.width=u.width),B.geometry.width=Math.max(B.geometry.width,k.geometry.width),B.geometry.height+=k.geometry.height,B.insert(k)));if(0<g.length){d.getModel().beginUpdate();try{g=d.importCells(g,e.x,e.y);u=[];for(x=0;x<g.length;x++)u.push(g[x]),u=u.concat(g[x].children);d.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{d.getModel().endUpdate()}d.setSelectionCells(g);d.scrollCellToVisible(d.getSelectionCell())}}}else{for(var B= -function(a){var b=m[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,m[a]=b,g.push(b));return b},m={},g=[],x=0;x<c.length;x++)if(";"!=c[x].charAt(0)){var G=c[x].split("->");if(2<=G.length){var n=B(G[0]),H=B(G[G.length-1]),G=new mxCell(2<G.length?G[1]:"",new mxGeometry);G.edge=!0;n.insertEdge(G,!0);H.insertEdge(G,!1);g.push(G)}}if(0<g.length){c=document.createElement("div");c.style.visibility="hidden";document.body.appendChild(c);d=new Graph(c);d.getModel().beginUpdate(); -try{g=d.importCells(g);for(x=0;x<g.length;x++)d.getModel().isVertex(g[x])&&(u=d.getPreferredSizeForCell(g[x]),g[x].geometry.width=Math.max(g[x].geometry.width,u.width),g[x].geometry.height=Math.max(g[x].geometry.height,u.height));p=new mxFastOrganicLayout(d);p.disableEdgeStyle=!1;p.forceConstant=120;p.execute(d.getDefaultParent());k=new mxParallelEdgeLayout(d);k.spacing=20;k.execute(d.getDefaultParent())}finally{d.getModel().endUpdate()}d.clearCellOverlays();u=[];a.editor.graph.getModel().beginUpdate(); -try{u=a.editor.graph.importCells(d.getModel().getChildren(d.getDefaultParent()),e.x,e.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(u);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());d.destroy();c.parentNode.removeChild(c)}}}function g(){return"list"==n.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String": +B.vertex=!0;u=sb.cloneCell(B,0<n?"PK":"");u.connectable=!1;u.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";u.geometry.width=30;u.geometry.height=26;B.insert(u);u=a.editor.graph.getPreferredSizeForCell(B);null!=u&&p.geometry.width<u.width+10&&(p.geometry.width=Math.min(220,u.width+10));p.insert(B);p.geometry.height+=26}}0<g.length&&(c=a.editor.graph, +x=c.view,d=c.getGraphBounds(),c.setSelectionCells(c.importCells(g,Math.ceil(Math.max(0,d.x/x.scale-x.translate.x)+4*c.gridSize),Math.ceil(Math.max(0,(d.y+d.height)/x.scale-x.translate.y)+4*c.gridSize))),c.scrollCellToVisible(c.getSelectionCell()))}else if("list"==f){if(0<d.length){c=a.editor.graph;B=null;g=[];for(x=p=0;x<d.length;x++)";"!=d[x].charAt(0)&&(0==d[x].length?B=null:null==B?(B=new mxCell(d[x],new mxGeometry(p,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"), +B.vertex=!0,g.push(B),u=c.getPreferredSizeForCell(B),null!=u&&B.geometry.width<u.width+10&&(B.geometry.width=u.width+10),p+=B.geometry.width+40):"--"==d[x]?(u=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),u.vertex=!0,B.geometry.height+=u.geometry.height,B.insert(u)):0<d[x].length&&(k=new mxCell(d[x],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"), +k.vertex=!0,u=c.getPreferredSizeForCell(k),null!=u&&k.geometry.width<u.width&&(k.geometry.width=u.width),B.geometry.width=Math.max(B.geometry.width,k.geometry.width),B.geometry.height+=k.geometry.height,B.insert(k)));if(0<g.length){c.getModel().beginUpdate();try{g=c.importCells(g,e.x,e.y);u=[];for(x=0;x<g.length;x++)u.push(g[x]),u=u.concat(g[x].children);c.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{c.getModel().endUpdate()}c.setSelectionCells(g);c.scrollCellToVisible(c.getSelectionCell())}}}else{for(var B= +function(a){var b=m[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,m[a]=b,g.push(b));return b},m={},g=[],x=0;x<d.length;x++)if(";"!=d[x].charAt(0)){var G=d[x].split("->");if(2<=G.length){var n=B(G[0]),H=B(G[G.length-1]),G=new mxCell(2<G.length?G[1]:"",new mxGeometry);G.edge=!0;n.insertEdge(G,!0);H.insertEdge(G,!1);g.push(G)}}if(0<g.length){d=document.createElement("div");d.style.visibility="hidden";document.body.appendChild(d);c=new Graph(d);c.getModel().beginUpdate(); +try{g=c.importCells(g);for(x=0;x<g.length;x++)c.getModel().isVertex(g[x])&&(u=c.getPreferredSizeForCell(g[x]),g[x].geometry.width=Math.max(g[x].geometry.width,u.width),g[x].geometry.height=Math.max(g[x].geometry.height,u.height));p=new mxFastOrganicLayout(c);p.disableEdgeStyle=!1;p.forceConstant=120;p.execute(c.getDefaultParent());k=new mxParallelEdgeLayout(c);k.spacing=20;k.execute(c.getDefaultParent())}finally{c.getModel().endUpdate()}c.clearCellOverlays();u=[];a.editor.graph.getModel().beginUpdate(); +try{u=a.editor.graph.importCells(c.getModel().getChildren(c.getDefaultParent()),e.x,e.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(u);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());c.destroy();d.parentNode.removeChild(d)}}}function g(){return"list"==n.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String": "mermaid"==n.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==n.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==n.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml": -"plantUmlSvg"==n.value||"plantUmlTxt"==n.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var e=a.editor.graph.getFreeInsertPoint();d=document.createElement("div");d.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height= -"354px";k.style.marginBottom="16px";var n=document.createElement("select");if("formatSql"==c||"mermaid"==c)n.style.display="none";var m=document.createElement("option");m.setAttribute("value","list");mxUtils.write(m,mxResources.get("list"));"plantUml"!=c&&n.appendChild(m);null!=c&&"fromText"!=c||m.setAttribute("selected","selected");m=document.createElement("option");m.setAttribute("value","table");mxUtils.write(m,mxResources.get("formatSql"));"formatSql"==c&&(n.appendChild(m),m.setAttribute("selected", -"selected"));m=document.createElement("option");m.setAttribute("value","mermaid");mxUtils.write(m,mxResources.get("formatSql"));"mermaid"==c&&(n.appendChild(m),m.setAttribute("selected","selected"));m=document.createElement("option");m.setAttribute("value","diagram");mxUtils.write(m,mxResources.get("diagram"));"plantUml"!=c&&n.appendChild(m);m=document.createElement("option");m.setAttribute("value","plantUmlSvg");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"== -c&&m.setAttribute("selected","selected");var t=document.createElement("option");t.setAttribute("value","plantUmlPng");mxUtils.write(t,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==c&&(n.appendChild(m),n.appendChild(t),n.appendChild(f));var l=g();k.value= -l;d.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){k.value=a.target.result};b.readAsText(a)}},!1));d.appendChild(n);mxEvent.addListener(n,"change",function(){var a=g();if(0==k.value.length||k.value==l)l=a,k.value=l}); -a.isOffline()||"mermaid"!=c&&"plantUml"!=c||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink("mermaid"==c?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),m.className="geBtn",d.appendChild(m));m=mxUtils.button(mxResources.get("close"),function(){k.value==l?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});m.className="geBtn";a.editor.cancelFirst&&d.appendChild(m);t=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog(); -b(k.value,n.value)});d.appendChild(t);t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(m);this.container=d},NewDialog=function(a,d,c,b,g,e,k,n,m,t,f,l,p,u,v,q,z){function y(){var a=!0;if(null!=S)for(;H<S.length&&(a||0!=mxUtils.mod(H,30));){var b=S[H++],b=x(b.url,b.libs,b.title,b.tooltip?b.tooltip:b.title,b.select,b.imgUrl,b.info,b.onClick,b.preview,b.noImg,b.clibs);a&&b.click();a=!1}}function C(){if(Y)c||a.hideDialog(),u(Y,aa,G.value);else if(b)c||a.hideDialog(),b(fa,G.value); +"plantUmlSvg"==n.value||"plantUmlTxt"==n.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var e=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height= +"354px";k.style.marginBottom="16px";var n=document.createElement("select");if("formatSql"==d||"mermaid"==d)n.style.display="none";var m=document.createElement("option");m.setAttribute("value","list");mxUtils.write(m,mxResources.get("list"));"plantUml"!=d&&n.appendChild(m);null!=d&&"fromText"!=d||m.setAttribute("selected","selected");m=document.createElement("option");m.setAttribute("value","table");mxUtils.write(m,mxResources.get("formatSql"));"formatSql"==d&&(n.appendChild(m),m.setAttribute("selected", +"selected"));m=document.createElement("option");m.setAttribute("value","mermaid");mxUtils.write(m,mxResources.get("formatSql"));"mermaid"==d&&(n.appendChild(m),m.setAttribute("selected","selected"));m=document.createElement("option");m.setAttribute("value","diagram");mxUtils.write(m,mxResources.get("diagram"));"plantUml"!=d&&n.appendChild(m);m=document.createElement("option");m.setAttribute("value","plantUmlSvg");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"== +d&&m.setAttribute("selected","selected");var t=document.createElement("option");t.setAttribute("value","plantUmlPng");mxUtils.write(t,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==d&&(n.appendChild(m),n.appendChild(t),n.appendChild(f));var l=g();k.value= +l;c.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){k.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(n);mxEvent.addListener(n,"change",function(){var a=g();if(0==k.value.length||k.value==l)l=a,k.value=l}); +a.isOffline()||"mermaid"!=d&&"plantUml"!=d||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink("mermaid"==d?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),m.className="geBtn",c.appendChild(m));m=mxUtils.button(mxResources.get("close"),function(){k.value==l?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});m.className="geBtn";a.editor.cancelFirst&&c.appendChild(m);t=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog(); +b(k.value,n.value)});c.appendChild(t);t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(m);this.container=c},NewDialog=function(a,c,d,b,g,e,k,n,m,t,f,l,p,u,v,q,z){function y(){var a=!0;if(null!=S)for(;H<S.length&&(a||0!=mxUtils.mod(H,30));){var b=S[H++],b=x(b.url,b.libs,b.title,b.tooltip?b.tooltip:b.title,b.select,b.imgUrl,b.info,b.onClick,b.preview,b.noImg,b.clibs);a&&b.click();a=!1}}function C(){if(Y)d||a.hideDialog(),u(Y,aa,G.value);else if(b)d||a.hideDialog(),b(fa,G.value); else{var f=G.value;null!=f&&0<f.length&&a.pickFolder(a.mode,function(b){a.createFile(f,fa,null!=W&&0<W.length?W:null,null,function(){a.hideDialog()},null,b,null,null!=ga&&0<ga.length?ga:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function I(a,b,f,c,d,l){null!=ba&&(ba.style.backgroundColor="transparent",ba.style.border="1px solid transparent");E.removeAttribute("disabled");fa=b;W=f;ga=l;ba=a;Y=c;aa=d;ba.style.backgroundColor=n;ba.style.border=m}function x(b,f,c,d, l,p,q,e,g,x,B){var k=document.createElement("div");k.className="geTemplate";k.style.height=Z+"px";k.style.width=da+"px";null!=c?k.setAttribute("title",mxResources.get(c,null,c)):null!=d&&0<d.length&&k.setAttribute("title",d);if(null!=p)k.style.backgroundImage="url("+p+")",k.style.backgroundSize="contain",k.style.backgroundPosition="center center",k.style.backgroundRepeat="no-repeat",mxEvent.addListener(k,"click",function(a){I(k,null,null,b,q,B)}),mxEvent.addListener(k,"dblclick",function(a){C()}); else if(!x&&null!=b&&0<b.length){d=g||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";k.style.backgroundImage="url("+d+")";k.style.backgroundPosition="center center";k.style.backgroundRepeat="no-repeat";null!=c&&(k.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;'+("dark"==uiTheme?"":"background:rgba(255,255,255,0.85);")+'border:inherit;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:rgba(255,255,255,0.85);overflow:hidden;text-overflow:ellipsis;max-width:'+ @@ -8320,26 +8321,26 @@ mxEvent.addListener(k,"dblclick",function(a){u=!0})}else k.innerHTML='<table wid null,b,q)}),mxEvent.addListener(k,"dblclick",function(a){C()}));P.appendChild(k);return k}function A(){T&&(T=!1,mxEvent.addListener(P,"scroll",function(a){P.scrollTop+P.clientHeight>=P.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<ea){var b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,mxResources.get("custom"));ca.appendChild(b);for(var c in M){var f=document.createElement("div"),b=c,d=M[c]; 18<b.length&&(b=b.substring(0,18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";f.setAttribute("title",b+" ("+d.length+")");mxUtils.write(f,f.getAttribute("title"));null!=t&&(f.style.padding=t);ca.appendChild(f);(function(b,c){mxEvent.addListener(f,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,P.scrollTop=0,P.innerHTML="",H=0,S=M[b],O=null,y())})})(c, f)}b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,"draw.io");ca.appendChild(b)}for(c in Q)f=document.createElement("div"),b=mxResources.get(c),d=Q[c],null==b&&(b=c.substring(0,1).toUpperCase()+c.substring(1)),18<b.length&&(b=b.substring(0,18)+"…"),f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;", -f.setAttribute("title",b+" ("+d.length+")"),mxUtils.write(f,f.getAttribute("title")),null!=t&&(f.style.padding=t),ca.appendChild(f),null==a&&0<d.length&&(a=f,a.style.backgroundColor=k,S=d),function(b,c){mxEvent.addListener(f,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,P.scrollTop=0,P.innerHTML="",H=0,S=Q[b],O=null,y())})}(c,f);y()}c=null!=c?c:!0;g=null!=g?g:!1;k=null!=k?k:"#ebf2f9";n=null!=n?n:"dark"==uiTheme?"transparent":"#e6eff8";m=null!=m?m:"dark"==uiTheme? -"1px dotted rgb(235, 242, 249)":"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var D=document.createElement("div");D.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";c&&D.appendChild(B);var F=document.createElement("img");F.setAttribute("border","0");F.setAttribute("align","absmiddle");F.style.width="40px";F.style.height="40px";F.style.marginRight="10px";F.style.paddingBottom="4px";F.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg": -a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!d&&c&&B.appendChild(F);c&&mxUtils.write(B,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"): +f.setAttribute("title",b+" ("+d.length+")"),mxUtils.write(f,f.getAttribute("title")),null!=t&&(f.style.padding=t),ca.appendChild(f),null==a&&0<d.length&&(a=f,a.style.backgroundColor=k,S=d),function(b,c){mxEvent.addListener(f,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,P.scrollTop=0,P.innerHTML="",H=0,S=Q[b],O=null,y())})}(c,f);y()}d=null!=d?d:!0;g=null!=g?g:!1;k=null!=k?k:"#ebf2f9";n=null!=n?n:"dark"==uiTheme?"transparent":"#e6eff8";m=null!=m?m:"dark"==uiTheme? +"1px dotted rgb(235, 242, 249)":"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var D=document.createElement("div");D.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";d&&D.appendChild(B);var F=document.createElement("img");F.setAttribute("border","0");F.setAttribute("align","absmiddle");F.style.width="40px";F.style.height="40px";F.style.marginRight="10px";F.style.paddingBottom="4px";F.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg": +a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&d&&B.appendChild(F);d&&mxUtils.write(B,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"): mxResources.get("filename"))+":");F=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?F=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?F=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?F=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?F=a.gitHub.extension:a.mode==App.MODE_GITLAB&&null!=a.gitLab?F=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(F=a.trello.extension);var G=document.createElement("input");G.setAttribute("value",a.defaultFilename+ -F);G.style.marginLeft="10px";G.style.width=d?"220px":"430px";this.init=function(){c&&(G.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?G.select():document.execCommand("selectAll",!1,null))};c&&(B.appendChild(G),null!=a.editor.fileExtensions&&(F=FilenameDialog.createTypeHint(a,G,a.editor.fileExtensions),F.style.marginTop="12px",B.appendChild(F)));var B=!1,H=0,J=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1, +F);G.style.marginLeft="10px";G.style.width=c?"220px":"430px";this.init=function(){d&&(G.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?G.select():document.execCommand("selectAll",!1,null))};d&&(B.appendChild(G),null!=a.editor.fileExtensions&&(F=FilenameDialog.createTypeHint(a,G,a.editor.fileExtensions),F.style.marginTop="12px",B.appendChild(F)));var B=!1,H=0,J=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1, hwaccel:!1,top:"40%",zIndex:2E9}),E=mxUtils.button(q||mxResources.get("create"),function(){E.setAttribute("disabled","disabled");C();E.removeAttribute("disabled")});E.className="geBtn gePrimaryBtn";if(l||p){var K=[],O=null,R=null,X=null,U=function(a){E.setAttribute("disabled","disabled");for(var b=0;b<K.length;b++)K[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},B=!0;q=document.createElement("div");q.style.whiteSpace="nowrap";q.style.height="30px";D.appendChild(q);F=mxUtils.button(mxResources.get("Templates", -null,"Templates"),function(){ca.style.display="";P.style.left="160px";U(0);P.scrollTop=0;P.innerHTML="";H=0;O!=S&&(S=O,Q=R,ea=X,ca.innerHTML="",A(),O=null)});K.push(F);q.appendChild(F);var L=function(a){ca.style.display="none";P.style.left="30px";U(a?-1:1);null==O&&(O=S);P.scrollTop=0;P.innerHTML="";J.spin(P);var b=function(a,b,f){H=0;J.stop();S=a;f=f||{};var c=0,d;for(d in f)c+=f[d].length;if(b)P.innerHTML=b;else if(0==a.length&&0==c)P.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams", -null,"No Diagrams Found"));else if(P.innerHTML="",0<c){ca.style.display="";P.style.left="160px";ca.innerHTML="";ea=0;Q={"draw.io":a};for(d in f)Q[d]=f[d];A()}else y()};a?p(V.value,b):l(b)};l&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),q.appendChild(F),K.push(F));if(p){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");q.appendChild(F);var V=document.createElement("input");V.style.marginRight="10px"; -V.style.marginLeft="10px";V.style.width="220px";mxEvent.addListener(V,"keypress",function(a){13==a.keyCode&&L(!0)});q.appendChild(V);F=mxUtils.button(mxResources.get("search"),function(){L(!0)});F.className="geBtn";q.appendChild(F)}U(0)}var W=null,ga=null,fa=null,ba=null,Y=null,aa=null,P=document.createElement("div");P.style.border="1px solid #d3d3d3";P.style.position="absolute";P.style.left="160px";P.style.right="34px";B=(c?72:40)+(B?30:0);P.style.top=B+"px";P.style.bottom="68px";P.style.margin= -"6px 0 0 -1px";P.style.padding="6px";P.style.overflow="auto";var ca=document.createElement("div");ca.style.cssText="position:absolute;left:30px;width:128px;top:"+B+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var Z=140,da=140,Q={},M={},ea=0,T=!0;Q.basic=[{title:"blankDiagram",select:!0}];var S=Q.basic;if(!d){var ha=function(){mxUtils.get(N,function(a){if(!ma){ma=!0;a=a.getXml().documentElement.firstChild;for(var b={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"== -a.nodeName){for(var f=a.getAttribute("name"),c=a.getElementsByTagName("add"),d=[],l=0;l<c.length;l++)d.push(encodeURIComponent(mxUtils.getTextContent(c[l])));null!=f&&0<d.length&&(b[f]=d.join(";"))}else f=a.getAttribute("url"),null!=f&&(c=a.getAttribute("section"),null==c&&(c=f.indexOf("/"),c=f.substring(0,c)),f=Q[c],null==f&&(f=[],Q[c]=f),c=a.getAttribute("clibs"),null!=b[c]&&(c=b[c]),f.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"), -preview:a.getAttribute("preview"),clibs:c}));a=a.nextSibling}J.stop();A()}})};D.appendChild(ca);D.appendChild(P);var ma=!1,N=f;/^https?:\/\//.test(N)&&!a.editor.isCorsEnabledForUrl(N)&&(N=PROXY_URL+"?url="+encodeURIComponent(N));J.spin(P);null!=z?z(function(a,b){M=a;X=ea=b;ha()},ha):ha();R=Q}mxEvent.addListener(G,"keypress",function(b){a.dialog.container.firstChild==D&&13==b.keyCode&&C()});f=document.createElement("div");f.style.marginTop=d?"4px":"16px";f.style.textAlign="right";f.style.position= -"absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";d||a.isOffline()||!c||null!=b||g||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",f.appendChild(z));z=mxUtils.button(mxResources.get("cancel"),function(){null!=e&&e();a.hideDialog(!0)});z.className="geBtn";!a.editor.cancelFirst||g&&null==e||f.appendChild(z);d||"1"==urlParams.embed||g||(d=mxUtils.button(mxResources.get("fromTemplateUrl"), -function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(G.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),d.className="geBtn",f.appendChild(d));Graph.fileSupport&&v&&(v=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var b= -document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(f){a.openFiles(b.files,!0);b.value=""});b.style.display="none";document.body.appendChild(b);a.newDlgFileInputElt=b}a.newDlgFileInputElt.click()}),v.className="geBtn",f.appendChild(v));f.appendChild(E);a.editor.cancelFirst||null!=b||g&&null==e||f.appendChild(z);D.appendChild(f);this.container=D},CreateDialog=function(a,d,c,b,g,e,k,n,m,t,f,l,p,u,v,q,z){function y(b, -f,c,p){function q(){mxEvent.addListener(e,"click",function(){var b=c;if(k){var f=x.value,l=f.lastIndexOf(".");if(0>d.lastIndexOf(".")&&0>l){var b=null!=b?b:B.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=a.gitHub.extension:b==App.MODE_GITLAB?p=a.gitLab.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".drawio");0<=l&&(f=f.substring(0,l));x.value=f+p}}C(c)})}var e= +null,"Templates"),function(){ca.style.display="";P.style.left="160px";U(0);P.scrollTop=0;P.innerHTML="";H=0;O!=S&&(S=O,Q=R,ea=X,ca.innerHTML="",A(),O=null)});K.push(F);q.appendChild(F);var L=function(a){ca.style.display="none";P.style.left="30px";U(a?-1:1);null==O&&(O=S);P.scrollTop=0;P.innerHTML="";J.spin(P);var b=function(a,b,c){H=0;J.stop();S=a;c=c||{};var f=0,d;for(d in c)f+=c[d].length;if(b)P.innerHTML=b;else if(0==a.length&&0==f)P.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams", +null,"No Diagrams Found"));else if(P.innerHTML="",0<f){ca.style.display="";P.style.left="160px";ca.innerHTML="";ea=0;Q={"draw.io":a};for(d in c)Q[d]=c[d];A()}else y()};a?p(V.value,b):l(b)};l&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),q.appendChild(F),K.push(F));if(p){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");q.appendChild(F);var V=document.createElement("input");V.style.marginRight="10px"; +V.style.marginLeft="10px";V.style.width="220px";mxEvent.addListener(V,"keypress",function(a){13==a.keyCode&&L(!0)});q.appendChild(V);F=mxUtils.button(mxResources.get("search"),function(){L(!0)});F.className="geBtn";q.appendChild(F)}U(0)}var W=null,ga=null,fa=null,ba=null,Y=null,aa=null,P=document.createElement("div");P.style.border="1px solid #d3d3d3";P.style.position="absolute";P.style.left="160px";P.style.right="34px";B=(d?72:40)+(B?30:0);P.style.top=B+"px";P.style.bottom="68px";P.style.margin= +"6px 0 0 -1px";P.style.padding="6px";P.style.overflow="auto";var ca=document.createElement("div");ca.style.cssText="position:absolute;left:30px;width:128px;top:"+B+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var Z=140,da=140,Q={},M={},ea=0,T=!0;Q.basic=[{title:"blankDiagram",select:!0}];var S=Q.basic;if(!c){var ha=function(){mxUtils.get(N,function(a){if(!ma){ma=!0;a=a.getXml().documentElement.firstChild;for(var b={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"== +a.nodeName){for(var c=a.getAttribute("name"),f=a.getElementsByTagName("add"),d=[],l=0;l<f.length;l++)d.push(encodeURIComponent(mxUtils.getTextContent(f[l])));null!=c&&0<d.length&&(b[c]=d.join(";"))}else c=a.getAttribute("url"),null!=c&&(f=a.getAttribute("section"),null==f&&(f=c.indexOf("/"),f=c.substring(0,f)),c=Q[f],null==c&&(c=[],Q[f]=c),f=a.getAttribute("clibs"),null!=b[f]&&(f=b[f]),c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"), +preview:a.getAttribute("preview"),clibs:f}));a=a.nextSibling}J.stop();A()}})};D.appendChild(ca);D.appendChild(P);var ma=!1,N=f;/^https?:\/\//.test(N)&&!a.editor.isCorsEnabledForUrl(N)&&(N=PROXY_URL+"?url="+encodeURIComponent(N));J.spin(P);null!=z?z(function(a,b){M=a;X=ea=b;ha()},ha):ha();R=Q}mxEvent.addListener(G,"keypress",function(b){a.dialog.container.firstChild==D&&13==b.keyCode&&C()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position= +"absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";c||a.isOffline()||!d||null!=b||g||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",f.appendChild(z));z=mxUtils.button(mxResources.get("cancel"),function(){null!=e&&e();a.hideDialog(!0)});z.className="geBtn";!a.editor.cancelFirst||g&&null==e||f.appendChild(z);c||"1"==urlParams.embed||g||(c=mxUtils.button(mxResources.get("fromTemplateUrl"), +function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(G.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),c.className="geBtn",f.appendChild(c));Graph.fileSupport&&v&&(v=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var b= +document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0);b.value=""});b.style.display="none";document.body.appendChild(b);a.newDlgFileInputElt=b}a.newDlgFileInputElt.click()}),v.className="geBtn",f.appendChild(v));f.appendChild(E);a.editor.cancelFirst||null!=b||g&&null==e||f.appendChild(z);D.appendChild(f);this.container=D},CreateDialog=function(a,c,d,b,g,e,k,n,m,t,f,l,p,u,v,q,z){function y(b, +f,d,p){function q(){mxEvent.addListener(e,"click",function(){var b=d;if(k){var f=x.value,l=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>l){var b=null!=b?b:B.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=a.gitHub.extension:b==App.MODE_GITLAB?p=a.gitLab.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".drawio");0<=l&&(f=f.substring(0,l));x.value=f+p}}C(d)})}var e= document.createElement("a");e.style.overflow="hidden";var g=document.createElement("img");g.src=b;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.className="geBaseButton";e.style.position="relative";e.style.margin="4px";e.style.padding="8px 8px 10px 8px";e.style.whiteSpace="nowrap";e.appendChild(g);mxClient.IS_QUIRKS&&(e.style.cssFloat="left",e.style.zoom= "1");e.style.color="gray";e.style.fontSize="11px";var u=document.createElement("div");e.appendChild(u);mxUtils.write(u,f);if(null!=p&&null==a[p]){g.style.visibility="hidden";mxUtils.setOpacity(u,10);var v=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(e);var n=window.setTimeout(function(){null==a[p]&&(v.stop(),e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!= -a[p]&&(window.clearTimeout(n),mxUtils.setOpacity(u,100),g.style.visibility="",v.stop(),q())}))}else q();A.appendChild(e);++D==l&&(mxUtils.br(A),D=0)}function C(b){var f=x.value;if(null==b||null!=f&&0<f.length)z&&a.hideDialog(),c(f,b,x)}k=null!=k?k:!0;n=null!=n?n:!0;l=null!=l?l:4;z=null!=z?z:!0;e=document.createElement("div");e.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(e);var I=document.createElement("h2");mxUtils.write(I,g||mxResources.get("create"));I.style.marginTop="0px";I.style.marginBottom= -"24px";e.appendChild(I);mxUtils.write(e,mxResources.get("filename")+":");var x=document.createElement("input");x.setAttribute("value",d);x.style.width="280px";x.style.marginLeft="10px";x.style.marginBottom="20px";x.style.maxWidth="70%";this.init=function(){x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null)};e.appendChild(x);null!=q&&e.appendChild(FilenameDialog.createTypeHint(a,x,q));null==p||null==u||"image/"!= +a[p]&&(window.clearTimeout(n),mxUtils.setOpacity(u,100),g.style.visibility="",v.stop(),q())}))}else q();A.appendChild(e);++D==l&&(mxUtils.br(A),D=0)}function C(b){var c=x.value;if(null==b||null!=c&&0<c.length)z&&a.hideDialog(),d(c,b,x)}k=null!=k?k:!0;n=null!=n?n:!0;l=null!=l?l:4;z=null!=z?z:!0;e=document.createElement("div");e.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(e);var I=document.createElement("h2");mxUtils.write(I,g||mxResources.get("create"));I.style.marginTop="0px";I.style.marginBottom= +"24px";e.appendChild(I);mxUtils.write(e,mxResources.get("filename")+":");var x=document.createElement("input");x.setAttribute("value",c);x.style.width="280px";x.style.marginLeft="10px";x.style.marginBottom="20px";x.style.maxWidth="70%";this.init=function(){x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null)};e.appendChild(x);null!=q&&e.appendChild(FilenameDialog.createTypeHint(a,x,q));null==p||null==u||"image/"!= u.substring(0,6)||"image/svg"==u.substring(0,9)&&!mxClient.IS_SVG||(x.style.width="160px",g=document.createElement("img"),p=v?p:btoa(unescape(encodeURIComponent(p))),g.setAttribute("src","data:"+u+";base64,"+p),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px",mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),e.appendChild(g),m&&Editor.popupsAllowed&&(g.style.cursor="pointer",mxEvent.addGestureListeners(g,null, null,function(){C("_blank")})));mxUtils.br(e);var A=document.createElement("div");A.style.textAlign="center";var D=0;A.style.marginTop="6px";e.appendChild(A);var B=document.createElement("select");B.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(u=document.createElement("option"),u.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(u,mxResources.get("googleDrive")),B.appendChild(u),y(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"), App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(u=document.createElement("option"),u.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(u,mxResources.get("oneDrive")),B.appendChild(u),a.mode==App.MODE_ONEDRIVE&&u.setAttribute("selected","selected"),y(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(u=document.createElement("option"),u.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(u, @@ -8349,122 +8350,122 @@ App.MODE_GITLAB),mxUtils.write(u,mxResources.get("gitlab")),B.appendChild(u),y(I "selected"),y(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=t&&(f=mxUtils.button(mxResources.get("help"),function(){a.openLink(t)}),f.className="geBtn",n.appendChild(f));f=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});f.className="geBtn";a.editor.cancelFirst&&n.appendChild(f); null==b&&(u=mxUtils.button(mxResources.get("decideLater"),function(){C(null)}),u.className="geBtn",n.appendChild(u));m&&Editor.popupsAllowed&&(m=mxUtils.button(mxResources.get("openInNewWindow"),function(){C("_blank")}),m.className="geBtn",n.appendChild(m));CreateDialog.showDownloadButton&&(m=mxUtils.button(mxResources.get("download"),function(){C("download")}),m.className="geBtn",n.appendChild(m));a.editor.cancelFirst||n.appendChild(f);mxEvent.addListener(x,"keypress",function(b){13==b.keyCode?C(App.MODE_DEVICE): 27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});e.appendChild(n);this.container=e};CreateDialog.showDownloadButton=!0; -var PopupDialog=function(a,d,c,b,g){g=null!=g?g:!0;var e=document.createElement("div");e.style.textAlign="left";mxUtils.write(e,mxResources.get("fileOpenLocation"));mxUtils.br(e);mxUtils.br(e);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){g&&a.hideDialog();null!=b&&b()});k.className="geBtn";k.style.marginBottom="8px";k.style.width="280px";e.appendChild(k);mxUtils.br(e);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){g&&a.hideDialog();null!=c&&c();a.openLink(d, -null,!0)});n.className="geBtn gePrimaryBtn";n.style.width=k.style.width;e.appendChild(n);mxUtils.br(e);mxUtils.br(e);mxUtils.write(e,mxResources.get("allowPopups"));this.container=e},ImageDialog=function(a,d,c,b,g,e){e=null!=e?e:!0;var k=a.editor.graph,n=document.createElement("div");mxUtils.write(n,d);d=document.createElement("div");d.className="geTitle";d.style.backgroundColor="transparent";d.style.borderColor="transparent";d.style.whiteSpace="nowrap";d.style.textOverflow="clip";d.style.cursor= -"default";mxClient.IS_VML||(d.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value",c);m.setAttribute("type","text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?460:340)+(mxClient.IS_QUIRKS?20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat"; -m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";c=document.createElement("div");c.setAttribute("title",mxResources.get("reset"));c.style.position="relative";c.style.left="-16px";c.style.width="12px";c.style.height="14px";c.style.cursor="pointer";c.style.display=mxClient.IS_VML?"inline":"inline-block";c.style.top=(mxClient.IS_VML?0:3)+"px";c.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(c,"click",function(){m.value="";m.focus()});d.appendChild(m);d.appendChild(c); -n.appendChild(d);var t=function(f,c,d,l){var p="data:"==f.substring(0,5);!a.isOffline()||p&&"undefined"===typeof chrome?0<f.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(f,function(p){a.spinner.stop();a.hideDialog();var q=!1===l?1:null!=c&&null!=d?Math.max(c/p.width,d/p.height):Math.min(1,Math.min(520/p.width,520/p.height));e&&(f=a.convertDataUri(f));b(f,Math.round(Number(p.width)*q),Math.round(Number(p.height)*q))},function(){a.spinner.stop();b(null);a.showError(mxResources.get("error"), -mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),b(f)):(f=a.convertDataUri(f),c=null==c?120:c,d=null==d?100:d,a.hideDialog(),b(f,c,d))},f=function(f,c){if(null!=f){var d=g?null:k.getModel().getGeometry(k.getSelectionCell());null!=d?t(f,d.width,d.height,c):t(f,null,null,c)}else a.hideDialog(),b(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=n.parentNode,c=null;mxEvent.addListener(b,"dragleave", +var PopupDialog=function(a,c,d,b,g){g=null!=g?g:!0;var e=document.createElement("div");e.style.textAlign="left";mxUtils.write(e,mxResources.get("fileOpenLocation"));mxUtils.br(e);mxUtils.br(e);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){g&&a.hideDialog();null!=b&&b()});k.className="geBtn";k.style.marginBottom="8px";k.style.width="280px";e.appendChild(k);mxUtils.br(e);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){g&&a.hideDialog();null!=d&&d();a.openLink(c, +null,!0)});n.className="geBtn gePrimaryBtn";n.style.width=k.style.width;e.appendChild(n);mxUtils.br(e);mxUtils.br(e);mxUtils.write(e,mxResources.get("allowPopups"));this.container=e},ImageDialog=function(a,c,d,b,g,e){e=null!=e?e:!0;var k=a.editor.graph,n=document.createElement("div");mxUtils.write(n,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor= +"default";mxClient.IS_VML||(c.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value",d);m.setAttribute("type","text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?460:340)+(mxClient.IS_QUIRKS?20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat"; +m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});c.appendChild(m);c.appendChild(d); +n.appendChild(c);var t=function(c,f,d,l){var p="data:"==c.substring(0,5);!a.isOffline()||p&&"undefined"===typeof chrome?0<c.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(c,function(p){a.spinner.stop();a.hideDialog();var q=!1===l?1:null!=f&&null!=d?Math.max(f/p.width,d/p.height):Math.min(1,Math.min(520/p.width,520/p.height));e&&(c=a.convertDataUri(c));b(c,Math.round(Number(p.width)*q),Math.round(Number(p.height)*q))},function(){a.spinner.stop();b(null);a.showError(mxResources.get("error"), +mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),b(c)):(c=a.convertDataUri(c),f=null==f?120:f,d=null==d?100:d,a.hideDialog(),b(c,f,d))},f=function(c,f){if(null!=c){var d=g?null:k.getModel().getGeometry(k.getSelectionCell());null!=d?t(c,d.width,d.height,f):t(c,null,null,f)}else a.hideDialog(),b(null)};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=n.parentNode,c=null;mxEvent.addListener(b,"dragleave", function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,d,l,p,e,q){f(a, -q)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b),null,null,!0);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&f(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};c=document.createElement("div");c.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";c.style.textAlign="center";d=mxUtils.button(mxResources.get("cancel"), -function(){a.spinner.stop();a.hideDialog()});d.className="geBtn";a.editor.cancelFirst&&c.appendChild(d);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){if(null==a.imgDlgFileInputElt){var l=document.createElement("input");l.setAttribute("multiple","multiple");l.setAttribute("type","file");mxEvent.addListener(l,"change",function(b){null!= -l.files&&(a.importFiles(l.files,0,0,a.maxImageSize,function(a,b,c,d,l,p){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0),l.type="",l.type="file",l.value="")});l.style.display="none";document.body.appendChild(l);a.imgDlgFileInputElt=l}var p=mxUtils.button(mxResources.get("open"),function(){a.imgDlgFileInputElt.click()});p.className="geBtn";c.appendChild(p)}document.createElement("canvas").getContext&&"data:image/"==m.value.substring(0, -11)&&"data:image/svg"!=m.value.substring(0,14)&&(p=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,m.value,function(a){m.value=a});a.showDialog(b.container,300,380,!0,!0);b.init()}),p.className="geBtn",c.appendChild(p));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(p=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN); -a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),p.className="geBtn",c.appendChild(p),null!=a.drive&&"1"==urlParams.photos&&(p=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD); -a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),p.className="geBtn",c.appendChild(p)));mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&f(m.value)});p=mxUtils.button(mxResources.get("apply"),function(){f(m.value)});p.className="geBtn gePrimaryBtn";c.appendChild(p);a.editor.cancelFirst||c.appendChild(d);Graph.fileSupport&&(c.style.marginTop="120px",n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.backgroundPosition= -"center 65%",n.style.backgroundRepeat="no-repeat",d=document.createElement("div"),d.style.position="absolute",d.style.width="420px",d.style.top="58%",d.style.textAlign="center",d.style.fontSize="18px",d.style.color="#a0c3ff",mxUtils.write(d,mxResources.get("dragImagesHere")),n.appendChild(d));n.appendChild(c);this.container=n},LinkDialog=function(a,d,c,b,g){function e(a,b,f){f=mxUtils.button("",f);f.className="geBtn";f.setAttribute("title",b);b=document.createElement("img");b.style.height="26px"; -b.style.width="26px";b.setAttribute("src",a);f.style.minWidth="42px";f.style.verticalAlign="middle";f.appendChild(b);z.appendChild(f)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var n=document.createElement("div");n.className="geTitle";n.style.backgroundColor="transparent";n.style.borderColor="transparent";n.style.whiteSpace="nowrap";n.style.textOverflow="clip";n.style.cursor="default";mxClient.IS_VML||(n.style.paddingRight="20px");var m=document.createElement("input"); +q)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b),null,null,!0);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&f(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};d=document.createElement("div");d.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";d.style.textAlign="center";c=mxUtils.button(mxResources.get("cancel"), +function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url));m.focus()};if(Graph.fileSupport){if(null==a.imgDlgFileInputElt){var l=document.createElement("input");l.setAttribute("multiple","multiple");l.setAttribute("type","file");mxEvent.addListener(l,"change",function(b){null!= +l.files&&(a.importFiles(l.files,0,0,a.maxImageSize,function(a,b,c,d,l,p){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0),l.type="",l.type="file",l.value="")});l.style.display="none";document.body.appendChild(l);a.imgDlgFileInputElt=l}var p=mxUtils.button(mxResources.get("open"),function(){a.imgDlgFileInputElt.click()});p.className="geBtn";d.appendChild(p)}document.createElement("canvas").getContext&&"data:image/"==m.value.substring(0, +11)&&"data:image/svg"!=m.value.substring(0,14)&&(p=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,m.value,function(a){m.value=a});a.showDialog(b.container,300,380,!0,!0);b.init()}),p.className="geBtn",d.appendChild(p));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(p=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN); +a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),p.className="geBtn",d.appendChild(p),null!=a.drive&&"1"==urlParams.photos&&(p=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD); +a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),p.className="geBtn",d.appendChild(p)));mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&f(m.value)});p=mxUtils.button(mxResources.get("apply"),function(){f(m.value)});p.className="geBtn gePrimaryBtn";d.appendChild(p);a.editor.cancelFirst||d.appendChild(c);Graph.fileSupport&&(d.style.marginTop="120px",n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.backgroundPosition= +"center 65%",n.style.backgroundRepeat="no-repeat",c=document.createElement("div"),c.style.position="absolute",c.style.width="420px",c.style.top="58%",c.style.textAlign="center",c.style.fontSize="18px",c.style.color="#a0c3ff",mxUtils.write(c,mxResources.get("dragImagesHere")),n.appendChild(c));n.appendChild(d);this.container=n},LinkDialog=function(a,c,d,b,g){function e(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px"; +b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);z.appendChild(c)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var n=document.createElement("div");n.className="geTitle";n.style.backgroundColor="transparent";n.style.borderColor="transparent";n.style.whiteSpace="nowrap";n.style.textOverflow="clip";n.style.cursor="default";mxClient.IS_VML||(n.style.paddingRight="20px");var m=document.createElement("input"); m.setAttribute("placeholder",mxResources.get("dragUrlsHere"));m.setAttribute("type","text");m.style.marginTop="6px";m.style.width="100%";m.style.boxSizing="border-box";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";var t=document.createElement("div");t.setAttribute("title",mxResources.get("reset"));t.style.position="relative";t.style.left="-16px";t.style.width="12px";t.style.height= "14px";t.style.cursor="pointer";t.style.display=mxClient.IS_VML?"inline":"inline-block";t.style.top=(mxClient.IS_VML?0:3)+"px";t.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(t,"click",function(){m.value="";m.focus()});var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","current-linkdialog");var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;"; -l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","current-linkdialog");var p=document.createElement("select");p.style.width="100%";if(g&&null!=a.pages){null!=d&&"data:page/id,"==d.substring(0,13)?(l.setAttribute("checked","checked"),l.defaultChecked=!0):(m.setAttribute("value",d),f.setAttribute("checked","checked"),f.defaultChecked=!0);n.appendChild(f);n.appendChild(m);n.appendChild(t);mxUtils.br(n);n.appendChild(l);g=!1;for(t=0;t<a.pages.length;t++){var u=document.createElement("option"); -mxUtils.write(u,a.pages[t].getName()||mxResources.get("pageWithNumber",[t+1]));u.setAttribute("value","data:page/id,"+a.pages[t].getId());d==u.getAttribute("value")&&(u.setAttribute("selected","selected"),g=!0);p.appendChild(u)}if(!g&&l.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value","pageNotFound");p.appendChild(v);mxEvent.addListener(p,"change",function(){null== -v.parentNode||v.selected||v.parentNode.removeChild(v)})}n.appendChild(p)}else m.setAttribute("value",d),n.appendChild(m),n.appendChild(t);k.appendChild(n);var q=mxUtils.button(c,function(){a.hideDialog();b(l.checked?"pageNotFound"!==p.value?p.value:d:m.value,LinkDialog.selectedDocs)});q.style.verticalAlign="middle";q.className="geBtn gePrimaryBtn";this.init=function(){l.checked?p.focus():(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll", +l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","current-linkdialog");var p=document.createElement("select");p.style.width="100%";if(g&&null!=a.pages){null!=c&&"data:page/id,"==c.substring(0,13)?(l.setAttribute("checked","checked"),l.defaultChecked=!0):(m.setAttribute("value",c),f.setAttribute("checked","checked"),f.defaultChecked=!0);n.appendChild(f);n.appendChild(m);n.appendChild(t);mxUtils.br(n);n.appendChild(l);g=!1;for(t=0;t<a.pages.length;t++){var u=document.createElement("option"); +mxUtils.write(u,a.pages[t].getName()||mxResources.get("pageWithNumber",[t+1]));u.setAttribute("value","data:page/id,"+a.pages[t].getId());c==u.getAttribute("value")&&(u.setAttribute("selected","selected"),g=!0);p.appendChild(u)}if(!g&&l.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value","pageNotFound");p.appendChild(v);mxEvent.addListener(p,"change",function(){null== +v.parentNode||v.selected||v.parentNode.removeChild(v)})}n.appendChild(p)}else m.setAttribute("value",c),n.appendChild(m),n.appendChild(t);k.appendChild(n);var q=mxUtils.button(d,function(){a.hideDialog();b(l.checked?"pageNotFound"!==p.value?p.value:c:m.value,LinkDialog.selectedDocs)});q.style.verticalAlign="middle";q.className="geBtn gePrimaryBtn";this.init=function(){l.checked?p.focus():(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll", !1,null));mxEvent.addListener(p,"focus",function(){f.removeAttribute("checked");l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(m,"focus",function(){l.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){var b=k.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null== c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(m.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,q.click());a.stopPropagation();a.preventDefault()}),!1)}};var z=document.createElement("div");z.style.marginTop= -"20px";z.style.textAlign="center";c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});c.style.verticalAlign="middle";c.className="geBtn";z.appendChild(c);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(c.style.display="none");c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.style.verticalAlign="middle";c.className="geBtn";a.editor.cancelFirst&&z.appendChild(c);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action== +"20px";z.style.textAlign="center";d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});d.style.verticalAlign="middle";d.className="geBtn";z.appendChild(d);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(d.style.display="none");d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&z.appendChild(d);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action== google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||null!=a.docs[0].mimeType&&"application/vnd.jgraph."==a.docs[0].mimeType.substring(0,23)?b="https://www.draw.io/#G"+a.docs[0].id:"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);m.value=b;m.focus()}else LinkDialog.selectedDocs=null;m.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&& -e(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),c=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0), -b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(b).addView(f).addView(c).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))}); +e(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0), +b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(b).addView(c).addView(f).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))}); "undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&e(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){m.value=a[0].link;m.focus()}})});null!=a.oneDrive&&e(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){m.value=b.value[0].webUrl;m.focus()})});null!=a.gitHub&&e(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!= -a){a=a.split("/");var b=a[0],f=a[1],c=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+b+"/"+f+"/blob/"+c+"/"+a;m.focus()}})});null!=a.gitLab&&e(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),function(){a.gitLab.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],f=a[1],c=a[2];a=a.slice(3,a.length).join("/");m.value=DRAWIO_GITLAB_URL+"/"+b+"/"+f+"/blob/"+c+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(f){13==f.keyCode&&(a.hideDialog(),b(l.checked? -p.value:m.value,LinkDialog.selectedDocs))});z.appendChild(q);a.editor.cancelFirst||z.appendChild(c);k.appendChild(z);this.container=k},AboutDialog=function(a){var d=document.createElement("div");d.style.marginTop="6px";d.setAttribute("align","center");var c=document.createElement("img");c.style.border="0px";mxClient.IS_SVG?(c.setAttribute("width","164"),c.setAttribute("height","221"),c.style.width="164px",c.style.height="221px",c.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(c.setAttribute("width", -"176"),c.setAttribute("height","219"),c.style.width="170px",c.style.height="219px",c.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));"dark"==uiTheme&&(c.style.filter="grayscale(100%) invert(100%)");d.appendChild(c);mxUtils.br(d);var c="dark"==uiTheme?"#cccccc":"#505050",b=document.createElement("small");b.innerHTML="v "+EditorUi.VERSION;b.style.color=c;d.appendChild(b);mxUtils.br(d);mxUtils.br(d);b=document.createElement("small");b.style.color=c;b.innerHTML='© 2005-2020 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.'; -d.appendChild(b);mxEvent.addListener(d,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=d},FeedbackDialog=function(a){var d=document.createElement("div"),c=document.createElement("div");mxUtils.write(c,mxResources.get("sendYourFeedbackToDrawIo"));c.style.fontSize="18px";c.style.marginBottom="18px";d.appendChild(c);c=document.createElement("div");mxUtils.write(c,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");d.appendChild(c);var b=document.createElement("input"); +a){a=a.split("/");var b=a[0],c=a[1],f=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+b+"/"+c+"/blob/"+f+"/"+a;m.focus()}})});null!=a.gitLab&&e(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),function(){a.gitLab.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],f=a[2];a=a.slice(3,a.length).join("/");m.value=DRAWIO_GITLAB_URL+"/"+b+"/"+c+"/blob/"+f+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(c){13==c.keyCode&&(a.hideDialog(),b(l.checked? +p.value:m.value,LinkDialog.selectedDocs))});z.appendChild(q);a.editor.cancelFirst||z.appendChild(d);k.appendChild(z);this.container=k},AboutDialog=function(a){var c=document.createElement("div");c.style.marginTop="6px";c.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(d.setAttribute("width", +"176"),d.setAttribute("height","219"),d.style.width="170px",d.style.height="219px",d.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));"dark"==uiTheme&&(d.style.filter="grayscale(100%) invert(100%)");c.appendChild(d);mxUtils.br(c);var d="dark"==uiTheme?"#cccccc":"#505050",b=document.createElement("small");b.innerHTML="v "+EditorUi.VERSION;b.style.color=d;c.appendChild(b);mxUtils.br(c);mxUtils.br(c);b=document.createElement("small");b.style.color=d;b.innerHTML='© 2005-2020 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.'; +c.appendChild(b);mxEvent.addListener(c,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=c},FeedbackDialog=function(a){var c=document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";c.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");c.appendChild(d);var b=document.createElement("input"); b.setAttribute("type","text");b.style.marginTop="6px";b.style.width="600px";var g=mxUtils.button(mxResources.get("sendMessage"),function(){var c=m.value+(k.checked?"\nDiagram:\n"+mxUtils.getXml(a.getXmlFileData()):"")+"\nBrowser:\n"+navigator.userAgent;c.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(b.value)+ "&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+c),function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");var e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; -mxEvent.addListener(b,"change",function(){0<b.value.length&&0<e.test(b.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});mxEvent.addListener(b,"keyup",function(){0<b.value.length&&e.test(b.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});d.appendChild(b);this.init=function(){b.focus()};var k=document.createElement("input");k.setAttribute("type","checkbox");k.setAttribute("checked","checked");k.defaultChecked=!0;c=document.createElement("p");c.style.marginTop= -"14px";c.appendChild(k);var n=document.createElement("span");mxUtils.write(n," "+mxResources.get("includeCopyOfMyDiagram"));c.appendChild(n);mxEvent.addListener(n,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});d.appendChild(c);c=document.createElement("div");mxUtils.write(c,mxResources.get("feedback"));d.appendChild(c);var m=document.createElement("textarea");m.style.resize="none";m.style.width="600px";m.style.height="140px";m.style.marginTop="6px";m.setAttribute("placeholder",mxResources.get("comments")); -d.appendChild(m);c=document.createElement("div");c.style.marginTop="26px";c.style.textAlign="right";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst?(c.appendChild(n),c.appendChild(g)):(c.appendChild(g),c.appendChild(n));d.appendChild(c);this.container=d};FeedbackDialog.maxAttachmentSize=1E6; -var RevisionDialog=function(a,d,c){var b=document.createElement("div"),g=document.createElement("h3");g.style.marginTop="0px";mxUtils.write(g,mxResources.get("revisionHistory"));b.appendChild(g);var e=document.createElement("div");e.style.position="absolute";e.style.overflow="auto";e.style.width="170px";e.style.height="378px";b.appendChild(e);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.left="199px";k.style.width="470px";k.style.height= +mxEvent.addListener(b,"change",function(){0<b.value.length&&0<e.test(b.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});mxEvent.addListener(b,"keyup",function(){0<b.value.length&&e.test(b.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});c.appendChild(b);this.init=function(){b.focus()};var k=document.createElement("input");k.setAttribute("type","checkbox");k.setAttribute("checked","checked");k.defaultChecked=!0;d=document.createElement("p");d.style.marginTop= +"14px";d.appendChild(k);var n=document.createElement("span");mxUtils.write(n," "+mxResources.get("includeCopyOfMyDiagram"));d.appendChild(n);mxEvent.addListener(n,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});c.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("feedback"));c.appendChild(d);var m=document.createElement("textarea");m.style.resize="none";m.style.width="600px";m.style.height="140px";m.style.marginTop="6px";m.setAttribute("placeholder",mxResources.get("comments")); +c.appendChild(m);d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst?(d.appendChild(n),d.appendChild(g)):(d.appendChild(g),d.appendChild(n));c.appendChild(d);this.container=c};FeedbackDialog.maxAttachmentSize=1E6; +var RevisionDialog=function(a,c,d){var b=document.createElement("div"),g=document.createElement("h3");g.style.marginTop="0px";mxUtils.write(g,mxResources.get("revisionHistory"));b.appendChild(g);var e=document.createElement("div");e.style.position="absolute";e.style.overflow="auto";e.style.width="170px";e.style.height="378px";b.appendChild(e);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.left="199px";k.style.width="470px";k.style.height= "376px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);b.appendChild(k);var n=new Graph(k);n.setTooltips(!1);n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;var m=0,t=null,f=0,l=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=t&&null!=t[f]?t[f].getAttribute("name"):"pagenumber"==a?f+1:"pagecount"==a?null!=t?t.length:1:l.apply(this,arguments)};n.getLinkForCell= -function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,f){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),v=null,q=null,z=null,y=null,C=mxUtils.button("",function(){null!=z&&n.zoomIn()});C.className="geSprite geSprite-zoomin"; +function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),v=null,q=null,z=null,y=null,C=mxUtils.button("",function(){null!=z&&n.zoomIn()});C.className="geSprite geSprite-zoomin"; C.setAttribute("title",mxResources.get("zoomIn"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var I=mxUtils.button("",function(){null!=z&&n.zoomOut()});I.className="geSprite geSprite-zoomout";I.setAttribute("title",mxResources.get("zoomOut"));I.style.outline="none";I.style.border="none";I.style.margin="2px";I.setAttribute("disabled","disabled");mxUtils.setOpacity(I,20);var x=mxUtils.button("",function(){null!=z&& (n.maxFitScale=8,n.fit(8),n.center())});x.className="geSprite geSprite-fit";x.setAttribute("title",mxResources.get("fit"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var A=mxUtils.button("",function(){null!=z&&(n.zoomActual(),n.center())});A.className="geSprite geSprite-actualsize";A.setAttribute("title",mxResources.get("actualSize"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled", -"disabled");mxUtils.setOpacity(A,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var B=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),f=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(b,f,"text/xml"):(b= -"undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(f)+"&format=xml"+b)).simulate(document,"_blank"))}});B.className="geBtn";B.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=c?c(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop(); +"disabled");mxUtils.setOpacity(A,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var B=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b= +"undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});B.className="geBtn";B.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop(); a.replaceFileData(y);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});F.className="geBtn";F.setAttribute("disabled","disabled");var G=document.createElement("select");G.setAttribute("disabled","disabled");G.style.maxWidth="80px";G.style.position="relative";G.style.top="-2px";G.style.verticalAlign="bottom";G.style.marginRight="6px";G.style.display="none";var H=null;mxEvent.addListener(G,"change",function(a){null!= -H&&(H(a),mxEvent.consume(a))});var J=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});J.className="geBtn";J.setAttribute("disabled","disabled");null!=c&&(J.style.display="none");var E=mxUtils.button(mxResources.get("show"),function(){null!=q&&a.openLink(q.getUrl(G.selectedIndex))});E.className="geBtn gePrimaryBtn";E.setAttribute("disabled", -"disabled");null!=c&&(E.style.display="none",F.className="geBtn gePrimaryBtn");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.width="640px";g.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var O=null;if(null!=d&&0<d.length){k.style.cursor="move";var R=document.createElement("table");R.style.border= -"1px solid lightGray";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var X=document.createElement("tbody"),U=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var L=d.length-1;0<=L;L--){var V=function(b){var c=new Date(b.modifiedDate),l=null;if(0<=c.getTime()){var e=function(d){p.stop();var e=mxUtils.parseXml(d),q=a.editor.extractGraphModel(e.documentElement,!0);if(null!=q){var g=function(a){null!=a&&(a= -v(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return a};G.style.display="none";G.innerHTML="";z=e;y=d;t=parseSelectFunction=null;f=0;if("mxfile"==q.nodeName){e=q.getElementsByTagName("diagram");t=[];for(d=0;d<e.length;d++)t.push(e[d]);f=Math.min(m, -t.length-1);0<t.length&&g(t[f]);if(1<t.length)for(G.removeAttribute("disabled"),G.style.display="",d=0;d<t.length;d++)e=document.createElement("option"),mxUtils.write(e,t[d].getAttribute("name")||mxResources.get("pageWithNumber",[d+1])),e.setAttribute("value",d),d==f&&e.setAttribute("selected","selected"),G.appendChild(e);H=function(){try{var b=parseInt(G.value);f=m=b;g(t[b])}catch(M){G.value=m,a.handleError(M)}}}else v(q);d=b.lastModifyingUserName;null!=d&&20<d.length&&(d=d.substring(0,20)+"..."); -D.innerHTML="";mxUtils.write(D,(null!=d?d+" ":"")+c.toLocaleDateString()+" "+c.toLocaleTimeString());D.setAttribute("title",l.getAttribute("title"));C.removeAttribute("disabled");I.removeAttribute("disabled");x.removeAttribute("disabled");A.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&F.removeAttribute("disabled"),B.removeAttribute("disabled"),E.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(I,60);mxUtils.setOpacity(x, -60);mxUtils.setOpacity(A,60)}else G.style.display="none",G.innerHTML="",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},l=document.createElement("tr");l.style.borderBottom="1px solid lightGray";l.style.fontSize="12px";l.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==d[d.length-1]?mxUtils.write(g,mxResources.get("current")):c.toDateString()===U?mxUtils.write(g,c.toLocaleTimeString()):mxUtils.write(g,c.toLocaleDateString()+ -" "+c.toLocaleTimeString());l.appendChild(g);l.setAttribute("title",c.toLocaleDateString()+" "+c.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(l,"click",function(a){q!=b&&(p.stop(),null!=v&&(v.style.backgroundColor=""),q=b,v=l,v.style.backgroundColor="#ebf2f9",y=z=null,D.removeAttribute("title"),D.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),k.style.backgroundColor= +H&&(H(a),mxEvent.consume(a))});var J=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});J.className="geBtn";J.setAttribute("disabled","disabled");null!=d&&(J.style.display="none");var E=mxUtils.button(mxResources.get("show"),function(){null!=q&&a.openLink(q.getUrl(G.selectedIndex))});E.className="geBtn gePrimaryBtn";E.setAttribute("disabled", +"disabled");null!=d&&(E.style.display="none",F.className="geBtn gePrimaryBtn");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.width="640px";g.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var O=null;if(null!=c&&0<c.length){k.style.cursor="move";var R=document.createElement("table");R.style.border= +"1px solid lightGray";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width="100%";var X=document.createElement("tbody"),U=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var L=c.length-1;0<=L;L--){var V=function(b){var d=new Date(b.modifiedDate),l=null;if(0<=d.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),q=a.editor.extractGraphModel(e.documentElement,!0);if(null!=q){var g=function(a){null!=a&&(a= +v(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return a};G.style.display="none";G.innerHTML="";z=e;y=c;t=parseSelectFunction=null;f=0;if("mxfile"==q.nodeName){e=q.getElementsByTagName("diagram");t=[];for(c=0;c<e.length;c++)t.push(e[c]);f=Math.min(m, +t.length-1);0<t.length&&g(t[f]);if(1<t.length)for(G.removeAttribute("disabled"),G.style.display="",c=0;c<t.length;c++)e=document.createElement("option"),mxUtils.write(e,t[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),G.appendChild(e);H=function(){try{var b=parseInt(G.value);f=m=b;g(t[b])}catch(M){G.value=m,a.handleError(M)}}}else v(q);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"..."); +D.innerHTML="";mxUtils.write(D,(null!=c?c+" ":"")+d.toLocaleDateString()+" "+d.toLocaleTimeString());D.setAttribute("title",l.getAttribute("title"));C.removeAttribute("disabled");I.removeAttribute("disabled");x.removeAttribute("disabled");A.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&F.removeAttribute("disabled"),B.removeAttribute("disabled"),E.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(I,60);mxUtils.setOpacity(x, +60);mxUtils.setOpacity(A,60)}else G.style.display="none",G.innerHTML="",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},l=document.createElement("tr");l.style.borderBottom="1px solid lightGray";l.style.fontSize="12px";l.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):d.toDateString()===U?mxUtils.write(g,d.toLocaleTimeString()):mxUtils.write(g,d.toLocaleDateString()+ +" "+d.toLocaleTimeString());l.appendChild(g);l.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(l,"click",function(a){q!=b&&(p.stop(),null!=v&&(v.style.backgroundColor=""),q=b,v=l,v.style.backgroundColor="#ebf2f9",y=z=null,D.removeAttribute("title"),D.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),k.style.backgroundColor= "#ffffff",n.getModel().clear(),F.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),mxUtils.setOpacity(C,20),mxUtils.setOpacity(I,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(A,20),p.spin(k),b.getXml(function(a){if(q== -b)try{e(a)}catch(ca){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+ca.message)}},function(a){p.stop();G.style.display="none";G.innerHTML="";D.innerHTML="";mxUtils.write(D,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(l,"dblclick",function(a){E.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);X.appendChild(l)}return l}(d[L]);null!=V&&L==d.length-1&&(O=V)}R.appendChild(X); +b)try{e(a)}catch(ca){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+ca.message)}},function(a){p.stop();G.style.display="none";G.innerHTML="";D.innerHTML="";mxUtils.write(D,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(l,"dblclick",function(a){E.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);X.appendChild(l)}return l}(c[L]);null!=V&&L==c.length-1&&(O=V)}R.appendChild(X); e.appendChild(R)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(k.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("notAvailable"))):(k.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("noRevisions")));this.init=function(){null!=O&&O.click()};e=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.className="geBtn";K.appendChild(G);K.appendChild(C);K.appendChild(I); -K.appendChild(A);K.appendChild(x);a.editor.cancelFirst?(g.appendChild(e),g.appendChild(B),g.appendChild(J),g.appendChild(F),g.appendChild(E)):(g.appendChild(B),g.appendChild(J),g.appendChild(F),g.appendChild(E),g.appendChild(e));b.appendChild(g);b.appendChild(K);b.appendChild(D);this.container=b},DraftDialog=function(a,d,c,b,g,e,k,n,m){var t=document.createElement("div"),f=document.createElement("div");f.style.marginTop="0px";f.style.whiteSpace="nowrap";f.style.overflow="auto";f.style.lineHeight= -"normal";mxUtils.write(f,d);t.appendChild(f);var l=document.createElement("select"),p=mxUtils.bind(this,function(){C=mxUtils.parseXml(m[l.value].data);I=a.editor.extractGraphModel(C.documentElement,!0);x=0;this.init()});if(null!=m){l.style.marginLeft="4px";for(d=0;d<m.length;d++){var u=document.createElement("option");u.setAttribute("value",d);var v=new Date(m[d].created),q=new Date(m[d].modified);mxUtils.write(u,v.toLocaleDateString()+" "+v.toLocaleTimeString()+" - "+(v.toDateString(),q.toDateString(), -q.toLocaleDateString())+" "+q.toLocaleTimeString());l.appendChild(u)}f.appendChild(l);mxEvent.addListener(l,"change",p)}null==c&&(c=m[0].data);var z=document.createElement("div");z.style.position="absolute";z.style.border="1px solid lightGray";z.style.marginTop="10px";z.style.width="640px";z.style.top="46px";z.style.bottom="74px";z.style.overflow="hidden";mxEvent.disableContextMenu(z);t.appendChild(z);var y=new Graph(z);y.setEnabled(!1);y.setPanning(!0);y.panningHandler.ignoreCell=!0;y.panningHandler.useLeftButtonForPanning= -!0;y.minFitScale=null;y.maxFitScale=null;y.centerZoom=!0;var C=mxUtils.parseXml(c),I=a.editor.extractGraphModel(C.documentElement,!0),x=0,A=null,D=y.getGlobalVariable;y.getGlobalVariable=function(a){return"page"==a&&null!=A&&null!=A[x]?A[x].getAttribute("name"):"pagenumber"==a?x+1:"pagecount"==a?null!=A?A.length:1:D.apply(this,arguments)};y.getLinkForCell=function(){return null};c=mxUtils.button("",function(){y.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn")); -c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);f=mxUtils.button("",function(){y.zoomOut()});f.className="geSprite geSprite-zoomout";f.setAttribute("title",mxResources.get("zoomOut"));f.style.outline="none";f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);d=mxUtils.button("",function(){y.maxFitScale=8;y.fit(8);y.center()});d.className="geSprite geSprite-fit";d.setAttribute("title",mxResources.get("fit"));d.style.outline="none";d.style.border= -"none";d.style.margin="2px";mxUtils.setOpacity(d,60);u=mxUtils.button("",function(){y.zoomActual();y.center()});u.className="geSprite geSprite-actualsize";u.setAttribute("title",mxResources.get("actualSize"));u.style.outline="none";u.style.border="none";u.style.margin="2px";mxUtils.setOpacity(u,60);k=mxUtils.button(k||mxResources.get("discard"),function(){g.apply(this,[l.value,mxUtils.bind(this,function(){null!=l.parentNode&&(l.options[l.selectedIndex].parentNode.removeChild(l.options[l.selectedIndex]), +K.appendChild(A);K.appendChild(x);a.editor.cancelFirst?(g.appendChild(e),g.appendChild(B),g.appendChild(J),g.appendChild(F),g.appendChild(E)):(g.appendChild(B),g.appendChild(J),g.appendChild(F),g.appendChild(E),g.appendChild(e));b.appendChild(g);b.appendChild(K);b.appendChild(D);this.container=b},DraftDialog=function(a,c,d,b,g,e,k,n,m){var t=document.createElement("div"),f=document.createElement("div");f.style.marginTop="0px";f.style.whiteSpace="nowrap";f.style.overflow="auto";f.style.lineHeight= +"normal";mxUtils.write(f,c);t.appendChild(f);var l=document.createElement("select"),p=mxUtils.bind(this,function(){C=mxUtils.parseXml(m[l.value].data);I=a.editor.extractGraphModel(C.documentElement,!0);x=0;this.init()});if(null!=m){l.style.marginLeft="4px";for(c=0;c<m.length;c++){var u=document.createElement("option");u.setAttribute("value",c);var v=new Date(m[c].created),q=new Date(m[c].modified);mxUtils.write(u,v.toLocaleDateString()+" "+v.toLocaleTimeString()+" - "+(v.toDateString(),q.toDateString(), +q.toLocaleDateString())+" "+q.toLocaleTimeString());l.appendChild(u)}f.appendChild(l);mxEvent.addListener(l,"change",p)}null==d&&(d=m[0].data);var z=document.createElement("div");z.style.position="absolute";z.style.border="1px solid lightGray";z.style.marginTop="10px";z.style.width="640px";z.style.top="46px";z.style.bottom="74px";z.style.overflow="hidden";mxEvent.disableContextMenu(z);t.appendChild(z);var y=new Graph(z);y.setEnabled(!1);y.setPanning(!0);y.panningHandler.ignoreCell=!0;y.panningHandler.useLeftButtonForPanning= +!0;y.minFitScale=null;y.maxFitScale=null;y.centerZoom=!0;var C=mxUtils.parseXml(d),I=a.editor.extractGraphModel(C.documentElement,!0),x=0,A=null,D=y.getGlobalVariable;y.getGlobalVariable=function(a){return"page"==a&&null!=A&&null!=A[x]?A[x].getAttribute("name"):"pagenumber"==a?x+1:"pagecount"==a?null!=A?A.length:1:D.apply(this,arguments)};y.getLinkForCell=function(){return null};d=mxUtils.button("",function(){y.zoomIn()});d.className="geSprite geSprite-zoomin";d.setAttribute("title",mxResources.get("zoomIn")); +d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);f=mxUtils.button("",function(){y.zoomOut()});f.className="geSprite geSprite-zoomout";f.setAttribute("title",mxResources.get("zoomOut"));f.style.outline="none";f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);c=mxUtils.button("",function(){y.maxFitScale=8;y.fit(8);y.center()});c.className="geSprite geSprite-fit";c.setAttribute("title",mxResources.get("fit"));c.style.outline="none";c.style.border= +"none";c.style.margin="2px";mxUtils.setOpacity(c,60);u=mxUtils.button("",function(){y.zoomActual();y.center()});u.className="geSprite geSprite-actualsize";u.setAttribute("title",mxResources.get("actualSize"));u.style.outline="none";u.style.border="none";u.style.margin="2px";mxUtils.setOpacity(u,60);k=mxUtils.button(k||mxResources.get("discard"),function(){g.apply(this,[l.value,mxUtils.bind(this,function(){null!=l.parentNode&&(l.options[l.selectedIndex].parentNode.removeChild(l.options[l.selectedIndex]), 0<l.options.length?(l.value=l.options[0].value,p()):a.hideDialog(!0))})])});k.className="geBtn";var B=document.createElement("select");B.style.maxWidth="80px";B.style.position="relative";B.style.top="-2px";B.style.verticalAlign="bottom";B.style.marginRight="6px";B.style.display="none";e=mxUtils.button(e||mxResources.get("edit"),function(){b.apply(this,[l.value])});e.className="geBtn gePrimaryBtn";v=document.createElement("div");v.style.position="absolute";v.style.bottom="30px";v.style.width="640px"; v.style.textAlign="right";q=document.createElement("div");q.className="geToolbarContainer";q.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";z.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,y.getModel());y.maxFitScale=1;y.fit(8);y.center()}}function b(b){null!=b&&(b=a(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(b))).documentElement)); return b}mxEvent.addListener(B,"change",function(a){x=parseInt(B.value);b(A[x]);mxEvent.consume(a)});if("mxfile"==I.nodeName){var c=I.getElementsByTagName("diagram");A=[];for(var f=0;f<c.length;f++)A.push(c[f]);0<A.length&&b(A[x]);B.innerHTML="";if(1<A.length)for(B.style.display="",f=0;f<A.length;f++)c=document.createElement("option"),mxUtils.write(c,A[f].getAttribute("name")||mxResources.get("pageWithNumber",[f+1])),c.setAttribute("value",f),f==x&&c.setAttribute("selected","selected"),B.appendChild(c); -else B.style.display="none"}else a(I)};q.appendChild(B);q.appendChild(c);q.appendChild(f);q.appendChild(u);q.appendChild(d);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(v.appendChild(c),null!=n&&v.appendChild(n),v.appendChild(k),v.appendChild(e)):(v.appendChild(e),v.appendChild(k),null!=n&&v.appendChild(n),v.appendChild(c));t.appendChild(v); -t.appendChild(q);this.container=t},FindWindow=function(a,d,c,b,g){function e(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var f=0;f<b.length;f++)if("label"!=b[f].nodeName){var d=mxUtils.trim(b[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&d.substring(0,c.length)===c||null!=a&&a.test(d))return!0}}return!1}function k(){var a=m.model.getDescendants(m.model.getRoot()),b=p.value.toLowerCase(),c=u.checked?new RegExp(b):null,d= +else B.style.display="none"}else a(I)};q.appendChild(B);q.appendChild(d);q.appendChild(f);q.appendChild(u);q.appendChild(c);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});d.className="geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(v.appendChild(d),null!=n&&v.appendChild(n),v.appendChild(k),v.appendChild(e)):(v.appendChild(e),v.appendChild(k),null!=n&&v.appendChild(n),v.appendChild(d));t.appendChild(v); +t.appendChild(q);this.container=t},FindWindow=function(a,c,d,b,g){function e(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var f=0;f<b.length;f++)if("label"!=b[f].nodeName){var d=mxUtils.trim(b[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&d.substring(0,c.length)===c||null!=a&&a.test(d))return!0}}return!1}function k(){var a=m.model.getDescendants(m.model.getRoot()),b=p.value.toLowerCase(),c=u.checked?new RegExp(b):null,d= null;t!=b&&(t=b,f=null);var l=null==f;if(0<b.length)for(var g=0;g<a.length;g++){var k=m.view.getState(a[g]);if(null!=k&&null!=k.cell.value&&(l||null==d)&&(m.model.isVertex(k.cell)||m.model.isEdge(k.cell))&&(m.isHtmlLabel(k.cell)?(q.innerHTML=m.getLabel(k.cell),label=mxUtils.extractTextWithWhitespace([q])):label=m.getLabel(k.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||e(c,k.cell,b))||null!=c&&(c.test(label)||e(c, k.cell,b))))if(l){d=k;break}else null==d&&(d=k);l=l||k==f}null!=d?(f=d,m.scrollCellToVisible(f.cell),m.isEnabled()?m.setSelectionCell(f.cell):m.highlightCell(f.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d}var n=a.actions.get("find"),m=a.editor.graph,t=null,f=null,l=document.createElement("div");l.style.userSelect="none";l.style.overflow="hidden";l.style.padding="10px";l.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",mxResources.get("find")); p.setAttribute("type","text");p.style.marginTop="4px";p.style.marginBottom="6px";p.style.width="200px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";l.appendChild(p);mxUtils.br(l);var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginRight="4px";l.appendChild(u);mxUtils.write(l,mxResources.get("regularExpression"));var v=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");v.style.position="relative";v.style.marginLeft= "6px";v.style.top="-1px";l.appendChild(v);var q=document.createElement("div");mxUtils.br(l);v=mxUtils.button(mxResources.get("reset"),function(){p.value="";p.style.backgroundColor="";t=f=null;p.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.className="geBtn";l.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{p.style.backgroundColor=k()?"":"#ffcfcf"}catch(y){a.handleError(y)}});v.setAttribute("title",mxResources.get("find")+ " (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";l.appendChild(v);mxEvent.addListener(p,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(t!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=k()?"":"#ffcfcf"}catch(C){p.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(l,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(n.funct(),mxEvent.consume(b))});this.window= -new mxWindow(mxResources.get("find"),l,d,c,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):m.container.focus()}));this.window.setLocation=function(a,b){var c=window.innerHeight|| +new mxWindow(mxResources.get("find"),l,c,d,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):m.container.focus()}));this.window.setLocation=function(a,b){var c=window.innerHeight|| document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var z=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",z);this.destroy= -function(){mxEvent.removeListener(window,"resize",z);this.window.destroy()}},FreehandWindow=function(a,d,c,b,g){var e=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var k=mxUtils.button(mxResources.get("startDrawing"),function(){e.freehand.isDrawing()&&e.freehand.stopDrawing();e.freehand.startDrawing()});k.setAttribute("title",mxResources.get("startDrawing"));k.style.marginTop="8px";k.style.marginRight="4px";k.style.width="160px"; -k.style.overflow="hidden";k.style.textOverflow="ellipsis";k.style.textAlign="center";k.className="geBtn gePrimaryBtn";a.appendChild(k);var n=k.cloneNode(!1);mxUtils.write(n,mxResources.get("stopDrawing"));n.setAttribute("title",mxResources.get("stopDrawing"));n.style.marginTop="4px";mxEvent.addListener(n,"click",function(){e.freehand.stopDrawing()});a.appendChild(n);this.window=new mxWindow(mxResources.get("freehand"),a,d,c,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1); +function(){mxEvent.removeListener(window,"resize",z);this.window.destroy()}},FreehandWindow=function(a,c,d,b,g){var e=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var k=mxUtils.button(mxResources.get("startDrawing"),function(){e.freehand.isDrawing()&&e.freehand.stopDrawing();e.freehand.startDrawing()});k.setAttribute("title",mxResources.get("startDrawing"));k.style.marginTop="8px";k.style.marginRight="4px";k.style.width="160px"; +k.style.overflow="hidden";k.style.textOverflow="ellipsis";k.style.textAlign="center";k.className="geBtn gePrimaryBtn";a.appendChild(k);var n=k.cloneNode(!1);mxUtils.write(n,mxResources.get("stopDrawing"));n.setAttribute("title",mxResources.get("stopDrawing"));n.style.marginTop="4px";mxEvent.addListener(n,"click",function(){e.freehand.stopDrawing()});a.appendChild(n);this.window=new mxWindow(mxResources.get("freehand"),a,c,d,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1); this.window.setClosable(!0);e.addListener("freehandStateChanged",mxUtils.bind(this,function(){n.className="geBtn"+(e.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){e.freehand.isDrawing()&&e.freehand.stopDrawing()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a, (window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var m=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",m);this.destroy=function(){mxEvent.removeListener(window,"resize",m);this.window.destroy()}},TagsWindow= -function(a,d,c,b,g){var e=a.editor.graph,k="tags",n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var m=document.createElement("input");m.setAttribute("placeholder",mxResources.get("allTags"));m.setAttribute("type","text");m.style.marginTop="4px";m.style.width="260px";m.style.fontSize="12px";m.style.borderRadius="4px";m.style.padding="6px";n.appendChild(m);if(!a.isOffline()||mxClient.IS_CHROMEAPP){m.style.width="240px"; +function(a,c,d,b,g){var e=a.editor.graph,k="tags",n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var m=document.createElement("input");m.setAttribute("placeholder",mxResources.get("allTags"));m.setAttribute("type","text");m.style.marginTop="4px";m.style.width="260px";m.style.fontSize="12px";m.style.borderRadius="4px";m.style.padding="6px";n.appendChild(m);if(!a.isOffline()||mxClient.IS_CHROMEAPP){m.style.width="240px"; var t=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");t.firstChild.style.marginBottom="6px";t.style.marginLeft="6px";n.appendChild(t)}mxEvent.addListener(m,"dblclick",function(){var b=new FilenameDialog(a,k,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(k=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});m.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(n);t=mxUtils.button(mxResources.get("hide"), function(){var a=e.getCellsForTags(m.value.split(" "),void 0,k,!0);e.setCellsVisible(a,!1)});t.setAttribute("title",mxResources.get("hide"));t.style.marginTop="8px";t.style.marginRight="4px";t.className="geBtn";n.appendChild(t);t=mxUtils.button(mxResources.get("show"),function(){var a=e.getCellsForTags(m.value.split(" "),void 0,k,!0);e.setCellsVisible(a,!0);if(e.isEnabled()){for(var b=[],c=0;c<a.length;c++)(e.model.isVertex(a[c])||e.model.isEdge(a[c]))&&b.push(a[c]);e.setSelectionCells(b)}else for(c= 0;c<a.length;c++)e.highlightCell(a[c])});t.setAttribute("title",mxResources.get("show"));t.style.marginTop="8px";t.style.marginRight="4px";t.className="geBtn";n.appendChild(t);var f=a.actions.get("tags"),t=mxUtils.button(mxResources.get("close"),function(){f.funct()});t.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");t.style.marginTop="8px";t.className="geBtn gePrimaryBtn";n.appendChild(t);mxEvent.addListener(m,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||f.funct()});this.window= -new mxWindow(mxResources.get("tags"),n,d,c,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):e.container.focus()}));this.window.setLocation=function(a,b){var c=window.innerHeight|| +new mxWindow(mxResources.get("tags"),n,c,d,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):e.container.focus()}));this.window.setLocation=function(a,b){var c=window.innerHeight|| document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var l=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",l);this.destroy= -function(){mxEvent.removeListener(window,"resize",l);this.window.destroy()}},AuthDialog=function(a,d,c,b){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("authorizationRequired"));var k="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";d==a.drive?(k= -mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):d==a.dropbox?(k=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):d==a.oneDrive?(k=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):d==a.gitHub?(k=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):d==a.gitLab?(k=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg",n.style.width="32px"):d==a.trello&&(k=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg"); -a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[k]));var m=document.createElement("input");m.setAttribute("type","checkbox");k=mxUtils.button(mxResources.get("authorize"),function(){b(m.checked)});k.insertBefore(n,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";k.style.fontSize="18px";k.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(k);c&&(c=document.createElement("p"),c.style.marginTop="20px",c.appendChild(m),e=document.createElement("span"), -mxUtils.write(e," "+mxResources.get("rememberMe")),c.appendChild(e),g.appendChild(c),m.checked=!0,m.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)}));this.container=g},MoreShapesDialog=function(a,d,c){c=null!=c?c:a.sidebar.entries;var b=document.createElement("div"),g=[];if(null!=a.sidebar.customEntries)for(var e=0;e<a.sidebar.customEntries.length;e++){for(var k=a.sidebar.customEntries[e],n={title:a.getResource(k.title),entries:[]},m=0;m<k.entries.length;m++){var t= -k.entries[m];n.entries.push({id:t.id,title:a.getResource(t.title),desc:a.getResource(t.desc),image:t.preview})}g.push(n)}for(e=0;e<c.length;e++)if(null==a.sidebar.enabledLibraries)g.push(c[e]);else{n={title:c[e].title,entries:[]};for(m=0;m<c[e].entries.length;m++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,c[e].entries[m].id)&&n.entries.push(c[e].entries[m]);0<n.entries.length&&g.push(n)}c=g;if(d){m=mxUtils.bind(this,function(b){for(var c=0;c<b.length;c++)(function(b){var d=v.cloneNode(!1);d.style.fontWeight= +function(){mxEvent.removeListener(window,"resize",l);this.window.destroy()}},AuthDialog=function(a,c,d,b){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("authorizationRequired"));var k="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";c==a.drive?(k= +mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?(k=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(k=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(k=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(k=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg",n.style.width="32px"):c==a.trello&&(k=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg"); +a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[k]));var m=document.createElement("input");m.setAttribute("type","checkbox");k=mxUtils.button(mxResources.get("authorize"),function(){b(m.checked)});k.insertBefore(n,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";k.style.fontSize="18px";k.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(k);d&&(d=document.createElement("p"),d.style.marginTop="20px",d.appendChild(m),e=document.createElement("span"), +mxUtils.write(e," "+mxResources.get("rememberMe")),d.appendChild(e),g.appendChild(d),m.checked=!0,m.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)}));this.container=g},MoreShapesDialog=function(a,c,d){d=null!=d?d:a.sidebar.entries;var b=document.createElement("div"),g=[];if(null!=a.sidebar.customEntries)for(var e=0;e<a.sidebar.customEntries.length;e++){for(var k=a.sidebar.customEntries[e],n={title:a.getResource(k.title),entries:[]},m=0;m<k.entries.length;m++){var t= +k.entries[m];n.entries.push({id:t.id,title:a.getResource(t.title),desc:a.getResource(t.desc),image:t.preview})}g.push(n)}for(e=0;e<d.length;e++)if(null==a.sidebar.enabledLibraries)g.push(d[e]);else{n={title:d[e].title,entries:[]};for(m=0;m<d[e].entries.length;m++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,d[e].entries[m].id)&&n.entries.push(d[e].entries[m]);0<n.entries.length&&g.push(n)}d=g;if(c){m=mxUtils.bind(this,function(b){for(var c=0;c<b.length;c++)(function(b){var d=v.cloneNode(!1);d.style.fontWeight= "bold";d.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";d.style.padding="6px 0px 6px 20px";mxUtils.write(d,b.title);f.appendChild(d);for(var e=0;e<b.entries.length;e++)(function(b){var d=v.cloneNode(!1);d.style.cursor="pointer";d.style.padding="4px 0px 4px 20px";d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.textOverflow="ellipsis";d.setAttribute("title",b.title+" ("+b.id+")");var q=document.createElement("input");q.setAttribute("type","checkbox");q.checked=a.sidebar.isEntryVisible(b.id); q.defaultChecked=q.checked;d.appendChild(q);mxUtils.write(d," "+b.title);f.appendChild(d);var g=function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName){l.style.textAlign="center";l.style.padding="0px";l.style.color="";l.innerHTML="";if(null!=b.desc){var c=document.createElement("pre");c.style.boxSizing="border-box";c.style.fontFamily="inherit";c.style.margin="20px";c.style.right="0px";c.style.textAlign="left";mxUtils.write(c,b.desc);l.appendChild(c)}null!=b.imageCallback?b.imageCallback(l): null!=b.image?l.innerHTML+='<img border="0" src="'+b.image+'"/>':null==b.desc&&(l.style.padding="20px",l.style.color="rgb(179, 179, 179)",mxUtils.write(l,mxResources.get("noPreview")));null!=p&&(p.style.backgroundColor="");p=d;p.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(d,"click",g);mxEvent.addListener(d,"dblclick",function(a){q.checked=!q.checked;mxEvent.consume(a)});u.push(function(){return q.checked?b.id:null});0==c&&0==e&&g()})(b.entries[e])})(b[c])}); e=document.createElement("div");e.className="geDialogTitle";mxUtils.write(e,mxResources.get("shapes"));e.style.position="absolute";e.style.top="0px";e.style.left="0px";e.style.lineHeight="40px";e.style.height="40px";e.style.right="0px";mxClient.IS_QUIRKS&&(e.style.width="718px");var f=document.createElement("div"),l=document.createElement("div");f.style.position="absolute";f.style.top="40px";f.style.left="0px";f.style.width="202px";f.style.bottom="60px";f.style.overflow="auto";mxClient.IS_QUIRKS&& (f.style.height="437px",f.style.marginTop="1px");l.style.position="absolute";l.style.left="202px";l.style.right="0px";l.style.top="40px";l.style.bottom="60px";l.style.overflow="auto";l.style.borderLeft="1px solid rgb(211, 211, 211)";l.style.textAlign="center";mxClient.IS_QUIRKS&&(l.style.width=parseInt(e.style.width)-202+"px",l.style.height=f.style.height,l.style.marginTop=f.style.marginTop);var p=null,u=[],v=document.createElement("div");v.style.position="relative";v.style.left="0px";v.style.right= -"0px";m(c);b.style.padding="30px";b.appendChild(e);b.appendChild(f);b.appendChild(l);c=document.createElement("div");c.className="geDialogFooter";c.style.position="absolute";c.style.paddingRight="16px";c.style.color="gray";c.style.left="0px";c.style.right="0px";c.style.bottom="0px";c.style.height="60px";c.style.lineHeight="52px";mxClient.IS_QUIRKS&&(c.style.width=e.style.width,c.style.paddingTop="12px");var q=document.createElement("input");q.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)e= -document.createElement("span"),e.style.paddingRight="20px",e.appendChild(q),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),q.checked=!0,q.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){mxEvent.getSource(a)!=q&&(q.checked=!q.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(e.style.position="relative",e.style.top="-6px"),c.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog(); -for(var b=[],c=0;c<u.length;c++){var f=u[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),q.checked,!0)});m.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),e=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";m=document.createElement("tr");z.style.width="100%";d=document.createElement("td");var g=document.createElement("td"),k=document.createElement("td"),y=mxUtils.bind(this,function(b,c,f){var d=document.createElement("input"); -d.type="checkbox";z.appendChild(d);d.checked=a.sidebar.isEntryVisible(f);var l=document.createElement("span");mxUtils.write(l,c);c=document.createElement("div");c.style.display="block";c.appendChild(d);c.appendChild(l);mxEvent.addListener(l,"click",function(a){d.checked=!d.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return d.checked?f:null}});m.appendChild(d);m.appendChild(g);m.appendChild(k);e.appendChild(m);z.appendChild(e);for(var u=[],C=0,e=0;e<c.length;e++)for(m=0;m<c[e].entries.length;m++)C++; -for(var I=[d,g,k],x=0,e=0;e<c.length;e++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];u.push(y(I[Math.floor(x/(C/3))],c.title,c.id));x++}})(c[e]);b.appendChild(z);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";q=document.createElement("input");isLocalStorage&&(q.setAttribute("type","checkbox"),q.checked=!0,q.defaultChecked=!0,c.appendChild(q),e=document.createElement("span"),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),c.appendChild(e), -mxEvent.addListener(e,"click",function(a){q.checked=!q.checked;mxEvent.consume(a)}));b.appendChild(c);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<u.length;c++){var f=u[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(0<b.length?b.join(";"):"",q.checked);a.hideDialog()});m.className="geBtn gePrimaryBtn";c=document.createElement("div");c.style.marginTop="26px"; -c.style.textAlign="right"}a.editor.cancelFirst?(c.appendChild(e),c.appendChild(m)):(c.appendChild(m),c.appendChild(e));b.appendChild(c);this.container=b},PluginsDialog=function(a){function d(){if(0==g.length)b.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{b.innerHTML="";for(var c=0;c<g.length;c++){var l=document.createElement("span");l.style.whiteSpace="nowrap";var p=document.createElement("span");p.className="geSprite geSprite-delete";p.style.position="relative";p.style.cursor= -"pointer";p.style.top="5px";p.style.marginRight="4px";p.style.display="inline-block";l.appendChild(p);mxUtils.write(l,g[c]);b.appendChild(l);mxUtils.br(b);mxEvent.addListener(p,"click",function(b){return function(){a.confirm(mxResources.get("delete")+' "'+g[b]+'"?',function(){g.splice(b,1);d()})}}(c))}}}var c=document.createElement("div"),b=document.createElement("div");b.style.height="120px";b.style.overflow="auto";var g=mxSettings.getPlugins().slice();c.appendChild(b);d();var e=mxUtils.button(mxResources.get("add"), -function(){var b="",c=urlParams.p;if(null!=c&&0<c.length){for(var p=c.split(";"),c=0;c<p.length;c++){var e=App.pluginRegistry[p[c]];null!=e&&(b+=e+";")}";"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1))}b=new FilenameDialog(a,b,mxResources.get("add"),function(a){if(null!=a&&0<a.length){p=a.split(";");for(a=0;a<p.length;a++){var b=p[a],c=App.pluginRegistry[b];null!=c&&(b=c);0<b.length&&0>mxUtils.indexOf(g,b)&&g.push(b)}d()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");a.showDialog(b.container, +"0px";m(d);b.style.padding="30px";b.appendChild(e);b.appendChild(f);b.appendChild(l);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=e.style.width,d.style.paddingTop="12px");var q=document.createElement("input");q.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)e= +document.createElement("span"),e.style.paddingRight="20px",e.appendChild(q),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),q.checked=!0,q.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){mxEvent.getSource(a)!=q&&(q.checked=!q.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(e.style.position="relative",e.style.top="-6px"),d.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog(); +for(var b=[],c=0;c<u.length;c++){var f=u[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),q.checked,!0)});m.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),e=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";m=document.createElement("tr");z.style.width="100%";c=document.createElement("td");var g=document.createElement("td"),k=document.createElement("td"),y=mxUtils.bind(this,function(b,c,f){var d=document.createElement("input"); +d.type="checkbox";z.appendChild(d);d.checked=a.sidebar.isEntryVisible(f);var l=document.createElement("span");mxUtils.write(l,c);c=document.createElement("div");c.style.display="block";c.appendChild(d);c.appendChild(l);mxEvent.addListener(l,"click",function(a){d.checked=!d.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return d.checked?f:null}});m.appendChild(c);m.appendChild(g);m.appendChild(k);e.appendChild(m);z.appendChild(e);for(var u=[],C=0,e=0;e<d.length;e++)for(m=0;m<d[e].entries.length;m++)C++; +for(var I=[c,g,k],x=0,e=0;e<d.length;e++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];u.push(y(I[Math.floor(x/(C/3))],c.title,c.id));x++}})(d[e]);b.appendChild(z);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";q=document.createElement("input");isLocalStorage&&(q.setAttribute("type","checkbox"),q.checked=!0,q.defaultChecked=!0,d.appendChild(q),e=document.createElement("span"),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),d.appendChild(e), +mxEvent.addListener(e,"click",function(a){q.checked=!q.checked;mxEvent.consume(a)}));b.appendChild(d);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<u.length;c++){var f=u[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(0<b.length?b.join(";"):"",q.checked);a.hideDialog()});m.className="geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px"; +d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(e),d.appendChild(m)):(d.appendChild(m),d.appendChild(e));b.appendChild(d);this.container=b},PluginsDialog=function(a){function c(){if(0==g.length)b.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{b.innerHTML="";for(var f=0;f<g.length;f++){var d=document.createElement("span");d.style.whiteSpace="nowrap";var p=document.createElement("span");p.className="geSprite geSprite-delete";p.style.position="relative";p.style.cursor= +"pointer";p.style.top="5px";p.style.marginRight="4px";p.style.display="inline-block";d.appendChild(p);mxUtils.write(d,g[f]);b.appendChild(d);mxUtils.br(b);mxEvent.addListener(p,"click",function(b){return function(){a.confirm(mxResources.get("delete")+' "'+g[b]+'"?',function(){g.splice(b,1);c()})}}(f))}}}var d=document.createElement("div"),b=document.createElement("div");b.style.height="120px";b.style.overflow="auto";var g=mxSettings.getPlugins().slice();d.appendChild(b);c();var e=mxUtils.button(mxResources.get("add"), +function(){var b="",d=urlParams.p;if(null!=d&&0<d.length){for(var p=d.split(";"),d=0;d<p.length;d++){var e=App.pluginRegistry[p[d]];null!=e&&(b+=e+";")}";"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1))}b=new FilenameDialog(a,b,mxResources.get("add"),function(a){if(null!=a&&0<a.length){p=a.split(";");for(a=0;a<p.length;a++){var b=p[a],d=App.pluginRegistry[b];null!=d&&(b=d);0<b.length&&0>mxUtils.indexOf(g,b)&&g.push(b)}c()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");a.showDialog(b.container, 300,80,!0,!0);b.init()});e.className="geBtn";var k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";var n=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(g);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});n.className="geBtn gePrimaryBtn";var m=document.createElement("div");m.style.marginTop="14px";m.style.textAlign="right";var t=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000056430")}); -t.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(t.style.display="none");m.appendChild(t);a.editor.cancelFirst?(m.appendChild(k),m.appendChild(e),m.appendChild(n)):(m.appendChild(e),m.appendChild(n),m.appendChild(k));c.appendChild(m);this.container=c},CropImageDialog=function(a,d,c){function b(a){null!=k&&k.destroy();k=a?new Croppie(e,{viewport:{width:150,height:150,type:"circle"},enableExif:!0,showZoomer:!1,enableResize:!1,enableOrientation:!0}):new Croppie(e,{viewport:{width:150,height:150, -type:"square"},enableExif:!0,showZoomer:!1,enableResize:!0,enableOrientation:!0});k.bind({url:d})}var g=document.createElement("div"),e=document.createElement("div");e.style.width="300px";e.style.height="300px";g.appendChild(e);var k=null;this.init=function(){b()};var n=document.createElement("input");n.setAttribute("type","checkbox");n.setAttribute("id","croppieCircle");n.style.margin="5px";g.appendChild(n);var m=document.createElement("label");m.setAttribute("for","croppieCircle");mxUtils.write(m, +t.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(t.style.display="none");m.appendChild(t);a.editor.cancelFirst?(m.appendChild(k),m.appendChild(e),m.appendChild(n)):(m.appendChild(e),m.appendChild(n),m.appendChild(k));d.appendChild(m);this.container=d},CropImageDialog=function(a,c,d){function b(a){null!=k&&k.destroy();k=a?new Croppie(e,{viewport:{width:150,height:150,type:"circle"},enableExif:!0,showZoomer:!1,enableResize:!1,enableOrientation:!0}):new Croppie(e,{viewport:{width:150,height:150, +type:"square"},enableExif:!0,showZoomer:!1,enableResize:!0,enableOrientation:!0});k.bind({url:c})}var g=document.createElement("div"),e=document.createElement("div");e.style.width="300px";e.style.height="300px";g.appendChild(e);var k=null;this.init=function(){b()};var n=document.createElement("input");n.setAttribute("type","checkbox");n.setAttribute("id","croppieCircle");n.style.margin="5px";g.appendChild(n);var m=document.createElement("label");m.setAttribute("for","croppieCircle");mxUtils.write(m, mxResources.get("circle"));g.appendChild(m);var t,f,l,p,m=document.createElement("div");t=document.createElement("button");f=document.createElement("button");m.appendChild(t);m.appendChild(f);l=document.createElement("i");p=document.createElement("i");t.appendChild(l);f.appendChild(p);m.className="cr-rotate-controls";m.style["float"]="right";m.style.position="inherit";t.className="cr-rotate-l";f.className="cr-rotate-r";g.appendChild(m);t.addEventListener("click",function(){k.rotate(-90)});f.addEventListener("click", -function(){k.rotate(90)});mxEvent.addListener(n,"change",function(){b(this.checked)});n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){k.result({type:"base64",size:"original"}).then(function(b){c(b);a.hideDialog()})});m.className="geBtn gePrimaryBtn";t=document.createElement("div");t.style.marginTop="20px";t.style.textAlign="right";a.editor.cancelFirst?(t.appendChild(n),t.appendChild(m)):(t.appendChild(m), -t.appendChild(n));g.appendChild(t);this.container=g},EditGeometryDialog=function(a,d){var c=a.editor.graph,b=1==d.length?c.getCellGeometry(d[0]):null,g=document.createElement("div"),e=document.createElement("table"),k=document.createElement("tbody"),n=document.createElement("tr"),m=document.createElement("td"),t=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("relative")+":");var f=document.createElement("input");f.setAttribute("type","checkbox");null!=b&&b.relative&& +function(){k.rotate(90)});mxEvent.addListener(n,"change",function(){b(this.checked)});n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";m=mxUtils.button(mxResources.get("apply"),function(){k.result({type:"base64",size:"original"}).then(function(b){d(b);a.hideDialog()})});m.className="geBtn gePrimaryBtn";t=document.createElement("div");t.style.marginTop="20px";t.style.textAlign="right";a.editor.cancelFirst?(t.appendChild(n),t.appendChild(m)):(t.appendChild(m), +t.appendChild(n));g.appendChild(t);this.container=g},EditGeometryDialog=function(a,c){var d=a.editor.graph,b=1==c.length?d.getCellGeometry(c[0]):null,g=document.createElement("div"),e=document.createElement("table"),k=document.createElement("tbody"),n=document.createElement("tr"),m=document.createElement("td"),t=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("relative")+":");var f=document.createElement("input");f.setAttribute("type","checkbox");null!=b&&b.relative&& (f.setAttribute("checked","checked"),f.defaultChecked=!0);this.init=function(){f.focus()};t.appendChild(f);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("left")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.width="100px";l.value=null!=b?b.x:"";t.appendChild(l);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr"); m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=b?b.y:"";t.appendChild(p);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("dx")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width= "100px";u.value=null!=b&&null!=b.offset?b.offset.x:"";t.appendChild(u);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("dy")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=b&&null!=b.offset?b.offset.y:"";t.appendChild(v);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td"); t=document.createElement("td");mxUtils.write(m,mxResources.get("width")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=b?b.width:"";t.appendChild(q);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("height")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=null!= -b?b.height:"";t.appendChild(z);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("rotation")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=1==d.length?mxUtils.getValue(c.getCellStyle(d[0]),mxConstants.STYLE_ROTATION,0):"";t.appendChild(y);n.appendChild(m);n.appendChild(t);k.appendChild(n);e.appendChild(k);g.appendChild(e); -b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var C=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c.getModel().beginUpdate();try{for(var b=0;b<d.length;b++){var e=c.getCellGeometry(d[b]);null!=e&&(e=e.clone(),c.isCellMovable(d[b])&&(e.relative=f.checked,0<mxUtils.trim(l.value).length&&(e.x=Number(l.value)),0<mxUtils.trim(p.value).length&&(e.y=Number(p.value)),0<mxUtils.trim(u.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.x= -Number(u.value)),0<mxUtils.trim(v.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.y=Number(v.value))),c.isCellResizable(d[b])&&(0<mxUtils.trim(q.value).length&&(e.width=Number(q.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),c.getModel().setGeometry(d[b],e));0<mxUtils.trim(y.value).length&&c.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[d[b]])}}finally{c.getModel().endUpdate()}});C.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13== -a.keyCode&&C.click()});e=document.createElement("div");e.style.marginTop="20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(b),e.appendChild(C)):(e.appendChild(C),e.appendChild(b));g.appendChild(e);this.container=g},LibraryDialog=function(a,d,c,b,g,e){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function n(b,c,d,l,p,e,g,m,A){try{if(a.spinner.stop(), +b?b.height:"";t.appendChild(z);n.appendChild(m);n.appendChild(t);k.appendChild(n);n=document.createElement("tr");m=document.createElement("td");t=document.createElement("td");mxUtils.write(m,mxResources.get("rotation")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=1==c.length?mxUtils.getValue(d.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";t.appendChild(y);n.appendChild(m);n.appendChild(t);k.appendChild(n);e.appendChild(k);g.appendChild(e); +b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var C=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var b=0;b<c.length;b++){var e=d.getCellGeometry(c[b]);null!=e&&(e=e.clone(),d.isCellMovable(c[b])&&(e.relative=f.checked,0<mxUtils.trim(l.value).length&&(e.x=Number(l.value)),0<mxUtils.trim(p.value).length&&(e.y=Number(p.value)),0<mxUtils.trim(u.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.x= +Number(u.value)),0<mxUtils.trim(v.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.y=Number(v.value))),d.isCellResizable(c[b])&&(0<mxUtils.trim(q.value).length&&(e.width=Number(q.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),d.getModel().setGeometry(c[b],e));0<mxUtils.trim(y.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[c[b]])}}finally{d.getModel().endUpdate()}});C.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13== +a.keyCode&&C.click()});e=document.createElement("div");e.style.marginTop="20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(b),e.appendChild(C)):(e.appendChild(C),e.appendChild(b));g.appendChild(e);this.container=g},LibraryDialog=function(a,c,d,b,g,e){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function n(b,c,d,l,p,e,g,m,A){try{if(a.spinner.stop(), null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==q[b]){var B=function(){E.innerHTML="";E.style.cursor="pointer";E.style.whiteSpace="nowrap";E.style.textOverflow="ellipsis";mxUtils.write(E,null!=J.title&&0<J.title.length?J.title:mxResources.get("untitled"));E.style.color=null==J.title||0==J.title.length?"#d0d0d0":""};u.style.backgroundImage="";v.style.display="none";var F=p,D=e;if(p>a.maxImageSize||e>a.maxImageSize){var y=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/ Math.max(1,e));p*=y;e*=y}F>D?(D=Math.round(100*D/F),F=100):(F=Math.round(100*F/D),D=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var t=document.createElement("img");t.setAttribute("src",I.convert(b));t.style.width=F+"px";t.style.height=D+"px";t.style.margin="10px";t.style.paddingBottom= Math.floor((100-D)/2)+"px";t.style.paddingLeft=Math.floor((100-F)/2)+"px";H.appendChild(t)}else if(null!=g){var G=a.stringToCells(Graph.decompress(g.xml));0<G.length&&(a.sidebar.createThumb(G,100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var K=document.createElement("img");K.setAttribute("src",Editor.closeImage);K.setAttribute("border","0");K.setAttribute("title",mxResources.get("delete"));K.setAttribute("align","top");K.style.paddingTop= @@ -8476,71 +8477,71 @@ mxEvent.addListener(E,"click",G);mxEvent.addListener(H,"dblclick",G);u.appendChi "dragend",function(a){"hidden"==K.style.visibility&&(K.style.visibility="",E.style.visibility="");z=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else x||(x=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(F=mxUtils.parseXml(b),"mxlibrary"==F.documentElement.nodeName){D=JSON.parse(mxUtils.getTextContent(F.documentElement));if(null!=D&&0<D.length)for(var O=0;O<D.length;O++)null!=D[O].xml?n(null,null,0,0,0,0,D[O]):n(D[O].data,null,0,0, D[O].w,D[O].h,null,"fixed",D[O].title);p=!0}else if("mxfile"==F.documentElement.nodeName){for(var R=F.documentElement.getElementsByTagName("diagram"),O=0;O<R.length;O++){var D=mxUtils.getTextContent(R[O]),G=a.stringToCells(Graph.decompress(D)),Z=a.editor.graph.getBoundingBoxFromGeometry(G);n(null,null,0,0,0,0,{xml:D,w:Z.width,h:Z.height})}p=!0}}catch(da){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(da){}return null}function m(a){a.dataTransfer.dropEffect= null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function t(b){b.stopPropagation();b.preventDefault();x=!1;y=k(b);if(null!=z)null!=y&&y<u.children.length?(f.splice(y>z?y-1:y,0,f.splice(z,1)[0]),u.insertBefore(u.children[z],u.children[y])):(f.push(f.splice(z,1)[0]),u.appendChild(u.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,A(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list")); -(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){n(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var f=[];c=document.createElement("div");c.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="40px";c.appendChild(l);mxUtils.write(l,mxResources.get("filename")+":");null==d&&(d=a.defaultLibraryName+".xml");var p=document.createElement("input"); -p.setAttribute("value",d);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==g||g.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};l.appendChild(p);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop= -"6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));c.appendChild(v);var q={},z=null,y=null, -C=null;d=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",d);mxEvent.addListener(u,"pointerdown",d);mxEvent.addListener(u,"touchstart",d);var I=new mxUrlConverter,x=!1;if(null!=b)for(d=0;d<b.length;d++)l=b[d],n(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(a){v.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==v){a.stopPropagation();a.preventDefault(); -break}b=b.parentNode}});var A=function(b){return function(c,f,d,l,p,e,g,q,k){null!=k&&(/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name))?a.importVisio(k,mxUtils.bind(this,function(a){n(a,f,d,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," "))})):null!=k&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,k.name)?a.parseFile(k,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(n(c.responseText, -f,d,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(n(c,f,d,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",m);mxEvent.addListener(u,"drop",t);mxEvent.addListener(v,"dragover",m);mxEvent.addListener(v,"drop",t);c.appendChild(u);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px"; -d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});d.setAttribute("id","btnCancel");d.className="geBtn";a.editor.cancelFirst&&b.appendChild(d);l=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(f),c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});l.setAttribute("id", -"btnDownload");l.className="geBtn";b.appendChild(l);if(Graph.fileSupport){if(null==a.libDlgFileInputElt){var D=document.createElement("input");D.setAttribute("multiple","multiple");D.setAttribute("type","file");mxEvent.addListener(D,"change",function(b){x=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,c,f,d,l,p,e,g,q){null!=D.files&&(A(b)(a,c,f,d,l,p,e,g,q),D.type="",D.type="file",D.value="")});u.scrollTop=u.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt= -D}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);a.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");l.className="geBtn";b.appendChild(l)}l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=C&&(C(),C=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){x=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}n(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})}); -l.setAttribute("id","btnAddImageUrl");l.className="geBtn";b.appendChild(l);this.saveBtnClickHandler=function(b,c,f,d){a.saveLibrary(b,c,f,d)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(p.value,f,g,e)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";b.appendChild(l);a.editor.cancelFirst||b.appendChild(d);c.appendChild(b);this.container=c},EditShapeDialog=function(a,d,c,b,g){b=null!=b?b:300;g=null!=g?g:120;var e, -k,n=document.createElement("table"),m=document.createElement("tbody");n.style.cellPadding="4px";e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,c);e.appendChild(k);m.appendChild(e);e=document.createElement("tr");k=document.createElement("td");var t=document.createElement("textarea");t.style.outline="none";t.style.resize="none";t.style.width=b-200+"px";t.style.height=g+"px";this.textarea=t;this.init=function(){t.focus(); -t.scrollTop=0};k.appendChild(t);e.appendChild(k);k=document.createElement("td");c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.top="6px";c.style.width="200px";c.style.height=g+4+"px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);k.appendChild(c);var f=new Graph(c);f.setEnabled(!1);var l=a.editor.graph.cloneCell(d);f.addCells([l]);c=f.view.getState(l);var p="";null!=c.shape&&null!=c.shape.stencil&&(p=mxUtils.getPrettyXml(c.shape.stencil.desc)); -mxUtils.write(t,p||"");c=f.getGraphBounds();g=Math.min(160/c.width,(g-40)/c.height);f.view.scaleAndTranslate(g,20/g-c.x,20/g-c.y);e.appendChild(k);m.appendChild(e);e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");a.isOffline()||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),g.className="geBtn", -k.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&k.appendChild(g);var u=function(b,c,f){var d=t.value,l=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(l.documentElement),l=l.documentElement.getElementsByTagName("parsererror");if(null!=l&&0<l.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(f&&a.hideDialog(),l=!b.model.contains(c),!f||l||d!=p){d=Graph.compress(d); -b.getModel().beginUpdate();try{if(l){var e=a.editor.graph.getFreeInsertPoint();c.geometry.x=e.x;c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[c])}catch(x){throw x;}finally{b.getModel().endUpdate()}l&&(b.setSelectionCell(c),b.scrollCellToVisible(c))}};c=mxUtils.button(mxResources.get("preview"),function(){u(f,l,!1)});c.className="geBtn";k.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,d,!0)});c.className="geBtn gePrimaryBtn"; -k.appendChild(c);a.editor.cancelFirst||k.appendChild(g);e.appendChild(k);m.appendChild(e);n.appendChild(m);this.container=n},CustomDialog=function(a,d,c,b,g,e,k,n){var m=document.createElement("div");m.appendChild(d);d=document.createElement("div");d.style.marginTop="16px";d.style.textAlign="center";null!=k&&d.appendChild(k);a.isOffline()||null==e||(k=mxUtils.button(mxResources.get("help"),function(){a.openLink(e)}),k.className="geBtn",d.appendChild(k));k=mxUtils.button(mxResources.get("cancel"), -function(){a.hideDialog();null!=b&&b()});k.className="geBtn";n&&(k.style.display="none");a.editor.cancelFirst&&d.appendChild(k);g=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c()});d.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(k);m.appendChild(d);this.cancelBtn=k;this.okButton=g;this.container=m},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+ +(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){n(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var f=[];d=document.createElement("div");d.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="40px";d.appendChild(l);mxUtils.write(l,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input"); +p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==g||g.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};l.appendChild(p);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop= +"6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));d.appendChild(v);var q={},z=null,y=null, +C=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",c);mxEvent.addListener(u,"pointerdown",c);mxEvent.addListener(u,"touchstart",c);var I=new mxUrlConverter,x=!1;if(null!=b)for(c=0;c<b.length;c++)l=b[c],n(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(a){v.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==v){a.stopPropagation();a.preventDefault(); +break}b=b.parentNode}});var A=function(b){return function(c,d,f,l,p,e,g,q,k){null!=k&&(/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name))?a.importVisio(k,mxUtils.bind(this,function(a){n(a,d,f,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," "))})):null!=k&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,k.name)?a.parseFile(k,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(n(c.responseText, +d,f,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(n(c,d,f,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",m);mxEvent.addListener(u,"drop",t);mxEvent.addListener(v,"dragover",m);mxEvent.addListener(v,"drop",t);d.appendChild(u);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px"; +c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);l=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(f),c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});l.setAttribute("id", +"btnDownload");l.className="geBtn";b.appendChild(l);if(Graph.fileSupport){if(null==a.libDlgFileInputElt){var D=document.createElement("input");D.setAttribute("multiple","multiple");D.setAttribute("type","file");mxEvent.addListener(D,"change",function(b){x=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,c,d,f,l,p,e,g,q){null!=D.files&&(A(b)(a,c,d,f,l,p,e,g,q),D.type="",D.type="file",D.value="")});u.scrollTop=u.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt= +D}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);a.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");l.className="geBtn";b.appendChild(l)}l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=C&&(C(),C=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){x=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}n(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})}); +l.setAttribute("id","btnAddImageUrl");l.className="geBtn";b.appendChild(l);this.saveBtnClickHandler=function(b,c,d,f){a.saveLibrary(b,c,d,f)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(p.value,f,g,e)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";b.appendChild(l);a.editor.cancelFirst||b.appendChild(c);d.appendChild(b);this.container=d},EditShapeDialog=function(a,c,d,b,g){b=null!=b?b:300;g=null!=g?g:120;var e, +k,n=document.createElement("table"),m=document.createElement("tbody");n.style.cellPadding="4px";e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,d);e.appendChild(k);m.appendChild(e);e=document.createElement("tr");k=document.createElement("td");var t=document.createElement("textarea");t.style.outline="none";t.style.resize="none";t.style.width=b-200+"px";t.style.height=g+"px";this.textarea=t;this.init=function(){t.focus(); +t.scrollTop=0};k.appendChild(t);e.appendChild(k);k=document.createElement("td");d=document.createElement("div");d.style.position="relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=g+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);k.appendChild(d);var f=new Graph(d);f.setEnabled(!1);var l=a.editor.graph.cloneCell(c);f.addCells([l]);d=f.view.getState(l);var p="";null!=d.shape&&null!=d.shape.stencil&&(p=mxUtils.getPrettyXml(d.shape.stencil.desc)); +mxUtils.write(t,p||"");d=f.getGraphBounds();g=Math.min(160/d.width,(g-40)/d.height);f.view.scaleAndTranslate(g,20/g-d.x,20/g-d.y);e.appendChild(k);m.appendChild(e);e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");a.isOffline()||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),g.className="geBtn", +k.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&k.appendChild(g);var u=function(b,c,d){var f=t.value,l=mxUtils.parseXml(f),f=mxUtils.getPrettyXml(l.documentElement),l=l.documentElement.getElementsByTagName("parsererror");if(null!=l&&0<l.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),l=!b.model.contains(c),!d||l||f!=p){f=Graph.compress(f); +b.getModel().beginUpdate();try{if(l){var e=a.editor.graph.getFreeInsertPoint();c.geometry.x=e.x;c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+f+")",[c])}catch(x){throw x;}finally{b.getModel().endUpdate()}l&&(b.setSelectionCell(c),b.scrollCellToVisible(c))}};d=mxUtils.button(mxResources.get("preview"),function(){u(f,l,!1)});d.className="geBtn";k.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,c,!0)});d.className="geBtn gePrimaryBtn"; +k.appendChild(d);a.editor.cancelFirst||k.appendChild(g);e.appendChild(k);m.appendChild(e);n.appendChild(m);this.container=n},CustomDialog=function(a,c,d,b,g,e,k,n){var m=document.createElement("div");m.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=k&&c.appendChild(k);a.isOffline()||null==e||(k=mxUtils.button(mxResources.get("help"),function(){a.openLink(e)}),k.className="geBtn",c.appendChild(k));k=mxUtils.button(mxResources.get("cancel"), +function(){a.hideDialog();null!=b&&b()});k.className="geBtn";n&&(k.style.display="none");a.editor.cancelFirst&&c.appendChild(k);g=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});c.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(k);m.appendChild(c);this.cancelBtn=k;this.okButton=g;this.container=m},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+ mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+ mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTempDlgDiagramsList"><div class="geTempDlgDiagramsListHeader"><div class="geTempDlgDiagramsListTitle"></div><div class="geTempDlgDiagramsListBtns"><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge" data-id="myDiagramsBtn"><img src="/images/my-diagrams.svg" class="geTempDlgMyDiagramsBtnImg"> <span>'+mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+ mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">🛈 '+ -mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",d=document.createElement("div");d.innerHTML=a;d.className="geTemplateDlg"; -var a=window.innerWidth,c=window.innerHeight,b=987,g=712;.9*a<b&&(b=Math.max(.9*a,600),d.style.width=b+"px");.9*c<g&&(g=Math.max(.9*c,300),d.style.height=g+"px");this.width=b;this.height=g;this.container=d}; -TemplatesDialog.prototype.init=function(a,d,c,b,g,e,k,n,m,t){function f(){null!=F&&(F.style.fontWeight="normal",F.style.textDecoration="none",F=null)}function l(a,b,c,f,d,l,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";A.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");A.querySelector("."+b).src="/images/"+c+"-sel.svg";A.querySelector("."+d).src="/images/"+ -l+".svg";return!0}function p(a){function b(a){W.removeChild(f);A.removeChild(c);W.scrollTop=l}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";A.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn"; -a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var l=W.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);W.appendChild(f);W.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function u(a,b,c){if(null!=G){for(var f=G.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}G.className=f.join(" ")}null!=a?(G=a,G.className+=" "+b,H=c,Y.className="geTempDlgCreateBtn"):(H=G=null,Y.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")} -function v(b){if(null!=H){var c=H;H=null;Y.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";c.isExternal?(1==b?t(c.url,c,"nameInput.value"):m(c.url,c,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+c.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(d(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function q(a){a=a?"":"none";for(var b=A.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display= -a}function z(a,b,c){function f(){Y.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));q(!b)}U.innerHTML="";u();O=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var l=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));l.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML= -mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));l.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));l.appendChild(e);d.appendChild(l);U.appendChild(d)}for(l=0;l<a.length;l++){a[l].isExternal=!b;var g=a[l].url,e=mxUtils.htmlEntities(a[l].title),k=a[l].tooltip||a[l].title,x=a[l].imgUrl,B=mxUtils.htmlEntities(a[l].changedBy||""),n=mxUtils.htmlEntities(a[l].lastModifiedOn|| +mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg"; +var a=window.innerWidth,d=window.innerHeight,b=987,g=712;.9*a<b&&(b=Math.max(.9*a,600),c.style.width=b+"px");.9*d<g&&(g=Math.max(.9*d,300),c.style.height=g+"px");this.width=b;this.height=g;this.container=c}; +TemplatesDialog.prototype.init=function(a,c,d,b,g,e,k,n,m,t){function f(){null!=F&&(F.style.fontWeight="normal",F.style.textDecoration="none",F=null)}function l(a,b,c,d,f,l,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";A.querySelector(".geTempDlgRadioBtn[data-id="+d+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");A.querySelector("."+b).src="/images/"+c+"-sel.svg";A.querySelector("."+f).src="/images/"+ +l+".svg";return!0}function p(a){function b(a){W.removeChild(d);A.removeChild(c);W.scrollTop=l}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";A.appendChild(c);var d=document.createElement("div");d.className="geTempDlgDiagramPreviewBox";var f=document.createElement("img");f.src=a;d.appendChild(f);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn"; +a.setAttribute("title",mxResources.get("close"));d.appendChild(a);var l=W.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);W.appendChild(d);W.scrollTop=0;d.style.lineHeight=d.clientHeight+"px"}function u(a,b,c){if(null!=G){for(var d=G.className.split(" "),f=0;f<d.length;f++)if(-1<d[f].indexOf("Active")){d.splice(f,1);break}G.className=d.join(" ")}null!=a?(G=a,G.className+=" "+b,H=c,Y.className="geTempDlgCreateBtn"):(H=G=null,Y.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")} +function v(b){if(null!=H){var d=H;H=null;Y.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";d.isExternal?(1==b?t(d.url,d,"nameInput.value"):m(d.url,d,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+d.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function q(a){a=a?"":"none";for(var b=A.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display= +a}function z(a,b,c){function d(){Y.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));q(!b)}U.innerHTML="";u();O=a;var f=null;if(c){f=document.createElement("table");f.className="geTempDlgDiagramsListGrid";var l=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));l.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML= +mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));l.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));l.appendChild(e);f.appendChild(l);U.appendChild(f)}for(l=0;l<a.length;l++){a[l].isExternal=!b;var g=a[l].url,e=mxUtils.htmlEntities(a[l].title),k=a[l].tooltip||a[l].title,x=a[l].imgUrl,B=mxUtils.htmlEntities(a[l].changedBy||""),n=mxUtils.htmlEntities(a[l].lastModifiedOn|| "");x||(x=TEMPLATE_PATH+"/"+g.substring(0,g.length-4)+".png");g=c?50:15;null!=e&&e.length>g&&(e=e.substring(0,g)+"…");if(c){var m=document.createElement("tr"),x=document.createElement("td"),A=document.createElement("img");A.src="/images/icon-search.svg";A.className="geTempDlgDiagramListPreviewBtn";A.setAttribute("title",mxResources.get("preview"));x.appendChild(A);k=document.createElement("span");k.className="geTempDlgDiagramTitle";k.innerHTML=e;x.appendChild(k);m.appendChild(x);x=document.createElement("td"); -x.innerHTML=B;m.appendChild(x);x=document.createElement("td");x.innerHTML=n;m.appendChild(x);d.appendChild(m);null==G&&(f(),u(m,"geTempDlgDiagramsListGridActive",a[l]));(function(a,b){mxEvent.addListener(m,"click",function(){G!=b&&(f(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(m,"dblclick",v);mxEvent.addListener(A,"click",function(){p(a)})})(a[l],m)}else{var D=document.createElement("div");D.className="geTempDlgDiagramTile";D.setAttribute("title",k);null==G&&(f(),u(D,"geTempDlgDiagramTileActive", +x.innerHTML=B;m.appendChild(x);x=document.createElement("td");x.innerHTML=n;m.appendChild(x);f.appendChild(m);null==G&&(d(),u(m,"geTempDlgDiagramsListGridActive",a[l]));(function(a,b){mxEvent.addListener(m,"click",function(){G!=b&&(d(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(m,"dblclick",v);mxEvent.addListener(A,"click",function(){p(a)})})(a[l],m)}else{var D=document.createElement("div");D.className="geTempDlgDiagramTile";D.setAttribute("title",k);null==G&&(d(),u(D,"geTempDlgDiagramTileActive", a[l]));B=document.createElement("div");B.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var y=document.createElement("img");y.style.display="none";(function(a,b){y.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};y.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(y,B);y.src=x;B.appendChild(y);D.appendChild(B);B=document.createElement("div");B.className="geTempDlgDiagramTileLbl";B.innerHTML=null!=e?e:"";D.appendChild(B); -A=document.createElement("img");A.src="/images/icon-search.svg";A.className="geTempDlgDiagramPreviewBtn";A.setAttribute("title",mxResources.get("preview"));D.appendChild(A);(function(a,b){mxEvent.addListener(D,"click",function(){G!=b&&(f(),u(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(D,"dblclick",v);mxEvent.addListener(A,"click",function(){p(a)})})(a[l],D);U.appendChild(D)}}}function y(a,b){ba.innerHTML="";u();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory= -!0;var l=document.createElement("div"),p=mxResources.get(d.title);null==p&&(p=d.title.substring(0,1).toUpperCase()+d.title.substring(1));l.className="geTempDlgNewDiagramCatItem";l.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"…");null==G&&(Y.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),q(),u(l,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img"); -g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);l.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;l.appendChild(e);ba.appendChild(l);(function(a,b){mxEvent.addListener(l,"click",function(){G!=b&&(Y.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),q(),u(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(l,"dblclick",v)})(d,l)}X.style.display=5>a.length?"none":""}function C(a){var b=A.querySelector(".geTemplatesList"), -c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),l=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",d+" ("+l.length+")");d=mxUtils.htmlEntities(d);15<d.length&&(d=d.substring(0,15)+"…");f.innerHTML=d+" ("+l.length+")";b.appendChild(f);(function(b,c,d){mxEvent.addListener(f,"click",function(){F!=d&&(null!=F?(F.style.fontWeight="normal",F.style.textDecoration="none"):(fa.style.display="none",ga.style.minHeight= -"100%"),F=d,F.style.fontWeight="bold",F.style.textDecoration="underline",W.scrollTop=0,D&&(B=!0),L.innerHTML=c,V.style.display="none",z(a[b],!0))})})(c,d,f)}}function I(a){k&&(W.scrollTop=0,U.innerHTML="",aa.spin(U),B=!1,D=!0,L.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),R=null,k(M,a?null:e))}function x(a){f();W.scrollTop=0;U.innerHTML="";aa.spin(U);B=!1;D=!0;ea=null;L.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+ +A=document.createElement("img");A.src="/images/icon-search.svg";A.className="geTempDlgDiagramPreviewBtn";A.setAttribute("title",mxResources.get("preview"));D.appendChild(A);(function(a,b){mxEvent.addListener(D,"click",function(){G!=b&&(d(),u(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(D,"dblclick",v);mxEvent.addListener(A,"click",function(){p(a)})})(a[l],D);U.appendChild(D)}}}function y(a,b){ba.innerHTML="";u();for(var c=!b&&5<a.length?5:a.length,d=0;d<c;d++){var f=a[d];f.isCategory= +!0;var l=document.createElement("div"),p=mxResources.get(f.title);null==p&&(p=f.title.substring(0,1).toUpperCase()+f.title.substring(1));l.className="geTempDlgNewDiagramCatItem";l.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"…");null==G&&(Y.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),q(),u(l,"geTempDlgNewDiagramCatItemActive",f));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img"); +g.src=NEW_DIAGRAM_CATS_PATH+"/"+f.img;e.appendChild(g);l.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;l.appendChild(e);ba.appendChild(l);(function(a,b){mxEvent.addListener(l,"click",function(){G!=b&&(Y.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),q(),u(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(l,"dblclick",v)})(f,l)}X.style.display=5>a.length?"none":""}function C(a){var b=A.querySelector(".geTemplatesList"), +c;for(c in a){var d=document.createElement("div"),f=mxResources.get(c),l=a[c];null==f&&(f=c.substring(0,1).toUpperCase()+c.substring(1));d.className="geTemplateCatLink";d.setAttribute("title",f+" ("+l.length+")");f=mxUtils.htmlEntities(f);15<f.length&&(f=f.substring(0,15)+"…");d.innerHTML=f+" ("+l.length+")";b.appendChild(d);(function(b,c,f){mxEvent.addListener(d,"click",function(){F!=f&&(null!=F?(F.style.fontWeight="normal",F.style.textDecoration="none"):(fa.style.display="none",ga.style.minHeight= +"100%"),F=f,F.style.fontWeight="bold",F.style.textDecoration="underline",W.scrollTop=0,D&&(B=!0),L.innerHTML=c,V.style.display="none",z(a[b],!0))})})(c,f,d)}}function I(a){k&&(W.scrollTop=0,U.innerHTML="",aa.spin(U),B=!1,D=!0,L.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),R=null,k(M,a?null:e))}function x(a){f();W.scrollTop=0;U.innerHTML="";aa.spin(U);B=!1;D=!0;ea=null;L.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+ mxUtils.htmlEntities(a)+'"';n(a,M,E?null:e);R=a}b=null!=b?b:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var A=this.container,D=!1,B=!1,F=null,G=null,H=null,J=!1,E=!0,K=!1,O=[],R,X=A.querySelector(".geTempDlgShowAllBtn"),U=A.querySelector(".geTempDlgDiagramsTiles"),L=A.querySelector(".geTempDlgDiagramsListTitle"),V=A.querySelector(".geTempDlgDiagramsListBtns"),W=A.querySelector(".geTempDlgContent"),ga=A.querySelector(".geTempDlgDiagramsList"),fa=A.querySelector(".geTempDlgNewDiagramCat"), ba=A.querySelector(".geTempDlgNewDiagramCatList"),Y=A.querySelector(".geTempDlgCreateBtn"),aa=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(A.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();fa.style.display="";ga.style.minHeight="calc(100% - 280px)";I(E)});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){l(this,"geTempDlgAllDiagramsBtnImg", "all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(E=!0,null==R?I(E):x(R))});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){l(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(E=!1,null==R?I(E):x(R))});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){l(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg", "tiles",!1)&&(K=!0,z(O,!1,K))});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){l(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(O,!1,K))});mxEvent.addListener(X,"click",function(){J?(fa.style.height="280px",ba.style.height="190px",X.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(da)):(fa.style.height="440px",ba.style.height="355px",X.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess", null,"- Show less")),y(da,!0));J=!J});var P=!1,ca=!1,Z={},da=[],Q=1;mxUtils.get(b,function(a){if(!P){P=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=Z[b];null==c&&(Q++,c=[],Z[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a= a.nextSibling}C(Z)}});mxUtils.get(g,function(a){if(!ca){ca=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&da.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;y(da)}});var M=function(a,b){V.style.display="";aa.stop();D=!1;B?B=!1:b?U.innerHTML=b:0==a.length?U.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")): -z(a,!1,K)};I(E);var ea=null;n&&mxEvent.addListener(A.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?x(b.value):ea=setTimeout(function(){x(b.value)},500)});mxEvent.addListener(Y,"click",v);mxEvent.addListener(A.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){v(!0)});mxEvent.addListener(A.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=c&&c();a.hideDialog(!0)})}; -var BtnDialog=function(a,d,c,b){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("done"));var k="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";d==a.drive?(k=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):d==a.dropbox? -(k=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):d==a.oneDrive?(k=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):d==a.gitHub?(k=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):d==a.gitLab?(k=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg"):d==a.trello&&(k=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[k],"You are now authorized in {1}")); -c=mxUtils.button(c,b);c.insertBefore(n,c.firstChild);c.style.marginTop="6px";c.className="geBigButton";c.style.fontSize="18px";c.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(c);this.container=g},FontDialog=function(a,d,c,b,g){function e(a){this.style.border="";13==a.keyCode&&C.click()}var k,n,m,t=document.createElement("table"),f=document.createElement("tbody");t.style.marginTop="8px";k=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace= +z(a,!1,K)};I(E);var ea=null;n&&mxEvent.addListener(A.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?x(b.value):ea=setTimeout(function(){x(b.value)},500)});mxEvent.addListener(Y,"click",v);mxEvent.addListener(A.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){v(!0)});mxEvent.addListener(A.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=d&&d();a.hideDialog(!0)})}; +var BtnDialog=function(a,c,d,b){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("done"));var k="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";c==a.drive?(k=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox? +(k=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(k=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(k=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(k=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg"):c==a.trello&&(k=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[k],"You are now authorized in {1}")); +d=mxUtils.button(d,b);d.insertBefore(n,d.firstChild);d.style.marginTop="6px";d.className="geBigButton";d.style.fontSize="18px";d.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(d);this.container=g},FontDialog=function(a,c,d,b,g){function e(a){this.style.border="";13==a.keyCode&&C.click()}var k,n,m,t=document.createElement("table"),f=document.createElement("tbody");t.style.marginTop="8px";k=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace= "nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;";l.setAttribute("value","sysfonts");l.setAttribute("type","radio");l.setAttribute("name","current-fontdialog");l.setAttribute("id","fontdialog-sysfonts");n.appendChild(l);m=document.createElement("label");m.setAttribute("for","fontdialog-sysfonts");mxUtils.write(m,mxResources.get("sysFonts",null,"System Fonts"));n.appendChild(m);k.appendChild(n);f.appendChild(k); -k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");k.appendChild(n);var p=document.createElement("input");"s"==b&&p.setAttribute("value",d);p.style.marginLeft="4px";p.style.width="250px";p.className="dlg_fontName_s";n=document.createElement("td");n.appendChild(p);k.appendChild(n);f.appendChild(k);k=document.createElement("tr"); +k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");k.appendChild(n);var p=document.createElement("input");"s"==b&&p.setAttribute("value",c);p.style.marginLeft="4px";p.style.width="250px";p.className="dlg_fontName_s";n=document.createElement("td");n.appendChild(p);k.appendChild(n);f.appendChild(k);k=document.createElement("tr"); n=document.createElement("td");n.colSpan=2;n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","googlefonts");u.setAttribute("type","radio");u.setAttribute("name","current-fontdialog");u.setAttribute("id","fontdialog-googlefonts");n.appendChild(u);m=document.createElement("label");m.setAttribute("for","fontdialog-googlefonts");mxUtils.write(m,mxResources.get("googleFonts", -null,"Google Fonts"));n.appendChild(m);k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");k.appendChild(n);var v=document.createElement("input");"g"==b&&v.setAttribute("value",d);v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontName_g";n=document.createElement("td");n.appendChild(v); +null,"Google Fonts"));n.appendChild(m);k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");k.appendChild(n);var v=document.createElement("input");"g"==b&&v.setAttribute("value",c);v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontName_g";n=document.createElement("td");n.appendChild(v); k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;";q.setAttribute("value","webfonts");q.setAttribute("type","radio");q.setAttribute("name","current-fontdialog");q.setAttribute("id","fontdialog-webfonts");n.appendChild(q);m=document.createElement("label");m.setAttribute("for", -"fontdialog-webfonts");mxUtils.write(m,mxResources.get("webfonts",null,"Web Fonts"));n.appendChild(m);k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");k.appendChild(n);var z=document.createElement("input");"w"==b&&z.setAttribute("value",d);z.style.marginLeft="4px";z.style.width="250px"; -z.className="dlg_fontName_w";n=document.createElement("td");n.appendChild(z);k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontUrl",null,"Font URL")+":");k.appendChild(n);var y=document.createElement("input");y.setAttribute("value",c||"");y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontUrl";n=document.createElement("td"); -n.appendChild(y);k.appendChild(n);f.appendChild(k);this.init=function(){var a=p;"g"==b?a=v:"w"==b&&(a=z);a.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?a.select():document.execCommand("selectAll",!1,null)};k=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.paddingTop="20px";n.style.whiteSpace="nowrap";n.setAttribute("align","right");a.isOffline()||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}), -d.className="geBtn",n.appendChild(d));d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";a.editor.cancelFirst&&n.appendChild(d);var C=mxUtils.button(mxResources.get("apply"),function(){var b,c,f;l.checked?(b=p.value,f="s"):u.checked?(b=v.value,c=Editor.GOOGLE_FONTS+encodeURIComponent(b).replace(/%20/g,"+"),f="g"):q.checked&&(b=z.value,c=y.value,f="w");var d;d=c;var e=f,k=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null== -b||0==b.length?(t.querySelector(".dlg_fontName_"+e).style.border="1px solid red",d=!1):"w"!=e||k.test(d)?d=!0:(t.querySelector(".dlg_fontUrl").style.border="1px solid red",d=!1);d&&(g(b,c,f),a.hideDialog())});C.className="geBtn gePrimaryBtn";mxEvent.addListener(p,"keypress",e);mxEvent.addListener(v,"keypress",e);mxEvent.addListener(z,"keypress",e);mxEvent.addListener(y,"keypress",e);mxEvent.addListener(p,"focus",function(){l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(v,"focus", -function(){u.setAttribute("checked","checked");u.checked=!0});mxEvent.addListener(z,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(y,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});n.appendChild(C);a.editor.cancelFirst||n.appendChild(d);k.appendChild(n);f.appendChild(k);t.appendChild(f);this.container=t}; -function AspectDialog(a,d,c,b,g){this.aspect={pageId:d||a.pages[0].getId(),layerIds:c||[]};d=document.createElement("div");var e=document.createElement("h5");e.style.margin="0 0 10px";mxUtils.write(e,mxResources.get("pages"));d.appendChild(e);c=document.createElement("div");c.className="geAspectDlgList";d.appendChild(c);e=document.createElement("h5");e.style.margin="0 0 10px";mxUtils.write(e,mxResources.get("layers"));d.appendChild(e);e=document.createElement("div");e.className="geAspectDlgList"; -d.appendChild(e);this.pagesContainer=c;this.layersContainer=e;this.ui=a;c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});e.className="geBtn";a.editor.cancelFirst&&c.appendChild(e);var k=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();b({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));c.appendChild(k);k.className="geBtn gePrimaryBtn"; -a.editor.cancelFirst||c.appendChild(e);k.setAttribute("disabled","disabled");this.okBtn=k;d.appendChild(c);this.container=d}AspectDialog.prototype.init=function(){this.ui.getFileData(!0);for(var a=0;a<this.ui.pages.length;a++){var d=this.ui.updatePageRoot(this.ui.pages[a]);this.createPageItem(d.getId(),d.getName(),d.node,d.root)}}; -AspectDialog.prototype.createViewer=function(a,d,c){mxEvent.disableContextMenu(a);a.style.userSelect="none";var b=new Graph(a);b.setTooltips(!1);b.setEnabled(!1);b.setPanning(!1);b.minFitScale=null;b.maxFitScale=null;b.centerZoom=!0;d=Editor.parseDiagramNode(d);if(null!=d){var g=d.getAttribute("background");if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";a.style.backgroundColor=g;g=new mxCodec(d.ownerDocument);a=b.getModel();g.decode(d,a);d=a.getChildCount(a.root);for(var g=null==c,e=0;e<d;e++){var k= -a.getChildAt(a.root,e);a.setVisible(k,g||c==k.id)}b.maxFitScale=1;b.fit(0);b.center()}return b}; -AspectDialog.prototype.createPageItem=function(a,d,c,b){var g=document.createElement("div");g.className="geAspectDlgListItem";g.setAttribute("data-page-id",a);g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+d+"</div>";this.pagesContainer.appendChild(g);var e=this.createViewer(g.childNodes[0],c);d=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=g;this.selectedPage=a; -g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerHTML="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");for(var b=e.model,b=b.getChildCells(b.getRoot()),d=0;d<b.length;d++)this.createLayerItem(b[d],a,e,c)});mxEvent.addListener(g,"click",d);this.aspect.pageId==a&&d()}; -AspectDialog.prototype.createLayerItem=function(a,d,c,b){d=c.convertValueToString(a)||mxResources.get("background")||"Background";var g=document.createElement("div");g.setAttribute("data-layer-id",a.id);g.className="geAspectDlgListItem";g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+d+"</div>";this.layersContainer.appendChild(g);this.createViewer(g.childNodes[0],b,a.id);b=mxUtils.bind(this,function(){0<=g.className.indexOf("geAspectDlgListItemSelected")? +"fontdialog-webfonts");mxUtils.write(m,mxResources.get("webfonts",null,"Web Fonts"));n.appendChild(m);k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");k.appendChild(n);var z=document.createElement("input");"w"==b&&z.setAttribute("value",c);z.style.marginLeft="4px";z.style.width="250px"; +z.className="dlg_fontName_w";n=document.createElement("td");n.appendChild(z);k.appendChild(n);f.appendChild(k);k=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontUrl",null,"Font URL")+":");k.appendChild(n);var y=document.createElement("input");y.setAttribute("value",d||"");y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontUrl";n=document.createElement("td"); +n.appendChild(y);k.appendChild(n);f.appendChild(k);this.init=function(){var a=p;"g"==b?a=v:"w"==b&&(a=z);a.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?a.select():document.execCommand("selectAll",!1,null)};k=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.paddingTop="20px";n.style.whiteSpace="nowrap";n.setAttribute("align","right");a.isOffline()||(c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}), +c.className="geBtn",n.appendChild(c));c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&n.appendChild(c);var C=mxUtils.button(mxResources.get("apply"),function(){var b,c,d;l.checked?(b=p.value,d="s"):u.checked?(b=v.value,c=Editor.GOOGLE_FONTS+encodeURIComponent(b).replace(/%20/g,"+"),d="g"):q.checked&&(b=z.value,c=y.value,d="w");var f;f=c;var e=d,k=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null== +b||0==b.length?(t.querySelector(".dlg_fontName_"+e).style.border="1px solid red",f=!1):"w"!=e||k.test(f)?f=!0:(t.querySelector(".dlg_fontUrl").style.border="1px solid red",f=!1);f&&(g(b,c,d),a.hideDialog())});C.className="geBtn gePrimaryBtn";mxEvent.addListener(p,"keypress",e);mxEvent.addListener(v,"keypress",e);mxEvent.addListener(z,"keypress",e);mxEvent.addListener(y,"keypress",e);mxEvent.addListener(p,"focus",function(){l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(v,"focus", +function(){u.setAttribute("checked","checked");u.checked=!0});mxEvent.addListener(z,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(y,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});n.appendChild(C);a.editor.cancelFirst||n.appendChild(c);k.appendChild(n);f.appendChild(k);t.appendChild(f);this.container=t}; +function AspectDialog(a,c,d,b,g){this.aspect={pageId:c||a.pages[0].getId(),layerIds:d||[]};c=document.createElement("div");var e=document.createElement("h5");e.style.margin="0 0 10px";mxUtils.write(e,mxResources.get("pages"));c.appendChild(e);d=document.createElement("div");d.className="geAspectDlgList";c.appendChild(d);e=document.createElement("h5");e.style.margin="0 0 10px";mxUtils.write(e,mxResources.get("layers"));c.appendChild(e);e=document.createElement("div");e.className="geAspectDlgList"; +c.appendChild(e);this.pagesContainer=d;this.layersContainer=e;this.ui=a;d=document.createElement("div");d.style.marginTop="16px";d.style.textAlign="center";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});e.className="geBtn";a.editor.cancelFirst&&d.appendChild(e);var k=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();b({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));d.appendChild(k);k.className="geBtn gePrimaryBtn"; +a.editor.cancelFirst||d.appendChild(e);k.setAttribute("disabled","disabled");this.okBtn=k;c.appendChild(d);this.container=c}AspectDialog.prototype.init=function(){this.ui.getFileData(!0);for(var a=0;a<this.ui.pages.length;a++){var c=this.ui.updatePageRoot(this.ui.pages[a]);this.createPageItem(c.getId(),c.getName(),c.node,c.root)}}; +AspectDialog.prototype.createViewer=function(a,c,d){mxEvent.disableContextMenu(a);a.style.userSelect="none";var b=new Graph(a);b.setTooltips(!1);b.setEnabled(!1);b.setPanning(!1);b.minFitScale=null;b.maxFitScale=null;b.centerZoom=!0;c=Editor.parseDiagramNode(c);if(null!=c){var g=c.getAttribute("background");if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";a.style.backgroundColor=g;g=new mxCodec(c.ownerDocument);a=b.getModel();g.decode(c,a);c=a.getChildCount(a.root);for(var g=null==d,e=0;e<c;e++){var k= +a.getChildAt(a.root,e);a.setVisible(k,g||d==k.id)}b.maxFitScale=1;b.fit(0);b.center()}return b}; +AspectDialog.prototype.createPageItem=function(a,c,d,b){var g=document.createElement("div");g.className="geAspectDlgListItem";g.setAttribute("data-page-id",a);g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+c+"</div>";this.pagesContainer.appendChild(g);var e=this.createViewer(g.childNodes[0],d);c=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=g;this.selectedPage=a; +g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerHTML="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");for(var b=e.model,b=b.getChildCells(b.getRoot()),c=0;c<b.length;c++)this.createLayerItem(b[c],a,e,d)});mxEvent.addListener(g,"click",c);this.aspect.pageId==a&&c()}; +AspectDialog.prototype.createLayerItem=function(a,c,d,b){c=d.convertValueToString(a)||mxResources.get("background")||"Background";var g=document.createElement("div");g.setAttribute("data-layer-id",a.id);g.className="geAspectDlgListItem";g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+c+"</div>";this.layersContainer.appendChild(g);this.createViewer(g.childNodes[0],b,a.id);b=mxUtils.bind(this,function(){0<=g.className.indexOf("geAspectDlgListItemSelected")? (g.className="geAspectDlgListItem",delete this.selectedLayers[a.id],0==Object.keys(this.selectedLayers).length&&this.okBtn.setAttribute("disabled","disabled")):(g.className+=" geAspectDlgListItemSelected",this.selectedLayers[a.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(g,"click",b);-1!=this.aspect.layerIds.indexOf(a.id)&&b()};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC": IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=": IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==": @@ -8585,10 +8586,10 @@ Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV Editor.prototype.setGraphXml=function(b){b=null!=b&&"mxlibrary"!=b.nodeName?this.extractGraphModel(b):null;if(null!=b){var c=b.getElementsByTagName("parsererror");if(null!=c&&0<c.length){var c=c[0],d=c.getElementsByTagName("div");null!=d&&0<d.length&&(c=d[0]);throw{message:mxUtils.getTextContent(c)};}if("mxGraphModel"==b.nodeName){c=b.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=c&&""!=c)c!=this.graph.currentStyle&&(d=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+ "/"+c+".xml").getDocumentElement(),null!=d&&(f=new mxCodec(d.ownerDocument),f.decode(d,this.graph.getStylesheet())));else if(d=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=d){var f=new mxCodec(d.ownerDocument);f.decode(d,this.graph.getStylesheet())}this.graph.currentStyle=c;this.graph.mathEnabled="1"==urlParams.math||"1"==b.getAttribute("math");c=b.getAttribute("backgroundImage");null!=c?(c=JSON.parse(c),this.graph.setBackgroundImage(new mxImage(c.src, c.width,c.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==b.getAttribute("shadow"),!1);if(c=b.getAttribute("extFonts"))try{for(c=c.split("|").map(function(a){a=a.split("^");return{name:a[0],url:a[1]}}),d=0;d<c.length;d++)this.graph.addExtFont(c[d].name, -c[d].url)}catch(J){console.log("ExtFonts format error: "+J.message)}}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var d=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var b=d.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&b.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&b.setAttribute("backgroundImage", -JSON.stringify(this.graph.backgroundImage));b.setAttribute("math",this.graph.mathEnabled?"1":"0");b.setAttribute("shadow",this.graph.shadowVisible?"1":"0");if(null!=this.graph.extFonts&&0<this.graph.extFonts.length){var c=this.graph.extFonts.map(function(a){return a.name+"^"+a.url});b.setAttribute("extFonts",c.join("|"))}return b};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b= -unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(H){}return!1};Editor.prototype.extractGraphModel=function(a,b,c){return Editor.extractGraphModel.apply(this,arguments)};var c=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0= -null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();c.apply(this,arguments)};var b=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){b.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?!0:this.originalNoForeignObject; +c[d].url)}catch(J){console.log("ExtFonts format error: "+J.message)}}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var c=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var b=c.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&b.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&b.setAttribute("backgroundImage", +JSON.stringify(this.graph.backgroundImage));b.setAttribute("math",this.graph.mathEnabled?"1":"0");b.setAttribute("shadow",this.graph.shadowVisible?"1":"0");if(null!=this.graph.extFonts&&0<this.graph.extFonts.length){var d=this.graph.extFonts.map(function(a){return a.name+"^"+a.url});b.setAttribute("extFonts",d.join("|"))}return b};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b= +unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(H){}return!1};Editor.prototype.extractGraphModel=function(a,b,c){return Editor.extractGraphModel.apply(this,arguments)};var d=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0= +null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();d.apply(this,arguments)};var b=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){b.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?!0:this.originalNoForeignObject; this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(a,b){a=null!=a?a:DRAW_MATH_URL+"/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){window.setTimeout(function(){"hidden"!=a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(b|| {jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],"HTML-CSS":{imageFont:null},TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};Editor.MathJaxRender=function(a){"undefined"!== typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var c=Editor.prototype.init;Editor.prototype.init=function(){c.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,b){null!=this.graph.container&&this.graph.mathEnabled&&!this.graph.blockMathRender&&Editor.MathJaxRender(this.graph.container)}))};var d=document.getElementsByTagName("script");if(null!=d&&0<d.length){var f= @@ -8727,7 +8728,7 @@ n.className="geBtn",p.appendChild(n));PrintDialog.previewEnabled&&(n=mxUtils.but this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(x.apply(this,arguments),null!=this.mathEnabled&& this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var A=document.createElement("canvas"),D=new Image;D.onload=function(){try{A.getContext("2d").drawImage(D,0,0);var a=A.toDataURL("image/png");Editor.prototype.useCanvasForExport= null!=a&&6<a.length}catch(F){}};D.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(B){}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="12.7.8";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars= +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="12.7.9";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars= "\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&& !EditorUi.isElectronApp&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4, topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(a,b,c,d,e,g){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e,g);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;g=null!=g?g:0<=a.indexOf("NetworkError")|| @@ -8820,7 +8821,7 @@ mxEvent.consume(a)})),k.insertBefore(d,k.firstChild))}g.appendChild(k);g.style.p "black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=", Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport? 480:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,640,440,!0,!1, -mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var d=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=d.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&b.refresh()}));return b};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position= +mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var c=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=c.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&b.refresh()}));return b};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position= "absolute";a.style.overflow="hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#DF6C0C";b.style.fontWeight="bold";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct(); mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,d,e,g,k){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},l=null!=a&&null!=a.error?a.error:a;if(null!=a&&null!=a.stack&&null!=a.message){try{null!=window.console&&console.error("EditorUi.handleError:",a)}catch(B){}try{k||"1"==urlParams.dev||EditorUi.logError(a.message,null,null,a,"INFO")}catch(B){}}if(null!=l||null!=b){k=mxUtils.htmlEntities(mxResources.get("unknownError")); var p=mxResources.get("ok"),q=null;b=null!=b?b:mxResources.get("error");if(null!=l){null!=l.retry&&(p=mxResources.get("cancel"),q=function(){f();l.retry()});if(404==l.code||404==l.status||403==l.code){k=403==l.code?null!=l.message?mxUtils.htmlEntities(l.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=e?e:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":""));var m= @@ -8836,14 +8837,14 @@ mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new Texta window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==c||"image/"!=c.substring(0,6)?this.showTextDialog(b+":",a):this.openInNewWindow(a,c,d);else{var f=document.createElement("a"),l=0>navigator.userAgent.indexOf("PaleMoon/")&&!mxClient.IS_IOS&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./), l=65==(g?parseInt(g[2],10):!1)?!1:l;if(l||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));l?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(C){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL, a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),l=Array(f),e=0;e<f;++e){for(var g=1024*e,k=Math.min(g+1024,d),m=Array(k-g),x=0;g<k;++x,++g)m[x]=c[g].charCodeAt(0);l[e]=new Uint8Array(m)}return new Blob(l,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,k){g=null!=g?g:!1;k=null!=k?k: -"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);isLocalStorage&&e++;var f=4>=e?2:6<e?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,d);else{var l=window.open("about:blank");null==l?mxUtils.popup(a,!0):(l.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"</pre>"),l.document.close())}else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&& -this.pickFolder(f,mxUtils.bind(this,function(l){try{this.exportFile(a,b,c,d,f,l)}catch(D){this.handleError(D)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,1<e,f,a,c,d);g=this.isServices(e)?e>f?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!= -b||mxClient.IS_SVG?(c=c?a:btoa(unescape(encodeURIComponent(a))),"image/svg+xml"==b?mxClient.IS_GC&&mxClient.IS_MAC?d.document.write('<html><object style="max-width:100%;" data="data:'+b+";base64,"+c+'"/></html>'):d.document.write("<html>"+a+"</html>"):d.document.write('<html><img style="max-width:100%;" src="data:'+b+";base64,"+c+'"/></html>')):d.document.write("<html><pre>"+mxUtils.htmlEntities(a,!1)+"</pre></html>"),d.document.close())};var c=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems= +"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);isLocalStorage&&e++;var f=4>=e?2:6<e?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,d);else{var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"</pre>"),e.document.close())}else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&& +this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(D){this.handleError(D)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,1<e,f,a,c,d);g=this.isServices(e)?e>f?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!= +b||mxClient.IS_SVG?(c=c?a:btoa(unescape(encodeURIComponent(a))),"image/svg+xml"==b?mxClient.IS_GC&&mxClient.IS_MAC?d.document.write('<html><object style="max-width:100%;" data="data:'+b+";base64,"+c+'"/></html>'):d.document.write("<html>"+a+"</html>"):d.document.write('<html><img style="max-width:100%;" src="data:'+b+";base64,"+c+'"/></html>')):d.document.write("<html><pre>"+mxUtils.htmlEntities(a,!1)+"</pre></html>"),d.document.close())};var d=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems= function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div");var d=b.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px"); this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+ this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var b=this.createImageDataUri(a, null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",b);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(b.substring(b.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this, -function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}c.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,f){return this.createEchoRequest(c,a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a, +function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}d.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,f){return this.createEchoRequest(c,a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a, b,c,d,e,g,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var f=this.getServiceCount(!1);isLocalStorage&&f++;var l=4>=f?2:6<f?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0<a.length){var e=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=e&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?e.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+ b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(B){this.handleError(B)}else this.spinner.spin(document.body,mxResources.get("saving"))&&e.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=e.getStatus()&&299>=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,f,c)}catch(B){this.handleError(B)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), mxResources.get("download"),!1,!1,k,null,1<f,l,d,g,e);f=this.isServices(f)?4<f?390:270:160;this.showDialog(a.container,380,f,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,g,k,m,n,t){if(this.spinner.spin(document.body,mxResources.get("export")))try{var f= @@ -8916,9 +8917,9 @@ b?b:0;c=null!=c?c:0;var f=[];try{var l=this.editor.graph;if(null!=a&&0<a.length) f))for(m=0;m<f.length;m++)this.updatePageLinksForCell(a,f[m])}finally{l.model.endUpdate()}}}catch(F){if(e)throw F;this.handleError(F)}return f};EditorUi.prototype.updatePageLinks=function(a,b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,b[c].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var c=document.createElement("div"),d=this.editor.graph,f=d.getLinkForCell(b);null!=f&&d.setLinkForCell(b,this.updatePageLink(a,f));if(d.isHtmlLabel(b)){c.innerHTML=d.getLabel(b);for(var e= c.getElementsByTagName("a"),l=!1,g=0;g<e.length;g++)f=e[g].getAttribute("href"),null!=f&&(e[g].setAttribute("href",this.updatePageLink(a,f)),l=!0);l&&d.labelChanged(b,c.innerHTML)}for(g=0;g<d.model.getChildCount(b);g++)this.updatePageLinksForCell(a,d.model.getChildAt(b,g))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17)); if(null!=d.actions){for(var f=0;f<d.actions.length;f++){var e=d.actions[f];null!=e.open&&"data:page/id,"==e.open.substring(0,13)&&(c=a[e.open.substring(e.open.indexOf(",")+1)],null!=c?e.open="data:page/id,"+c:delete e.open)}b="data:action/json,"+JSON.stringify(d)}}catch(z){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,d){d=null!=d?d:a.name;c=null!=c?c:mxUtils.bind(this, -function(a){this.handleError(a)});var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var f=this.isRemoteVisioFormat(d);try{var e="UNKNOWN-VISIO",l=d.lastIndexOf(".");0<=l&&l<d.length&&(e=d.substring(l+1).toUpperCase());EditorUi.logEvent({category:e+"-MS-IMPORT-FILE",action:"filename_"+d,label:f?"remote":"local"})}catch(I){}if(f)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")}); -else{f=new FormData;f.append("file1",a,d);var g=new XMLHttpRequest;g.open("POST",VSD_CONVERT_URL);g.responseType="blob";this.addRemoteServiceSecurityCheck(g);g.onreadystatechange=mxUtils.bind(this,function(){if(4==g.readyState)if(200<=g.status&&299>=g.status)try{var a=g.response;if("text/xml"==a.type){var f=new FileReader;f.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(D){c({message:mxResources.get("errorLoadingFile")})}});f.readAsText(a)}else this.doImportVisio(a,b,c,d)}catch(A){c(A)}else c({})}); -g.send(f)}else try{this.doImportVisio(a,b,c,d)}catch(I){c(I)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a, +function(a){this.handleError(a)});var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var f=this.isRemoteVisioFormat(d);try{var e="UNKNOWN-VISIO",g=d.lastIndexOf(".");0<=g&&g<d.length&&(e=d.substring(g+1).toUpperCase());EditorUi.logEvent({category:e+"-MS-IMPORT-FILE",action:"filename_"+d,label:f?"remote":"local"})}catch(I){}if(f)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")}); +else{f=new FormData;f.append("file1",a,d);var l=new XMLHttpRequest;l.open("POST",VSD_CONVERT_URL);l.responseType="blob";this.addRemoteServiceSecurityCheck(l);l.onreadystatechange=mxUtils.bind(this,function(){if(4==l.readyState)if(200<=l.status&&299>=l.status)try{var a=l.response;if("text/xml"==a.type){var f=new FileReader;f.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(D){c({message:mxResources.get("errorLoadingFile")})}});f.readAsText(a)}else this.doImportVisio(a,b,c,d)}catch(A){c(A)}else c({})}); +l.send(f)}else try{this.doImportVisio(a,b,c,d)}catch(I){c(I)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a, b,c)}catch(v){c(v)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(l){this.handleError(l)}else this.spinner.stop(), this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length}),EditorUi.debug("convertLucidChart",a)}catch(v){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(v){null!= window.console&&console.error(v),c(v)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generateMermaidImage=function(a,b,c,d){var f=this,e=function(){try{this.loadingMermaid=!1,b=null!=b?b:EditorUi.defaultMermaidConfig,b.securityLevel= @@ -9082,12 +9083,12 @@ a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remote msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var f=a.functionArgs;Array.isArray(f)||(f=[]);if(d.isAsync)f.push(function(){b(Array.prototype.slice.apply(arguments))}), f.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,f);else{var e=this[c].apply(this,f);b([e])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(z){b(null,"Invalid Call: An error occured, "+z.message)}};EditorUi.prototype.openDatabase=function(a,b){if(null==this.database){var c=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=c)try{var d=c.open("database","1.0");d.onupgradeneeded=function(a){a.target.result.createObjectStore("objects",{keyPath:"key"})};d.onsuccess= mxUtils.bind(this,function(b){this.database=b.target.result;a(this.database)});d.onerror=b}catch(v){null!=b&&b(v)}else null!=b&&b()}else a(this.database)};EditorUi.prototype.setDatabaseItem=function(a,b,c,d){this.openDatabase(mxUtils.bind(this,function(f){try{var e=f.transaction(["objects"],"readwrite").objectStore("objects").put({key:a,data:b});e.onsuccess=c;e.onerror=d}catch(z){null!=d&&d(z)}}),d)};EditorUi.prototype.removeDatabaseItem=function(a,b,c){this.openDatabase(mxUtils.bind(this,function(d){d= -d.transaction(["objects"],"readwrite").objectStore("objects")["delete"](a);d.onsuccess=b;d.onerror=c}),c)};EditorUi.prototype.getDatabaseItems=function(a,b){this.openDatabase(mxUtils.bind(this,function(c){try{var d=c.transaction(["objects"],"readwrite").objectStore("objects").openCursor(IDBKeyRange.lowerBound(0)),f=[];d.onsuccess=function(b){null==b.target.result?a(f):(f.push(b.target.result.value),b.target.result["continue"]())};d.onerror=b}catch(q){null!=b&&b(q)}}),b)};EditorUi.prototype.commentsSupported= +d.transaction(["objects"],"readwrite").objectStore("objects")["delete"](a);d.onsuccess=b;d.onerror=c}),c)};EditorUi.prototype.getDatabaseItems=function(a,b){this.openDatabase(mxUtils.bind(this,function(c){try{var d=c.transaction(["objects"],"readwrite").objectStore("objects").openCursor(IDBKeyRange.lowerBound(0)),e=[];d.onsuccess=function(b){null==b.target.result?a(e):(e.push(b.target.result.value),b.target.result["continue"]())};d.onerror=b}catch(q){null!=b&&b(q)}}),b)};EditorUi.prototype.commentsSupported= function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,c){var d=this.getCurrentFile(); null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile(); return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language", "da, mi, en, de-DE")}})(); -var CommentsWindow=function(a,d,c,b,g,e){function k(){for(var a=C.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==C&&b++;I.style.display=0==b?"block":"none"}function n(a,b,c,d){function e(){b.removeChild(m);b.removeChild(l);g.style.display="block";f.style.display="block"}q={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),m=document.createElement("textarea");m.className= +var CommentsWindow=function(a,c,d,b,g,e){function k(){for(var a=C.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==C&&b++;I.style.display=0==b?"block":"none"}function n(a,b,c,d){function e(){b.removeChild(m);b.removeChild(l);g.style.display="block";f.style.display="block"}q={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),m=document.createElement("textarea");m.className= "geCommentEditTxtArea";m.style.minHeight=f.offsetHeight+"px";m.value=a.content;b.insertBefore(m,f);var l=document.createElement("div");l.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),k()):e();q=null});n.className="geCommentEditBtn";l.appendChild(n);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=m.value;mxUtils.write(f,a.content);e();c(a);q=null});mxEvent.addListener(m,"keydown",mxUtils.bind(this, function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";l.appendChild(p);b.insertBefore(l,f);g.style.display="none";f.style.display="none";m.focus()}function m(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo", [e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function t(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function f(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function l(a){a.style.border="";a.removeChild(a.busyImg)}function p(b,c,d,e,g){function x(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className= @@ -9106,41 +9107,41 @@ Dialog.backdropColor;C.style.bottom=parseInt(y)+7+"px";z.appendChild(C);var I=do (y.style.filter="invert(100%)"),mxEvent.addListener(y,"click",function(a){e();a.preventDefault();mxEvent.consume(a)}),x.appendChild(y));z.appendChild(x);var B=[],F=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var b=q.div.querySelector(".geCommentEditTxtArea"),c=q.div.querySelector(".geCommentEditBtns");q.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(E){a.handleError(E)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+ IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";v=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});C.innerHTML="";C.appendChild(I);I.style.display="block";B=a;for(a=0;a<B.length;a++)b(B[a].replies), p(B[a],B,null,0,D);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(C.appendChild(q.div),n(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(a){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});F();this.refreshComments=F;x=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(m(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])} -if(this.window.isVisible()){for(var b=C.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<B.length;d++)a(B[d])}});setInterval(x,6E4);this.refreshCommentsTime=x;this.window=new mxWindow(mxResources.get("comments"),z,d,c,b,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW, +if(this.window.isVisible()){for(var b=C.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<B.length;d++)a(B[d])}});setInterval(x,6E4);this.refreshCommentsTime=x;this.window=new mxWindow(mxResources.get("comments"),z,c,d,b,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW, mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var G=mxUtils.bind(this,function(){var a=this.window.getX(), -b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",G);this.destroy=function(){mxEvent.removeListener(window,"resize",G);this.window.destroy()}},ConfirmDialog=function(a,d,c,b,g,e,k,n,m,t,f){var l=document.createElement("div");l.style.textAlign="center";f=null!=f?f:44;var p=document.createElement("div");p.style.padding="6px";p.style.overflow="auto";p.style.maxHeight=f+"px";p.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(p.style.height="60px");mxUtils.write(p,d); -l.appendChild(p);null!=t&&(p=document.createElement("div"),p.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",t),p.appendChild(d),l.appendChild(p));t=document.createElement("div");t.style.textAlign="center";t.style.whiteSpace="nowrap";var u=document.createElement("input");u.setAttribute("type","checkbox");e=mxUtils.button(e||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(u.checked)});e.className="geBtn";null!=n&&(e.innerHTML=n+"<br>"+e.innerHTML,e.style.paddingBottom= -"8px",e.style.paddingTop="8px",e.style.height="auto",e.style.width="40%");a.editor.cancelFirst&&t.appendChild(e);var v=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c(u.checked)});t.appendChild(v);null!=k?(v.innerHTML=k+"<br>"+v.innerHTML+"<br>",v.style.paddingBottom="8px",v.style.paddingTop="8px",v.style.height="auto",v.className="geBtn",v.style.width="40%"):v.className="geBtn gePrimaryBtn";a.editor.cancelFirst||t.appendChild(e);l.appendChild(t);m?(t.style.marginTop= +b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",G);this.destroy=function(){mxEvent.removeListener(window,"resize",G);this.window.destroy()}},ConfirmDialog=function(a,c,d,b,g,e,k,n,m,t,f){var l=document.createElement("div");l.style.textAlign="center";f=null!=f?f:44;var p=document.createElement("div");p.style.padding="6px";p.style.overflow="auto";p.style.maxHeight=f+"px";p.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(p.style.height="60px");mxUtils.write(p,c); +l.appendChild(p);null!=t&&(p=document.createElement("div"),p.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",t),p.appendChild(c),l.appendChild(p));t=document.createElement("div");t.style.textAlign="center";t.style.whiteSpace="nowrap";var u=document.createElement("input");u.setAttribute("type","checkbox");e=mxUtils.button(e||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(u.checked)});e.className="geBtn";null!=n&&(e.innerHTML=n+"<br>"+e.innerHTML,e.style.paddingBottom= +"8px",e.style.paddingTop="8px",e.style.height="auto",e.style.width="40%");a.editor.cancelFirst&&t.appendChild(e);var v=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d(u.checked)});t.appendChild(v);null!=k?(v.innerHTML=k+"<br>"+v.innerHTML+"<br>",v.style.paddingBottom="8px",v.style.paddingTop="8px",v.style.height="auto",v.className="geBtn",v.style.width="40%"):v.className="geBtn gePrimaryBtn";a.editor.cancelFirst||t.appendChild(e);l.appendChild(t);m?(t.style.marginTop= "10px",p=document.createElement("p"),p.style.marginTop="20px",p.appendChild(u),g=document.createElement("span"),mxUtils.write(g," "+mxResources.get("rememberThisSetting")),p.appendChild(g),l.appendChild(p),mxEvent.addListener(g,"click",function(a){u.checked=!u.checked;mxEvent.consume(a)})):t.style.marginTop="12px";this.init=function(){v.focus()};this.container=l};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0}; -EditorUi.prototype.patchPages=function(a,d,c,b,g){var e={},k=[],n={},m={},t={},f={};if(null!=b&&null!=b[EditorUi.DIFF_UPDATE])for(var l in b[EditorUi.DIFF_UPDATE])e[l]=b[EditorUi.DIFF_UPDATE][l];if(null!=d[EditorUi.DIFF_REMOVE])for(b=0;b<d[EditorUi.DIFF_REMOVE].length;b++)m[d[EditorUi.DIFF_REMOVE][b]]=!0;if(null!=d[EditorUi.DIFF_INSERT])for(b=0;b<d[EditorUi.DIFF_INSERT].length;b++)n[d[EditorUi.DIFF_INSERT][b].previous]=d[EditorUi.DIFF_INSERT][b];if(null!=d[EditorUi.DIFF_UPDATE])for(l in d[EditorUi.DIFF_UPDATE])b= -d[EditorUi.DIFF_UPDATE][l],null!=b.previous&&(f[b.previous]=l);if(null!=a){var p="";for(b=0;b<a.length;b++){var u=a[b].getId();t[u]=a[b];null!=f[p]||m[u]||null!=d[EditorUi.DIFF_UPDATE]&&null!=d[EditorUi.DIFF_UPDATE][u]&&null!=d[EditorUi.DIFF_UPDATE][u].previous||(f[p]=u);p=u}}var v={},q=mxUtils.bind(this,function(a){var b=null!=a?a.getId():"";if(null!=a&&!v[b]){v[b]=!0;k.push(a);var m=null!=d[EditorUi.DIFF_UPDATE]?d[EditorUi.DIFF_UPDATE][b]:null;null!=m&&(this.updatePageRoot(a),null!=m.name&&a.setName(m.name), -null!=m.view&&this.patchViewState(a,m.view),null!=m.cells&&this.patchPage(a,m.cells,e[a.getId()],g),!c||null==m.cells&&null==m.view||(a.needsUpdate=!0))}a=f[b];null!=a&&(delete f[b],q(t[a]));a=n[b];null!=a&&(delete n[b],z(a))}),z=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var b=t[a.getId()];null==b?q(a):(b.root=a.root,this.currentPage==b?this.editor.graph.model.setRoot(b.root):c&&(b.needsUpdate=!0))});q();for(l in f)q(t[f[l]]), -delete f[l];for(l in n)z(n[l]),delete n[l];return k};EditorUi.prototype.patchViewState=function(a,d){if(null!=a.viewState&&null!=d){a==this.currentPage&&(a.viewState=this.editor.graph.getViewState());for(var c in d)a.viewState[c]=JSON.parse(d[c]);a==this.currentPage&&this.editor.graph.setViewState(a.viewState,!0)}}; -EditorUi.prototype.createParentLookup=function(a,d){function c(a){var c=b[a];null==c&&(c={inserted:[],moved:{}},b[a]=c);return c}var b={};if(null!=d[EditorUi.DIFF_INSERT])for(var g=0;g<d[EditorUi.DIFF_INSERT].length;g++){var e=d[EditorUi.DIFF_INSERT][g],k=null!=e.parent?e.parent:"",n=null!=e.previous?e.previous:"";c(k).inserted[n]=e}if(null!=d[EditorUi.DIFF_UPDATE])for(var m in d[EditorUi.DIFF_UPDATE])e=d[EditorUi.DIFF_UPDATE][m],null!=e.previous&&(k=e.parent,null==k&&(g=a.getCell(m),null!=g&&(g= -a.getParent(g),null!=g&&(k=g.getId()))),null!=k&&(c(k).moved[e.previous]=m));return b}; -EditorUi.prototype.patchPage=function(a,d,c,b){var g=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),e=this.createParentLookup(g,d);g.beginUpdate();try{var k=g.updateEdgeParent,n=new mxDictionary,m=[];g.updateEdgeParent=function(a,c){!n.get(a)&&b&&(n.put(a,!0),m.push(a))};var t=e[""],f=null!=t&&null!=t.inserted?t.inserted[""]:null,l=null;null!=f&&(l=this.getCellForJson(f));if(null==l){var p=null!=t&&null!=t.moved?t.moved[""]:null;null!=p&&(l=g.getCell(p))}null!=l&&(g.setRoot(l), -a.root=l);this.patchCellRecursive(a,g,g.root,e,d);if(null!=d[EditorUi.DIFF_REMOVE])for(var u=0;u<d[EditorUi.DIFF_REMOVE].length;u++){var v=g.getCell(d[EditorUi.DIFF_REMOVE][u]);null!=v&&g.remove(v)}if(null!=d[EditorUi.DIFF_UPDATE]){var q=null!=c&&null!=c.cells?c.cells[EditorUi.DIFF_UPDATE]:null;for(p in d[EditorUi.DIFF_UPDATE])this.patchCell(g,g.getCell(p),d[EditorUi.DIFF_UPDATE][p],null!=q?q[p]:null)}if(null!=d[EditorUi.DIFF_INSERT])for(u=0;u<d[EditorUi.DIFF_INSERT].length;u++)f=d[EditorUi.DIFF_INSERT][u], +EditorUi.prototype.patchPages=function(a,c,d,b,g){var e={},k=[],n={},m={},t={},f={};if(null!=b&&null!=b[EditorUi.DIFF_UPDATE])for(var l in b[EditorUi.DIFF_UPDATE])e[l]=b[EditorUi.DIFF_UPDATE][l];if(null!=c[EditorUi.DIFF_REMOVE])for(b=0;b<c[EditorUi.DIFF_REMOVE].length;b++)m[c[EditorUi.DIFF_REMOVE][b]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(b=0;b<c[EditorUi.DIFF_INSERT].length;b++)n[c[EditorUi.DIFF_INSERT][b].previous]=c[EditorUi.DIFF_INSERT][b];if(null!=c[EditorUi.DIFF_UPDATE])for(l in c[EditorUi.DIFF_UPDATE])b= +c[EditorUi.DIFF_UPDATE][l],null!=b.previous&&(f[b.previous]=l);if(null!=a){var p="";for(b=0;b<a.length;b++){var u=a[b].getId();t[u]=a[b];null!=f[p]||m[u]||null!=c[EditorUi.DIFF_UPDATE]&&null!=c[EditorUi.DIFF_UPDATE][u]&&null!=c[EditorUi.DIFF_UPDATE][u].previous||(f[p]=u);p=u}}var v={},q=mxUtils.bind(this,function(a){var b=null!=a?a.getId():"";if(null!=a&&!v[b]){v[b]=!0;k.push(a);var m=null!=c[EditorUi.DIFF_UPDATE]?c[EditorUi.DIFF_UPDATE][b]:null;null!=m&&(this.updatePageRoot(a),null!=m.name&&a.setName(m.name), +null!=m.view&&this.patchViewState(a,m.view),null!=m.cells&&this.patchPage(a,m.cells,e[a.getId()],g),!d||null==m.cells&&null==m.view||(a.needsUpdate=!0))}a=f[b];null!=a&&(delete f[b],q(t[a]));a=n[b];null!=a&&(delete n[b],z(a))}),z=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var b=t[a.getId()];null==b?q(a):(b.root=a.root,this.currentPage==b?this.editor.graph.model.setRoot(b.root):d&&(b.needsUpdate=!0))});q();for(l in f)q(t[f[l]]), +delete f[l];for(l in n)z(n[l]),delete n[l];return k};EditorUi.prototype.patchViewState=function(a,c){if(null!=a.viewState&&null!=c){a==this.currentPage&&(a.viewState=this.editor.graph.getViewState());for(var d in c)a.viewState[d]=JSON.parse(c[d]);a==this.currentPage&&this.editor.graph.setViewState(a.viewState,!0)}}; +EditorUi.prototype.createParentLookup=function(a,c){function d(a){var c=b[a];null==c&&(c={inserted:[],moved:{}},b[a]=c);return c}var b={};if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++){var e=c[EditorUi.DIFF_INSERT][g],k=null!=e.parent?e.parent:"",n=null!=e.previous?e.previous:"";d(k).inserted[n]=e}if(null!=c[EditorUi.DIFF_UPDATE])for(var m in c[EditorUi.DIFF_UPDATE])e=c[EditorUi.DIFF_UPDATE][m],null!=e.previous&&(k=e.parent,null==k&&(g=a.getCell(m),null!=g&&(g= +a.getParent(g),null!=g&&(k=g.getId()))),null!=k&&(d(k).moved[e.previous]=m));return b}; +EditorUi.prototype.patchPage=function(a,c,d,b){var g=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),e=this.createParentLookup(g,c);g.beginUpdate();try{var k=g.updateEdgeParent,n=new mxDictionary,m=[];g.updateEdgeParent=function(a,c){!n.get(a)&&b&&(n.put(a,!0),m.push(a))};var t=e[""],f=null!=t&&null!=t.inserted?t.inserted[""]:null,l=null;null!=f&&(l=this.getCellForJson(f));if(null==l){var p=null!=t&&null!=t.moved?t.moved[""]:null;null!=p&&(l=g.getCell(p))}null!=l&&(g.setRoot(l), +a.root=l);this.patchCellRecursive(a,g,g.root,e,c);if(null!=c[EditorUi.DIFF_REMOVE])for(var u=0;u<c[EditorUi.DIFF_REMOVE].length;u++){var v=g.getCell(c[EditorUi.DIFF_REMOVE][u]);null!=v&&g.remove(v)}if(null!=c[EditorUi.DIFF_UPDATE]){var q=null!=d&&null!=d.cells?d.cells[EditorUi.DIFF_UPDATE]:null;for(p in c[EditorUi.DIFF_UPDATE])this.patchCell(g,g.getCell(p),c[EditorUi.DIFF_UPDATE][p],null!=q?q[p]:null)}if(null!=c[EditorUi.DIFF_INSERT])for(u=0;u<c[EditorUi.DIFF_INSERT].length;u++)f=c[EditorUi.DIFF_INSERT][u], v=g.getCell(f.id),null!=v&&(g.setTerminal(v,g.getCell(f.source),!0),g.setTerminal(v,g.getCell(f.target),!1));g.updateEdgeParent=k;if(b&&0<m.length)for(u=0;u<m.length;u++)g.contains(m[u])&&g.updateEdgeParent(m[u])}finally{g.endUpdate()}}; -EditorUi.prototype.patchCellRecursive=function(a,d,c,b,g){if(null!=c){for(var e=b[c.getId()],k=null!=e&&null!=e.inserted?e.inserted:{},e=null!=e&&null!=e.moved?e.moved:{},n=0,m=d.getChildCount(c),t="",f=0;f<m;f++){var l=d.getChildAt(c,f).getId();null==e[t]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][l]||null==g[EditorUi.DIFF_UPDATE][l].previous&&null==g[EditorUi.DIFF_UPDATE][l].parent)&&(e[t]=l);t=l}m=mxUtils.bind(this,function(e,f){var k=null!=e?e.getId():"";if(null!=e&&f){var m= -d.getCell(k);null!=m&&m!=e&&(e=null)}null!=e&&(d.getChildAt(c,n)!=e&&d.add(c,e,n),this.patchCellRecursive(a,d,e,b,g),n++);return k});for(t=[null];0<t.length;)if(f=t.shift(),f=m(null!=f?f.child:null,null!=f?f.insert:!1),l=e[f],null!=l&&(delete e[f],t.push({child:d.getCell(l)})),l=k[f],null!=l&&(delete k[f],t.push({child:this.getCellForJson(l),insert:!0})),0==t.length){for(f in e)t.push({child:d.getCell(e[f])}),delete e[f];for(f in k)t.push({child:this.getCellForJson(k[f]),insert:!0}),delete k[f]}}}; -EditorUi.prototype.patchCell=function(a,d,c,b){if(null!=d&&null!=c){if(null==b||null==b.xmlValue&&(null==b.value||""==b.value))"value"in c?a.setValue(d,c.value):null!=c.xmlValue&&a.setValue(d,mxUtils.parseXml(c.xmlValue).documentElement);null!=b&&null!=b.style||null==c.style||a.setStyle(d,c.style);null!=c.visible&&a.setVisible(d,1==c.visible);null!=c.collapsed&&a.setCollapsed(d,1==c.collapsed);null!=c.vertex&&(d.vertex=1==c.vertex);null!=c.edge&&(d.edge=1==c.edge);null!=c.connectable&&(d.connectable= -1==c.connectable);null!=c.geometry&&a.setGeometry(d,this.codec.decode(mxUtils.parseXml(c.geometry).documentElement));null!=c.source&&a.setTerminal(d,a.getCell(c.source),!0);null!=c.target&&a.setTerminal(d,a.getCell(c.target),!1);for(var g in c)this.cellProperties[g]||(d[g]=c[g])}}; -EditorUi.prototype.getPagesForNode=function(a,d){var c=this.editor.extractGraphModel(a,!0,!0);null!=c&&(a=c);var c=a.getElementsByTagName(d||"diagram"),b=[];if(0<c.length)for(var g=0;g<c.length;g++){var e=new DiagramPage(c[g]);this.updatePageRoot(e,!0);b.push(e)}else"mxGraphModel"==a.nodeName&&(e=new DiagramPage(a.ownerDocument.createElement("diagram")),e.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(e.node,Graph.compressNode(a,!0)),b.push(e));return b}; -EditorUi.prototype.diffPages=function(a,d){for(var c=[],b=[],g={},e={},k={},n=null,m=0;m<d.length;m++)e[d[m].getId()]={page:d[m],prev:n},n=d[m];n=null;for(m=0;m<a.length;m++){var t=a[m].getId(),f=e[t];if(null==f)b.push(t);else{var l=this.diffPage(a[m],f.page),p={};0<Object.keys(l).length&&(p.cells=l);l=this.diffViewState(a[m],f.page);0<Object.keys(l).length&&(p.view=l);if((null!=f.prev?null==n:null!=n)||null!=n&&null!=f.prev&&n.getId()!=f.prev.getId())p.previous=null!=f.prev?f.prev.getId():"";null!= -f.page.getName()&&a[m].getName()!=f.page.getName()&&(p.name=f.page.getName());0<Object.keys(p).length&&(k[t]=p)}delete e[a[m].getId()];n=a[m]}for(t in e)f=e[t],c.push({data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});0<Object.keys(k).length&&(g[EditorUi.DIFF_UPDATE]=k);0<b.length&&(g[EditorUi.DIFF_REMOVE]=b);0<c.length&&(g[EditorUi.DIFF_INSERT]=c);return g}; -EditorUi.prototype.createCellLookup=function(a,d,c){c=null!=c?c:{};c[a.getId()]={cell:a,prev:d};var b=a.getChildCount();d=null;for(var g=0;g<b;g++){var e=a.getChildAt(g);this.createCellLookup(e,d,c);d=e}return c}; -EditorUi.prototype.diffCellRecursive=function(a,d,c,b,g){b=null!=b?b:{};var e=c[a.getId()];delete c[a.getId()];if(null==e)g.push(a.getId());else{var k=this.diffCell(a,e.cell);if(null!=k.parent||(null!=e.prev?null==d:null!=d)||null!=d&&null!=e.prev&&d.getId()!=e.prev.getId())k.previous=null!=e.prev?e.prev.getId():"";0<Object.keys(k).length&&(b[a.getId()]=k)}e=a.getChildCount();d=null;for(k=0;k<e;k++){var n=a.getChildAt(k);this.diffCellRecursive(n,d,c,b,g);d=n}return b}; -EditorUi.prototype.diffPage=function(a,d){var c=[],b=[],g={};this.updatePageRoot(a);this.updatePageRoot(d);var e=this.createCellLookup(d.root),k=this.diffCellRecursive(a.root,null,e,k,b),n;for(n in e){var m=e[n];c.push(this.getJsonForCell(m.cell,m.prev))}0<Object.keys(k).length&&(g[EditorUi.DIFF_UPDATE]=k);0<b.length&&(g[EditorUi.DIFF_REMOVE]=b);0<c.length&&(g[EditorUi.DIFF_INSERT]=c);return g}; -EditorUi.prototype.diffViewState=function(a,d){var c=a.viewState,b=d.viewState,g={};d==this.currentPage&&(b=this.editor.graph.getViewState());if(null!=c&&null!=b)for(var e in this.viewStateProperties){var k=JSON.stringify(c[e]),n=JSON.stringify(b[e]);k!=n&&(g[e]=n)}return g}; -EditorUi.prototype.getCellForJson=function(a){var d=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,c=a.value;null!=a.xmlValue&&(c=mxUtils.parseXml(a.xmlValue).documentElement);d=new mxCell(c,d,a.style);d.connectable=0!=a.connectable;d.collapsed=1==a.collapsed;d.visible=0!=a.visible;d.vertex=1==a.vertex;d.edge=1==a.edge;d.id=a.id;for(var b in a)this.cellProperties[b]||(d[b]=a[b]);return d}; -EditorUi.prototype.getJsonForCell=function(a,d){var c={id:a.getId()};a.vertex&&(c.vertex=1);a.edge&&(c.edge=1);a.connectable||(c.connectable=0);null!=a.parent&&(c.parent=a.parent.getId());null!=d&&(c.previous=d.getId());null!=a.source&&(c.source=a.source.getId());null!=a.target&&(c.target=a.target.getId());null!=a.style&&(c.style=a.style);null!=a.geometry&&(c.geometry=mxUtils.getXml(this.codec.encode(a.geometry)));a.collapsed&&(c.collapsed=1);a.visible||(c.visible=0);null!=a.value&&("object"===typeof a.value&& -"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?c.xmlValue=mxUtils.getXml(a.value):c.value=a.value);for(var b in a)this.cellProperties[b]||"function"===typeof a[b]||(c[b]=a[b]);return c}; -EditorUi.prototype.diffCell=function(a,d){function c(a){return null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute}var b={};a.vertex!=d.vertex&&(b.vertex=d.vertex?1:0);a.edge!=d.edge&&(b.edge=d.edge?1:0);a.connectable!=d.connectable&&(b.connectable=d.connectable?1:0);if((null!=a.parent?null==d.parent:null!=d.parent)||null!=a.parent&&null!=d.parent&&a.parent.getId()!=d.parent.getId())b.parent=null!=d.parent?d.parent.getId():""; -if((null!=a.source?null==d.source:null!=d.source)||null!=a.source&&null!=d.source&&a.source.getId()!=d.source.getId())b.source=null!=d.source?d.source.getId():"";if((null!=a.target?null==d.target:null!=d.target)||null!=a.target&&null!=d.target&&a.target.getId()!=d.target.getId())b.target=null!=d.target?d.target.getId():"";c(a.value)&&c(d.value)?a.value.isEqualNode(d.value)||(b.xmlValue=mxUtils.getXml(d.value)):a.value!=d.value&&(c(d.value)?b.xmlValue=mxUtils.getXml(d.value):b.value=null!=d.value? -d.value:null);a.style!=d.style&&(b.style=d.style);a.visible!=d.visible&&(b.visible=d.visible?1:0);a.collapsed!=d.collapsed&&(b.collapsed=d.collapsed?1:0);if(!this.isObjectEqual(a.geometry,d.geometry,new mxGeometry)){var g=this.codec.encode(d.geometry);null!=g&&(b.geometry=mxUtils.getXml(g))}for(var e in a)this.cellProperties[e]||"function"===typeof a[e]||"function"===typeof d[e]||a[e]==d[e]||(b[e]=void 0===d[e]?null:d[e]);for(e in d)e in a||this.cellProperties[e]||"function"===typeof a[e]||"function"=== -typeof d[e]||a[e]==d[e]||(b[e]=void 0===d[e]?null:d[e]);return b};EditorUi.prototype.isObjectEqual=function(a,d,c){if(null==a&&null==d)return!0;if(null!=a?null==d:null!=d)return!1;var b=function(a,b){return null==c||c[a]!=b?!0===b?1:b:void 0};return JSON.stringify(a,b)==JSON.stringify(d,b)};var mxSettings={currentVersion:18,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(a){return a?mxSettings.settings.darkGridColor: -mxSettings.settings.gridColor},setGridColor:function(a,d){d?mxSettings.settings.darkGridColor=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},setCustomFonts:function(a){mxSettings.settings.customFonts=a},getCustomFonts:function(){for(var a=mxSettings.settings.customFonts||[],d=0;d<a.length;d++)"string"===typeof a[d]&&(a[d]={name:a[d],url:null});return 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, +EditorUi.prototype.patchCellRecursive=function(a,c,d,b,g){if(null!=d){for(var e=b[d.getId()],k=null!=e&&null!=e.inserted?e.inserted:{},e=null!=e&&null!=e.moved?e.moved:{},n=0,m=c.getChildCount(d),t="",f=0;f<m;f++){var l=c.getChildAt(d,f).getId();null==e[t]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][l]||null==g[EditorUi.DIFF_UPDATE][l].previous&&null==g[EditorUi.DIFF_UPDATE][l].parent)&&(e[t]=l);t=l}m=mxUtils.bind(this,function(e,f){var k=null!=e?e.getId():"";if(null!=e&&f){var m= +c.getCell(k);null!=m&&m!=e&&(e=null)}null!=e&&(c.getChildAt(d,n)!=e&&c.add(d,e,n),this.patchCellRecursive(a,c,e,b,g),n++);return k});for(t=[null];0<t.length;)if(f=t.shift(),f=m(null!=f?f.child:null,null!=f?f.insert:!1),l=e[f],null!=l&&(delete e[f],t.push({child:c.getCell(l)})),l=k[f],null!=l&&(delete k[f],t.push({child:this.getCellForJson(l),insert:!0})),0==t.length){for(f in e)t.push({child:c.getCell(e[f])}),delete e[f];for(f in k)t.push({child:this.getCellForJson(k[f]),insert:!0}),delete k[f]}}}; +EditorUi.prototype.patchCell=function(a,c,d,b){if(null!=c&&null!=d){if(null==b||null==b.xmlValue&&(null==b.value||""==b.value))"value"in d?a.setValue(c,d.value):null!=d.xmlValue&&a.setValue(c,mxUtils.parseXml(d.xmlValue).documentElement);null!=b&&null!=b.style||null==d.style||a.setStyle(c,d.style);null!=d.visible&&a.setVisible(c,1==d.visible);null!=d.collapsed&&a.setCollapsed(c,1==d.collapsed);null!=d.vertex&&(c.vertex=1==d.vertex);null!=d.edge&&(c.edge=1==d.edge);null!=d.connectable&&(c.connectable= +1==d.connectable);null!=d.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(d.geometry).documentElement));null!=d.source&&a.setTerminal(c,a.getCell(d.source),!0);null!=d.target&&a.setTerminal(c,a.getCell(d.target),!1);for(var g in d)this.cellProperties[g]||(c[g]=d[g])}}; +EditorUi.prototype.getPagesForNode=function(a,c){var d=this.editor.extractGraphModel(a,!0,!0);null!=d&&(a=d);var d=a.getElementsByTagName(c||"diagram"),b=[];if(0<d.length)for(var g=0;g<d.length;g++){var e=new DiagramPage(d[g]);this.updatePageRoot(e,!0);b.push(e)}else"mxGraphModel"==a.nodeName&&(e=new DiagramPage(a.ownerDocument.createElement("diagram")),e.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(e.node,Graph.compressNode(a,!0)),b.push(e));return b}; +EditorUi.prototype.diffPages=function(a,c){for(var d=[],b=[],g={},e={},k={},n=null,m=0;m<c.length;m++)e[c[m].getId()]={page:c[m],prev:n},n=c[m];n=null;for(m=0;m<a.length;m++){var t=a[m].getId(),f=e[t];if(null==f)b.push(t);else{var l=this.diffPage(a[m],f.page),p={};0<Object.keys(l).length&&(p.cells=l);l=this.diffViewState(a[m],f.page);0<Object.keys(l).length&&(p.view=l);if((null!=f.prev?null==n:null!=n)||null!=n&&null!=f.prev&&n.getId()!=f.prev.getId())p.previous=null!=f.prev?f.prev.getId():"";null!= +f.page.getName()&&a[m].getName()!=f.page.getName()&&(p.name=f.page.getName());0<Object.keys(p).length&&(k[t]=p)}delete e[a[m].getId()];n=a[m]}for(t in e)f=e[t],d.push({data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});0<Object.keys(k).length&&(g[EditorUi.DIFF_UPDATE]=k);0<b.length&&(g[EditorUi.DIFF_REMOVE]=b);0<d.length&&(g[EditorUi.DIFF_INSERT]=d);return g}; +EditorUi.prototype.createCellLookup=function(a,c,d){d=null!=d?d:{};d[a.getId()]={cell:a,prev:c};var b=a.getChildCount();c=null;for(var g=0;g<b;g++){var e=a.getChildAt(g);this.createCellLookup(e,c,d);c=e}return d}; +EditorUi.prototype.diffCellRecursive=function(a,c,d,b,g){b=null!=b?b:{};var e=d[a.getId()];delete d[a.getId()];if(null==e)g.push(a.getId());else{var k=this.diffCell(a,e.cell);if(null!=k.parent||(null!=e.prev?null==c:null!=c)||null!=c&&null!=e.prev&&c.getId()!=e.prev.getId())k.previous=null!=e.prev?e.prev.getId():"";0<Object.keys(k).length&&(b[a.getId()]=k)}e=a.getChildCount();c=null;for(k=0;k<e;k++){var n=a.getChildAt(k);this.diffCellRecursive(n,c,d,b,g);c=n}return b}; +EditorUi.prototype.diffPage=function(a,c){var d=[],b=[],g={};this.updatePageRoot(a);this.updatePageRoot(c);var e=this.createCellLookup(c.root),k=this.diffCellRecursive(a.root,null,e,k,b),n;for(n in e){var m=e[n];d.push(this.getJsonForCell(m.cell,m.prev))}0<Object.keys(k).length&&(g[EditorUi.DIFF_UPDATE]=k);0<b.length&&(g[EditorUi.DIFF_REMOVE]=b);0<d.length&&(g[EditorUi.DIFF_INSERT]=d);return g}; +EditorUi.prototype.diffViewState=function(a,c){var d=a.viewState,b=c.viewState,g={};c==this.currentPage&&(b=this.editor.graph.getViewState());if(null!=d&&null!=b)for(var e in this.viewStateProperties){var k=JSON.stringify(d[e]),n=JSON.stringify(b[e]);k!=n&&(g[e]=n)}return g}; +EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,d=a.value;null!=a.xmlValue&&(d=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(d,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var b in a)this.cellProperties[b]||(c[b]=a[b]);return c}; +EditorUi.prototype.getJsonForCell=function(a,c){var d={id:a.getId()};a.vertex&&(d.vertex=1);a.edge&&(d.edge=1);a.connectable||(d.connectable=0);null!=a.parent&&(d.parent=a.parent.getId());null!=c&&(d.previous=c.getId());null!=a.source&&(d.source=a.source.getId());null!=a.target&&(d.target=a.target.getId());null!=a.style&&(d.style=a.style);null!=a.geometry&&(d.geometry=mxUtils.getXml(this.codec.encode(a.geometry)));a.collapsed&&(d.collapsed=1);a.visible||(d.visible=0);null!=a.value&&("object"===typeof a.value&& +"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?d.xmlValue=mxUtils.getXml(a.value):d.value=a.value);for(var b in a)this.cellProperties[b]||"function"===typeof a[b]||(d[b]=a[b]);return d}; +EditorUi.prototype.diffCell=function(a,c){function d(a){return null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute}var b={};a.vertex!=c.vertex&&(b.vertex=c.vertex?1:0);a.edge!=c.edge&&(b.edge=c.edge?1:0);a.connectable!=c.connectable&&(b.connectable=c.connectable?1:0);if((null!=a.parent?null==c.parent:null!=c.parent)||null!=a.parent&&null!=c.parent&&a.parent.getId()!=c.parent.getId())b.parent=null!=c.parent?c.parent.getId():""; +if((null!=a.source?null==c.source:null!=c.source)||null!=a.source&&null!=c.source&&a.source.getId()!=c.source.getId())b.source=null!=c.source?c.source.getId():"";if((null!=a.target?null==c.target:null!=c.target)||null!=a.target&&null!=c.target&&a.target.getId()!=c.target.getId())b.target=null!=c.target?c.target.getId():"";d(a.value)&&d(c.value)?a.value.isEqualNode(c.value)||(b.xmlValue=mxUtils.getXml(c.value)):a.value!=c.value&&(d(c.value)?b.xmlValue=mxUtils.getXml(c.value):b.value=null!=c.value? +c.value:null);a.style!=c.style&&(b.style=c.style);a.visible!=c.visible&&(b.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(b.collapsed=c.collapsed?1:0);if(!this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)){var g=this.codec.encode(c.geometry);null!=g&&(b.geometry=mxUtils.getXml(g))}for(var e in a)this.cellProperties[e]||"function"===typeof a[e]||"function"===typeof c[e]||a[e]==c[e]||(b[e]=void 0===c[e]?null:c[e]);for(e in c)e in a||this.cellProperties[e]||"function"===typeof a[e]||"function"=== +typeof c[e]||a[e]==c[e]||(b[e]=void 0===c[e]?null:c[e]);return b};EditorUi.prototype.isObjectEqual=function(a,c,d){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var b=function(a,b){return null==d||d[a]!=b?!0===b?1:b:void 0};return JSON.stringify(a,b)==JSON.stringify(c,b)};var mxSettings={currentVersion:18,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(a){return a?mxSettings.settings.darkGridColor: +mxSettings.settings.gridColor},setGridColor:function(a,c){c?mxSettings.settings.darkGridColor=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},setCustomFonts:function(a){mxSettings.settings.customFonts=a},getCustomFonts:function(){for(var a=mxSettings.settings.customFonts||[],c=0;c<a.length;c++)"string"===typeof a[c]&&(a[c]={name:a[c],url:null});return a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0, 0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors= a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},isCreateTarget:function(){return mxSettings.settings.createTarget},setCreateTarget:function(a){mxSettings.settings.createTarget=a},getPageFormat:function(){return mxSettings.settings.pageFormat},setPageFormat:function(a){mxSettings.settings.pageFormat=a},getUnit:function(){return mxSettings.settings.unit||mxConstants.POINTS},setUnit:function(a){mxSettings.settings.unit= a},isRulerOn:function(){return mxSettings.settings.isRulerOn},setRulerOn:function(a){mxSettings.settings.isRulerOn=a},init:function(){mxSettings.settings={language:"",configVersion:Editor.configVersion,customFonts:[],libraries:Sidebar.prototype.defaultEntries,customLibraries:Editor.defaultCustomLibraries,plugins:[],recentColors:[],formatWidth:mxSettings.defaultFormatWidth,createTarget:!1,pageFormat:mxGraph.prototype.pageFormat,search:!0,showStartScreen:!0,gridColor:mxGraphView.prototype.defaultGridColor, @@ -9150,341 +9151,341 @@ null==mxSettings.settings&&mxSettings.init()},parse:function(a){a=null!=a?JSON.p (mxSettings.settings.pageFormat=mxGraph.prototype.pageFormat),null==mxSettings.settings.search&&(mxSettings.settings.search=!0),null==mxSettings.settings.showStartScreen&&(mxSettings.settings.showStartScreen=!0),null==mxSettings.settings.gridColor&&(mxSettings.settings.gridColor=mxGraphView.prototype.defaultGridColor),null==mxSettings.settings.darkGridColor&&(mxSettings.settings.darkGridColor=mxGraphView.prototype.defaultDarkGridColor),null==mxSettings.settings.autosave&&(mxSettings.settings.autosave= !0),null!=mxSettings.settings.scratchpadSeen&&delete mxSettings.settings.scratchpadSeen)},clear:function(){isLocalStorage&&localStorage.removeItem(mxSettings.key)}};("undefined"==typeof mxLoadSettings||mxLoadSettings)&&mxSettings.load();DrawioFileSync=function(a){mxEventSource.call(this);this.lastActivity=new Date;this.clientId=Editor.guid();this.ui=a.ui;this.file=a;this.onlineListener=mxUtils.bind(this,function(){this.updateOnlineState();this.isConnected()&&this.fileChangedNotify()});mxEvent.addListener(window,"online",this.onlineListener);this.visibleListener=mxUtils.bind(this,function(){"hidden"==document.visibilityState?this.isConnected()&&this.stop():this.start()});mxEvent.addListener(document,"visibilitychange",this.visibleListener); this.activityListener=mxUtils.bind(this,function(a){this.lastActivity=new Date;this.start()});mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener);mxEvent.addListener(document,"keypress",this.activityListener);mxEvent.addListener(window,"focus",this.activityListener);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.addListener(document,"touchstart",this.activityListener),mxEvent.addListener(document,"touchmove",this.activityListener));this.pusherErrorListener= -mxUtils.bind(this,function(a){null!=a.error&&null!=a.error.data&&4004===a.error.data.code&&EditorUi.logError("Error: Pusher Limit",null,this.file.getId())});this.connectionListener=mxUtils.bind(this,function(){this.updateOnlineState();this.updateStatus();if(this.isConnected())if(this.announced)this.fileChangedNotify();else{var a=this.file.getCurrentUser(),c={a:"join"};null!=a&&(c.name=encodeURIComponent(a.displayName),c.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(c)))); +mxUtils.bind(this,function(a){null!=a.error&&null!=a.error.data&&4004===a.error.data.code&&EditorUi.logError("Error: Pusher Limit",null,this.file.getId())});this.connectionListener=mxUtils.bind(this,function(){this.updateOnlineState();this.updateStatus();if(this.isConnected())if(this.announced)this.fileChangedNotify();else{var a=this.file.getCurrentUser(),d={a:"join"};null!=a&&(d.name=encodeURIComponent(a.displayName),d.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(d)))); this.file.stats.msgSent++;this.announced=!0}});this.changeListener=mxUtils.bind(this,function(a){this.file.stats.msgReceived++;this.lastActivity=new Date;if(this.enabled&&!this.file.inConflictState&&!this.file.redirectDialogShowing)try{var c=this.stringToObject(a);null!=c&&(EditorUi.debug("Sync.message",[this],c,a.length,"bytes"),c.v>DrawioFileSync.PROTOCOL?this.file.redirectToNewApp(mxUtils.bind(this,function(){})):c.v===DrawioFileSync.PROTOCOL&&null!=c.d&&this.handleMessageData(c.d))}catch(b){this.isConnected()&& this.fileChangedNotify()}})};DrawioFileSync.PROTOCOL=6;mxUtils.extend(DrawioFileSync,mxEventSource);DrawioFileSync.prototype.maxCacheEntrySize=1E6;DrawioFileSync.prototype.enabled=!0;DrawioFileSync.prototype.updateStatusInterval=1E4;DrawioFileSync.prototype.channelId=null;DrawioFileSync.prototype.channel=null;DrawioFileSync.prototype.catchupRetryCount=0;DrawioFileSync.prototype.maxCatchupRetries=15;DrawioFileSync.prototype.maxCacheReadyRetries=1;DrawioFileSync.prototype.cacheReadyDelay=700; DrawioFileSync.prototype.inactivityTimeoutSeconds=1800;DrawioFileSync.prototype.lastActivity=null; DrawioFileSync.prototype.start=function(){null==this.channelId&&(this.channelId=this.file.getChannelId());null==this.key&&(this.key=this.file.getChannelKey());if(null==this.pusher&&null!=this.channelId&&"hidden"!=document.visibilityState){this.pusher=this.ui.getPusher();if(null!=this.pusher){try{null!=this.pusher.connection&&this.pusher.connection.bind("error",this.pusherErrorListener)}catch(a){}try{this.pusher.connect(),this.channel=this.pusher.subscribe(this.channelId),EditorUi.debug("Sync.start", [this,"v"+DrawioFileSync.PROTOCOL])}catch(a){}this.installListeners()}window.setTimeout(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.lastActivity=new Date;this.resetUpdateStatusThread();this.updateOnlineState();this.updateStatus()},0))}};DrawioFileSync.prototype.isConnected=function(){return null!=this.pusher&&null!=this.pusher.connection?"connected"==this.pusher.connection.state:!1}; -DrawioFileSync.prototype.updateOnlineState=function(){var a=mxUtils.bind(this,function(a){mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.enabled=!this.enabled;this.ui.updateButtonContainer();this.resetUpdateStatusThread();this.updateOnlineState();this.updateStatus();!this.file.inConflictState&&this.enabled&&this.fileChangedNotify()}))});if("min"==uiTheme&&null!=this.ui.buttonContainer){if(null==this.collaboratorsElement){var d=document.createElement("a");d.className="geToolbarButton"; -d.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;float:left;";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="24px 24px";d.style.height="24px";d.style.width="24px";a(d);this.ui.buttonContainer.appendChild(d);this.collaboratorsElement=d}}else null!=this.ui.toolbarContainer&&null==this.collaboratorsElement&&(d=document.createElement("a"),d.className="geButton",d.style.position="absolute", -d.style.display="inline-block",d.style.verticalAlign="bottom",d.style.color="#666",d.style.top="6px",d.style.right="atlas"!=uiTheme?"70px":"50px",d.style.padding="2px",d.style.fontSize="8pt",d.style.verticalAlign="middle",d.style.textDecoration="none",d.style.backgroundPosition="center center",d.style.backgroundRepeat="no-repeat",d.style.backgroundSize="16px 16px",d.style.width="16px",d.style.height="16px",mxUtils.setOpacity(d,60),"dark"==uiTheme&&(d.style.filter="invert(100%)"),mxEvent.addListener(d, -mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()})),a(d),this.ui.toolbarContainer.appendChild(d),this.collaboratorsElement=d);null!=this.collaboratorsElement&&(a="",a=this.enabled?this.file.invalidChecksum?mxResources.get("error")+": "+mxResources.get("checksum"):this.ui.isOffline()||!this.isConnected()?mxResources.get("offline"):mxResources.get("online"):mxResources.get("disconnected"),this.collaboratorsElement.setAttribute("title",a),this.collaboratorsElement.style.backgroundImage= +DrawioFileSync.prototype.updateOnlineState=function(){var a=mxUtils.bind(this,function(a){mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.enabled=!this.enabled;this.ui.updateButtonContainer();this.resetUpdateStatusThread();this.updateOnlineState();this.updateStatus();!this.file.inConflictState&&this.enabled&&this.fileChangedNotify()}))});if("min"==uiTheme&&null!=this.ui.buttonContainer){if(null==this.collaboratorsElement){var c=document.createElement("a");c.className="geToolbarButton"; +c.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;float:left;";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";c.style.backgroundSize="24px 24px";c.style.height="24px";c.style.width="24px";a(c);this.ui.buttonContainer.appendChild(c);this.collaboratorsElement=c}}else null!=this.ui.toolbarContainer&&null==this.collaboratorsElement&&(c=document.createElement("a"),c.className="geButton",c.style.position="absolute", +c.style.display="inline-block",c.style.verticalAlign="bottom",c.style.color="#666",c.style.top="6px",c.style.right="atlas"!=uiTheme?"70px":"50px",c.style.padding="2px",c.style.fontSize="8pt",c.style.verticalAlign="middle",c.style.textDecoration="none",c.style.backgroundPosition="center center",c.style.backgroundRepeat="no-repeat",c.style.backgroundSize="16px 16px",c.style.width="16px",c.style.height="16px",mxUtils.setOpacity(c,60),"dark"==uiTheme&&(c.style.filter="invert(100%)"),mxEvent.addListener(c, +mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()})),a(c),this.ui.toolbarContainer.appendChild(c),this.collaboratorsElement=c);null!=this.collaboratorsElement&&(a="",a=this.enabled?this.file.invalidChecksum?mxResources.get("error")+": "+mxResources.get("checksum"):this.ui.isOffline()||!this.isConnected()?mxResources.get("offline"):mxResources.get("online"):mxResources.get("disconnected"),this.collaboratorsElement.setAttribute("title",a),this.collaboratorsElement.style.backgroundImage= "url("+(this.enabled?this.ui.isOffline()||!this.isConnected()||this.file.invalidChecksum?Editor.syncProblemImage:Editor.syncImage:Editor.syncDisabledImage)+")")}; -DrawioFileSync.prototype.updateStatus=function(){this.isConnected()&&null!=this.lastActivity&&((new Date).getTime()-this.lastActivity.getTime())/1E3>this.inactivityTimeoutSeconds&&this.stop();if(!(this.file.isModified()||this.file.inConflictState||null!=this.file.autosaveThread||this.file.savingFile||this.file.redirectDialogShowing))if(this.enabled&&null!=this.ui.statusContainer){var a=this.ui.timeSince(new Date(this.lastModified));null==a&&(a=mxResources.get("lessThanAMinute"));var d=this.file.isRevisionHistorySupported(), -c=this.lastMessage;this.lastMessage=null;null!=c&&40<c.length&&(c=c.substring(0,40)+"...");a=mxResources.get("lastChange",[a]);this.ui.editor.setStatus('<div title="'+mxUtils.htmlEntities(a)+'" style="display:inline-block;">'+mxUtils.htmlEntities(a)+"</div>"+(null!=c?' <span style="opacity:0;" title="'+mxUtils.htmlEntities(c)+'">('+mxUtils.htmlEntities(c)+")</span>":"")+(this.file.isEditable()?"":'<div class="geStatusAlert" style="margin-left:8px;display:inline-block;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+ -"</div>")+(this.isConnected()?"":'<div class="geStatusAlert geBlink" style="margin-left:8px;display:inline-block;">'+mxUtils.htmlEntities(mxResources.get("disconnected"))+"</div>"));c=this.ui.statusContainer.getElementsByTagName("div");0<c.length&&d&&(c[0].style.cursor="pointer",c[0].style.textDecoration="underline",mxEvent.addListener(c[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()})));d=this.ui.statusContainer.getElementsByTagName("span");if(0<d.length){var b= -d[0];mxUtils.setPrefixedStyle(b.style,"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(b,100);mxUtils.setPrefixedStyle(b.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(b,0)}),this.updateStatusInterval/2)}),0)}this.resetUpdateStatusThread()}else this.file.addAllSavedStatus()}; +DrawioFileSync.prototype.updateStatus=function(){this.isConnected()&&null!=this.lastActivity&&((new Date).getTime()-this.lastActivity.getTime())/1E3>this.inactivityTimeoutSeconds&&this.stop();if(!(this.file.isModified()||this.file.inConflictState||null!=this.file.autosaveThread||this.file.savingFile||this.file.redirectDialogShowing))if(this.enabled&&null!=this.ui.statusContainer){var a=this.ui.timeSince(new Date(this.lastModified));null==a&&(a=mxResources.get("lessThanAMinute"));var c=this.file.isRevisionHistorySupported(), +d=this.lastMessage;this.lastMessage=null;null!=d&&40<d.length&&(d=d.substring(0,40)+"...");a=mxResources.get("lastChange",[a]);this.ui.editor.setStatus('<div title="'+mxUtils.htmlEntities(a)+'" style="display:inline-block;">'+mxUtils.htmlEntities(a)+"</div>"+(null!=d?' <span style="opacity:0;" title="'+mxUtils.htmlEntities(d)+'">('+mxUtils.htmlEntities(d)+")</span>":"")+(this.file.isEditable()?"":'<div class="geStatusAlert" style="margin-left:8px;display:inline-block;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+ +"</div>")+(this.isConnected()?"":'<div class="geStatusAlert geBlink" style="margin-left:8px;display:inline-block;">'+mxUtils.htmlEntities(mxResources.get("disconnected"))+"</div>"));d=this.ui.statusContainer.getElementsByTagName("div");0<d.length&&c&&(d[0].style.cursor="pointer",d[0].style.textDecoration="underline",mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()})));c=this.ui.statusContainer.getElementsByTagName("span");if(0<c.length){var b= +c[0];mxUtils.setPrefixedStyle(b.style,"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(b,100);mxUtils.setPrefixedStyle(b.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(b,0)}),this.updateStatusInterval/2)}),0)}this.resetUpdateStatusThread()}else this.file.addAllSavedStatus()}; DrawioFileSync.prototype.resetUpdateStatusThread=function(){null!=this.updateStatusThread&&window.clearInterval(this.updateStatusThread);null!=this.channel&&(this.updateStatusThread=window.setInterval(mxUtils.bind(this,function(){this.updateStatus()}),this.updateStatusInterval))};DrawioFileSync.prototype.installListeners=function(){null!=this.pusher&&null!=this.pusher.connection&&this.pusher.connection.bind("state_change",this.connectionListener);null!=this.channel&&this.channel.bind("changed",this.changeListener)}; DrawioFileSync.prototype.handleMessageData=function(a){"desc"==a.a?this.file.savingFile||this.reloadDescriptor():"join"==a.a||"leave"==a.a?("join"==a.a&&this.file.stats.joined++,null!=a.name&&(this.lastMessage=mxResources.get("join"==a.a?"userJoined":"userLeft",[decodeURIComponent(a.name)]),this.resetUpdateStatusThread(),this.updateStatus())):null!=a.m&&(a=new Date(a.m),null==this.lastMessageModified||this.lastMessageModified<a)&&(this.lastMessageModified=a,this.fileChangedNotify())}; DrawioFileSync.prototype.isValidState=function(){return this.ui.getCurrentFile()==this.file&&this.file.sync==this&&!this.file.invalidChecksum&&!this.file.redirectDialogShowing}; DrawioFileSync.prototype.fileChangedNotify=function(){if(this.isValidState())if(this.file.savingFile)this.remoteFileChanged=!0;else var a=this.fileChanged(mxUtils.bind(this,function(a){this.updateStatus()}),mxUtils.bind(this,function(a){this.file.handleFileError(a)}),mxUtils.bind(this,function(){return!this.file.savingFile&&this.notifyThread!=a}),!0)}; -DrawioFileSync.prototype.fileChanged=function(a,d,c,b){return this.notifyThread=b=window.setTimeout(mxUtils.bind(this,function(){null!=c&&c()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(b){null!=c&&c()||(this.isValidState()?this.catchup(b,a,d,c):null!=d&&d())}),d):null!=d&&d())}),b?this.cacheReadyDelay:0)}; +DrawioFileSync.prototype.fileChanged=function(a,c,d,b){return this.notifyThread=b=window.setTimeout(mxUtils.bind(this,function(){null!=d&&d()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(b){null!=d&&d()||(this.isValidState()?this.catchup(b,a,c,d):null!=c&&c())}),c):null!=c&&c())}),b?this.cacheReadyDelay:0)}; DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorRevisionId(a,this.file.getCurrentRevisionId()),this.updateDescriptor(a),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(a){this.file.inConflictState=!0;this.file.handleFileError(a)}))}; DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()}; -DrawioFileSync.prototype.catchup=function(a,d,c,b){if(null!=a&&(null==b||!b())){var g=this.file.getDescriptorRevisionId(a),e=this.file.getCurrentRevisionId();if(e==g)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=d&&d();else if(this.isValidState()){var k=this.file.getDescriptorSecret(a),n=0,m=!1,t=mxUtils.bind(this,function(){if(null==b||!b())if(e!=this.file.getCurrentRevisionId())null!=d&&d();else if(this.isValidState()){var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=!1; -this.reload(d,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(e)+"&to="+encodeURIComponent(g)+(null!=k?"&secret="+encodeURIComponent(k):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(l);if(f&&(null==b||!b()))if(e!=this.file.getCurrentRevisionId())null!=d&&d();else if(this.isValidState()){var k=null,p=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var q= -JSON.parse(g.getText());if(null!=q&&0<q.length)for(var z=0;z<q.length;z++){var y=this.stringToObject(q[z]);if(y.v>DrawioFileSync.PROTOCOL){m=!0;p=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)k=y.d.checksum,p.push(y.d.patch);else{m=!0;p=[];break}}}catch(C){p=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<p.length?(this.file.stats.cacheHits++,this.merge(p,k,a,d,c,b)):n<=this.maxCacheReadyRetries-1&&!m&&401!=g.getStatus()?(n++,this.file.stats.cacheMiss++,window.setTimeout(t, -(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(d,c,b))}catch(C){null!=c&&c(C)}}else null!=c&&c()}))}else null!=c&&c()});window.setTimeout(t,this.cacheReadyDelay)}else null!=c&&c()}};DrawioFileSync.prototype.reload=function(a,d,c,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=d&&d(a)}),c,b)}; -DrawioFileSync.prototype.merge=function(a,d,c,b,g,e){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var k=this.file.ignorePatches(a),n=this.file.getDescriptorRevisionId(c);if(!k){for(e=0;e<a.length;e++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages, -a[e]);var m=null!=d?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",n,"etag",this.file.getDescriptorEtag(c),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",d==m,d);if(null!=d&&d!=m){var t=this.ui.hashValue(this.file.getCurrentRevisionId()),f=this.ui.hashValue(n);this.file.checksumError(g,a,"From: "+t+"\nTo: "+f+"\nChecksum: "+d+"\nCurrent: "+m,n,"merge"); -return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),c);this.file.backupPatch=null;null!=b&&b()}catch(u){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=g&&g(u);try{if(this.file.errorReportsEnabled)t=this.ui.hashValue(this.file.getCurrentRevisionId()),f=this.ui.hashValue(n),this.file.sendErrorReport("Error in merge", -"From: "+t+"\nTo: "+f+"\nChecksum: "+d+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),u);else{var l=this.file.getCurrentUser(),p=null!=l?l.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),p,u)}}catch(v){}}}; -DrawioFileSync.prototype.descriptorChanged=function(a){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var d=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),c=this.file.getCurrentRevisionId(),b=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(a)+"&to="+encodeURIComponent(c)+"&msg="+encodeURIComponent(d)+"&data="+encodeURIComponent(b));this.file.stats.bytesSent+=b.length;this.file.stats.msgSent++}this.updateStatus()}; +DrawioFileSync.prototype.catchup=function(a,c,d,b){if(null!=a&&(null==b||!b())){var g=this.file.getDescriptorRevisionId(a),e=this.file.getCurrentRevisionId();if(e==g)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=c&&c();else if(this.isValidState()){var k=this.file.getDescriptorSecret(a),n=0,m=!1,t=mxUtils.bind(this,function(){if(null==b||!b())if(e!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=!1; +this.reload(c,d,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(e)+"&to="+encodeURIComponent(g)+(null!=k?"&secret="+encodeURIComponent(k):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(l);if(f&&(null==b||!b()))if(e!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var k=null,p=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var q= +JSON.parse(g.getText());if(null!=q&&0<q.length)for(var z=0;z<q.length;z++){var y=this.stringToObject(q[z]);if(y.v>DrawioFileSync.PROTOCOL){m=!0;p=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)k=y.d.checksum,p.push(y.d.patch);else{m=!0;p=[];break}}}catch(C){p=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<p.length?(this.file.stats.cacheHits++,this.merge(p,k,a,c,d,b)):n<=this.maxCacheReadyRetries-1&&!m&&401!=g.getStatus()?(n++,this.file.stats.cacheMiss++,window.setTimeout(t, +(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,d,b))}catch(C){null!=d&&d(C)}}else null!=d&&d()}))}else null!=d&&d()});window.setTimeout(t,this.cacheReadyDelay)}else null!=d&&d()}};DrawioFileSync.prototype.reload=function(a,c,d,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),d,b)}; +DrawioFileSync.prototype.merge=function(a,c,d,b,g,e){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var k=this.file.ignorePatches(a),n=this.file.getDescriptorRevisionId(d);if(!k){for(e=0;e<a.length;e++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages, +a[e]);var m=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",n,"etag",this.file.getDescriptorEtag(d),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==m,c);if(null!=c&&c!=m){var t=this.ui.hashValue(this.file.getCurrentRevisionId()),f=this.ui.hashValue(n);this.file.checksumError(g,a,"From: "+t+"\nTo: "+f+"\nChecksum: "+c+"\nCurrent: "+m,n,"merge"); +return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),d);this.file.backupPatch=null;null!=b&&b()}catch(u){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=g&&g(u);try{if(this.file.errorReportsEnabled)t=this.ui.hashValue(this.file.getCurrentRevisionId()),f=this.ui.hashValue(n),this.file.sendErrorReport("Error in merge", +"From: "+t+"\nTo: "+f+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),u);else{var l=this.file.getCurrentUser(),p=null!=l?l.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),p,u)}}catch(v){}}}; +DrawioFileSync.prototype.descriptorChanged=function(a){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var c=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),d=this.file.getCurrentRevisionId(),b=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(a)+"&to="+encodeURIComponent(d)+"&msg="+encodeURIComponent(c)+"&data="+encodeURIComponent(b));this.file.stats.bytesSent+=b.length;this.file.stats.msgSent++}this.updateStatus()}; DrawioFileSync.prototype.objectToString=function(a){a=Graph.compress(JSON.stringify(a));null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.encrypt(a,this.key).toString());return a};DrawioFileSync.prototype.stringToObject=function(a){null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.decrypt(a,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(a))}; -DrawioFileSync.prototype.fileSaved=function(a,d,c,b){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var g=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);b=this.ui.getHashValueForPages(a);g=this.ui.diffPages(g,a);d=this.file.getDescriptorRevisionId(d); -var e=this.file.getCurrentRevisionId(),k=this.objectToString(this.createMessage({patch:g,checksum:b})),n=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),m=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=k.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(d)+"&to="+encodeURIComponent(e)+"&msg="+encodeURIComponent(n)+(null!=m?"&secret="+encodeURIComponent(m):"")+(k.length<this.maxCacheEntrySize? -"&data="+encodeURIComponent(k):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",d,"to",e,"etag",this.file.getCurrentEtag(),k.length,"bytes","diff",g,"checksum",b)}this.file.shadowPages=a;null!=c&&c()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a}; -DrawioFileSync.prototype.createMessage=function(a){return{v:DrawioFileSync.PROTOCOL,d:a,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(a,d,c){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,d,c):this.fileChanged(d,c)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=c&&c({message:mxResources.get("timeout")}))}; +DrawioFileSync.prototype.fileSaved=function(a,c,d,b){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var g=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);b=this.ui.getHashValueForPages(a);g=this.ui.diffPages(g,a);c=this.file.getDescriptorRevisionId(c); +var e=this.file.getCurrentRevisionId(),k=this.objectToString(this.createMessage({patch:g,checksum:b})),n=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),m=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=k.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(c)+"&to="+encodeURIComponent(e)+"&msg="+encodeURIComponent(n)+(null!=m?"&secret="+encodeURIComponent(m):"")+(k.length<this.maxCacheEntrySize? +"&data="+encodeURIComponent(k):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",c,"to",e,"etag",this.file.getCurrentEtag(),k.length,"bytes","diff",g,"checksum",b)}this.file.shadowPages=a;null!=d&&d()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a}; +DrawioFileSync.prototype.createMessage=function(a){return{v:DrawioFileSync.PROTOCOL,d:a,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(a,c,d){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,c,d):this.fileChanged(c,d)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=d&&d({message:mxResources.get("timeout")}))}; DrawioFileSync.prototype.stop=function(){null!=this.pusher&&(EditorUi.debug("Sync.stop",[this]),null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null);this.updateOnlineState();this.updateStatus()}; -DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var a=this.file.getCurrentUser(),d={a:"leave"};null!=a&&(d.name=encodeURIComponent(a.displayName),d.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(d))));this.file.stats.msgSent++}this.stop();null!=this.updateStatusThread&&(window.clearInterval(this.updateStatusThread),this.updateStatusThread=null);null!=this.onlineListener&&(mxEvent.removeListener(window, +DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var a=this.file.getCurrentUser(),c={a:"leave"};null!=a&&(c.name=encodeURIComponent(a.displayName),c.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(c))));this.file.stats.msgSent++}this.stop();null!=this.updateStatusThread&&(window.clearInterval(this.updateStatusThread),this.updateStatusThread=null);null!=this.onlineListener&&(mxEvent.removeListener(window, "online",this.onlineListener),this.onlineListener=null);null!=this.visibleListener&&(mxEvent.removeListener(document,"visibilitychange",this.visibleListener),this.visibleListener=null);null!=this.activityListener&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener),mxEvent.removeListener(document,"keypress",this.activityListener),mxEvent.removeListener(window,"focus",this.activityListener),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.removeListener(document, "touchstart",this.activityListener),mxEvent.removeListener(document,"touchmove",this.activityListener)),this.activityListener=null);null!=this.collaboratorsElement&&(this.collaboratorsElement.parentNode.removeChild(this.collaboratorsElement),this.collaboratorsElement=null)};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#ffffff"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#ffffff"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="#ffffff"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="#ffffff"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="white"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="#ffffff"/></add></mxStylesheet>').documentElement; Graph.prototype.defaultThemes.darkTheme=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#2a2a2a"/><add as="strokeColor" value="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="#2a2a2a"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="#2a2a2a"/></add></mxStylesheet>').documentElement;function mxAsyncCanvas(a){mxAbstractCanvas2D.call(this);this.htmlCanvas=a;a.images=a.images||[];a.subCanvas=a.subCanvas||[]}mxUtils.extend(mxAsyncCanvas,mxAbstractCanvas2D);mxAsyncCanvas.prototype.htmlCanvas=null;mxAsyncCanvas.prototype.canvasIndex=0;mxAsyncCanvas.prototype.waitCounter=0;mxAsyncCanvas.prototype.onComplete=null;mxAsyncCanvas.prototype.incWaitCounter=function(){this.waitCounter++}; -mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxAsyncCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};mxAsyncCanvas.prototype.rotate=function(a,d,c,b,g){}; +mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxAsyncCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};mxAsyncCanvas.prototype.rotate=function(a,c,d,b,g){}; mxAsyncCanvas.prototype.setAlpha=function(a){this.state.alpha=a};mxAsyncCanvas.prototype.setFontColor=function(a){this.state.fontColor=a};mxAsyncCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAsyncCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAsyncCanvas.prototype.setFontSize=function(a){this.state.fontSize=a}; -mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,d,c,b){};mxAsyncCanvas.prototype.roundrect=function(a,d,c,b,g,e){};mxAsyncCanvas.prototype.ellipse=function(a,d,c,b){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a}; -mxAsyncCanvas.prototype.image=function(a,d,c,b,g,e,k,n){g=this.rewriteImageSource(g);a=this.htmlCanvas.images[g];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[g]=a,a.src=g)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){}; -mxAsyncCanvas.prototype.text=function(a,d,c,b,g,e,k,n,m,t,f,l){if(null!=g&&0!=g.length&&(a=this.state.scale,"html"==m&&"function"===typeof html2canvas)){this.incWaitCounter();var p=this.canvasIndex++;html2canvas(g,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[p]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null; -mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,b,g){return c+c+b+b+g+g});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++}; +mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,c,d,b){};mxAsyncCanvas.prototype.roundrect=function(a,c,d,b,g,e){};mxAsyncCanvas.prototype.ellipse=function(a,c,d,b){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a}; +mxAsyncCanvas.prototype.image=function(a,c,d,b,g,e,k,n){g=this.rewriteImageSource(g);a=this.htmlCanvas.images[g];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[g]=a,a.src=g)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){}; +mxAsyncCanvas.prototype.text=function(a,c,d,b,g,e,k,n,m,t,f,l){if(null!=g&&0!=g.length&&(a=this.state.scale,"html"==m&&"function"===typeof html2canvas)){this.incWaitCounter();var p=this.canvasIndex++;html2canvas(g,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[p]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null; +mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,d,b,g){return d+d+b+b+g+g});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++}; mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily}; -mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a;this.ctx.scale(a,a)};mxJsCanvas.prototype.translate=function(a,d){this.state.dx+=a;this.state.dy+=d;this.ctx.translate(a,d)}; -mxJsCanvas.prototype.rotate=function(a,d,c,b,g){b-=this.state.dx;g-=this.state.dy;this.ctx.translate(b,g);(d||c)&&this.ctx.scale(d?-1:1,c?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-b,-g)};mxJsCanvas.prototype.setAlpha=function(a){this.state.alpha=a;this.ctx.globalAlpha=a};mxJsCanvas.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null;this.ctx.fillStyle=a}; -mxJsCanvas.prototype.setGradient=function(a,d,c,b,g,e,k,n,m){c=this.ctx.createLinearGradient(0,b,0,b+e);b=this.state;b.fillColor=a;b.fillAlpha=null!=n?n:1;b.gradientColor=d;b.gradientAlpha=null!=m?m:1;b.gradientDirection=k;a=this.hexToRgb(a);d=this.hexToRgb(d);null!=a&&c.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+b.fillAlpha+")");null!=d&&c.addColorStop(1,"rgba("+d.r+","+d.g+","+d.b+","+b.gradientAlpha+")");this.ctx.fillStyle=c}; -mxJsCanvas.prototype.setStrokeColor=function(a){null!=a&&(a==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=a,this.state.strokeColor=a))};mxJsCanvas.prototype.setStrokeWidth=function(a){this.ctx.lineWidth=a};mxJsCanvas.prototype.setDashed=function(a){if(this.state.dashed=a){a=this.state.dashPattern.split(" ");for(var d=0;d<a.length;d++)a[d]=parseInt(a[d],10);this.setLineDash(a)}else this.setLineDash([0])}; -mxJsCanvas.prototype.setLineDash=function(a){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(a)}catch(d){}};mxJsCanvas.prototype.setDashPattern=function(a){this.state.dashPattern=a;if(this.state.dashed){a=a.split(" ");for(var d=0;d<a.length;d++)a[d]=parseInt(a[d],10);this.ctx.setLineDash(a)}};mxJsCanvas.prototype.setLineCap=function(a){this.ctx.lineCap=a};mxJsCanvas.prototype.setLineJoin=function(a){this.ctx.lineJoin=a}; +mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a;this.ctx.scale(a,a)};mxJsCanvas.prototype.translate=function(a,c){this.state.dx+=a;this.state.dy+=c;this.ctx.translate(a,c)}; +mxJsCanvas.prototype.rotate=function(a,c,d,b,g){b-=this.state.dx;g-=this.state.dy;this.ctx.translate(b,g);(c||d)&&this.ctx.scale(c?-1:1,d?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-b,-g)};mxJsCanvas.prototype.setAlpha=function(a){this.state.alpha=a;this.ctx.globalAlpha=a};mxJsCanvas.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null;this.ctx.fillStyle=a}; +mxJsCanvas.prototype.setGradient=function(a,c,d,b,g,e,k,n,m){d=this.ctx.createLinearGradient(0,b,0,b+e);b=this.state;b.fillColor=a;b.fillAlpha=null!=n?n:1;b.gradientColor=c;b.gradientAlpha=null!=m?m:1;b.gradientDirection=k;a=this.hexToRgb(a);c=this.hexToRgb(c);null!=a&&d.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+b.fillAlpha+")");null!=c&&d.addColorStop(1,"rgba("+c.r+","+c.g+","+c.b+","+b.gradientAlpha+")");this.ctx.fillStyle=d}; +mxJsCanvas.prototype.setStrokeColor=function(a){null!=a&&(a==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=a,this.state.strokeColor=a))};mxJsCanvas.prototype.setStrokeWidth=function(a){this.ctx.lineWidth=a};mxJsCanvas.prototype.setDashed=function(a){if(this.state.dashed=a){a=this.state.dashPattern.split(" ");for(var c=0;c<a.length;c++)a[c]=parseInt(a[c],10);this.setLineDash(a)}else this.setLineDash([0])}; +mxJsCanvas.prototype.setLineDash=function(a){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(a)}catch(c){}};mxJsCanvas.prototype.setDashPattern=function(a){this.state.dashPattern=a;if(this.state.dashed){a=a.split(" ");for(var c=0;c<a.length;c++)a[c]=parseInt(a[c],10);this.ctx.setLineDash(a)}};mxJsCanvas.prototype.setLineCap=function(a){this.ctx.lineCap=a};mxJsCanvas.prototype.setLineJoin=function(a){this.ctx.lineJoin=a}; mxJsCanvas.prototype.setMiterLimit=function(a){this.ctx.lineJoin=a};mxJsCanvas.prototype.setFontColor=function(a){this.ctx.fillStyle=a};mxJsCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxJsCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxJsCanvas.prototype.setFontSize=function(a){this.state.fontSize=a}; mxJsCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxJsCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxJsCanvas.prototype.setShadow=function(a){(this.state.shadow=a)?(this.setShadowOffset(this.state.shadowDx,this.state.shadowDy),this.setShadowAlpha(this.state.shadowAlpha)):(this.ctx.shadowColor="transparent",this.ctx.shadowBlur=0,this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0)}; -mxJsCanvas.prototype.setShadowColor=function(a){if(null==a||a==mxConstants.NONE)a=null,this.ctx.shadowColor="transparent";this.state.shadowColor=a;if(this.state.shadow&&null!=a){var d=null!=this.state.shadowAlpha?this.state.shadowAlpha:1;a=this.hexToRgb(a);this.ctx.shadowColor="rgba("+a.r+","+a.g+","+a.b+","+d+")"}};mxJsCanvas.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a;this.setShadowColor(this.state.shadowColor)}; -mxJsCanvas.prototype.setShadowOffset=function(a,d){this.state.shadowDx=a;this.state.shadowDy=d;this.state.shadow&&(this.ctx.shadowOffsetX=a,this.ctx.shadowOffsetY=d)};mxJsCanvas.prototype.moveTo=function(a,d){this.ctx.moveTo(a,d);this.lastMoveX=a;this.lastMoveY=d};mxJsCanvas.prototype.lineTo=function(a,d){this.ctx.lineTo(a,d);this.lastMoveX=a;this.lastMoveY=d};mxJsCanvas.prototype.quadTo=function(a,d,c,b){this.ctx.quadraticCurveTo(a,d,c,b);this.lastMoveX=c;this.lastMoveY=b}; -mxJsCanvas.prototype.arcTo=function(a,d,c,b,g,e,k){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,d,c,b,g,e,k);if(null!=a)for(d=0;d<a.length;d+=6)this.curveTo(a[d],a[d+1],a[d+2],a[d+3],a[d+4],a[d+5])};mxJsCanvas.prototype.curveTo=function(a,d,c,b,g,e){this.ctx.bezierCurveTo(a,d,c,b,g,e);this.lastMoveX=g;this.lastMoveY=e};mxJsCanvas.prototype.rect=function(a,d,c,b){this.begin();this.moveTo(a,d);this.lineTo(a+c,d);this.lineTo(a+c,d+b);this.lineTo(a,d+b);this.close()}; -mxJsCanvas.prototype.roundrect=function(a,d,c,b,g,e){this.begin();this.moveTo(a+g,d);this.lineTo(a+c-g,d);this.quadTo(a+c,d,a+c,d+e);this.lineTo(a+c,d+b-e);this.quadTo(a+c,d+b,a+c-g,d+b);this.lineTo(a+g,d+b);this.quadTo(a,d+b,a,d+b-e);this.lineTo(a,d+e);this.quadTo(a,d,a+g,d)};mxJsCanvas.prototype.ellipse=function(a,d,c,b){this.ctx.save();this.ctx.translate(a+c/2,d+b/2);this.ctx.scale(c/2,b/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()}; +mxJsCanvas.prototype.setShadowColor=function(a){if(null==a||a==mxConstants.NONE)a=null,this.ctx.shadowColor="transparent";this.state.shadowColor=a;if(this.state.shadow&&null!=a){var c=null!=this.state.shadowAlpha?this.state.shadowAlpha:1;a=this.hexToRgb(a);this.ctx.shadowColor="rgba("+a.r+","+a.g+","+a.b+","+c+")"}};mxJsCanvas.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a;this.setShadowColor(this.state.shadowColor)}; +mxJsCanvas.prototype.setShadowOffset=function(a,c){this.state.shadowDx=a;this.state.shadowDy=c;this.state.shadow&&(this.ctx.shadowOffsetX=a,this.ctx.shadowOffsetY=c)};mxJsCanvas.prototype.moveTo=function(a,c){this.ctx.moveTo(a,c);this.lastMoveX=a;this.lastMoveY=c};mxJsCanvas.prototype.lineTo=function(a,c){this.ctx.lineTo(a,c);this.lastMoveX=a;this.lastMoveY=c};mxJsCanvas.prototype.quadTo=function(a,c,d,b){this.ctx.quadraticCurveTo(a,c,d,b);this.lastMoveX=d;this.lastMoveY=b}; +mxJsCanvas.prototype.arcTo=function(a,c,d,b,g,e,k){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,c,d,b,g,e,k);if(null!=a)for(c=0;c<a.length;c+=6)this.curveTo(a[c],a[c+1],a[c+2],a[c+3],a[c+4],a[c+5])};mxJsCanvas.prototype.curveTo=function(a,c,d,b,g,e){this.ctx.bezierCurveTo(a,c,d,b,g,e);this.lastMoveX=g;this.lastMoveY=e};mxJsCanvas.prototype.rect=function(a,c,d,b){this.begin();this.moveTo(a,c);this.lineTo(a+d,c);this.lineTo(a+d,c+b);this.lineTo(a,c+b);this.close()}; +mxJsCanvas.prototype.roundrect=function(a,c,d,b,g,e){this.begin();this.moveTo(a+g,c);this.lineTo(a+d-g,c);this.quadTo(a+d,c,a+d,c+e);this.lineTo(a+d,c+b-e);this.quadTo(a+d,c+b,a+d-g,c+b);this.lineTo(a+g,c+b);this.quadTo(a,c+b,a,c+b-e);this.lineTo(a,c+e);this.quadTo(a,c,a+g,c)};mxJsCanvas.prototype.ellipse=function(a,c,d,b){this.ctx.save();this.ctx.translate(a+d/2,c+b/2);this.ctx.scale(d/2,b/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()}; mxJsCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a}; -mxJsCanvas.prototype.image=function(a,d,c,b,g,e,k,n){g=this.rewriteImageSource(g);g=this.images[g];if(null!=g&&0<g.height&&0<g.width){var m=this.ctx;m.save();if(e){e=g.width;var t=g.height,f=Math.min(c/e,b/t);a+=(c-e*f)/2;d+=(b-t*f)/2;c=e*f;b=t*f}k&&(m.translate(2*a+c,0),m.scale(-1,1));n&&(m.translate(0,2*d+b),m.scale(1,-1));m.drawImage(g,a,d,c,b);m.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()}; -mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var a=this.ctx.shadowColor,d=this.ctx.shadowOffsetX,c=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=a;this.ctx.shadowOffsetX=d;this.ctx.shadowOffsetY=c}else this.ctx.fill(),this.ctx.stroke()}; -mxJsCanvas.prototype.text=function(a,d,c,b,g,e,k,n,m,t,f,l){if(null!=g&&0!=g.length){c=this.state.scale;0!=l&&(this.ctx.translate(Math.round(a),Math.round(d)),this.ctx.rotate(l*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-d)));if("html"==m){g=this.subCanvas[this.canvasIndex++];m=g.height;l=g.width;switch(k){case mxConstants.ALIGN_MIDDLE:d-=m/2/c;break;case mxConstants.ALIGN_BOTTOM:d-=m/c}switch(e){case mxConstants.ALIGN_CENTER:a-=l/2/c;break;case mxConstants.ALIGN_RIGHT:a-=l/c}this.ctx.save(); -if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(a)-.5,Math.round(d)-.5,Math.round(g.width/c),Math.round(g.height/c))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(d)-.5,Math.round(g.width/c),Math.round(g.height/c)));this.ctx.scale(1/c,1/c);this.ctx.drawImage(g, -Math.round(a*c),Math.round(d*c))}else{this.ctx.save();this.updateFont();l=document.createElement("div");l.innerHTML=g;l.style.position="absolute";l.style.top="-9999px";l.style.left="-9999px";l.style.fontFamily=this.state.fontFamily;l.style.fontWeight="bold";l.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(l);m=[l.offsetWidth,l.offsetHeight];document.body.removeChild(l);g=g.split("\n");l=m[1];this.ctx.textBaseline="top";m=d;switch(k){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline= -"middle";d-=(g.length-1)*l/2;m=d-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",d-=l*(g.length-1),m=d-this.state.fontSize}k=[];l=[];for(c=0;c<g.length;c++)l[c]=a,k[c]=this.ctx.measureText(g[c]).width,null!=e&&e!=mxConstants.ALIGN_LEFT&&(l[c]-=k[c],e==mxConstants.ALIGN_CENTER&&(l[c]+=k[c]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=l[0];e=k[0];for(c=1;c<g.length;c++)a=Math.min(a,l[c]),e=Math.max(e,k[c]);this.ctx.save(); -a=Math.round(a)-.5;m=Math.round(m)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,m,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(a,m,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));this.ctx.restore()}for(c=0;c<g.length;c++)this.ctx.fillText(g[c],l[c],d),d+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}}; -mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};DrawioClient=function(a,d){mxEventSource.call(this);this.ui=a;this.cookieName=d;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(a){this.user=a;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user}; +mxJsCanvas.prototype.image=function(a,c,d,b,g,e,k,n){g=this.rewriteImageSource(g);g=this.images[g];if(null!=g&&0<g.height&&0<g.width){var m=this.ctx;m.save();if(e){e=g.width;var t=g.height,f=Math.min(d/e,b/t);a+=(d-e*f)/2;c+=(b-t*f)/2;d=e*f;b=t*f}k&&(m.translate(2*a+d,0),m.scale(-1,1));n&&(m.translate(0,2*c+b),m.scale(1,-1));m.drawImage(g,a,c,d,b);m.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()}; +mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var a=this.ctx.shadowColor,c=this.ctx.shadowOffsetX,d=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=a;this.ctx.shadowOffsetX=c;this.ctx.shadowOffsetY=d}else this.ctx.fill(),this.ctx.stroke()}; +mxJsCanvas.prototype.text=function(a,c,d,b,g,e,k,n,m,t,f,l){if(null!=g&&0!=g.length){d=this.state.scale;0!=l&&(this.ctx.translate(Math.round(a),Math.round(c)),this.ctx.rotate(l*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-c)));if("html"==m){g=this.subCanvas[this.canvasIndex++];m=g.height;l=g.width;switch(k){case mxConstants.ALIGN_MIDDLE:c-=m/2/d;break;case mxConstants.ALIGN_BOTTOM:c-=m/d}switch(e){case mxConstants.ALIGN_CENTER:a-=l/2/d;break;case mxConstants.ALIGN_RIGHT:a-=l/d}this.ctx.save(); +if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(g.width/d),Math.round(g.height/d))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(g.width/d),Math.round(g.height/d)));this.ctx.scale(1/d,1/d);this.ctx.drawImage(g, +Math.round(a*d),Math.round(c*d))}else{this.ctx.save();this.updateFont();l=document.createElement("div");l.innerHTML=g;l.style.position="absolute";l.style.top="-9999px";l.style.left="-9999px";l.style.fontFamily=this.state.fontFamily;l.style.fontWeight="bold";l.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(l);m=[l.offsetWidth,l.offsetHeight];document.body.removeChild(l);g=g.split("\n");l=m[1];this.ctx.textBaseline="top";m=c;switch(k){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline= +"middle";c-=(g.length-1)*l/2;m=c-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",c-=l*(g.length-1),m=c-this.state.fontSize}k=[];l=[];for(d=0;d<g.length;d++)l[d]=a,k[d]=this.ctx.measureText(g[d]).width,null!=e&&e!=mxConstants.ALIGN_LEFT&&(l[d]-=k[d],e==mxConstants.ALIGN_CENTER&&(l[d]+=k[d]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=l[0];e=k[0];for(d=1;d<g.length;d++)a=Math.min(a,l[d]),e=Math.max(e,k[d]);this.ctx.save(); +a=Math.round(a)-.5;m=Math.round(m)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,m,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(a,m,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));this.ctx.restore()}for(d=0;d<g.length;d++)this.ctx.fillText(g[d],l[d],c),c+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}}; +mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};DrawioClient=function(a,c){mxEventSource.call(this);this.ui=a;this.cookieName=c;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(a){this.user=a;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user}; DrawioClient.prototype.clearPersistentToken=function(){if(isLocalStorage)localStorage.removeItem("."+this.cookieName),sessionStorage.removeItem("."+this.cookieName);else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie=this.cookieName+"=; expires="+a.toUTCString()}}; -DrawioClient.prototype.getPersistentToken=function(a){var d=null;isLocalStorage&&(d=localStorage.getItem("."+this.cookieName),null==d&&a&&(d=sessionStorage.getItem("."+this.cookieName)));if(null==d&&"undefined"!=typeof Storage){var c=document.cookie;a=this.cookieName+"=";var b=c.indexOf(a);0<=b&&(b+=a.length,d=c.indexOf(";",b),0>d?d=c.length:postCookie=c.substring(d),d=c.substring(b,d),d=0<d.length?d:null,null!=d&&isLocalStorage&&(c=new Date,c.setYear(c.getFullYear()-1),document.cookie=a+"; expires="+ -c.toUTCString(),localStorage.setItem("."+this.cookieName,d)))}return d};DrawioClient.prototype.setPersistentToken=function(a,d){try{if(null!=a)if(isLocalStorage)d?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var c=new Date;c.setYear(c.getFullYear()+10);var b=this.cookieName+"="+a+"; path=/"+(d?"":"; expires="+c.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()}catch(g){this.ui.handleError(g)}};DrawioUser=function(a,d,c,b,g){this.id=a;this.email=d;this.displayName=c;this.pictureUrl=b;this.locale=g};DriveFile=function(a,d,c){DrawioFile.call(this,a,d);this.desc=c};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.autosaveDelay=2500;DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted}; +DrawioClient.prototype.getPersistentToken=function(a){var c=null;isLocalStorage&&(c=localStorage.getItem("."+this.cookieName),null==c&&a&&(c=sessionStorage.getItem("."+this.cookieName)));if(null==c&&"undefined"!=typeof Storage){var d=document.cookie;a=this.cookieName+"=";var b=d.indexOf(a);0<=b&&(b+=a.length,c=d.indexOf(";",b),0>c?c=d.length:postCookie=d.substring(c),c=d.substring(b,c),c=0<c.length?c:null,null!=c&&isLocalStorage&&(d=new Date,d.setYear(d.getFullYear()-1),document.cookie=a+"; expires="+ +d.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){try{if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var d=new Date;d.setYear(d.getFullYear()+10);var b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+d.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()}catch(g){this.ui.handleError(g)}};DrawioUser=function(a,c,d,b,g){this.id=a;this.email=c;this.displayName=d;this.pictureUrl=b;this.locale=g};DriveFile=function(a,c,d){DrawioFile.call(this,a,c);this.desc=d};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.autosaveDelay=2500;DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted}; DriveFile.prototype.isConflict=function(a){return null!=a&&null!=a.error&&412==a.error.code};DriveFile.prototype.getCurrentUser=function(){return null!=this.ui.drive?this.ui.drive.user:null};DriveFile.prototype.getMode=function(){return App.MODE_GOOGLE}; -DriveFile.prototype.getPublicUrl=function(a){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(d){if(null!=d&&null!=d.items)for(var c=0;c<d.items.length;c++)if("anyoneWithLink"===d.items[c].id||"anyone"===d.items[c].id){a(this.desc.webContentLink);return}a(null)}),mxUtils.bind(this,function(){a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0}; -DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(a,d,c,b,g){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,d,c,b,g)}),c,b,g])}; -DriveFile.prototype.saveFile=function(a,d,c,b,g,e){try{if(!this.isEditable())null!=c&&c();else if(!this.savingFile){var k=mxUtils.bind(this,function(a,e){var m=null,f=null;try{m=this.isModified;f=this.isModified();this.setModified(!1);this.savingFileTime=new Date;this.savingFile=!0;this.isModified=function(){return!0};var l=this.desc;this.ui.drive.saveFile(this,e,mxUtils.bind(this,function(a,e){try{this.savingFile=!1,this.isModified=m,0!=a?(d&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay= -Math.min(8E3,Math.max(this.saveDelay+500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(e,l,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c(a)}),b)):(this.setModified(f||this.isModified()),null!=b&&b(a))}catch(v){if(this.setModified(f||this.isModified()),null!=b)b(v);else throw v;}}),mxUtils.bind(this,function(c,d){try{this.savingFile=!1,this.isModified=m,this.setModified(f||this.isModified()),this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile= +DriveFile.prototype.getPublicUrl=function(a){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(c){if(null!=c&&null!=c.items)for(var d=0;d<c.items.length;d++)if("anyoneWithLink"===c.items[d].id||"anyone"===c.items[d].id){a(this.desc.webContentLink);return}a(null)}),mxUtils.bind(this,function(){a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0}; +DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(a,c,d,b,g){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,c,d,b,g)}),d,b,g])}; +DriveFile.prototype.saveFile=function(a,c,d,b,g,e){try{if(!this.isEditable())null!=d&&d();else if(!this.savingFile){var k=mxUtils.bind(this,function(a,e){var m=null,f=null;try{m=this.isModified;f=this.isModified();this.setModified(!1);this.savingFileTime=new Date;this.savingFile=!0;this.isModified=function(){return!0};var l=this.desc;this.ui.drive.saveFile(this,e,mxUtils.bind(this,function(a,e){try{this.savingFile=!1,this.isModified=m,0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay= +Math.min(8E3,Math.max(this.saveDelay+500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(e,l,mxUtils.bind(this,function(){this.contentChanged();null!=d&&d(a)}),b)):(this.setModified(f||this.isModified()),null!=b&&b(a))}catch(v){if(this.setModified(f||this.isModified()),null!=b)b(v);else throw v;}}),mxUtils.bind(this,function(c,d){try{this.savingFile=!1,this.isModified=m,this.setModified(f||this.isModified()),this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile= !0,this.savingFileTime=new Date,this.sync.fileConflict(d,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();k(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b()):null!=b&&b(c)}catch(v){if(this.setModified(f||this.isModified()),null!=b)b(v);else throw v;}}),g,g,a)}catch(p){if(this.savingFile=!1,null!=m&&(this.isModified=m),null!=f&&this.setModified(f||this.isModified()),null!=b)b(p);else throw p; -}});k(e,d)}}catch(n){if(null!=b)b(n);else throw n;}};DriveFile.prototype.copyFile=function(a,d){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,d)}catch(c){d(c)}}),d,!0)}; -DriveFile.prototype.makeCopy=function(a,d,c){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,c),mxUtils.bind(this,function(b){this.desc=b;this.ui.spinner.stop();this.setModified(!1);this.backupPatch=null;this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();a()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=d&&d()}))};DriveFile.prototype.saveAs=function(a,d,c){this.ui.drive.copyFile(this.getId(),a,d,c)}; -DriveFile.prototype.rename=function(a,d,c){var b=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.desc=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(b),null!=d&&d(g)):(this.desc=g,null!=this.sync&&this.sync.descriptorChanged(b),this.save(!0,d,c))}),c)}; -DriveFile.prototype.move=function(a,d,c){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=d&&d(a)}),c)};DriveFile.prototype.getTitle=function(){return this.desc.title};DriveFile.prototype.getHash=function(){return"G"+this.getId()};DriveFile.prototype.getId=function(){return this.desc.id};DriveFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&this.desc.editable}; +}});k(e,c)}}catch(n){if(null!=b)b(n);else throw n;}};DriveFile.prototype.copyFile=function(a,c){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,c)}catch(d){c(d)}}),c,!0)}; +DriveFile.prototype.makeCopy=function(a,c,d){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,d),mxUtils.bind(this,function(b){this.desc=b;this.ui.spinner.stop();this.setModified(!1);this.backupPatch=null;this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();a()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=c&&c()}))};DriveFile.prototype.saveAs=function(a,c,d){this.ui.drive.copyFile(this.getId(),a,c,d)}; +DriveFile.prototype.rename=function(a,c,d){var b=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.desc=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(b),null!=c&&c(g)):(this.desc=g,null!=this.sync&&this.sync.descriptorChanged(b),this.save(!0,c,d))}),d)}; +DriveFile.prototype.move=function(a,c,d){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=c&&c(a)}),d)};DriveFile.prototype.getTitle=function(){return this.desc.title};DriveFile.prototype.getHash=function(){return"G"+this.getId()};DriveFile.prototype.getId=function(){return this.desc.id};DriveFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&this.desc.editable}; DriveFile.prototype.isSyncSupported=function(){return!0};DriveFile.prototype.isRevisionHistorySupported=function(){return!0}; -DriveFile.prototype.getRevisions=function(a,d){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/revisions"},mxUtils.bind(this,function(c){for(var b=0;b<c.items.length;b++)mxUtils.bind(this,function(a){a.title=a.originalFilename;a.getXml=mxUtils.bind(this,function(b,c){this.ui.drive.getXmlFile(a,mxUtils.bind(this,function(a){b(a.getData())}),c)});a.getUrl=mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+a.id+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!= -b?"&page="+b:""))+window.location.hash})})(c.items[b]);a(c.items)}),d)};DriveFile.prototype.getLatestVersion=function(a,d){this.ui.drive.getFile(this.getId(),a,d,!0)};DriveFile.prototype.getChannelId=function(){var a=this.ui.drive.getCustomProperty(this.desc,"channel");null!=a&&(a="G-"+this.getId()+"."+a);return a};DriveFile.prototype.getChannelKey=function(){return this.ui.drive.getCustomProperty(this.desc,"key")};DriveFile.prototype.getLastModifiedDate=function(){return new Date(this.desc.modifiedDate)}; -DriveFile.prototype.getDescriptor=function(){return this.desc};DriveFile.prototype.setDescriptor=function(a){this.desc=a};DriveFile.prototype.getDescriptorSecret=function(a){return this.ui.drive.getCustomProperty(a,"secret")};DriveFile.prototype.setDescriptorRevisionId=function(a,d){a.headRevisionId=d};DriveFile.prototype.getDescriptorRevisionId=function(a){return a.headRevisionId};DriveFile.prototype.getDescriptorEtag=function(a){return a.etag}; -DriveFile.prototype.setDescriptorEtag=function(a,d){a.etag=d};DriveFile.prototype.loadPatchDescriptor=function(a,d){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"?supportsAllDrives=true&fields="+this.ui.drive.catchupFields},mxUtils.bind(this,function(c){a(c)}),d)};DriveFile.prototype.patchDescriptor=function(a,d){DrawioFile.prototype.patchDescriptor.apply(this,arguments);a.headRevisionId=d.headRevisionId;a.modifiedDate=d.modifiedDate}; -DriveFile.prototype.loadDescriptor=function(a,d){this.ui.drive.loadDescriptor(this.getId(),a,d)};DriveFile.prototype.commentsSupported=function(){return!0}; -DriveFile.prototype.getComments=function(a,d){function c(a,d,k){if(d.deleted)return null;k=new DriveComment(a,d.commentId||d.replyId,d.content,d.modifiedDate,d.createdDate,"resolved"==d.status,d.author.isAuthenticatedUser?b:new DrawioUser(d.author.permissionId,d.author.emailAddress,d.author.displayName,d.author.picture.url),k);for(var e=0;null!=d.replies&&e<d.replies.length;e++)k.addReplyDirect(c(a,d.replies[e],d.commentId));return k}var b=this.ui.getCurrentUser();this.ui.drive.executeRequest({url:"/files/"+ -this.getId()+"/comments"},mxUtils.bind(this,function(b){for(var d=[],g=0;g<b.items.length;g++){var n=c(this,b.items[g]);null!=n&&d.push(n)}a(d)}),d)};DriveFile.prototype.addComment=function(a,d,c){a={content:a.content};this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/comments",method:"POST",params:a},mxUtils.bind(this,function(a){d(a.commentId)}),c)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment}; -DriveFile.prototype.newComment=function(a,d){return new DriveComment(this,null,a,Date.now(),Date.now(),!1,d)};DriveLibrary=function(a,d,c){DriveFile.call(this,a,d,c)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,d,c){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=d&&d(a)}),c)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);DrawioClient.call(this,a,"gDriveAuthInfo");this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.mimeType="application/vnd.jgraph.mxfile.realtime";this.ui.editor.chromeless&&!this.ui.editor.editable&&"1"!=urlParams.rt?(this.cookieName="gDriveViewerAuthInfo",this.token=this.getPersistentToken(),this.appId=window.DRAWIO_GOOGLE_VIEWER_APP_ID||"850530949725",this.clientId=window.DRAWIO_GOOGLE_VIEWER_CLIENT_ID||"850530949725.apps.googleusercontent.com", +DriveFile.prototype.getRevisions=function(a,c){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/revisions"},mxUtils.bind(this,function(c){for(var b=0;b<c.items.length;b++)mxUtils.bind(this,function(a){a.title=a.originalFilename;a.getXml=mxUtils.bind(this,function(b,c){this.ui.drive.getXmlFile(a,mxUtils.bind(this,function(a){b(a.getData())}),c)});a.getUrl=mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+a.id+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!= +b?"&page="+b:""))+window.location.hash})})(c.items[b]);a(c.items)}),c)};DriveFile.prototype.getLatestVersion=function(a,c){this.ui.drive.getFile(this.getId(),a,c,!0)};DriveFile.prototype.getChannelId=function(){var a=this.ui.drive.getCustomProperty(this.desc,"channel");null!=a&&(a="G-"+this.getId()+"."+a);return a};DriveFile.prototype.getChannelKey=function(){return this.ui.drive.getCustomProperty(this.desc,"key")};DriveFile.prototype.getLastModifiedDate=function(){return new Date(this.desc.modifiedDate)}; +DriveFile.prototype.getDescriptor=function(){return this.desc};DriveFile.prototype.setDescriptor=function(a){this.desc=a};DriveFile.prototype.getDescriptorSecret=function(a){return this.ui.drive.getCustomProperty(a,"secret")};DriveFile.prototype.setDescriptorRevisionId=function(a,c){a.headRevisionId=c};DriveFile.prototype.getDescriptorRevisionId=function(a){return a.headRevisionId};DriveFile.prototype.getDescriptorEtag=function(a){return a.etag}; +DriveFile.prototype.setDescriptorEtag=function(a,c){a.etag=c};DriveFile.prototype.loadPatchDescriptor=function(a,c){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"?supportsAllDrives=true&fields="+this.ui.drive.catchupFields},mxUtils.bind(this,function(c){a(c)}),c)};DriveFile.prototype.patchDescriptor=function(a,c){DrawioFile.prototype.patchDescriptor.apply(this,arguments);a.headRevisionId=c.headRevisionId;a.modifiedDate=c.modifiedDate}; +DriveFile.prototype.loadDescriptor=function(a,c){this.ui.drive.loadDescriptor(this.getId(),a,c)};DriveFile.prototype.commentsSupported=function(){return!0}; +DriveFile.prototype.getComments=function(a,c){function d(a,c,k){if(c.deleted)return null;k=new DriveComment(a,c.commentId||c.replyId,c.content,c.modifiedDate,c.createdDate,"resolved"==c.status,c.author.isAuthenticatedUser?b:new DrawioUser(c.author.permissionId,c.author.emailAddress,c.author.displayName,c.author.picture.url),k);for(var e=0;null!=c.replies&&e<c.replies.length;e++)k.addReplyDirect(d(a,c.replies[e],c.commentId));return k}var b=this.ui.getCurrentUser();this.ui.drive.executeRequest({url:"/files/"+ +this.getId()+"/comments"},mxUtils.bind(this,function(b){for(var c=[],g=0;g<b.items.length;g++){var n=d(this,b.items[g]);null!=n&&c.push(n)}a(c)}),c)};DriveFile.prototype.addComment=function(a,c,d){a={content:a.content};this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/comments",method:"POST",params:a},mxUtils.bind(this,function(a){c(a.commentId)}),d)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment}; +DriveFile.prototype.newComment=function(a,c){return new DriveComment(this,null,a,Date.now(),Date.now(),!1,c)};DriveLibrary=function(a,c,d){DriveFile.call(this,a,c,d)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,c,d){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),d)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);DrawioClient.call(this,a,"gDriveAuthInfo");this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.mimeType="application/vnd.jgraph.mxfile.realtime";this.ui.editor.chromeless&&!this.ui.editor.editable&&"1"!=urlParams.rt?(this.cookieName="gDriveViewerAuthInfo",this.token=this.getPersistentToken(),this.appId=window.DRAWIO_GOOGLE_VIEWER_APP_ID||"850530949725",this.clientId=window.DRAWIO_GOOGLE_VIEWER_CLIENT_ID||"850530949725.apps.googleusercontent.com", this.scopes=["https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/userinfo.profile"]):(this.appId=window.DRAWIO_GOOGLE_APP_ID||"671128082532",this.clientId=window.DRAWIO_GOOGLE_CLIENT_ID||"671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com");this.mimeTypes=this.xmlMimeType+",application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy";"1"==urlParams.photos&&this.scopes.push("https://www.googleapis.com/auth/photos.upload"); -a=JSON.parse(this.token);if(null!=a&&null!=a.current){a=a.current;this.userId=a.userId;this.token=a.access_token;var d=(a.expires-Date.now())/1E3;a.expires_in=600>d?1:d;this.resetTokenRefresh(a);this.authCalled=!1}};mxUtils.extend(DriveClient,mxEventSource);mxUtils.extend(DriveClient,DrawioClient);DriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/google";DriveClient.prototype.GDriveBaseUrl="https://www.googleapis.com/drive/v2"; +a=JSON.parse(this.token);if(null!=a&&null!=a.current){a=a.current;this.userId=a.userId;this.token=a.access_token;var c=(a.expires-Date.now())/1E3;a.expires_in=600>c?1:c;this.resetTokenRefresh(a);this.authCalled=!1}};mxUtils.extend(DriveClient,mxEventSource);mxUtils.extend(DriveClient,DrawioClient);DriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/google";DriveClient.prototype.GDriveBaseUrl="https://www.googleapis.com/drive/v2"; DriveClient.prototype.scopes=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/userinfo.profile"];DriveClient.prototype.allFields="kind,id,parents,headRevisionId,etag,title,mimeType,modifiedDate,editable,copyable,canComment,labels,properties,downloadUrl,webContentLink,userPermission,fileSize";DriveClient.prototype.catchupFields="etag,headRevisionId,modifiedDate,properties(key,value)"; DriveClient.prototype.enableThumbnails=!0;DriveClient.prototype.thumbnailWidth=1E3;DriveClient.prototype.maxThumbnailSize=2E6; DriveClient.prototype.placeholderThumbnail="iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAACN1BMVEXwhwXvhgX4iwXzhwXgbQzvhgXhbAzocgzqcwzldAoAAADhbgvjcQnmdgrlbgDwhgXsfwXufgjwhgXwgQfziAXxgADibgz4iwX4jAX3iwTpcwr1igXoewjsfgj3igX4iwXqcQv4jAX3iwXtfQnndQrvhAbibArwhwXgbQz//////v39jwX6jQX+/v7fagHfawzdVQDwhADgbhPgbhXwhwPocQ3uvKvwiA/faQDscgzxiAT97+XgciTgcSP6jAXgbQ3gcCHwiRfpcQzwhwfeXQD77ef74NLvhgTvegD66uPgbAf66+TvfADwjCzgcCfwiSD67ObhcjjwiBHhczvwiyrgbxj///777ujgcSHgcB/xiRzgbhveWgDeVwDhdEDgbRDqfgffYgDfXwD97+bvfQDxiz7//vvwiRr118rrcgztggbfZgDfZAD++PT98+3gbBPsgAb99vD33tPgcB7icAvuhAX//Pn66N/00sTyy7vuuqbjekLwhwzkcgr88er449n++vfutp/kh1vgcBvhbwvmdwnwgwDwgADeWQD87eLxxrTssJjqpIf0roHmjWTkhFP759n63czvvanomnjnlHDhczD22cr4y6/wwa/3xKX2wJ3rqpH0tY7qp4vpnoDymlbjf0vxjjntcwzldAroegj/kgX12s7518PzqnnnkWfynmLieUjpewjrdAD40Lj1uZTzpm3idTbiciLydQzzfwnyiQTsfgD3xqnzp3TxlkzgbCrdTwDdSwBLKUlNAAAAJ3RSTlP8/b2X/YH8wb+FAIuIggJbQin5opAM9+a/ubaubyD78NjSyr2WgRp4sjN4AAAI70lEQVR42u2cZ38SQRDGT8WGvfde4E4BxVMRRaKiUURRlJhQRDCCSgQVO/bee++9994+nMt5ywoezFJd/fm8uITi3p9n5mbYkcCpO6rVnVu2YEXd+3dRIySuo7pLv4GjGNKg7j3UHTl1l14PajmG9OFBnx7Ird4PumpYEtf1QXc112l0M7OGKXEfeg3guo3iNIyJG92Jaz61mYYxcaNacs1H/8f6j6X5j1WI/mMVIsawRFEzI49SjwOqAJa43emclk8Rp2c7AFZ+LDGyvXE2kmO2Q1Lq17RSd6ND48QIwFVuLNHTOPbEpTOz8ujMpccHGz0AV5mxIo4TpwUeUPj0YwfAVVYs0Tn7VZjnBUA8v+n6CyfERY8FR/DEJj7MQ6oL85vOvfDUAsuVC8s19s5yXuAppOPnvPk4EeSCsehCeBVTwVzHfE6RcFUQa4an8Qw91kpbw2oz4aoc1sSxniO0WAI/J24wriabmEpizZtM79bc+fr4/tUarEpiLabGElJYRsOGjbJfjGDpJCxtmosRLOEnVpqLESzZLYlLg65H1rAkLo2GESwcROwXI1jELcS1Y6OGQSzEVaupZQJLDiLhYtCtFBcbbslYhOueqKllDwtzwVhTq4RFuBh0C3EdEBl0C3OBWNUrEISLvSD+5GLQLYmLoSqfwcUiFuaqzhYDxiJc981lxqqdVsCGbHPcQLBgrtK3rwLt9tWqhblKxxI9hW3267U5ZHhuBrCKzXl4NIJTS5FrmbmMWGIEDZIouOp0/O6boYQ2jxBXWcdu13fzRILuF/2Ku+aGr96uBbhALHo5Z38+XcfXyVRZVx/+Ed513ldDCCCu0rFE0Xlo2mu5TAj8ki0XV0q6ePHilhi+d/15b9ACQGGusg3AFzc+XSMBCPzu89+CNlnB7zfD8t1z4iaLXUvDVT6sGdMOnv5pi47f6r9Qk9YF3xZ0l8S11UfMArlgLMpZM6bamYy6rWnta9q7TrZrzZPgPgoqg3atubY8WK6D8lQXHfb4p/wSK7vFfxmxSsAPQ96AlZ4LxoLNeompdkUDGQVznL5mLr4ar5ESD3PBWHA9fbpbjlT4pq1Bm6H6w9dwfOd69ePouNDYt3S3ULPGZ96S3YqtAW/Tepz1E8bgAANc+xEXhAX36ut1cslcd6rJq81SIvgEe7lmL3kY5iqxVYvOI9isswp22KeMOcrriJlWai5giwHl+yec73Ma9Mbfz+qOJndKz6hLpR5V1uPxavFuTTt0K1XfpbNeO0wKeUaR2IPBN5sMRlqu1eY8bsFmPeIFUpi0CjIGTLvSZY2EGeYSi3VL9Dgeb0I+SQl9MlcZT4TObZKzfmfS5NZSx1GsLQ5r+8Sxp7ERR/1TtDlUn2qNuGXCrZGM5URlLDiEVzDVkje5fdjXdDsm27XpXChBz4XG0UpYcDOMYaxjGc3wtyJxFtu1PohaI71f2K2imqEONcN4nrMZ9TWbMf81wg9z3VNwC26Gr3enY4ObobLqbccFefuz5AKONpVfzQp2y3NoVvrN32GLNl9orA22lTiM+Nqg5CJY1DueOjkwsdtNgAP7gidR2SWVhFqt3o9QwoKHIuiwDcwX+xT/UWztSlvCaqXGmtQBY1GadQmfh6anuE0XlkhhRFs3tGGkd+tuIVhiJN0M+brj0mlAu46lX0bcbizVLbgZrgwl4JhYA+NQa9TJQUetsSJYHscJvAVct7eJKoUbQudxPYmdirqzsYsIojhjoitD01yadH287J+vpZF1/uGt2K4ttinjshQo2C2XMzI2U64X6WY4tyZq99a7wZS3eA3BpNyrUPn1x00Z0uM1ACzilOfg7EN3VmRo8dN16WYYerYw6G9qCOSDCjQ0jQkufRbalt65LVyapaA/2mClxhK3Rxy3rsyavDxDR/DL5sMLFiyYu/7sXps7z8VldPv2Xl6PnjlTwOOuJQuytH7CXpvXCOQWoZrYeHWd4nw2Q+v22OLGnFSG0Nk1PCi0xjgjpVvTGi8hht9F+ARBGq8dtXmtOSLoDm1FhUSHnihkTecESalHkPAaWVhtFbA8jqvQGBmbt8fWkKtNn0Xw9GvAWK6DX9bBVHjzqtyvvcG9a+jXyC5oKoKV/a4YFG7Yij2ofszlgtaA3ZoRwW+pIOH3w0qZFURNh3oNtKsDsAr9LNvMC0pj93H6hTPpX9ocg8FIgTVvcgFYC03jFLBMi6ix0MDAoi8/lh7Cgt2q0VfNrSX0ayhjTa2IW0tKdotNrMq4NbPkILKZW+xdiSoGgshogfh7Ul7FcIEoFevfrPLC3+XWf6y/CEvHZoFQqlts9sQigqjLxFpQCJauakFcsqhKPXH79rGb6bE2B5Qmu0b91zn0WJtN8Wys9tgtIqfjEf2SWw7XKI8gHuKQ0X0eDsQSI44TaGBN6dYN5dlI/eFj9I7f8GWtoUJYOIgkiq6Ds/gw5T7dZDUqTrfscbLbB9eIB7JmEKsUgiii/4uO8ToBfJlhfif5tEGWEsGTMT4Mr6HDa0BBlP5Y88lcnkdkCtLhnyjMM0+Gcn2WzW6xnd/J8zn+LZq4SUeEvUBaA8LCs6Tk1p1AetXt3JoMWexWZSyr3RK6vSUGrRHbmkRUVgCLpP1HW/L4tgl5tO140mdKKFFhrkTUdxta4xleA8DCXC6n/vCYvPJFa9zAWL4m6qNaA8IiqjW73lreWnJrSj0AJYFZpvwq6RZRzjVUGEtB5tX7DdoqCXaL+PXHuEjdYsuvVqva4Sqv6NdabdW4YLeIKsoFYzHGhYPIGBd2izGuVpPaSVgAV7VEsOQgsuUXdosxLuwWxLVMW0WRK5ExLiiIpN4vq2YYVTiIbPmFgii5xRiXimCBqmIcVSS3WMqvdMqz5VcKqzdKeca4UrnVT/ryR6bi2Opuf64TwYJlfl4FLqu2Zxeux5BRXZnisvZ8103NqTtzoziuGa24+wZVRdVK9W7wyNSX1nYeOmrU6JSmjp6KhH5BR+kGvk++Ld0c/X66rPH4SEQeGl+kpq8a33eAumPqK347durWpzm9hrWhUevi1Hd4ZzVC+gGMHY0TYnDOYwAAAABJRU5ErkJggg==".replace(/\+/g,"-").replace(/\//g, "_");DriveClient.prototype.placeholderMimeType="image/png";DriveClient.prototype.libraryMimeType="application/vnd.jgraph.mxlibrary";DriveClient.prototype.newAppHostname="www.draw.io";DriveClient.prototype.extension=".drawio";DriveClient.prototype.tokenRefreshInterval=0;DriveClient.prototype.lastTokenRefresh=0;DriveClient.prototype.maxRetries=5;DriveClient.prototype.staleEtagMaxRetries=3;DriveClient.prototype.coolOff=1E3;DriveClient.prototype.mimeTypeCheckCoolOff=6E4;DriveClient.prototype.user=null; DriveClient.prototype.setUser=function(a){this.user=a;null==this.user?(this.userId=null,null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null)):this.userId=a.id;this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.setUserId=function(a){this.userId=a;null!=this.user&&this.user.id!=this.userId&&(this.user=null)};DriveClient.prototype.getUser=function(){return this.user}; -DriveClient.prototype.getUsersList=function(){var a=[],d=JSON.parse(this.getPersistentToken(!0)),c=null;if(null!=d){null!=d.current&&(c=d.current.userId,a.push(d[c].user),a[0].isCurrent=!0);for(var b in d)"current"!=b&&b!=c&&a.push(d[b].user)}return a};DriveClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null}; -DriveClient.prototype.execute=function(a){var d=mxUtils.bind(this,function(c){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();a()}),mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.logout();this.ui.showError(mxResources.get("error"),b,mxResources.get("help"), -mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,d)}; -DriveClient.prototype.executeRequest=function(a,d,c){try{var b=!0,g=null,e=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var k=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=a;null!=g&&window.clearTimeout(g);g=window.setTimeout(mxUtils.bind(this,function(){b=!1;null!=c&&c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:k})}),this.ui.timeout);var n=null,m=!1;"string"===typeof a.params?n=a.params:null!=a.params&&(n=JSON.stringify(a.params), +DriveClient.prototype.getUsersList=function(){var a=[],c=JSON.parse(this.getPersistentToken(!0)),d=null;if(null!=c){null!=c.current&&(d=c.current.userId,a.push(c[d].user),a[0].isCurrent=!0);for(var b in c)"current"!=b&&b!=d&&a.push(c[b].user)}return a};DriveClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null}; +DriveClient.prototype.execute=function(a){var c=mxUtils.bind(this,function(c){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();a()}),mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.logout();this.ui.showError(mxResources.get("error"),b,mxResources.get("help"), +mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,c)}; +DriveClient.prototype.executeRequest=function(a,c,d){try{var b=!0,g=null,e=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var k=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=a;null!=g&&window.clearTimeout(g);g=window.setTimeout(mxUtils.bind(this,function(){b=!1;null!=d&&d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:k})}),this.ui.timeout);var n=null,m=!1;"string"===typeof a.params?n=a.params:null!=a.params&&(n=JSON.stringify(a.params), m=!0);var t=a.fullUrl||this.GDriveBaseUrl+a.url;m&&(t+=(0<t.indexOf("?")?"&":"?")+"alt=json");var f=new mxXmlRequest(t,n,a.method||"GET");f.setRequestHeaders=mxUtils.bind(this,function(b,c){if(null!=a.headers)for(var d in a.headers)b.setRequestHeader(d,a.headers[d]);else null!=a.contentType?b.setRequestHeader("Content-Type",a.contentType):m&&b.setRequestHeader("Content-Type","application/json");b.setRequestHeader("Authorization","Bearer "+this.token)});f.send(mxUtils.bind(this,function(f){try{if(window.clearTimeout(g), -b){var m;try{m=JSON.parse(f.getText())}catch(q){m=null}if(200<=f.getStatus()&&299>=f.getStatus())null!=d&&d(m);else{var l=null!=m&&null!=m.error?null!=m.error.data?m.error.data:m.error.errors:null,n=null!=l&&0<l.length?l[0].reason:null;null==c||null==m||null==m.error||-1!=m.error.code&&(403!=m.error.code||"domainPolicy"!=n&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=n)?403==m.error.code&&this.retryAuth|| -401==m.error.code&&this.retryAuth&&"authError"==n?(null!=c&&c(m),this.retryAuth=!1):(this.retryAuth=!0,this.execute(k)):null!=m&&null!=m.error&&412!=m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==a&&e<this.maxRetries?(e++,this.requestThread=window.setTimeout(k,Math.round(Math.pow(2,e)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=c&&c(m):c(m)}}}catch(q){if(null!=c)c(q);else throw q;}}))}catch(l){if(null!=c)c(l);else throw l;}});null!=this.token&&this.authCalled?k():this.execute(k)}catch(n){if(null!= -c)c(n);else throw n;}};DriveClient.prototype.createAuthWin=function(a){return window.open(a?a:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())}; -DriveClient.prototype.authorize=function(a,d,c,b,g){var e=mxUtils.bind(this,function(a,b,e){this.token=a.access_token;a.expires=Date.now()+1E3*parseInt(a.expires_in);a.remember=b;this.resetTokenRefresh(a);this.authCalled=!0;if(e||null==this.user){var f=JSON.stringify(a);this.updateUser(mxUtils.bind(this,function(){var a=JSON.parse(f);this.setPersistentToken(a,!b);null!=d&&d()}),c)}else null!=d&&(this.setPersistentToken(a,!b),d())});try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId= +b){var m;try{m=JSON.parse(f.getText())}catch(q){m=null}if(200<=f.getStatus()&&299>=f.getStatus())null!=c&&c(m);else{var l=null!=m&&null!=m.error?null!=m.error.data?m.error.data:m.error.errors:null,n=null!=l&&0<l.length?l[0].reason:null;null==d||null==m||null==m.error||-1!=m.error.code&&(403!=m.error.code||"domainPolicy"!=n&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=n)?403==m.error.code&&this.retryAuth|| +401==m.error.code&&this.retryAuth&&"authError"==n?(null!=d&&d(m),this.retryAuth=!1):(this.retryAuth=!0,this.execute(k)):null!=m&&null!=m.error&&412!=m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==a&&e<this.maxRetries?(e++,this.requestThread=window.setTimeout(k,Math.round(Math.pow(2,e)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=d&&d(m):d(m)}}}catch(q){if(null!=d)d(q);else throw q;}}))}catch(l){if(null!=d)d(l);else throw l;}});null!=this.token&&this.authCalled?k():this.execute(k)}catch(n){if(null!= +d)d(n);else throw n;}};DriveClient.prototype.createAuthWin=function(a){return window.open(a?a:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())}; +DriveClient.prototype.authorize=function(a,c,d,b,g){var e=mxUtils.bind(this,function(a,b,e){this.token=a.access_token;a.expires=Date.now()+1E3*parseInt(a.expires_in);a.remember=b;this.resetTokenRefresh(a);this.authCalled=!0;if(e||null==this.user){var f=JSON.stringify(a);this.updateUser(mxUtils.bind(this,function(){var a=JSON.parse(f);this.setPersistentToken(a,!b);null!=c&&c()}),d)}else null!=c&&(this.setPersistentToken(a,!b),c())});try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId= this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));var k=JSON.parse(this.getPersistentToken(!0));null!=k&&(null==this.userId?null!=k.current?(this.userId=k.current.userId,k=k[this.userId]):k=null:k=k[this.userId]);if(!a||null!=k&&null!=k.refresh_token)if(a)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname)+"&refresh_token="+k.refresh_token,null,"GET")).send(mxUtils.bind(this,function(a){200<= -a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),a.refresh_token=k.refresh_token,e(a,!0)):(0!=a.getStatus()&&this.logout(),null!=c&&c(a))}),c);else{var n="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(b?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+ -"&domain="+window.location.hostname);null==g?g=this.createAuthWin(n):g.location=n;null!=g&&(window.onGoogleDriveCallback=mxUtils.bind(this,function(a,d){window.onGoogleDriveCallback=null;try{null==a?null!=c&&c({message:mxResources.get("accessDenied")}):e(a,b,!0)}catch(f){null!=c&&c(f)}finally{null!=d&&d.close()}}),g.focus())}else null!=c&&c()}catch(m){if(null!=c)c(m);else throw m;}}; +a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),a.refresh_token=k.refresh_token,e(a,!0)):(0!=a.getStatus()&&this.logout(),null!=d&&d(a))}),d);else{var n="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(b?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+ +"&domain="+window.location.hostname);null==g?g=this.createAuthWin(n):g.location=n;null!=g&&(window.onGoogleDriveCallback=mxUtils.bind(this,function(a,c){window.onGoogleDriveCallback=null;try{null==a?null!=d&&d({message:mxResources.get("accessDenied")}):e(a,b,!0)}catch(f){null!=d&&d(f)}finally{null!=c&&c.close()}}),g.focus())}else null!=d&&d()}catch(m){if(null!=d)d(m);else throw m;}}; DriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=a&&null==a.error&&0<a.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(a.expires_in),this.lastTokenRefresh=(new Date).getTime(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*a.expires_in))}; -DriveClient.prototype.checkToken=function(a){var d=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();d&&this.fireEvent(new mxEventObject("disconnected"))})):a()}; -DriveClient.prototype.updateUser=function(a,d){try{var c={Authorization:"Bearer "+this.token};this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(b){var c=JSON.parse(b);this.executeRequest({url:"/about"},mxUtils.bind(this,function(b){var d=mxResources.get("notAvailable"),e=d,g=null;null!=b&&null!=b.user&&(d=b.user.emailAddress,e=b.user.displayName,g=null!=b.user.picture?b.user.picture.url:null);this.setUser(new DrawioUser(c.id,d,e,g,c.locale));this.userId= -c.id;null!=a&&a()}),d)}),d,null,null,null,null,c)}catch(b){if(null!=d)d(b);else throw b;}};DriveClient.prototype.copyFile=function(a,d,c,b){null!=a&&null!=d&&this.executeRequest({url:"/files/"+a+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true",method:"POST",params:{title:d,properties:[{key:"channel",value:Editor.guid()}]}},c,b)};DriveClient.prototype.renameFile=function(a,d,c,b){null!=a&&null!=d&&this.executeRequest(this.createDriveRequest(a,{title:d}),c,b)}; -DriveClient.prototype.moveFile=function(a,d,c,b){null!=a&&null!=d&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:d}]}),c,b)};DriveClient.prototype.createDriveRequest=function(a,d){return{url:"/files/"+a+"?uploadType=multipart&supportsAllDrives=true",method:"PUT",contentType:"application/json; charset=UTF-8",params:d}};DriveClient.prototype.getLibrary=function(a,d,c){return this.getFile(a,d,c,!0,!0)}; -DriveClient.prototype.loadDescriptor=function(a,d,c,b){this.executeRequest({url:"/files/"+a+"?supportsAllDrives=true&fields="+(null!=b?b:this.allFields)},d,c)};DriveClient.prototype.getCustomProperty=function(a,d){var c=a.properties,b=null;if(null!=c)for(var g=0;g<c.length;g++)if(c[g].key==d){b=c[g].value;break}return b}; -DriveClient.prototype.getFile=function(a,d,c,b,g){b=null!=b?b:!1;g=null!=g?g:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+a+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},mxUtils.bind(this,function(b){b.title=b.originalFilename;b.headRevisionId=b.id;b.id=a;this.getXmlFile(b,d,c)}),c):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var e=/\.png$/i.test(a.title);/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&& -e?this.ui.convertFile(a.downloadUrl,a.title,a.mimeType,this.extension,d,c,null,{Authorization:"Bearer "+this.token}):b||g||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,d,c,!0,g):this.getXmlFile(a,d,c)}else c({message:mxResources.get("loggedOut")})}catch(n){if(null!=c)c(n);else throw n;}}),c)};DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)}; -DriveClient.prototype.getXmlFile=function(a,d,c,b,g){try{var e={Authorization:"Bearer "+this.token},k=a.downloadUrl;this.ui.loadUrl(k,mxUtils.bind(this,function(b){try{if(null==b)c({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||g)a.mimeType!=this.libraryMimeType||g?d(new DriveLibrary(this.ui,b,a)):c({message:mxResources.get("notADiagramFile")});else{var e=!1;if(/\.png$/i.test(a.title)){var n=b.lastIndexOf(",");if(0<n){var f=this.ui.extractGraphModelFromPng(b.substring(n+ +DriveClient.prototype.checkToken=function(a){var c=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();c&&this.fireEvent(new mxEventObject("disconnected"))})):a()}; +DriveClient.prototype.updateUser=function(a,c){try{var d={Authorization:"Bearer "+this.token};this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(b){var d=JSON.parse(b);this.executeRequest({url:"/about"},mxUtils.bind(this,function(b){var c=mxResources.get("notAvailable"),e=c,g=null;null!=b&&null!=b.user&&(c=b.user.emailAddress,e=b.user.displayName,g=null!=b.user.picture?b.user.picture.url:null);this.setUser(new DrawioUser(d.id,c,e,g,d.locale));this.userId= +d.id;null!=a&&a()}),c)}),c,null,null,null,null,d)}catch(b){if(null!=c)c(b);else throw b;}};DriveClient.prototype.copyFile=function(a,c,d,b){null!=a&&null!=c&&this.executeRequest({url:"/files/"+a+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true",method:"POST",params:{title:c,properties:[{key:"channel",value:Editor.guid()}]}},d,b)};DriveClient.prototype.renameFile=function(a,c,d,b){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),d,b)}; +DriveClient.prototype.moveFile=function(a,c,d,b){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:c}]}),d,b)};DriveClient.prototype.createDriveRequest=function(a,c){return{url:"/files/"+a+"?uploadType=multipart&supportsAllDrives=true",method:"PUT",contentType:"application/json; charset=UTF-8",params:c}};DriveClient.prototype.getLibrary=function(a,c,d){return this.getFile(a,c,d,!0,!0)}; +DriveClient.prototype.loadDescriptor=function(a,c,d,b){this.executeRequest({url:"/files/"+a+"?supportsAllDrives=true&fields="+(null!=b?b:this.allFields)},c,d)};DriveClient.prototype.getCustomProperty=function(a,c){var d=a.properties,b=null;if(null!=d)for(var g=0;g<d.length;g++)if(d[g].key==c){b=d[g].value;break}return b}; +DriveClient.prototype.getFile=function(a,c,d,b,g){b=null!=b?b:!1;g=null!=g?g:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+a+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},mxUtils.bind(this,function(b){b.title=b.originalFilename;b.headRevisionId=b.id;b.id=a;this.getXmlFile(b,c,d)}),d):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var e=/\.png$/i.test(a.title);/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&& +e?this.ui.convertFile(a.downloadUrl,a.title,a.mimeType,this.extension,c,d,null,{Authorization:"Bearer "+this.token}):b||g||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,d,!0,g):this.getXmlFile(a,c,d)}else d({message:mxResources.get("loggedOut")})}catch(n){if(null!=d)d(n);else throw n;}}),d)};DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)}; +DriveClient.prototype.getXmlFile=function(a,c,d,b,g){try{var e={Authorization:"Bearer "+this.token},k=a.downloadUrl;this.ui.loadUrl(k,mxUtils.bind(this,function(b){try{if(null==b)d({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||g)a.mimeType!=this.libraryMimeType||g?c(new DriveLibrary(this.ui,b,a)):d({message:mxResources.get("notADiagramFile")});else{var e=!1;if(/\.png$/i.test(a.title)){var n=b.lastIndexOf(",");if(0<n){var f=this.ui.extractGraphModelFromPng(b.substring(n+ 1));if(null!=f&&0<f.length)b=f;else try{var f=b.substring(n+1),l=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(f):atob(f),p=this.ui.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0);null==p||0<p.getElementsByTagName("parsererror").length?e=!0:b=l}catch(u){e=!0}}}else/\.pdf$/i.test(a.title)?(f=Editor.extractGraphModelFromPdf(b),null!=f&&0<f.length&&(e=!0,b=f)):"data:image/png;base64,PG14ZmlsZS"==b.substring(0,32)&&(l=b.substring(22),b=window.atob&&!mxClient.IS_SF?atob(l): -Base64.decode(l));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(b,k)?this.ui.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){try{4==b.readyState&&(200<=b.status&&299>=b.status?d(new LocalFile(this.ui,b.responseText,a.title+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(v){if(null!=c)c(v);else throw v;}}),a.title):d(e?new LocalFile(this.ui,b,a.title,!0):new DriveFile(this.ui,b,a))}}catch(u){if(null!= -c)c(u);else throw u;}}),c,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title)||/\.pdf$/i.test(a.title),null,null,null,e)}catch(n){if(null!=c)c(n);else throw n;}}; -DriveClient.prototype.saveFile=function(a,d,c,b,g,e,k,n){try{var m=0;a.saveLevel=1;var t=mxUtils.bind(this,function(c){if(null!=b)b(c);else throw c;try{if(!a.isConflict(c)){var d="sl_"+a.saveLevel+"-error_"+(a.getErrorMessage(c)||"unknown");null!=c&&null!=c.error&&null!=c.error.code&&(d+="-code_"+c.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"": +Base64.decode(l));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(b,k)?this.ui.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){try{4==b.readyState&&(200<=b.status&&299>=b.status?c(new LocalFile(this.ui,b.responseText,a.title+this.extension,!0)):null!=d&&d({message:mxResources.get("errorLoadingFile")}))}catch(v){if(null!=d)d(v);else throw v;}}),a.title):c(e?new LocalFile(this.ui,b,a.title,!0):new DriveFile(this.ui,b,a))}}catch(u){if(null!= +d)d(u);else throw u;}}),d,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title)||/\.pdf$/i.test(a.title),null,null,null,e)}catch(n){if(null!=d)d(n);else throw n;}}; +DriveClient.prototype.saveFile=function(a,c,d,b,g,e,k,n){try{var m=0;a.saveLevel=1;var t=mxUtils.bind(this,function(c){if(null!=b)b(c);else throw c;try{if(!a.isConflict(c)){var d="sl_"+a.saveLevel+"-error_"+(a.getErrorMessage(c)||"unknown");null!=c&&null!=c.error&&null!=c.error.code&&(d+="-code_"+c.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"": "-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:d,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(D){}}),f=mxUtils.bind(this,function(b){t(b);try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+ "."+a.desc.headRevisionId+"\nMime="+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nSaveLevel="+a.saveLevel+"\nSaveAsPng="+(this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle()))+"\nRetryCount="+m+"\nError="+b+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(A){}});if(a.isEditable()&&null!=a.desc){var l=(new Date).getTime(),p=a.desc.etag,u=a.desc.modifiedDate,v=a.desc.headRevisionId,q=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle()); -e=null!=e?e:!1;var z=null,y=!1,C={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(C.mimeType))C.mimeType=this.xmlMimeType,z=a.desc,y=d=!0;else if("application/octet-stream"==C.mimeType||"1"==urlParams["override-mime"]&&C.mimeType!=this.xmlMimeType)C.mimeType=this.xmlMimeType;var I=mxUtils.bind(this,function(b,g,D){try{a.saveLevel=3;a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&& -n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:Editor.guid(32)}));D||(null!=b||e||(b=this.placeholderThumbnail,g=this.placeholderMimeType),null!=b&&null!=g&&(C.thumbnail={image:b,mimeType:g}));var x=a.getData(),A=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-l,a.saveLevel=11,null==b)t({message:mxResources.get("errorSavingFile")+": Empty response"});else{var e=(new Date(b.modifiedDate)).getTime()-(new Date(u)).getTime();if(0>=e||p==b.etag||d&&v==b.headRevisionId){a.saveLevel= -12;var g=[];0>=e&&g.push("invalid modified time");p==b.etag&&g.push("stale etag");d&&v==b.headRevisionId&&g.push("stale revision");var k=g.join(", ");t({message:mxResources.get("errorSavingFile")+": "+k},b);try{EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+v+"."+u+"-"+this.ui.hashValue(p)+"-to-"+b.headRevisionId+"."+b.modifiedDate+"-"+this.ui.hashValue(b.etag)+(0<k.length?"-errors-"+k:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+ -a.sync.clientId:"-nosync"))}catch(O){}}else if(a.saveLevel=null,c(b,x),null!=z){this.executeRequest({url:"/files/"+z.id+"/revisions/"+z.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+z.id+"/revisions/"+z.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+a.getHash(),action:"from_"+z.id+"."+z.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!= -this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(O){}}}}catch(O){f(O)}}),G=mxUtils.bind(this,function(c,e){a.saveLevel=4;try{null!=n&&(C.properties=n);var g=k||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),l=mxUtils.bind(this,function(b){a.saveLevel=5;try{var k=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,l=!0,n=null;try{n=window.setTimeout(mxUtils.bind(this, -function(){l=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(W){}this.executeRequest(this.createUploadRequest(a.getId(),C,c,d||b||k,e,b?null:g,y),mxUtils.bind(this,function(a){window.clearTimeout(n);l&&A(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!= +e=null!=e?e:!1;var z=null,y=!1,C={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(C.mimeType))C.mimeType=this.xmlMimeType,z=a.desc,y=c=!0;else if("application/octet-stream"==C.mimeType||"1"==urlParams["override-mime"]&&C.mimeType!=this.xmlMimeType)C.mimeType=this.xmlMimeType;var I=mxUtils.bind(this,function(b,g,D){try{a.saveLevel=3;a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&& +n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:Editor.guid(32)}));D||(null!=b||e||(b=this.placeholderThumbnail,g=this.placeholderMimeType),null!=b&&null!=g&&(C.thumbnail={image:b,mimeType:g}));var x=a.getData(),A=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-l,a.saveLevel=11,null==b)t({message:mxResources.get("errorSavingFile")+": Empty response"});else{var e=(new Date(b.modifiedDate)).getTime()-(new Date(u)).getTime();if(0>=e||p==b.etag||c&&v==b.headRevisionId){a.saveLevel= +12;var g=[];0>=e&&g.push("invalid modified time");p==b.etag&&g.push("stale etag");c&&v==b.headRevisionId&&g.push("stale revision");var k=g.join(", ");t({message:mxResources.get("errorSavingFile")+": "+k},b);try{EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+v+"."+u+"-"+this.ui.hashValue(p)+"-to-"+b.headRevisionId+"."+b.modifiedDate+"-"+this.ui.hashValue(b.etag)+(0<k.length?"-errors-"+k:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+ +a.sync.clientId:"-nosync"))}catch(O){}}else if(a.saveLevel=null,d(b,x),null!=z){this.executeRequest({url:"/files/"+z.id+"/revisions/"+z.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+z.id+"/revisions/"+z.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+a.getHash(),action:"from_"+z.id+"."+z.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!= +this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(O){}}}}catch(O){f(O)}}),G=mxUtils.bind(this,function(d,e){a.saveLevel=4;try{null!=n&&(C.properties=n);var g=k||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),l=mxUtils.bind(this,function(b){a.saveLevel=5;try{var k=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,l=!0,n=null;try{n=window.setTimeout(mxUtils.bind(this, +function(){l=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(W){}this.executeRequest(this.createUploadRequest(a.getId(),C,d,c||b||k,e,b?null:g,y),mxUtils.bind(this,function(a){window.clearTimeout(n);l&&A(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!= c&&c.etag==g)if(m<this.staleEtagMaxRetries){m++;var d=2*m*this.coolOff*(1+.1*(Math.random()-.5));window.setTimeout(p,d);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",m,"delay",d)}else{p(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+a.getHash(),action:"rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+ (a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(ba){}}else"1"==urlParams.test&&c.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed","local",g,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),t(b,c)}catch(ba){f(ba)}}),mxUtils.bind(this,function(){t(b)})):t(b)}catch(ga){f(ga)}}}))}catch(W){f(W)}}),p=mxUtils.bind(this,function(b){a.saveLevel= 9;if(b)l(b);else{var c=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){c=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(V){}this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(e){window.clearTimeout(d);if(c){a.saveLevel=10;try{null!=e&&e.headRevisionId==v?("1"==urlParams.test&&g!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",g,"to",e.etag,"rev", a.desc.headRevisionId,"response",[e],"file",[a]),g=e.etag,l(b)):t({error:{code:412}},e)}catch(W){f(W)}}}),mxUtils.bind(this,function(b){window.clearTimeout(d);c&&(a.saveLevel=11,t(b))}))}});if(q&&null==b){a.saveLevel=8;var x=new Image;x.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/x.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(x.height*a);b.getContext("2d").drawImage(x,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+ -1).replace(/\+/g,"-").replace(/\//g,"_");C.thumbnail={image:c,mimeType:"image/png"};p(!1)}catch(V){try{p(!1)}catch(W){f(W)}}});x.src="data:image/png;base64,"+c}else p(!1)}catch(X){f(X)}});q?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){G(a,!0)}),t,this.ui.getCurrentFile()!=a?x:null):G(x,!1)}catch(H){f(H)}});try{a.saveLevel=2,(e||q||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=C.mimeType&&"application/vnd.jgraph.mxfile"!=C.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth, +1).replace(/\+/g,"-").replace(/\//g,"_");C.thumbnail={image:c,mimeType:"image/png"};p(!1)}catch(V){try{p(!1)}catch(W){f(W)}}});x.src="data:image/png;base64,"+d}else p(!1)}catch(X){f(X)}});q?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){G(a,!0)}),t,this.ui.getCurrentFile()!=a?x:null):G(x,!1)}catch(H){f(H)}});try{a.saveLevel=2,(e||q||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=C.mimeType&&"application/vnd.jgraph.mxfile"!=C.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth, mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(D){b=null}I(b,"image/png")}catch(D){f(D)}})))&&I(null,null,a.constructor!=DriveLibrary)}catch(x){f(x)}}else this.ui.editor.graph.reset(),t({message:mxResources.get("readOnly")})}catch(x){f(x)}}; -DriveClient.prototype.insertFile=function(a,d,c,b,g,e,k){e=null!=e?e:this.xmlMimeType;a={mimeType:e,title:a};null!=c&&(a.parents=[{kind:"drive#fileLink",id:c}]);this.executeRequest(this.createUploadRequest(null,a,d,!1,k),mxUtils.bind(this,function(a){e==this.libraryMimeType?b(new DriveLibrary(this.ui,d,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,d,a))}),g)}; -DriveClient.prototype.createUploadRequest=function(a,d,c,b,g,e,k){g=null!=g?g:!1;var n={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=e&&(n["If-Match"]=e);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsAllDrives=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:n,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(d)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+ -(null!=c?g?c:Base64.encode(c):"")+"\r\n---------314159265358979323846--"};b||(a.fullUrl+="&newRevision=false");k&&(a.fullUrl+="&pinned=true");return a}; -DriveClient.prototype.pickFile=function(a,d){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=d?"genericPicker":"filePicker",b=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"== -mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",b),this[a].setVisible(!1))});if(null==this[a]||this[a+"Token"]!=this.token){this[a+"Token"]=this.token;var g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),e=(new google.picker.DocsView).setIncludeFolders(!0),k=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);d?(g.setMimeTypes("*/*"),e.setMimeTypes("*/*"), +DriveClient.prototype.insertFile=function(a,c,d,b,g,e,k){e=null!=e?e:this.xmlMimeType;a={mimeType:e,title:a};null!=d&&(a.parents=[{kind:"drive#fileLink",id:d}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,k),mxUtils.bind(this,function(a){e==this.libraryMimeType?b(new DriveLibrary(this.ui,c,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,c,a))}),g)}; +DriveClient.prototype.createUploadRequest=function(a,c,d,b,g,e,k){g=null!=g?g:!1;var n={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=e&&(n["If-Match"]=e);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsAllDrives=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:n,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+ +(null!=d?g?d:Base64.encode(d):"")+"\r\n---------314159265358979323846--"};b||(a.fullUrl+="&newRevision=false");k&&(a.fullUrl+="&pinned=true");return a}; +DriveClient.prototype.pickFile=function(a,c){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=c?"genericPicker":"filePicker",b=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"== +mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",b),this[a].setVisible(!1))});if(null==this[a]||this[a+"Token"]!=this.token){this[a+"Token"]=this.token;var g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),e=(new google.picker.DocsView).setIncludeFolders(!0),k=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(g.setMimeTypes("*/*"),e.setMimeTypes("*/*"), k.setMimeTypes("*/*")):(g.setMimeTypes(this.mimeTypes),e.setMimeTypes(this.mimeTypes),k.setMimeTypes(this.mimeTypes));this[a]=(new google.picker.PickerBuilder).setOAuthToken(this[a+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(g).addView(e).addView(k).addView(google.picker.ViewId.RECENTLY_PICKED).addView(n).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document, "click",b);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",b);this[a].setVisible(!0)}catch(m){this.ui.spinner.stop(),this.ui.handleError(m)}}))}; -DriveClient.prototype.pickFolder=function(a,d){this.folderPickerCallback=a;var c=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=this.token){this.folderPickerToken= +DriveClient.prototype.pickFolder=function(a,c){this.folderPickerCallback=a;var d=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=this.token){this.folderPickerToken= this.token;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),k=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(c).addView(d).addView(k).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this, -function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);this.folderPickerCallback(b)})).build()}mxEvent.addListener(document,"click",a);this.folderPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))}catch(b){this.ui.handleError(b)}});d?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder", -id:"root"}]})}),mxUtils.bind(this,function(){c()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}; +function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);this.folderPickerCallback(b)})).build()}mxEvent.addListener(document,"click",a);this.folderPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))}catch(b){this.ui.handleError(b)}});c?d():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder", +id:"root"}]})}),mxUtils.bind(this,function(){d()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}; DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"== -mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))});if(null==this.libraryPicker||this.libraryPickerToken!=this.token){this.libraryPickerToken=this.token;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),b=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"), -g=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),e=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(c).addView(b).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(e).setCallback(mxUtils.bind(this, +mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))});if(null==this.libraryPicker||this.libraryPickerToken!=this.token){this.libraryPickerToken=this.token;var d=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),b=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"), +g=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),e=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(d).addView(b).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(e).setCallback(mxUtils.bind(this, function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}catch(k){this.ui.spinner.stop(),this.ui.handleError(k)}}))}; -DriveClient.prototype.showPermissions=function(a){var d=mxUtils.bind(this,function(){var c=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(c.container,360,190,!0,!0);c.init()});this.sharingFailed?d():this.checkToken(mxUtils.bind(this,function(){try{var c=new gapi.drive.share.ShareClient(this.appId); -c.setOAuthToken(this.token);c.setItemIds([a]);c.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,c=0;c<a.length;c++)for(var k=0;k<a[c].addedNodes.length;k++){var n=a[c].addedNodes[k];"BUTTON"==n.nodeName&&"ok"==n.getAttribute("name")&&null!=n.parentNode&&null!=n.parentNode.parentNode&&"dialog"==n.parentNode.parentNode.getAttribute("role")? -(this.sharingFailed=!0,n.click(),d(),b=!0):"DIV"==n.nodeName&&"shr-q-shr-r-shr-xb"==n.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(b){this.ui.handleError(b)}}))}; -DriveClient.prototype.clearPersistentToken=function(){var a=JSON.parse(this.getPersistentToken(!0))||{};delete a.current;delete a[this.userId];for(var d in a){a.current={userId:d,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(a))}; -DriveClient.prototype.setPersistentToken=function(a,d){var c=JSON.parse(this.getPersistentToken(!0))||{};a.userId=this.userId;c.current=a;c[this.userId]={refresh_token:a.refresh_token,user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(c),d)};DropboxFile=function(a,d,c){DrawioFile.call(this,a,d);this.stat=c};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name}; +DriveClient.prototype.showPermissions=function(a){var c=mxUtils.bind(this,function(){var c=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(c.container,360,190,!0,!0);c.init()});this.sharingFailed?c():this.checkToken(mxUtils.bind(this,function(){try{var d=new gapi.drive.share.ShareClient(this.appId); +d.setOAuthToken(this.token);d.setItemIds([a]);d.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,d=0;d<a.length;d++)for(var k=0;k<a[d].addedNodes.length;k++){var n=a[d].addedNodes[k];"BUTTON"==n.nodeName&&"ok"==n.getAttribute("name")&&null!=n.parentNode&&null!=n.parentNode.parentNode&&"dialog"==n.parentNode.parentNode.getAttribute("role")? +(this.sharingFailed=!0,n.click(),c(),b=!0):"DIV"==n.nodeName&&"shr-q-shr-r-shr-xb"==n.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(b){this.ui.handleError(b)}}))}; +DriveClient.prototype.clearPersistentToken=function(){var a=JSON.parse(this.getPersistentToken(!0))||{};delete a.current;delete a[this.userId];for(var c in a){a.current={userId:c,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(a))}; +DriveClient.prototype.setPersistentToken=function(a,c){var d=JSON.parse(this.getPersistentToken(!0))||{};a.userId=this.userId;d.current=a;d[this.userId]={refresh_token:a.refresh_token,user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(d),c)};DropboxFile=function(a,c,d){DrawioFile.call(this,a,c);this.stat=d};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name}; DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0}; -DropboxFile.prototype.getRevisions=function(a,d){var c=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});c.then(mxUtils.bind(this,function(b){try{for(var c=[],e=b.entries.length-1;0<=e;e--)mxUtils.bind(this,function(a){c.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+ -a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[e]);a(c)}catch(k){d(k)}}));c["catch"](function(a){d(a)})};DropboxFile.prototype.getLatestVersion=function(a,d){this.ui.dropbox.getFile(this.getId(),a,d)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,d,c,b,g){this.doSave(this.getTitle(),a,d,c,b,g)};DropboxFile.prototype.saveAs=function(a,d,c){this.doSave(a,!1,d,c)}; -DropboxFile.prototype.doSave=function(a,d,c,b,g,e){var k=this.stat.name;this.stat.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=k;this.saveFile(a,d,c,b,g,e)}),b,g,e])}; -DropboxFile.prototype.saveFile=function(a,d,c,b){this.isEditable()?this.savingFile?null!=b&&b({code:App.ERROR_BUSY}):(d=mxUtils.bind(this,function(d){if(d){var e=null,g=null;try{e=this.isModified;g=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var n=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}});n();var m=mxUtils.bind(this,function(d){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a, -d,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.stat=a;this.contentChanged();null!=c&&c()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){n();c()}}b(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(this.ui.base64ToBlob(a,"image/png"))}),b,this.ui.getCurrentFile()!= -this?this.getData():null):m(this.getData())}catch(t){if(this.savingFile=!1,null!=e&&(this.isModified=e),null!=g&&this.setModified(g||this.isModified()),null!=b)b(t);else throw t;}}else null!=b&&b()}),this.getTitle()==a?d(!0):this.ui.dropbox.checkExists(a,d)):null!=c&&c()}; -DropboxFile.prototype.rename=function(a,d,c){this.ui.dropbox.renameFile(this,a,mxUtils.bind(this,function(b){this.hasSameExtension(a,this.getTitle())?(this.stat=b,this.descriptorChanged(),null!=d&&d()):(this.stat=b,this.descriptorChanged(),this.save(!0,d,c))}),c)};DropboxLibrary=function(a,d,c){DropboxFile.call(this,a,d,c)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(a,d,c){this.saveFile(a,!1,d,c)};DropboxLibrary.prototype.open=function(){};DropboxClient=function(a){DrawioClient.call(this,a,"dbauth");this.client=new Dropbox({clientId:App.DROPBOX_APPKEY});this.client.setAccessToken(this.token)};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio/";DropboxClient.prototype.extension=".drawio";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4; +DropboxFile.prototype.getRevisions=function(a,c){var d=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});d.then(mxUtils.bind(this,function(b){try{for(var d=[],e=b.entries.length-1;0<=e;e--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+ +a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[e]);a(d)}catch(k){c(k)}}));d["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,d,b,g){this.doSave(this.getTitle(),a,c,d,b,g)};DropboxFile.prototype.saveAs=function(a,c,d){this.doSave(a,!1,c,d)}; +DropboxFile.prototype.doSave=function(a,c,d,b,g,e){var k=this.stat.name;this.stat.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=k;this.saveFile(a,c,d,b,g,e)}),b,g,e])}; +DropboxFile.prototype.saveFile=function(a,c,d,b){this.isEditable()?this.savingFile?null!=b&&b({code:App.ERROR_BUSY}):(c=mxUtils.bind(this,function(c){if(c){var e=null,g=null;try{e=this.isModified;g=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var n=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}});n();var m=mxUtils.bind(this,function(c){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a, +c,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.stat=a;this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){n();c()}}b(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(this.ui.base64ToBlob(a,"image/png"))}),b,this.ui.getCurrentFile()!= +this?this.getData():null):m(this.getData())}catch(t){if(this.savingFile=!1,null!=e&&(this.isModified=e),null!=g&&this.setModified(g||this.isModified()),null!=b)b(t);else throw t;}}else null!=b&&b()}),this.getTitle()==a?c(!0):this.ui.dropbox.checkExists(a,c)):null!=d&&d()}; +DropboxFile.prototype.rename=function(a,c,d){this.ui.dropbox.renameFile(this,a,mxUtils.bind(this,function(b){this.hasSameExtension(a,this.getTitle())?(this.stat=b,this.descriptorChanged(),null!=c&&c()):(this.stat=b,this.descriptorChanged(),this.save(!0,c,d))}),d)};DropboxLibrary=function(a,c,d){DropboxFile.call(this,a,c,d)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(a,c,d){this.saveFile(a,!1,c,d)};DropboxLibrary.prototype.open=function(){};DropboxClient=function(a){DrawioClient.call(this,a,"dbauth");this.client=new Dropbox({clientId:App.DROPBOX_APPKEY});this.client.setAccessToken(this.token)};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio/";DropboxClient.prototype.extension=".drawio";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4; DropboxClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null;this.client.authTokenRevoke().then(mxUtils.bind(this,function(){this.client.setAccessToken(null)}))}; -DropboxClient.prototype.updateUser=function(a,d,c){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),e=this.client.usersGetCurrentAccount();e.then(mxUtils.bind(this,function(c){window.clearTimeout(g);b&&(this.setUser(new DrawioUser(c.account_id,c.email,c.name.display_name)),a())}));e["catch"](mxUtils.bind(this,function(e){window.clearTimeout(g);b&&(null==e||401!==e.status||c?d({message:mxResources.get("accessDenied")}):(this.setUser(null), -this.client.setAccessToken(null),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,d,!0)}),d)))}))}; -DropboxClient.prototype.authenticate=function(a,d){if(null==window.onDropboxCallback){var c=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(k,n){if(b){window.onDropboxCallback=null;b=!1;try{null==k?d({message:mxResources.get("accessDenied"),retry:c}):(null!=e&&e(),this.client.setAccessToken(k), -this.setUser(null),g&&this.setPersistentToken(k),a())}catch(m){d(m)}finally{null!=n&&n.close()}}else null!=n&&n.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:c})}),mxUtils.bind(this,function(){b&&(window.onDropboxCallback=null,b=!1,d({message:mxResources.get("accessDenied"),retry:c}))}))});c()}else d({code:App.ERROR_BUSY})}; -DropboxClient.prototype.executePromise=function(a,d,c){var b=mxUtils.bind(this,function(e){var k=!0,n=window.setTimeout(mxUtils.bind(this,function(){k=!1;c({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(n);k&&null!=d&&d(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(n);k&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?c({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null), -e?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){g(!0)},c)})}):this.authenticate(function(){b(!0)},c)))}))}),g=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){g(!0)},c,a):b(a)});null===this.client.getAccessToken()?this.authenticate(function(){g(!0)},c):g(!1)};DropboxClient.prototype.getLibrary=function(a,d,c){this.getFile(a,d,c,!0)}; -DropboxClient.prototype.getFile=function(a,d,c,b){b=null!=b?b:!1;var g=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&g){var e=mxUtils.bind(this,function(){var b=a.split("/");this.ui.convertFile(a,0<b.length?b[b.length-1]:a,null,this.extension,d,c)});null!=this.token?e():this.authenticate(e,c)}else e={path:"/"+a},null!=urlParams.rev&&(e.rev=urlParams.rev),this.readFile(e,mxUtils.bind(this,function(c,e){var k= -g?c.lastIndexOf(","):-1,n=null;0<k&&(k=this.ui.extractGraphModelFromPng(c.substring(k+1)),null!=k&&0<k.length?c=k:n=new LocalFile(this,c,a,!0));d(null!=n?n:b?new DropboxLibrary(this.ui,c,e):new DropboxFile(this.ui,c,e))}),c,g)}; -DropboxClient.prototype.readFile=function(a,d,c,b){var g=mxUtils.bind(this,function(k){var n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),t=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});t.then(mxUtils.bind(this,function(a){}));t["catch"](function(a){window.clearTimeout(m);n&&null!=a&&409==a.status&&(n=!1,c({message:mxResources.get("fileNotFound")}))});t=this.client.filesDownload(a);t.then(mxUtils.bind(this, -function(a){window.clearTimeout(m);if(n){n=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(b){d(e.result,a)});b?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(p){c(p)}}}));t["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);n&&(n=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?c({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),k?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)}, -c)})}):this.authenticate(function(){g(!0)},c)))}))}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},c,a):g(a)});null===this.client.getAccessToken()?this.authenticate(function(){e(!0)},c):e(!1)}; -DropboxClient.prototype.checkExists=function(a,d,c){var b=this.client.filesGetMetadata({path:"/"+a.toLowerCase(),include_deleted:!1});this.executePromise(b,mxUtils.bind(this,function(b){c?d(!1,!0,b):this.ui.confirm(mxResources.get("replaceIt",[a]),function(){d(!0,!0,b)},function(){d(!1,!0,b)})}),function(a){d(!0,!1)})}; -DropboxClient.prototype.renameFile=function(a,d,c,b){if(/[\\\/:\?\*"\|]/.test(d))b({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=d){var g=a.stat.path_display.substring(1),e=g.lastIndexOf("/");0<e&&(d=g.substring(0,e+1)+d)}null!=a&&null!=d&&a.stat.path_lower.substring(1)!==d.toLowerCase()?this.checkExists(d,mxUtils.bind(this,function(e,g,m){e?(e=mxUtils.bind(this,function(e){e=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+d,autorename:!1});this.executePromise(e, -c,b)}),g&&m.path_lower.substring(1)!==d.toLowerCase()?(g=this.client.filesDelete({path:"/"+d.toLowerCase()}),this.executePromise(g,e,b)):e()):b()})):b({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(a,d,c,b){this.insertFile(a,d,c,b,!0)}; -DropboxClient.prototype.insertFile=function(a,d,c,b,g){g=null!=g?g:!1;this.checkExists(a,mxUtils.bind(this,function(e){e?this.saveFile(a,d,mxUtils.bind(this,function(a){g?c(new DropboxLibrary(this.ui,d,a)):c(new DropboxFile(this.ui,d,a))}),b):b()}))}; -DropboxClient.prototype.saveFile=function(a,d,c,b,g){/[\\\/:\?\*"\|]/.test(a)?b({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=d.length?b({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(d.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=g?g:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([d],{type:"text/plain"})}),this.executePromise(a,c,b))}; -DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(d){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var c=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),b=d[0].link.indexOf(this.appPath);if(0<b){var g=decodeURIComponent(d[0].link.substring(b+this.appPath.length-1));this.readFile({path:g},mxUtils.bind(this,function(b,k){if(null!=k&&k.id==d[0].id)try{this.ui.spinner.stop(), -a(g.substring(1),new DropboxLibrary(this.ui,b,k))}catch(n){this.ui.handleError(n)}else this.createLibrary(d[0],a,c)}),c)}else this.createLibrary(d[0],a,c)}})})}; -DropboxClient.prototype.createLibrary=function(a,d,c){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(b){this.insertFile(a.name,b,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),d(a.getHash().substring(1),a)}catch(e){c(e)}}),c,!0)}),c)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))}; -DropboxClient.prototype.pickFile=function(a,d){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,b){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):b.getHash(),null,b)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(d)this.ui.spinner.stop(),a(c[0].link);else{var b=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),g=mxUtils.bind(this, -function(b,c){this.ui.spinner.stop();a(b,c)}),e=/\.png$/i.test(c[0].name);if(/\.vsdx$/i.test(c[0].name)||/\.gliffy$/i.test(c[0].name)||!this.ui.useCanvasForExport&&e)g(c[0].link);else{var k=c[0].link.indexOf(this.appPath);if(0<k){var n=decodeURIComponent(c[0].link.substring(k+this.appPath.length-1));this.readFile({path:n},mxUtils.bind(this,function(d,k){if(null!=k&&k.id==c[0].id){var f=e?d.lastIndexOf(","):-1;this.ui.spinner.stop();var m=null;0<f&&(f=this.ui.extractGraphModelFromPng(d.substring(f+ -1)),null!=f&&0<f.length?d=f:m=new LocalFile(this,d,n,!0));a(n.substring(1),null!=m?m:new DropboxFile(this.ui,d,k))}else this.createFile(c[0],g,b)}),b,e)}else this.createFile(c[0],g,b)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}; -DropboxClient.prototype.createFile=function(a,d,c){var b=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(g){null!=g&&0<g.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var e=b?g.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(g.substring(e+1)),null!=e&&0<e.length&&(g=e));this.insertFile(a.name,g,mxUtils.bind(this,function(b){d(a.name,b)}),c)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})): -(this.ui.spinner.stop(),c({message:mxResources.get("errorLoadingFile")}))}),c,b)};OneDriveFile=function(a,d,c){DrawioFile.call(this,a,d);this.meta=c};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getId=function(){return this.getIdOf(this.meta)};OneDriveFile.prototype.getParentId=function(){return this.getIdOf(this.meta,!0)};OneDriveFile.prototype.getIdOf=function(a,d){return(null!=a.parentReference&&null!=a.parentReference.driveId?a.parentReference.driveId+"/":"")+(null!=d?a.parentReference.id:a.id)}; +DropboxClient.prototype.updateUser=function(a,c,d){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),e=this.client.usersGetCurrentAccount();e.then(mxUtils.bind(this,function(c){window.clearTimeout(g);b&&(this.setUser(new DrawioUser(c.account_id,c.email,c.name.display_name)),a())}));e["catch"](mxUtils.bind(this,function(e){window.clearTimeout(g);b&&(null==e||401!==e.status||d?c({message:mxResources.get("accessDenied")}):(this.setUser(null), +this.client.setAccessToken(null),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)))}))}; +DropboxClient.prototype.authenticate=function(a,c){if(null==window.onDropboxCallback){var d=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(k,n){if(b){window.onDropboxCallback=null;b=!1;try{null==k?c({message:mxResources.get("accessDenied"),retry:d}):(null!=e&&e(),this.client.setAccessToken(k), +this.setUser(null),g&&this.setPersistentToken(k),a())}catch(m){c(m)}finally{null!=n&&n.close()}}else null!=n&&n.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){b&&(window.onDropboxCallback=null,b=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})}; +DropboxClient.prototype.executePromise=function(a,c,d){var b=mxUtils.bind(this,function(e){var k=!0,n=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(n);k&&null!=c&&c(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(n);k&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?d({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null), +e?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){g(!0)},d)})}):this.authenticate(function(){b(!0)},d)))}))}),g=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){g(!0)},d,a):b(a)});null===this.client.getAccessToken()?this.authenticate(function(){g(!0)},d):g(!1)};DropboxClient.prototype.getLibrary=function(a,c,d){this.getFile(a,c,d,!0)}; +DropboxClient.prototype.getFile=function(a,c,d,b){b=null!=b?b:!1;var g=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&g){var e=mxUtils.bind(this,function(){var b=a.split("/");this.ui.convertFile(a,0<b.length?b[b.length-1]:a,null,this.extension,c,d)});null!=this.token?e():this.authenticate(e,d)}else e={path:"/"+a},null!=urlParams.rev&&(e.rev=urlParams.rev),this.readFile(e,mxUtils.bind(this,function(d,e){var k= +g?d.lastIndexOf(","):-1,n=null;0<k&&(k=this.ui.extractGraphModelFromPng(d.substring(k+1)),null!=k&&0<k.length?d=k:n=new LocalFile(this,d,a,!0));c(null!=n?n:b?new DropboxLibrary(this.ui,d,e):new DropboxFile(this.ui,d,e))}),d,g)}; +DropboxClient.prototype.readFile=function(a,c,d,b){var g=mxUtils.bind(this,function(k){var n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),t=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});t.then(mxUtils.bind(this,function(a){}));t["catch"](function(a){window.clearTimeout(m);n&&null!=a&&409==a.status&&(n=!1,d({message:mxResources.get("fileNotFound")}))});t=this.client.filesDownload(a);t.then(mxUtils.bind(this, +function(a){window.clearTimeout(m);if(n){n=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(b){c(e.result,a)});b?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(p){d(p)}}}));t["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);n&&(n=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?d({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),k?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)}, +d)})}):this.authenticate(function(){g(!0)},d)))}))}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},d,a):g(a)});null===this.client.getAccessToken()?this.authenticate(function(){e(!0)},d):e(!1)}; +DropboxClient.prototype.checkExists=function(a,c,d){var b=this.client.filesGetMetadata({path:"/"+a.toLowerCase(),include_deleted:!1});this.executePromise(b,mxUtils.bind(this,function(b){d?c(!1,!0,b):this.ui.confirm(mxResources.get("replaceIt",[a]),function(){c(!0,!0,b)},function(){c(!1,!0,b)})}),function(a){c(!0,!1)})}; +DropboxClient.prototype.renameFile=function(a,c,d,b){if(/[\\\/:\?\*"\|]/.test(c))b({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=c){var g=a.stat.path_display.substring(1),e=g.lastIndexOf("/");0<e&&(c=g.substring(0,e+1)+c)}null!=a&&null!=c&&a.stat.path_lower.substring(1)!==c.toLowerCase()?this.checkExists(c,mxUtils.bind(this,function(e,g,m){e?(e=mxUtils.bind(this,function(e){e=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+c,autorename:!1});this.executePromise(e, +d,b)}),g&&m.path_lower.substring(1)!==c.toLowerCase()?(g=this.client.filesDelete({path:"/"+c.toLowerCase()}),this.executePromise(g,e,b)):e()):b()})):b({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(a,c,d,b){this.insertFile(a,c,d,b,!0)}; +DropboxClient.prototype.insertFile=function(a,c,d,b,g){g=null!=g?g:!1;this.checkExists(a,mxUtils.bind(this,function(e){e?this.saveFile(a,c,mxUtils.bind(this,function(a){g?d(new DropboxLibrary(this.ui,c,a)):d(new DropboxFile(this.ui,c,a))}),b):b()}))}; +DropboxClient.prototype.saveFile=function(a,c,d,b,g){/[\\\/:\?\*"\|]/.test(a)?b({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=c.length?b({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=g?g:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([c],{type:"text/plain"})}),this.executePromise(a,d,b))}; +DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var d=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),b=c[0].link.indexOf(this.appPath);if(0<b){var g=decodeURIComponent(c[0].link.substring(b+this.appPath.length-1));this.readFile({path:g},mxUtils.bind(this,function(b,k){if(null!=k&&k.id==c[0].id)try{this.ui.spinner.stop(), +a(g.substring(1),new DropboxLibrary(this.ui,b,k))}catch(n){this.ui.handleError(n)}else this.createLibrary(c[0],a,d)}),d)}else this.createLibrary(c[0],a,d)}})})}; +DropboxClient.prototype.createLibrary=function(a,c,d){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(b){this.insertFile(a.name,b,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),c(a.getHash().substring(1),a)}catch(e){d(e)}}),d,!0)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))}; +DropboxClient.prototype.pickFile=function(a,c){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,b){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):b.getHash(),null,b)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(d){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(c)this.ui.spinner.stop(),a(d[0].link);else{var b=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),g=mxUtils.bind(this, +function(b,c){this.ui.spinner.stop();a(b,c)}),e=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!this.ui.useCanvasForExport&&e)g(d[0].link);else{var k=d[0].link.indexOf(this.appPath);if(0<k){var n=decodeURIComponent(d[0].link.substring(k+this.appPath.length-1));this.readFile({path:n},mxUtils.bind(this,function(c,k){if(null!=k&&k.id==d[0].id){var f=e?c.lastIndexOf(","):-1;this.ui.spinner.stop();var m=null;0<f&&(f=this.ui.extractGraphModelFromPng(c.substring(f+ +1)),null!=f&&0<f.length?c=f:m=new LocalFile(this,c,n,!0));a(n.substring(1),null!=m?m:new DropboxFile(this.ui,c,k))}else this.createFile(d[0],g,b)}),b,e)}else this.createFile(d[0],g,b)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}; +DropboxClient.prototype.createFile=function(a,c,d){var b=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(g){null!=g&&0<g.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var e=b?g.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(g.substring(e+1)),null!=e&&0<e.length&&(g=e));this.insertFile(a.name,g,mxUtils.bind(this,function(b){c(a.name,b)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})): +(this.ui.spinner.stop(),d({message:mxResources.get("errorLoadingFile")}))}),d,b)};OneDriveFile=function(a,c,d){DrawioFile.call(this,a,c);this.meta=d};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getId=function(){return this.getIdOf(this.meta)};OneDriveFile.prototype.getParentId=function(){return this.getIdOf(this.meta,!0)};OneDriveFile.prototype.getIdOf=function(a,c){return(null!=a.parentReference&&null!=a.parentReference.driveId?a.parentReference.driveId+"/":"")+(null!=c?a.parentReference.id:a.id)}; OneDriveFile.prototype.getChannelId=function(){return"W-"+DrawioFile.prototype.getChannelId.apply(this,arguments)};OneDriveFile.prototype.getHash=function(){return"W"+encodeURIComponent(this.getId())};OneDriveFile.prototype.getMode=function(){return App.MODE_ONEDRIVE};OneDriveFile.prototype.isAutosaveOptional=function(){return!0};OneDriveFile.prototype.getTitle=function(){return this.meta.name};OneDriveFile.prototype.isRenamable=function(){return!0};OneDriveFile.prototype.isSyncSupported=function(){return!0}; OneDriveFile.prototype.getSize=function(){return this.meta.size};OneDriveFile.prototype.isConflict=function(a){return null!=a&&(412==a.getStatus()||409==a.getStatus())};OneDriveFile.prototype.getCurrentUser=function(){return null!=this.ui.oneDrive?this.ui.oneDrive.user:null}; -OneDriveFile.prototype.loadDescriptor=function(a,d){this.ui.oneDrive.executeRequest(this.ui.oneDrive.getItemURL(this.getId()),mxUtils.bind(this,function(c){200<=c.getStatus()&&299>=c.getStatus()?a(JSON.parse(c.getText())):null!=d&&d()}),d)};OneDriveFile.prototype.getLatestVersion=function(a,d){this.ui.oneDrive.getFile(this.getId(),a,d)};OneDriveFile.prototype.getDescriptor=function(){return this.meta};OneDriveFile.prototype.setDescriptor=function(a){this.meta=a}; -OneDriveFile.prototype.getDescriptorSecret=function(a){return null!=a.file&&null!=a.file.hashes&&null!=a.file.hashes.quickXorHash?a.file.hashes.quickXorHash:null};OneDriveFile.prototype.getDescriptorEtag=function(a){return a.eTag};OneDriveFile.prototype.setDescriptorEtag=function(a,d){a.eTag=d}; -OneDriveFile.prototype.loadPatchDescriptor=function(a,d){var c=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(c+"?select=etag,file",mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):d(this.ui.oneDrive.parseRequestText(b))}),d)}; -OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,d,c,b,g){this.doSave(this.getTitle(),a,d,c,b,g)};OneDriveFile.prototype.saveAs=function(a,d,c){this.doSave(a,!1,d,c)}; -OneDriveFile.prototype.doSave=function(a,d,c,b,g,e){var k=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=k;this.saveFile(a,d,c,b,g,e)}),b,g,e])}; -OneDriveFile.prototype.saveFile=function(a,d,c,b,g,e){if(!this.isEditable())null!=c&&c();else if(!this.savingFile)if(this.getTitle()==a){var k=mxUtils.bind(this,function(){var a=null,d=null;try{a=this.isModified;d=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var g=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return d}}),f=e||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),l=this.meta; -g();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(d,e){this.isModified=a;this.savingFile=!1;this.meta=d;this.fileSaved(e,l,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c()}),b)}),mxUtils.bind(this,function(c,e){this.savingFile=!1;this.isModified=a;this.setModified(d||this.isModified());if(this.isConflict(e))this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.savingFileTime=new Date,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this, -function(){this.updateFileData();k()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b();else if(null!=b){if(null!=c&&null!=c.retry){var f=c.retry;c.retry=function(){g();f()}}b(c)}}),f)}catch(p){if(this.savingFile=!1,null!=a&&(this.isModified=a),null!=d&&this.setModified(d||this.isModified()),null!=b)b(p);else throw p;}});k()}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile= -!1;null!=c&&c();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))};OneDriveFile.prototype.rename=function(a,d,c){var b=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.meta=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(b),null!=d&&d(g)):(this.meta=g,null!=this.sync&&this.sync.descriptorChanged(b),this.save(!0,d,c))}),c)}; -OneDriveFile.prototype.move=function(a,d,c){this.ui.oneDrive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=d&&d(a)}),c)};OneDriveLibrary=function(a,d,c){OneDriveFile.call(this,a,d,c)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(a,d,c){this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.desc=a;null!=d&&d(a)}),c)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a){DrawioClient.call(this,a,"oneDriveAuthInfo");a=JSON.parse(this.token);null!=a&&(this.token=a.access_token,this.endpointHint=null!=a.endpointHint?a.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):a.endpointHint,this.tokenExpiresOn=a.expiresOn,a=(this.tokenExpiresOn-Date.now())/1E3,this.resetTokenRefresh(600>a?1:a))};mxUtils.extend(OneDriveClient,DrawioClient); +OneDriveFile.prototype.loadDescriptor=function(a,c){this.ui.oneDrive.executeRequest(this.ui.oneDrive.getItemURL(this.getId()),mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()?a(JSON.parse(d.getText())):null!=c&&c()}),c)};OneDriveFile.prototype.getLatestVersion=function(a,c){this.ui.oneDrive.getFile(this.getId(),a,c)};OneDriveFile.prototype.getDescriptor=function(){return this.meta};OneDriveFile.prototype.setDescriptor=function(a){this.meta=a}; +OneDriveFile.prototype.getDescriptorSecret=function(a){return null!=a.file&&null!=a.file.hashes&&null!=a.file.hashes.quickXorHash?a.file.hashes.quickXorHash:null};OneDriveFile.prototype.getDescriptorEtag=function(a){return a.eTag};OneDriveFile.prototype.setDescriptorEtag=function(a,c){a.eTag=c}; +OneDriveFile.prototype.loadPatchDescriptor=function(a,c){var d=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(d+"?select=etag,file",mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):c(this.ui.oneDrive.parseRequestText(b))}),c)}; +OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,c,d,b,g){this.doSave(this.getTitle(),a,c,d,b,g)};OneDriveFile.prototype.saveAs=function(a,c,d){this.doSave(a,!1,c,d)}; +OneDriveFile.prototype.doSave=function(a,c,d,b,g,e){var k=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=k;this.saveFile(a,c,d,b,g,e)}),b,g,e])}; +OneDriveFile.prototype.saveFile=function(a,c,d,b,g,e){if(!this.isEditable())null!=d&&d();else if(!this.savingFile)if(this.getTitle()==a){var k=mxUtils.bind(this,function(){var a=null,c=null;try{a=this.isModified;c=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var g=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return c}}),f=e||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),l=this.meta; +g();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(c,e){this.isModified=a;this.savingFile=!1;this.meta=c;this.fileSaved(e,l,mxUtils.bind(this,function(){this.contentChanged();null!=d&&d()}),b)}),mxUtils.bind(this,function(d,e){this.savingFile=!1;this.isModified=a;this.setModified(c||this.isModified());if(this.isConflict(e))this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.savingFileTime=new Date,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this, +function(){this.updateFileData();k()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b();else if(null!=b){if(null!=d&&null!=d.retry){var f=d.retry;d.retry=function(){g();f()}}b(d)}}),f)}catch(p){if(this.savingFile=!1,null!=a&&(this.isModified=a),null!=c&&this.setModified(c||this.isModified()),null!=b)b(p);else throw p;}});k()}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile= +!1;null!=d&&d();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))};OneDriveFile.prototype.rename=function(a,c,d){var b=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.meta=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(b),null!=c&&c(g)):(this.meta=g,null!=this.sync&&this.sync.descriptorChanged(b),this.save(!0,c,d))}),d)}; +OneDriveFile.prototype.move=function(a,c,d){this.ui.oneDrive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=c&&c(a)}),d)};OneDriveLibrary=function(a,c,d){OneDriveFile.call(this,a,c,d)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(a,c,d){this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),d)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a){DrawioClient.call(this,a,"oneDriveAuthInfo");a=JSON.parse(this.token);null!=a&&(this.token=a.access_token,this.endpointHint=null!=a.endpointHint?a.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):a.endpointHint,this.tokenExpiresOn=a.expiresOn,a=(this.tokenExpiresOn-Date.now())/1E3,this.resetTokenRefresh(600>a?1:a))};mxUtils.extend(OneDriveClient,DrawioClient); OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"2e598409-107f-4b59-89ca-d7723c8e00a4":"45c10911-200f-4e27-a666-9e9fca147395");OneDriveClient.prototype.scopes="user.read files.readwrite.all offline_access";OneDriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/microsoft";OneDriveClient.prototype.pickerRedirectUri=window.location.protocol+"//"+window.location.host+"/onedrive3.html"; OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.extension=".drawio";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i]; -OneDriveClient.prototype.isValidFilename=function(a){if(null==a||""===a)return!1;for(var d=0;d<this.invalidFilenameRegExs.length;d++)if(this.invalidFilenameRegExs[d].test(a))return!1;return!0};OneDriveClient.prototype.get=function(a,d,c){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(d,c);return a}; -OneDriveClient.prototype.updateUser=function(a,d,c){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(e){window.clearTimeout(g);b&&(200>e.getStatus()||300<=e.getStatus()?c?d({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,d,!0)}),d)):(e=JSON.parse(e.getText()),this.setUser(new DrawioUser(e.id,null,e.displayName)), -a()))}),d)};OneDriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<a&&(this.tokenRefreshInterval=1E3*a,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0)}),900*a))}; -OneDriveClient.prototype.authenticate=function(a,d,c){if(null==window.onOneDriveCallback){var b=mxUtils.bind(this,function(){var g=!0,e=JSON.parse(this.getPersistentToken(!0));null!=e?(new mxXmlRequest(this.redirectUri+"?refresh_token="+e.refresh_token+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname),null,"GET")).send(mxUtils.bind(this,function(e){200<=e.getStatus()&&299>=e.getStatus()?(e=JSON.parse(e.getText()),this.token=e.access_token,e.access_token=e.access_token, -e.refresh_token=e.refresh_token,e.expiresOn=Date.now()+1E3*e.expires_in,this.tokenExpiresOn=e.expiresOn,this.setPersistentToken(JSON.stringify(e),!e.remember),this.resetTokenRefresh(e.expires_in),a()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=e.getStatus()||c?d({message:mxResources.get("accessDenied"),retry:b}):b())}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(c,e){var k="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+ +OneDriveClient.prototype.isValidFilename=function(a){if(null==a||""===a)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(a))return!1;return!0};OneDriveClient.prototype.get=function(a,c,d){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(c,d);return a}; +OneDriveClient.prototype.updateUser=function(a,c,d){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(e){window.clearTimeout(g);b&&(200>e.getStatus()||300<=e.getStatus()?d?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):(e=JSON.parse(e.getText()),this.setUser(new DrawioUser(e.id,null,e.displayName)), +a()))}),c)};OneDriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<a&&(this.tokenRefreshInterval=1E3*a,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0)}),900*a))}; +OneDriveClient.prototype.authenticate=function(a,c,d){if(null==window.onOneDriveCallback){var b=mxUtils.bind(this,function(){var g=!0,e=JSON.parse(this.getPersistentToken(!0));null!=e?(new mxXmlRequest(this.redirectUri+"?refresh_token="+e.refresh_token+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname),null,"GET")).send(mxUtils.bind(this,function(e){200<=e.getStatus()&&299>=e.getStatus()?(e=JSON.parse(e.getText()),this.token=e.access_token,e.access_token=e.access_token, +e.refresh_token=e.refresh_token,e.expiresOn=Date.now()+1E3*e.expires_in,this.tokenExpiresOn=e.expiresOn,this.setPersistentToken(JSON.stringify(e),!e.remember),this.resetTokenRefresh(e.expires_in),a()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=e.getStatus()||d?c({message:mxResources.get("accessDenied"),retry:b}):b())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(d,e){var k="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+ "&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes)+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname),k=window.open(k,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=k&&(window.onOneDriveCallback=mxUtils.bind(this,function(k, -f){if(g){window.onOneDriveCallback=null;g=!1;try{null==k?d({message:mxResources.get("accessDenied"),retry:b}):(null!=e&&e(),this.setUser(null),this.token=k.access_token,k.expiresOn=Date.now()+1E3*k.expires_in,this.tokenExpiresOn=k.expiresOn,k.remember=c,this.setPersistentToken(JSON.stringify(k),!c),this.resetTokenRefresh(k.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){a()}),d))}catch(l){d(l)}finally{null!=f&&f.close()}}else null!=f&&f.close()}),k.focus())}),mxUtils.bind(this, -function(){g&&(window.onOneDriveCallback=null,g=!1,d({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else d({code:App.ERROR_BUSY})}; -OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,d){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(c){try{if(200<=c.getStatus()&&299>=c.getStatus()){var b=JSON.parse(c.getText());0<b.webUrl.indexOf(".sharepoint.com")?this.endpointHint=b.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var g=JSON.parse(this.getPersistentToken(!0));null!=g&&(g.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(g),!g.remember)); -a();return}}catch(e){}d({message:mxResources.get("unknownError")+" (Code: "+c.getStatus()+")"})}),d)}; -OneDriveClient.prototype.executeRequest=function(a,d,c){var b=mxUtils.bind(this,function(g){var e=!0,k=window.setTimeout(mxUtils.bind(this,function(){e=!1;c({code:App.ERROR_TIMEOUT,retry:b})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(k);e&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),d(a)):g||401!==a.getStatus()&&400!==a.getStatus()?c(this.parseRequestText(a)):this.authenticate(function(){b(!0)}, -c,g))}),c)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){b(!0)},c):b(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var d=a.split("/");return 1<d.length?{driveId:d[0],id:d[1]}:{id:a}}; -OneDriveClient.prototype.getItemURL=function(a,d){var c=a.split("/");return 1<c.length?(d?"":this.baseUrl)+"/drives/"+c[0]+"/items/"+c[1]:(d?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,d,c){this.getFile(a,d,c,!1,!0)}; -OneDriveClient.prototype.getFile=function(a,d,c,b,g){g=null!=g?g:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var b=JSON.parse(a.getText()),e=/\.png$/i.test(b.name);if(/\.v(dx|sdx?)$/i.test(b.name)||/\.gliffy$/i.test(b.name)||/\.pdf$/i.test(b.name)||!this.ui.useCanvasForExport&&e)this.ui.convertFile(b["@microsoft.graph.downloadUrl"],b.name,null!=b.file?b.file.mimeType:null,this.extension,d,c);else{var m=!0,t=window.setTimeout(mxUtils.bind(this, -function(){m=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(b["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(t),m){var f=e?a.lastIndexOf(","):-1,k=null;if(0<f){var n=this.ui.extractGraphModelFromPng(a.substring(f+1));null!=n&&0<n.length?a=n:k=new LocalFile(this.ui,a,b.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var v=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(v):Base64.decode(v)}Graph.fileSupport&&(new XMLHttpRequest).upload&& -this.ui.isRemoteFileFormat(a,b["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?d(new LocalFile(this.ui,a.responseText,b.name+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(z){if(null!=c)c(z);else throw z;}}),b.name):null!=k?d(k):g?d(new OneDriveLibrary(this.ui,a,b)):d(new OneDriveFile(this.ui,a,b))}}catch(q){if(null!=c)c(q);else throw q; -}}),mxUtils.bind(this,function(a){window.clearTimeout(t);m&&c(this.parseRequestText(a))}),e||null!=b.file&&null!=b.file.mimeType&&("image/"==b.file.mimeType.substring(0,6)||"application/pdf"==b.file.mimeType))}}else c(this.parseRequestText(a))}),c)}; -OneDriveClient.prototype.renameFile=function(a,d,c,b){null!=a&&null!=d&&(this.isValidFilename(d)?this.checkExists(a.getParentId(),d,!1,mxUtils.bind(this,function(g){g?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:d}),"PATCH","application/json",c,b):b()})):b({message:this.invalidFilenameRegExs[0].test(d)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))}; -OneDriveClient.prototype.moveFile=function(a,d,c,b){d=this.getItemRef(d);var g=this.getItemRef(a);d.driveId!=g.driveId?b({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:d}),"PATCH","application/json",c,b)};OneDriveClient.prototype.insertLibrary=function(a,d,c,b,g){this.insertFile(a,d,c,b,!0,g)}; -OneDriveClient.prototype.insertFile=function(a,d,c,b,g,e){this.isValidFilename(a)?(g=null!=g?g:!1,this.checkExists(e,a,!0,mxUtils.bind(this,function(k){k?(k="/me/drive/root",null!=e&&(k=this.getItemURL(e,!0)),k=this.baseUrl+k+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(k,d,"PUT",null,mxUtils.bind(this,function(a){g?c(new OneDriveLibrary(this.ui,d,a)):c(new OneDriveFile(this.ui,d,a))}),b)):b()}))):b({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"): +f){if(g){window.onOneDriveCallback=null;g=!1;try{null==k?c({message:mxResources.get("accessDenied"),retry:b}):(null!=e&&e(),this.setUser(null),this.token=k.access_token,k.expiresOn=Date.now()+1E3*k.expires_in,this.tokenExpiresOn=k.expiresOn,k.remember=d,this.setPersistentToken(JSON.stringify(k),!d),this.resetTokenRefresh(k.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){a()}),c))}catch(l){c(l)}finally{null!=f&&f.close()}}else null!=f&&f.close()}),k.focus())}),mxUtils.bind(this, +function(){g&&(window.onOneDriveCallback=null,g=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})}; +OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(d){try{if(200<=d.getStatus()&&299>=d.getStatus()){var b=JSON.parse(d.getText());0<b.webUrl.indexOf(".sharepoint.com")?this.endpointHint=b.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var g=JSON.parse(this.getPersistentToken(!0));null!=g&&(g.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(g),!g.remember)); +a();return}}catch(e){}c({message:mxResources.get("unknownError")+" (Code: "+d.getStatus()+")"})}),c)}; +OneDriveClient.prototype.executeRequest=function(a,c,d){var b=mxUtils.bind(this,function(g){var e=!0,k=window.setTimeout(mxUtils.bind(this,function(){e=!1;d({code:App.ERROR_TIMEOUT,retry:b})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(k);e&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(a)):g||401!==a.getStatus()&&400!==a.getStatus()?d(this.parseRequestText(a)):this.authenticate(function(){b(!0)}, +d,g))}),d)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){b(!0)},d):b(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var c=a.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:a}}; +OneDriveClient.prototype.getItemURL=function(a,c){var d=a.split("/");return 1<d.length?(c?"":this.baseUrl)+"/drives/"+d[0]+"/items/"+d[1]:(c?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,c,d){this.getFile(a,c,d,!1,!0)}; +OneDriveClient.prototype.getFile=function(a,c,d,b,g){g=null!=g?g:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var b=JSON.parse(a.getText()),e=/\.png$/i.test(b.name);if(/\.v(dx|sdx?)$/i.test(b.name)||/\.gliffy$/i.test(b.name)||/\.pdf$/i.test(b.name)||!this.ui.useCanvasForExport&&e)this.ui.convertFile(b["@microsoft.graph.downloadUrl"],b.name,null!=b.file?b.file.mimeType:null,this.extension,c,d);else{var m=!0,t=window.setTimeout(mxUtils.bind(this, +function(){m=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(b["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(t),m){var f=e?a.lastIndexOf(","):-1,k=null;if(0<f){var n=this.ui.extractGraphModelFromPng(a.substring(f+1));null!=n&&0<n.length?a=n:k=new LocalFile(this.ui,a,b.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var v=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(v):Base64.decode(v)}Graph.fileSupport&&(new XMLHttpRequest).upload&& +this.ui.isRemoteFileFormat(a,b["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?c(new LocalFile(this.ui,a.responseText,b.name+this.extension,!0)):null!=d&&d({message:mxResources.get("errorLoadingFile")}))}catch(z){if(null!=d)d(z);else throw z;}}),b.name):null!=k?c(k):g?c(new OneDriveLibrary(this.ui,a,b)):c(new OneDriveFile(this.ui,a,b))}}catch(q){if(null!=d)d(q);else throw q; +}}),mxUtils.bind(this,function(a){window.clearTimeout(t);m&&d(this.parseRequestText(a))}),e||null!=b.file&&null!=b.file.mimeType&&("image/"==b.file.mimeType.substring(0,6)||"application/pdf"==b.file.mimeType))}}else d(this.parseRequestText(a))}),d)}; +OneDriveClient.prototype.renameFile=function(a,c,d,b){null!=a&&null!=c&&(this.isValidFilename(c)?this.checkExists(a.getParentId(),c,!1,mxUtils.bind(this,function(g){g?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:c}),"PATCH","application/json",d,b):b()})):b({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))}; +OneDriveClient.prototype.moveFile=function(a,c,d,b){c=this.getItemRef(c);var g=this.getItemRef(a);c.driveId!=g.driveId?b({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:c}),"PATCH","application/json",d,b)};OneDriveClient.prototype.insertLibrary=function(a,c,d,b,g){this.insertFile(a,c,d,b,!0,g)}; +OneDriveClient.prototype.insertFile=function(a,c,d,b,g,e){this.isValidFilename(a)?(g=null!=g?g:!1,this.checkExists(e,a,!0,mxUtils.bind(this,function(k){k?(k="/me/drive/root",null!=e&&(k=this.getItemURL(e,!0)),k=this.baseUrl+k+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(k,c,"PUT",null,mxUtils.bind(this,function(a){g?d(new OneDriveLibrary(this.ui,c,a)):d(new OneDriveFile(this.ui,c,a))}),b)):b()}))):b({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"): mxResources.get("oneDriveInvalidDeviceName")})}; -OneDriveClient.prototype.checkExists=function(a,d,c,b){var g="/me/drive/root";null!=a&&(g=this.getItemURL(a,!0));this.executeRequest(this.baseUrl+g+"/children/"+encodeURIComponent(d),mxUtils.bind(this,function(a){404==a.getStatus()?b(!0):c?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[d]),function(){b(!0)},function(){b(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)}))}),function(a){b(!1)}, -!0)};OneDriveClient.prototype.saveFile=function(a,d,c,b){try{var g=a.getData(),e=mxUtils.bind(this,function(e){var k=this.getItemURL(a.getId());this.writeFile(k+"/content/",e,"PUT",null,mxUtils.bind(this,function(a){d(a,g)}),c,b)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,"image/png"))}),c,this.ui.getCurrentFile()!=a?g:null):e(g)}catch(k){c(k)}}; -OneDriveClient.prototype.writeFile=function(a,d,c,b,g,e,k){try{if(null!=a&&null!=d)if(4E6<=d.length)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(d.length)+" / 4 MB)"});else{var n=mxUtils.bind(this,function(m){try{var t=!0,f=null;try{f=window.setTimeout(mxUtils.bind(this,function(){t=!1;e({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout)}catch(p){}var l=new mxXmlRequest(a,d,c);l.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Content-Type",b||" "); +OneDriveClient.prototype.checkExists=function(a,c,d,b){var g="/me/drive/root";null!=a&&(g=this.getItemURL(a,!0));this.executeRequest(this.baseUrl+g+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(a){404==a.getStatus()?b(!0):d?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){b(!0)},function(){b(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)}))}),function(a){b(!1)}, +!0)};OneDriveClient.prototype.saveFile=function(a,c,d,b){try{var g=a.getData(),e=mxUtils.bind(this,function(e){var k=this.getItemURL(a.getId());this.writeFile(k+"/content/",e,"PUT",null,mxUtils.bind(this,function(a){c(a,g)}),d,b)});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?g:null):e(g)}catch(k){d(k)}}; +OneDriveClient.prototype.writeFile=function(a,c,d,b,g,e,k){try{if(null!=a&&null!=c)if(4E6<=c.length)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 4 MB)"});else{var n=mxUtils.bind(this,function(m){try{var t=!0,f=null;try{f=window.setTimeout(mxUtils.bind(this,function(){t=!1;e({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout)}catch(p){}var l=new mxXmlRequest(a,c,d);l.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Content-Type",b||" "); a.setRequestHeader("Authorization","Bearer "+this.token);null!=k&&a.setRequestHeader("If-Match",k)});l.send(mxUtils.bind(this,function(a){window.clearTimeout(f);t&&(200<=a.getStatus()&&299>=a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),g(JSON.parse(a.getText()))):m||401!==a.getStatus()?e(this.parseRequestText(a),a):this.authenticate(function(){n(!0)},e,m))}),mxUtils.bind(this,function(a){window.clearTimeout(f);t&&e(this.parseRequestText(a))}))}catch(p){e(p)}});null== -this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){n(!0)},e):n(!1)}else e({message:mxResources.get("unknownError")})}catch(m){e(m)}};OneDriveClient.prototype.parseRequestText=function(a){var d={message:mxResources.get("unknownError")};try{d=JSON.parse(a.getText())}catch(c){}return d};OneDriveClient.prototype.pickLibrary=function(a){this.pickFile(function(d){a(d)})}; -OneDriveClient.prototype.pickFolder=function(a,d){var c=mxUtils.bind(this,function(b){var c=mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(b){a(b);mxClient.IS_IE11&&(this.token=b.accessToken)}),cancel:mxUtils.bind(this,function(){}), -error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})});b?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){a({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})}),c,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){c(!1)}),this.emptyFn):c(d)}; -OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("W"+encodeURIComponent(a))});var d=mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(c){null!=c&&null!=c.value&&0<c.value.length&& -(mxClient.IS_IE11&&(this.token=c.accessToken),a(OneDriveFile.prototype.getIdOf(c.value[0]),c))}),cancel:mxUtils.bind(this,function(){}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){d();this.ui.hideDialog()}))).container, -300,140,!0,!0)}),this.emptyFn):d()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var a=localStorage.getItem("odpickerv7cache");null!=a&&'{"odsdkLoginHint":{'==a.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}this.clearPersistentToken();this.setUser(null);this.token=null};GitHubFile=function(a,d,c){DrawioFile.call(this,a,d);this.meta=c;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.getId=function(){return encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+this.getId())}; -GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(d){a(200<=d.getStatus()&&299>=d.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.isConflict=function(a){return null!=a&&409==a.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name}; -GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(a,d){this.peer.getFile(this.getId(),a,d)};GitHubFile.prototype.isCompressedStorage=function(){return!1};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,d){a.sha=d}; -GitHubFile.prototype.save=function(a,d,c,b,g,e){this.doSave(this.getTitle(),d,c,b,g,e)};GitHubFile.prototype.saveAs=function(a,d,c){this.doSave(a,d,c)};GitHubFile.prototype.doSave=function(a,d,c,b,g,e){var k=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=k;this.saveFile(a,!1,d,c,b,g,e)}),c,b,g])}; -GitHubFile.prototype.saveFile=function(a,d,c,b,g,e,k){if(this.isEditable())if(this.savingFile)null!=b&&b({code:App.ERROR_BUSY});else{var n=mxUtils.bind(this,function(d){if(this.getTitle()==a){var g=null,f=null;try{g=this.isModified;f=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}}),m=this.getCurrentEtag(),n=this.data;k();this.peer.saveFile(this,mxUtils.bind(this,function(a){this.savingFile= -!1;this.isModified=g;this.setDescriptorEtag(this.meta,a);this.fileSaved(n,m,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c()}),b)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(f||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=b&&b({commitMessage:d});else if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){k();c()}}b(a)}}),e,d)}catch(v){if(this.savingFile=!1,null!=g&&(this.isModified=g),null!=f&&this.setModified(f|| -this.isModified()),null!=b)b(v);else throw v;}}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(e){this.peer.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=c&&c();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,e,d)}))});null!=k?n(k):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(a){n(a)}), -b)}else null!=c&&c()};GitHubLibrary=function(a,d,c){GitHubFile.call(this,a,d,c)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(a,d,c){this.saveFile(a,!1,d,c)};GitHubLibrary.prototype.open=function(){};GitHubClient=function(a,d){DrawioClient.call(this,a,d||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"23bc97120b9035515661":"89c9e4624ca416554489";GitHubClient.prototype.scope="repo";GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl="https://api.github.com";GitHubClient.prototype.maxFileSize=1E6;GitHubClient.prototype.authToken="token"; -GitHubClient.prototype.updateUser=function(a,d,c){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),e=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),k=this.authToken+" "+this.token;e.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",k)};e.send(mxUtils.bind(this,function(){window.clearTimeout(g);b&&(401===e.getStatus()?c?d({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this, -function(){this.updateUser(a,d,!0)}),d)):200>e.getStatus()||300<=e.getStatus()?d({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(e.getText()))),a()))}),d)};GitHubClient.prototype.createUser=function(a){return new DrawioUser(a.id,a.email,a.name)}; -GitHubClient.prototype.authenticate=function(a,d){if(null==window.onGitHubCallback){var c=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,n){if(b)if(window.onGitHubCallback=null,b=!1,null==k)d({message:mxResources.get("accessDenied"),retry:c});else{var m=mxUtils.bind(this,function(){var b= -!0,c=window.setTimeout(mxUtils.bind(this,function(){b=!1;d({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(f){window.clearTimeout(c);if(b)try{if(200>f.getStatus()||300<=f.getStatus())d({message:mxResources.get("cannotLogin")});else{null!=e&&e();var k=f.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);g&&this.setPersistentToken(this.token);a()}}catch(u){d(u)}finally{null!=n&& -n.close()}}))});m()}else null!=n&&n.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:c})}),mxUtils.bind(this,function(){b&&(window.onGitHubCallback=null,b=!1,d({message:mxResources.get("accessDenied"),retry:c}))}))});c()}else d({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(a,d){try{var c=JSON.parse(a.getText());null!=c&&null!=c.message&&(d=c.message)}catch(b){}return d}; -GitHubClient.prototype.executeRequest=function(a,d,c,b){var g=mxUtils.bind(this,function(k){var n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;c({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),t=this.authToken+" "+this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",t)};a.send(mxUtils.bind(this,function(){window.clearTimeout(m);if(n)if(200<=a.getStatus()&&299>=a.getStatus()||b&&404==a.getStatus())d(a);else if(401===a.getStatus())k?c({code:a.getStatus(), -message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},c)})}):this.authenticate(function(){g(!0)},c);else if(403===a.getStatus()){var f=!1;try{var l=JSON.parse(a.getText());null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code)}catch(p){}c({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?c({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()? -c({code:a.getStatus(),status:409}):c({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),c)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},c,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},c):e(!1)};GitHubClient.prototype.getLibrary=function(a,d,c){this.getFile(a,d,c,!0)}; -GitHubClient.prototype.getSha=function(a,d,c,b,g,e){var k="&t="+(new Date).getTime();a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+d+"/contents/"+c+"?ref="+b+k,null,"HEAD");this.executeRequest(a,mxUtils.bind(this,function(a){try{g(a.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(m){e(m)}}),e)}; -GitHubClient.prototype.getFile=function(a,d,c,b,g){b=null!=b?b:!1;var e=a.split("/"),k=e[0],n=e[1],m=e[2];a=e.slice(3,e.length).join("/");e=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&e))if(null!=this.token){g=this.baseUrl+"/repos/"+k+"/"+n+"/contents/"+a+"?ref="+m;var t={Authorization:"token "+this.token},e=a.split("/");this.ui.convertFile(g,0<e.length?e[e.length-1]:a,null,this.extension,d,c,null,t)}else c({message:mxResources.get("accessDenied")}); -else e="&t="+(new Date).getTime(),a=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+n+"/contents/"+a+"?ref="+m+e,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{d(this.createGitHubFile(k,n,m,JSON.parse(a.getText()),b))}catch(l){c(l)}}),c)}; -GitHubClient.prototype.createGitHubFile=function(a,d,c,b,g){a={org:a,repo:d,ref:c,name:b.name,path:b.path,sha:b.sha,html_url:b.html_url,download_url:b.download_url};d=b.content;"base64"===b.encoding&&(/\.jpe?g$/i.test(b.name)?d="data:image/jpeg;base64,"+d:/\.gif$/i.test(b.name)?d="data:image/gif;base64,"+d:/\.png$/i.test(b.name)?(b=this.ui.extractGraphModelFromPng(d),d=null!=b&&0<b.length?b:"data:image/png;base64,"+d):d=Base64.decode(d));return g?new GitHubLibrary(this.ui,d,a):new GitHubFile(this.ui, -d,a)};GitHubClient.prototype.insertLibrary=function(a,d,c,b,g){this.insertFile(a,d,c,b,!0,g,!1)}; -GitHubClient.prototype.insertFile=function(a,d,c,b,g,e,k){g=null!=g?g:!1;e=e.split("/");var n=e[0],m=e[1],t=e[2],f=e.slice(3,e.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(n+"/"+m+"/"+t+"/"+f,!0,mxUtils.bind(this,function(e,p){e?g?(k||(d=Base64.encode(d)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(n,m,t,f,a,d,p,mxUtils.bind(this,function(a){try{var d=JSON.parse(a.getText());c(this.createGitHubFile(n,m,t,d.content,g))}catch(z){b(z)}}),b)}),b)):c(new GitHubFile(this.ui, -d,{org:n,repo:m,ref:t,name:a,path:f,sha:p,isNew:!0})):b()}))};GitHubClient.prototype.showCommitDialog=function(a,d,c,b){var g=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(d?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){g();c(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){b()}),null,280);this.ui.showDialog(a.container,400,80,!0,!1);a.init()}; -GitHubClient.prototype.writeFile=function(a,d,c,b,g,e,k,n,m){e.length>=this.maxFileSize?m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"}):(c={path:b,branch:decodeURIComponent(c),message:g,content:e},null!=k&&(c.sha=k),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+d+"/contents/"+b,JSON.stringify(c),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){n(a)}),mxUtils.bind(this,function(a){404==a.code&&(a.helpLink="https://github.com/settings/connections/applications/"+ +this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){n(!0)},e):n(!1)}else e({message:mxResources.get("unknownError")})}catch(m){e(m)}};OneDriveClient.prototype.parseRequestText=function(a){var c={message:mxResources.get("unknownError")};try{c=JSON.parse(a.getText())}catch(d){}return c};OneDriveClient.prototype.pickLibrary=function(a){this.pickFile(function(c){a(c)})}; +OneDriveClient.prototype.pickFolder=function(a,c){var d=mxUtils.bind(this,function(b){var c=mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(b){a(b);mxClient.IS_IE11&&(this.token=b.accessToken)}),cancel:mxUtils.bind(this,function(){}), +error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})});b?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){a({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})}),c,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){d(!1)}),this.emptyFn):d(c)}; +OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("W"+encodeURIComponent(a))});var c=mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(c){null!=c&&null!=c.value&&0<c.value.length&& +(mxClient.IS_IE11&&(this.token=c.accessToken),a(OneDriveFile.prototype.getIdOf(c.value[0]),c))}),cancel:mxUtils.bind(this,function(){}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){c();this.ui.hideDialog()}))).container, +300,140,!0,!0)}),this.emptyFn):c()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var a=localStorage.getItem("odpickerv7cache");null!=a&&'{"odsdkLoginHint":{'==a.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}this.clearPersistentToken();this.setUser(null);this.token=null};GitHubFile=function(a,c,d){DrawioFile.call(this,a,c);this.meta=d;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.getId=function(){return encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+this.getId())}; +GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(c){a(200<=c.getStatus()&&299>=c.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.isConflict=function(a){return null!=a&&409==a.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name}; +GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(a,c){this.peer.getFile(this.getId(),a,c)};GitHubFile.prototype.isCompressedStorage=function(){return!1};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,c){a.sha=c}; +GitHubFile.prototype.save=function(a,c,d,b,g,e){this.doSave(this.getTitle(),c,d,b,g,e)};GitHubFile.prototype.saveAs=function(a,c,d){this.doSave(a,c,d)};GitHubFile.prototype.doSave=function(a,c,d,b,g,e){var k=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=k;this.saveFile(a,!1,c,d,b,g,e)}),d,b,g])}; +GitHubFile.prototype.saveFile=function(a,c,d,b,g,e,k){if(this.isEditable())if(this.savingFile)null!=b&&b({code:App.ERROR_BUSY});else{var n=mxUtils.bind(this,function(c){if(this.getTitle()==a){var g=null,f=null;try{g=this.isModified;f=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}}),m=this.getCurrentEtag(),n=this.data;k();this.peer.saveFile(this,mxUtils.bind(this,function(a){this.savingFile= +!1;this.isModified=g;this.setDescriptorEtag(this.meta,a);this.fileSaved(n,m,mxUtils.bind(this,function(){this.contentChanged();null!=d&&d()}),b)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(f||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=b&&b({commitMessage:c});else if(null!=b){if(null!=a&&null!=a.retry){var d=a.retry;a.retry=function(){k();d()}}b(a)}}),e,c)}catch(v){if(this.savingFile=!1,null!=g&&(this.isModified=g),null!=f&&this.setModified(f|| +this.isModified()),null!=b)b(v);else throw v;}}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(e){this.peer.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,e,c)}))});null!=k?n(k):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(a){n(a)}), +b)}else null!=d&&d()};GitHubLibrary=function(a,c,d){GitHubFile.call(this,a,c,d)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(a,c,d){this.saveFile(a,!1,c,d)};GitHubLibrary.prototype.open=function(){};GitHubClient=function(a,c){DrawioClient.call(this,a,c||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"23bc97120b9035515661":"89c9e4624ca416554489";GitHubClient.prototype.scope="repo";GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl="https://api.github.com";GitHubClient.prototype.maxFileSize=1E6;GitHubClient.prototype.authToken="token"; +GitHubClient.prototype.updateUser=function(a,c,d){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),e=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),k=this.authToken+" "+this.token;e.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",k)};e.send(mxUtils.bind(this,function(){window.clearTimeout(g);b&&(401===e.getStatus()?d?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this, +function(){this.updateUser(a,c,!0)}),c)):200>e.getStatus()||300<=e.getStatus()?c({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(e.getText()))),a()))}),c)};GitHubClient.prototype.createUser=function(a){return new DrawioUser(a.id,a.email,a.name)}; +GitHubClient.prototype.authenticate=function(a,c){if(null==window.onGitHubCallback){var d=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,n){if(b)if(window.onGitHubCallback=null,b=!1,null==k)c({message:mxResources.get("accessDenied"),retry:d});else{var m=mxUtils.bind(this,function(){var b= +!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(f){window.clearTimeout(d);if(b)try{if(200>f.getStatus()||300<=f.getStatus())c({message:mxResources.get("cannotLogin")});else{null!=e&&e();var k=f.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);g&&this.setPersistentToken(this.token);a()}}catch(u){c(u)}finally{null!=n&& +n.close()}}))});m()}else null!=n&&n.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){b&&(window.onGitHubCallback=null,b=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(a,c){try{var d=JSON.parse(a.getText());null!=d&&null!=d.message&&(c=d.message)}catch(b){}return c}; +GitHubClient.prototype.executeRequest=function(a,c,d,b){var g=mxUtils.bind(this,function(k){var n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),t=this.authToken+" "+this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",t)};a.send(mxUtils.bind(this,function(){window.clearTimeout(m);if(n)if(200<=a.getStatus()&&299>=a.getStatus()||b&&404==a.getStatus())c(a);else if(401===a.getStatus())k?d({code:a.getStatus(), +message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){g(!0)},d);else if(403===a.getStatus()){var f=!1;try{var l=JSON.parse(a.getText());null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code)}catch(p){}d({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?d({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()? +d({code:a.getStatus(),status:409}):d({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),d)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},d,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},d):e(!1)};GitHubClient.prototype.getLibrary=function(a,c,d){this.getFile(a,c,d,!0)}; +GitHubClient.prototype.getSha=function(a,c,d,b,g,e){var k="&t="+(new Date).getTime();a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+d+"?ref="+b+k,null,"HEAD");this.executeRequest(a,mxUtils.bind(this,function(a){try{g(a.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(m){e(m)}}),e)}; +GitHubClient.prototype.getFile=function(a,c,d,b,g){b=null!=b?b:!1;var e=a.split("/"),k=e[0],n=e[1],m=e[2];a=e.slice(3,e.length).join("/");e=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&e))if(null!=this.token){g=this.baseUrl+"/repos/"+k+"/"+n+"/contents/"+a+"?ref="+m;var t={Authorization:"token "+this.token},e=a.split("/");this.ui.convertFile(g,0<e.length?e[e.length-1]:a,null,this.extension,c,d,null,t)}else d({message:mxResources.get("accessDenied")}); +else e="&t="+(new Date).getTime(),a=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+n+"/contents/"+a+"?ref="+m+e,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{c(this.createGitHubFile(k,n,m,JSON.parse(a.getText()),b))}catch(l){d(l)}}),d)}; +GitHubClient.prototype.createGitHubFile=function(a,c,d,b,g){a={org:a,repo:c,ref:d,name:b.name,path:b.path,sha:b.sha,html_url:b.html_url,download_url:b.download_url};c=b.content;"base64"===b.encoding&&(/\.jpe?g$/i.test(b.name)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(b.name)?c="data:image/gif;base64,"+c:/\.png$/i.test(b.name)?(b=this.ui.extractGraphModelFromPng(c),c=null!=b&&0<b.length?b:"data:image/png;base64,"+c):c=Base64.decode(c));return g?new GitHubLibrary(this.ui,c,a):new GitHubFile(this.ui, +c,a)};GitHubClient.prototype.insertLibrary=function(a,c,d,b,g){this.insertFile(a,c,d,b,!0,g,!1)}; +GitHubClient.prototype.insertFile=function(a,c,d,b,g,e,k){g=null!=g?g:!1;e=e.split("/");var n=e[0],m=e[1],t=e[2],f=e.slice(3,e.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(n+"/"+m+"/"+t+"/"+f,!0,mxUtils.bind(this,function(e,p){e?g?(k||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(n,m,t,f,a,c,p,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());d(this.createGitHubFile(n,m,t,c.content,g))}catch(z){b(z)}}),b)}),b)):d(new GitHubFile(this.ui, +c,{org:n,repo:m,ref:t,name:a,path:f,sha:p,isNew:!0})):b()}))};GitHubClient.prototype.showCommitDialog=function(a,c,d,b){var g=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(c?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){g();d(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){b()}),null,280);this.ui.showDialog(a.container,400,80,!0,!1);a.init()}; +GitHubClient.prototype.writeFile=function(a,c,d,b,g,e,k,n,m){e.length>=this.maxFileSize?m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"}):(d={path:b,branch:decodeURIComponent(d),message:g,content:e},null!=k&&(d.sha=k),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+b,JSON.stringify(d),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){n(a)}),mxUtils.bind(this,function(a){404==a.code&&(a.helpLink="https://github.com/settings/connections/applications/"+ this.clientId,a.code=null);m(a)})))}; -GitHubClient.prototype.checkExists=function(a,d,c){var b=a.split("/"),g=b[0],e=b[1],k=b[2];a=b.slice(3,b.length).join("/");this.getSha(g,e,a,k,mxUtils.bind(this,function(b){if(d){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();c(!0,b)},function(){e();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(a){c(!0)}),null,!0)}; -GitHubClient.prototype.saveFile=function(a,d,c,b,g){var e=a.meta.org,k=a.meta.repo,n=a.meta.ref,m=a.meta.path,t=mxUtils.bind(this,function(b,f){this.writeFile(e,k,n,m,g,f,b,mxUtils.bind(this,function(b){delete a.meta.isNew;d(JSON.parse(b.getText()).content.sha)}),mxUtils.bind(this,function(a){c(a)}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(m)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){t(a.meta.sha,b)}),c,this.ui.getCurrentFile()!=a?a.getData():null): -t(a.meta.sha,Base64.encode(a.getData()))});b?this.getSha(e,k,m,n,mxUtils.bind(this,function(b){a.meta.sha=b;f()}),c):f()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)}; -GitHubClient.prototype.showGitHubDialog=function(a,d){var c=null,b=null,g=null,e=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(n);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.border="1px solid lightgray";m.style.boxSizing= -"border-box";m.style.padding="4px";m.style.overflow="auto";m.style.lineHeight="1.2em";m.style.height="274px";k.appendChild(m);var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.boxSizing="border-box";t.style.overflow="hidden";t.style.padding="4px";t.style.width="100%";var f=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){d(c+"/"+b+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(f.container,420,360,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var l= -mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=t.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),p=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(l(c+"/"+b,mxUtils.bind(this,function(){e=null;C()})));a||(mxUtils.write(d," / "),d.appendChild(l(decodeURIComponent(g),mxUtils.bind(this, -function(){e=null;y()}))));if(null!=e&&0<e.length){var f=e.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(l(f[a],mxUtils.bind(this,function(){e=f.slice(0,a+1).join("/");z()})))})(a)}m.appendChild(d)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(e=g=b=c=null,C()):this.ui.hideDialog()}))}),v=null,q=null,z=mxUtils.bind(this,function(k){null==k&&(m.innerHTML="",k=1);var n=new mxXmlRequest(this.baseUrl+ -"/repos/"+c+"/"+b+"/contents/"+e+"?ref="+encodeURIComponent(g)+"&per_page=100&page="+k,null,"GET");this.ui.spinner.spin(m,mxResources.get("loading"));f.okButton.removeAttribute("disabled");null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var A=mxUtils.bind(this,function(){z(k+1)});mxEvent.addListener(v, +GitHubClient.prototype.checkExists=function(a,c,d){var b=a.split("/"),g=b[0],e=b[1],k=b[2];a=b.slice(3,b.length).join("/");this.getSha(g,e,a,k,mxUtils.bind(this,function(b){if(c){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();d(!0,b)},function(){e();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(a){d(!0)}),null,!0)}; +GitHubClient.prototype.saveFile=function(a,c,d,b,g){var e=a.meta.org,k=a.meta.repo,n=a.meta.ref,m=a.meta.path,t=mxUtils.bind(this,function(b,f){this.writeFile(e,k,n,m,g,f,b,mxUtils.bind(this,function(b){delete a.meta.isNew;c(JSON.parse(b.getText()).content.sha)}),mxUtils.bind(this,function(a){d(a)}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(m)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){t(a.meta.sha,b)}),d,this.ui.getCurrentFile()!=a?a.getData():null): +t(a.meta.sha,Base64.encode(a.getData()))});b?this.getSha(e,k,m,n,mxUtils.bind(this,function(b){a.meta.sha=b;f()}),d):f()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)}; +GitHubClient.prototype.showGitHubDialog=function(a,c){var d=null,b=null,g=null,e=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(n);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.border="1px solid lightgray";m.style.boxSizing= +"border-box";m.style.padding="4px";m.style.overflow="auto";m.style.lineHeight="1.2em";m.style.height="274px";k.appendChild(m);var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.boxSizing="border-box";t.style.overflow="hidden";t.style.padding="4px";t.style.width="100%";var f=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){c(d+"/"+b+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(f.container,420,360,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var l= +mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=t.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),p=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(l(d+"/"+b,mxUtils.bind(this,function(){e=null;C()})));a||(mxUtils.write(c," / "),c.appendChild(l(decodeURIComponent(g),mxUtils.bind(this, +function(){e=null;y()}))));if(null!=e&&0<e.length){var f=e.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(l(f[a],mxUtils.bind(this,function(){e=f.slice(0,a+1).join("/");z()})))})(a)}m.appendChild(c)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(e=g=b=d=null,C()):this.ui.hideDialog()}))}),v=null,q=null,z=mxUtils.bind(this,function(k){null==k&&(m.innerHTML="",k=1);var n=new mxXmlRequest(this.baseUrl+ +"/repos/"+d+"/"+b+"/contents/"+e+"?ref="+encodeURIComponent(g)+"&per_page=100&page="+k,null,"GET");this.ui.spinner.spin(m,mxResources.get("loading"));f.okButton.removeAttribute("disabled");null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var A=mxUtils.bind(this,function(){z(k+1)});mxEvent.addListener(v, "click",A);this.executeRequest(n,mxUtils.bind(this,function(f){this.ui.spinner.stop();1==k&&(p(),m.appendChild(l("../ [Up]",mxUtils.bind(this,function(){if(""==e)e=null,C();else{var a=e.split("/");e=a.slice(0,a.length-1).join("/");z()}}),"4px")));var n=JSON.parse(f.getText());if(null==n||0==n.length)mxUtils.write(m,mxResources.get("noFiles"));else{var x=!0,q=0;f=mxUtils.bind(this,function(f){for(var k=0;k<n.length;k++)mxUtils.bind(this,function(k,n){if(f==("dir"==k.type)){var p=t.cloneNode();p.style.backgroundColor= -x?"#eeeeee":"";x=!x;var A=document.createElement("img");A.src=IMAGE_PATH+"/"+("dir"==k.type?"folder.png":"file.png");A.setAttribute("align","absmiddle");A.style.marginRight="4px";A.style.marginTop="-4px";A.width=20;p.appendChild(A);p.appendChild(l(k.name+("dir"==k.type?"/":""),mxUtils.bind(this,function(){"dir"==k.type?(e=k.path,z()):a&&"file"==k.type&&(this.ui.hideDialog(),d(c+"/"+b+"/"+encodeURIComponent(g)+"/"+k.path))})));m.appendChild(p);q++}})(n[k],k)});f(!0);a&&f(!1)}}),u,!0)}),y=mxUtils.bind(this, -function(a){null==a&&(m.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+b+"/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k= -mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(p(!0),m.appendChild(l("../ [Up]",mxUtils.bind(this,function(){e=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=t.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(l(a.name,mxUtils.bind(this,function(){g= -a.name;e="";z()})));m.appendChild(c)})(b[c],c);100==b.length&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",q))}}),u)}),C=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&mxEvent.removeListener(m,"scroll",q);null!=v&&null!=v.parentNode&& -v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(d,mxUtils.bind(this,function(d){this.ui.spinner.stop();d=JSON.parse(d.getText());if(null==d||0==d.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==a&&(m.appendChild(l(mxResources.get("enterValue")+"...",mxUtils.bind(this, -function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var d=a.split("/");if(1<d.length){a=d[0];var f=d[1];3>d.length?(c=a,b=f,e=g=null,y()):this.ui.spinner.spin(m,mxResources.get("loading"))&&(d=encodeURIComponent(d.slice(2,d.length).join("/")),this.getFile(a+"/"+f+"/"+d,mxUtils.bind(this,function(a){this.ui.spinner.stop();c=a.meta.org;b=a.meta.repo;g=decodeURIComponent(a.meta.ref);e="";z()}),mxUtils.bind(this,function(a){this.ui.spinner.stop(); -this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var f=0;f<d.length;f++)mxUtils.bind(this,function(a,d){var f=t.cloneNode();f.style.backgroundColor=0==d%2?"#eeeeee":"";f.appendChild(l(a.full_name,mxUtils.bind(this,function(){c=a.owner.login;b=a.name;g=a.default_branch; -e="";z()})));m.appendChild(f)})(d[f],f)}100==d.length&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",q))}),u)});C()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,d,c){DrawioFile.call(this,a,d);this.meta=c;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes}; -TrelloFile.prototype.save=function(a,d,c){this.doSave(this.getTitle(),d,c)};TrelloFile.prototype.saveAs=function(a,d,c){this.doSave(a,d,c)};TrelloFile.prototype.doSave=function(a,d,c){var b=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=b;this.saveFile(a,!1,d,c)}; -TrelloFile.prototype.saveFile=function(a,d,c,b){if(this.isEditable())if(this.savingFile)null!=b&&(this.saveNeededCounter++,b({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.savingFileTime=new Date,this.getTitle()==a){var g=this.isModified,e=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return e}});k();this.ui.trello.saveFile(this,mxUtils.bind(this,function(e){this.savingFile=!1;this.isModified=g;this.meta=e;this.contentChanged();null!=c&& -c();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,d,c,b))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(e||this.isModified());if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){k();c()}}b(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=c&&c();this.ui.fileLoaded(e);0<this.saveNeededCounter&& -(this.saveNeededCounter--,this.saveFile(a,d,c,b))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,e)}));else null!=c&&c()};TrelloLibrary=function(a,d,c){TrelloFile.call(this,a,d,c)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,d,c){this.saveFile(a,!1,d,c)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml"; -TrelloClient.prototype.authenticate=function(a,d,c){c&&this.logout();c=mxUtils.bind(this,function(b,c){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:b?"never":"1hour",success:function(){null!=c&&c();a()},error:function(){null!=c&&c();null!=d&&d(mxResources.get("loggedOut"))}})});this.isAuthorized()?c(!0):this.ui.showAuthDialog(this,!0,c)};TrelloClient.prototype.getLibrary=function(a,d,c){this.getFile(a,d,c,!1,!0)}; -TrelloClient.prototype.getFile=function(a,d,c,b,g){g=null!=g?g:!1;var e=mxUtils.bind(this,function(){var b=a.split(this.SEPARATOR),n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;c({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);Trello.cards.get(b[0]+"/attachments/"+b[1],mxUtils.bind(this,function(b){window.clearTimeout(m);if(n){var f=/\.png$/i.test(b.name);/\.v(dx|sdx?)$/i.test(b.name)||/\.gliffy$/i.test(b.name)||!this.ui.useCanvasForExport&&f?this.ui.convertFile(PROXY_URL+"?url="+ -encodeURIComponent(b.url),b.name,b.mimeType,this.extension,d,c):(n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b.url),mxUtils.bind(this,function(c){window.clearTimeout(m);if(n){b.compoundId=a;var e=f?c.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(c.substring(e+1)),null!=e&&0<e.length&&(c=e));g?d(new TrelloLibrary(this.ui,c,b)):d(new TrelloFile(this.ui,c,b))}}),mxUtils.bind(this, -function(a,b){window.clearTimeout(m);n&&(401==b.status?this.authenticate(e,c,!0):c())}),f||null!=b.mimeType&&"image/"==b.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(m);n&&(null!=a&&401==a.status?this.authenticate(e,c,!0):c())}))});this.authenticate(e,c)};TrelloClient.prototype.insertLibrary=function(a,d,c,b,g){this.insertFile(a,d,c,b,!0,g)}; -TrelloClient.prototype.insertFile=function(a,d,c,b,g,e){g=null!=g?g:!1;var k=mxUtils.bind(this,function(){var k=mxUtils.bind(this,function(k){this.writeFile(a,k,e,mxUtils.bind(this,function(a){g?c(new TrelloLibrary(this.ui,d,a)):c(new TrelloFile(this.ui,d,a))}),b)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){k(this.ui.base64ToBlob(a,"image/png"))}),b,d):k(d)});this.authenticate(k,b)}; -TrelloClient.prototype.saveFile=function(a,d,c){var b=a.meta.compoundId.split(this.SEPARATOR),g=mxUtils.bind(this,function(g){this.writeFile(a.meta.name,g,b[0],function(a){Trello.del("cards/"+b[0]+"/attachments/"+b[1],mxUtils.bind(this,function(){d(a)}),mxUtils.bind(this,function(a){null!=a&&401==a.status?this.authenticate(e,c,!0):c()}))},c)}),e=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){g(this.ui.base64ToBlob(a, -"image/png"))}),c,this.ui.getCurrentFile()!=a?a.getData():null):g(a.getData())});this.authenticate(e,c)}; -TrelloClient.prototype.writeFile=function(a,d,c,b,g){if(null!=a&&null!=d)if(d.length>=this.maxFileSize)g({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(d.length)+" / 10 MB)"});else{var e=mxUtils.bind(this,function(){var k=!0,n=window.setTimeout(mxUtils.bind(this,function(){k=!1;g({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),m=new FormData;m.append("key",Trello.key());m.append("token",Trello.token());m.append("file","string"===typeof d?new Blob([d]):d,a);m.append("name", -a);var t=new XMLHttpRequest;t.responseType="json";t.onreadystatechange=mxUtils.bind(this,function(){if(4===t.readyState&&(window.clearTimeout(n),k))if(200==t.status){var a=t.response;a.compoundId=c+this.SEPARATOR+a.id;b(a)}else 401==t.status?this.authenticate(e,g,!0):g()});t.open("POST",this.baseUrl+"cards/"+c+"/attachments");t.send(m)});this.authenticate(e,g)}else g({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)}; -TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};TrelloClient.prototype.pickFile=function(a,d){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a,mxResources.get("ok"))}))}; -TrelloClient.prototype.showTrelloDialog=function(a,d){var c=null,b="@me",g=0,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.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";e.appendChild(k);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.overflow="auto";n.style.height= +x?"#eeeeee":"";x=!x;var A=document.createElement("img");A.src=IMAGE_PATH+"/"+("dir"==k.type?"folder.png":"file.png");A.setAttribute("align","absmiddle");A.style.marginRight="4px";A.style.marginTop="-4px";A.width=20;p.appendChild(A);p.appendChild(l(k.name+("dir"==k.type?"/":""),mxUtils.bind(this,function(){"dir"==k.type?(e=k.path,z()):a&&"file"==k.type&&(this.ui.hideDialog(),c(d+"/"+b+"/"+encodeURIComponent(g)+"/"+k.path))})));m.appendChild(p);q++}})(n[k],k)});f(!0);a&&f(!1)}}),u,!0)}),y=mxUtils.bind(this, +function(a){null==a&&(m.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+b+"/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k= +mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(p(!0),m.appendChild(l("../ [Up]",mxUtils.bind(this,function(){e=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=t.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(l(a.name,mxUtils.bind(this,function(){g= +a.name;e="";z()})));m.appendChild(c)})(b[c],c);100==b.length&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",q))}}),u)}),C=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&mxEvent.removeListener(m,"scroll",q);null!=v&&null!=v.parentNode&& +v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==a&&(m.appendChild(l(mxResources.get("enterValue")+"...",mxUtils.bind(this, +function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var c=a.split("/");if(1<c.length){a=c[0];var f=c[1];3>c.length?(d=a,b=f,e=g=null,y()):this.ui.spinner.spin(m,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+f+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();d=a.meta.org;b=a.meta.repo;g=decodeURIComponent(a.meta.ref);e="";z()}),mxUtils.bind(this,function(a){this.ui.spinner.stop(); +this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var f=0;f<c.length;f++)mxUtils.bind(this,function(a,c){var f=t.cloneNode();f.style.backgroundColor=0==c%2?"#eeeeee":"";f.appendChild(l(a.full_name,mxUtils.bind(this,function(){d=a.owner.login;b=a.name;g=a.default_branch; +e="";z()})));m.appendChild(f)})(c[f],f)}100==c.length&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",q))}),u)});C()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,d){DrawioFile.call(this,a,c);this.meta=d;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes}; +TrelloFile.prototype.save=function(a,c,d){this.doSave(this.getTitle(),c,d)};TrelloFile.prototype.saveAs=function(a,c,d){this.doSave(a,c,d)};TrelloFile.prototype.doSave=function(a,c,d){var b=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=b;this.saveFile(a,!1,c,d)}; +TrelloFile.prototype.saveFile=function(a,c,d,b){if(this.isEditable())if(this.savingFile)null!=b&&(this.saveNeededCounter++,b({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.savingFileTime=new Date,this.getTitle()==a){var g=this.isModified,e=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return e}});k();this.ui.trello.saveFile(this,mxUtils.bind(this,function(e){this.savingFile=!1;this.isModified=g;this.meta=e;this.contentChanged();null!=d&& +d();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,d,b))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(e||this.isModified());if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){k();c()}}b(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(e);0<this.saveNeededCounter&& +(this.saveNeededCounter--,this.saveFile(a,c,d,b))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,e)}));else null!=d&&d()};TrelloLibrary=function(a,c,d){TrelloFile.call(this,a,c,d)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,c,d){this.saveFile(a,!1,c,d)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml"; +TrelloClient.prototype.authenticate=function(a,c,d){d&&this.logout();d=mxUtils.bind(this,function(b,d){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:b?"never":"1hour",success:function(){null!=d&&d();a()},error:function(){null!=d&&d();null!=c&&c(mxResources.get("loggedOut"))}})});this.isAuthorized()?d(!0):this.ui.showAuthDialog(this,!0,d)};TrelloClient.prototype.getLibrary=function(a,c,d){this.getFile(a,c,d,!1,!0)}; +TrelloClient.prototype.getFile=function(a,c,d,b,g){g=null!=g?g:!1;var e=mxUtils.bind(this,function(){var b=a.split(this.SEPARATOR),n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);Trello.cards.get(b[0]+"/attachments/"+b[1],mxUtils.bind(this,function(b){window.clearTimeout(m);if(n){var f=/\.png$/i.test(b.name);/\.v(dx|sdx?)$/i.test(b.name)||/\.gliffy$/i.test(b.name)||!this.ui.useCanvasForExport&&f?this.ui.convertFile(PROXY_URL+"?url="+ +encodeURIComponent(b.url),b.name,b.mimeType,this.extension,c,d):(n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b.url),mxUtils.bind(this,function(d){window.clearTimeout(m);if(n){b.compoundId=a;var e=f?d.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(d.substring(e+1)),null!=e&&0<e.length&&(d=e));g?c(new TrelloLibrary(this.ui,d,b)):c(new TrelloFile(this.ui,d,b))}}),mxUtils.bind(this, +function(a,b){window.clearTimeout(m);n&&(401==b.status?this.authenticate(e,d,!0):d())}),f||null!=b.mimeType&&"image/"==b.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(m);n&&(null!=a&&401==a.status?this.authenticate(e,d,!0):d())}))});this.authenticate(e,d)};TrelloClient.prototype.insertLibrary=function(a,c,d,b,g){this.insertFile(a,c,d,b,!0,g)}; +TrelloClient.prototype.insertFile=function(a,c,d,b,g,e){g=null!=g?g:!1;var k=mxUtils.bind(this,function(){var k=mxUtils.bind(this,function(k){this.writeFile(a,k,e,mxUtils.bind(this,function(a){g?d(new TrelloLibrary(this.ui,c,a)):d(new TrelloFile(this.ui,c,a))}),b)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){k(this.ui.base64ToBlob(a,"image/png"))}),b,c):k(c)});this.authenticate(k,b)}; +TrelloClient.prototype.saveFile=function(a,c,d){var b=a.meta.compoundId.split(this.SEPARATOR),g=mxUtils.bind(this,function(g){this.writeFile(a.meta.name,g,b[0],function(a){Trello.del("cards/"+b[0]+"/attachments/"+b[1],mxUtils.bind(this,function(){c(a)}),mxUtils.bind(this,function(a){null!=a&&401==a.status?this.authenticate(e,d,!0):d()}))},d)}),e=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){g(this.ui.base64ToBlob(a, +"image/png"))}),d,this.ui.getCurrentFile()!=a?a.getData():null):g(a.getData())});this.authenticate(e,d)}; +TrelloClient.prototype.writeFile=function(a,c,d,b,g){if(null!=a&&null!=c)if(c.length>=this.maxFileSize)g({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 10 MB)"});else{var e=mxUtils.bind(this,function(){var k=!0,n=window.setTimeout(mxUtils.bind(this,function(){k=!1;g({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),m=new FormData;m.append("key",Trello.key());m.append("token",Trello.token());m.append("file","string"===typeof c?new Blob([c]):c,a);m.append("name", +a);var t=new XMLHttpRequest;t.responseType="json";t.onreadystatechange=mxUtils.bind(this,function(){if(4===t.readyState&&(window.clearTimeout(n),k))if(200==t.status){var a=t.response;a.compoundId=d+this.SEPARATOR+a.id;b(a)}else 401==t.status?this.authenticate(e,g,!0):g()});t.open("POST",this.baseUrl+"cards/"+d+"/attachments");t.send(m)});this.authenticate(e,g)}else g({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)}; +TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};TrelloClient.prototype.pickFile=function(a,c){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a,mxResources.get("ok"))}))}; +TrelloClient.prototype.showTrelloDialog=function(a,c){var d=null,b="@me",g=0,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.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";e.appendChild(k);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.overflow="auto";n.style.height= "194px";e.appendChild(n);e=new CustomDialog(this.ui,e);this.ui.showDialog(e.container,340,270,!0,!0);e.okButton.parentNode.removeChild(e.okButton);var m=mxUtils.bind(this,function(a,b,c){g++;var d=document.createElement("div");d.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;background:"+(0==g%2?"#eee":"#fff");var e=document.createElement("a");e.setAttribute("href","javascript:void(0);");if(null!=c){var f=document.createElement("img");f.src=c.url;f.width=c.width;f.height= -c.height;f.style="border: 1px solid black;margin:5px;vertical-align:middle";e.appendChild(f)}mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d.appendChild(e);return d}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),f=mxUtils.bind(this,function(){g=0;n.innerHTML="";this.ui.spinner.spin(n,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(c+"/attachments",{fields:"id,name,previews"}, -mxUtils.bind(this,function(a){this.ui.spinner.stop();n.appendChild(m("../ [Up]",mxUtils.bind(this,function(){u()})));mxUtils.br(n);null==a||0==a.length?mxUtils.write(n,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var b=0;b<a.length;b++)mxUtils.bind(this,function(a){n.appendChild(m(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();d(c+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[b])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,t,!0): +c.height;f.style="border: 1px solid black;margin:5px;vertical-align:middle";e.appendChild(f)}mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d.appendChild(e);return d}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),f=mxUtils.bind(this,function(){g=0;n.innerHTML="";this.ui.spinner.spin(n,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(d+"/attachments",{fields:"id,name,previews"}, +mxUtils.bind(this,function(a){this.ui.spinner.stop();n.appendChild(m("../ [Up]",mxUtils.bind(this,function(){u()})));mxUtils.br(n);null==a||0==a.length?mxUtils.write(n,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var b=0;b<a.length;b++)mxUtils.bind(this,function(a){n.appendChild(m(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();c(d+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[b])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,t,!0): null!=t&&t(b)}))});a()}),l=null,p=null,u=mxUtils.bind(this,function(e){null==e&&(g=0,n.innerHTML="",e=1);this.ui.spinner.spin(n,mxResources.get("loading"));null!=l&&null!=l.parentNode&&l.parentNode.removeChild(l);l=document.createElement("a");l.style.display="block";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(n,"scroll",p);u(e+1)});mxEvent.addListener(l,"click",k);var v=mxUtils.bind(this,function(){Trello.get("search", {query:""==mxUtils.trim(b)?"is:open":b,cards_limit:100,cards_page:e-1},mxUtils.bind(this,function(g){this.ui.spinner.stop();g=null!=g?g.cards:null;if(null==g||0==g.length)mxUtils.write(n,mxResources.get("noFiles"));else{1==e&&(n.appendChild(m(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,b,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(b=a,u())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards"); -this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(n));for(var q=0;q<g.length;q++)mxUtils.bind(this,function(b){n.appendChild(m(b.name,mxUtils.bind(this,function(){a?(c=b.id,f()):(this.ui.hideDialog(),d(b.id))})))})(g[q]);100==g.length&&(n.appendChild(l),p=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",p))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(v,t,!0):null!=t&&t({message:a.responseText})}))});v()});u()}; -TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};GitLabFile=function(a,d,c){GitHubFile.call(this,a,d,c);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(a){return null!=a&&400==a.status}; -GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(a){return a.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(a,d){a.last_commit_id=d};GitLabLibrary=function(a,d,c){GitLabFile.call(this,a,d,c)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(a,d,c){this.saveFile(a,!1,d,c)};GitLabLibrary.prototype.open=function(){};GitLabClient=function(a){GitHubClient.call(this,a,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.authToken="Bearer"; -GitLabClient.prototype.authenticate=function(a,d){if(null==window.onGitLabCallback){var c=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){var k=window.location.href,k=k.substring(0,k.lastIndexOf("/")),k=encodeURIComponent(k+"/gitlab.html");null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+k+"&response_type=token&state=123","gitlabauth")?window.onGitLabCallback=mxUtils.bind(this, -function(k,m){b?(window.onGitLabCallback=null,b=!1,null==k?d({message:mxResources.get("accessDenied"),retry:c}):(null!=e&&e(),this.token=k,this.setUser(null),g&&this.setPersistentToken(this.token),a())):null!=m&&m.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:c})}),mxUtils.bind(this,function(){b&&(window.onGitLabCallback=null,b=!1,d({message:mxResources.get("accessDenied"),retry:c}))}))});c()}else d({code:App.ERROR_BUSY})}; -GitLabClient.prototype.executeRequest=function(a,d,c,b){var g=mxUtils.bind(this,function(k){var n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),t=this.authToken+" "+this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",t);a.setRequestHeader("PRIVATE_TOKEN",t);a.setRequestHeader("Content-Type","application/json")};a.send(mxUtils.bind(this,function(){window.clearTimeout(m);if(n)if(200<= -a.getStatus()&&299>=a.getStatus()||b&&404==a.getStatus())d(a);else if(401===a.getStatus())k?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},c)})}):this.authenticate(function(){g(!0)},c);else if(403===a.getStatus()){var f=!1;try{var l=JSON.parse(a.getText());null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code)}catch(p){}c({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?c({message:this.getErrorMessage(a, -mxResources.get("fileNotFound"))}):400===a.getStatus()?c({status:400}):c({status:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),c)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},c,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},c):e(!1)}; -GitLabClient.prototype.getRefIndex=function(a,d,c,b,g){if(null!=g)c(a,g);else{var e=a.length-2,k=mxUtils.bind(this,function(){if(2>e)b({message:mxResources.get("fileNotFound")});else{var g=Math.max(e-1,0),m=a.slice(0,g).join("/"),g=a[g],t=a[e],f=a.slice(e+1,a.length).join("/"),m=this.baseUrl+"/projects/"+encodeURIComponent(m+"/"+g)+"/repository/"+(d?"tree?path="+f+"&ref="+t:"files/"+encodeURIComponent(f)+"?ref="+t),l=new mxXmlRequest(m,null,"HEAD");this.executeRequest(l,mxUtils.bind(this,function(){200== -l.getStatus()?c(a,e):b({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==l.getStatus()?(e--,k()):b({message:mxResources.get("fileNotFound")})}))}});k()}}; -GitLabClient.prototype.getFile=function(a,d,c,b,g,e){b=null!=b?b:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(e,n){var k=Math.max(n-1,0),t=e.slice(0,k).join("/"),f=e[k],l=e[n];a=e.slice(n+1,e.length).join("/");k=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&k))if(null!=this.token){var k="&t="+(new Date).getTime(),p=this.baseUrl+"/projects/"+encodeURIComponent(t+"/"+f)+"/repository/files/"+encodeURIComponent(a)+ -"?ref="+l;e=a.split("/");this.ui.convertFile(p+k,0<e.length?e[e.length-1]:a,null,this.extension,d,c,mxUtils.bind(this,function(a,b,c){a=new mxXmlRequest(a,null,"GET");this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.getFileContent(JSON.parse(a.getText())))}catch(y){c(y)}}),c)}))}else c({message:mxResources.get("accessDenied")});else k="&t="+(new Date).getTime(),p=this.baseUrl+"/projects/"+encodeURIComponent(t+"/"+f)+"/repository/files/"+encodeURIComponent(a)+"?ref="+l,k=new mxXmlRequest(p+ -k,null,"GET"),this.executeRequest(k,mxUtils.bind(this,function(a){try{d(this.createGitLabFile(t,f,l,JSON.parse(a.getText()),b,n))}catch(v){c(v)}}),c)}),c,e)}; -GitLabClient.prototype.getFileContent=function(a){var d=a.file_name,c=a.content;"base64"===a.encoding&&(/\.jpe?g$/i.test(d)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(d)?c="data:image/gif;base64,"+c:/\.pdf$/i.test(d)?c="data:application/pdf;base64,"+c:/\.png$/i.test(d)?(a=this.ui.extractGraphModelFromPng(c),c=null!=a&&0<a.length?a:"data:image/png;base64,"+c):c=Base64.decode(c));return c}; -GitLabClient.prototype.createGitLabFile=function(a,d,c,b,g,e){var k=DRAWIO_GITLAB_URL+"/";a={org:a,repo:d,ref:c,name:b.file_name,path:b.file_path,html_url:k+a+"/"+d+"/blob/"+c+"/"+b.file_path,download_url:k+a+"/"+d+"/raw/"+c+"/"+b.file_path+"?inline=false",last_commit_id:b.last_commit_id,refPos:e};b=this.getFileContent(b);return g?new GitLabLibrary(this.ui,b,a):new GitLabFile(this.ui,b,a)}; -GitLabClient.prototype.insertFile=function(a,d,c,b,g,e,k){g=null!=g?g:!1;this.getRefIndex(e.split("/"),!0,mxUtils.bind(this,function(e,m){var n=Math.max(m-1,0),f=e.slice(0,n).join("/"),l=e[n],p=e[m];path=e.slice(m+1,e.length).join("/");0<path.length&&(path+="/");path+=a;this.checkExists(f+"/"+l+"/"+p+"/"+path,!0,mxUtils.bind(this,function(e,n){if(e)if(g)k||(d=Base64.encode(d)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(f,l,p,path,a,d,n,mxUtils.bind(this,function(a){try{var d= -JSON.parse(a.getText());c(this.createGitLabFile(f,l,p,d.content,g,m))}catch(I){b(I)}}),b)}),b);else{var q=DRAWIO_GITLAB_URL+"/";c(new GitLabFile(this.ui,d,{org:f,repo:l,ref:p,name:a,path:path,html_url:q+f+"/"+l+"/blob/"+p+"/"+path,download_url:q+f+"/"+l+"/raw/"+p+"/"+path+"?inline=false",refPos:m,last_commit_id:n,isNew:!0}))}else b()}))}),b)}; -GitLabClient.prototype.checkExists=function(a,d,c){this.getFile(a,mxUtils.bind(this,function(b){if(d){var g=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){g();c(!0,b.getCurrentEtag())},function(){g();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(a){c(!0)}),null,!0)}; -GitLabClient.prototype.writeFile=function(a,d,c,b,g,e,k,n,m){if(e.length>=this.maxFileSize)m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"});else{var t="POST";c={path:encodeURIComponent(b),branch:decodeURIComponent(c),commit_message:g,content:e,encoding:"base64"};null!=k&&(c.last_commit_id=k,t="PUT");a=this.baseUrl+"/projects/"+encodeURIComponent(a+"/"+d)+"/repository/files/"+encodeURIComponent(b);t=new mxXmlRequest(a,JSON.stringify(c),t);this.executeRequest(t, +this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(n));for(var q=0;q<g.length;q++)mxUtils.bind(this,function(b){n.appendChild(m(b.name,mxUtils.bind(this,function(){a?(d=b.id,f()):(this.ui.hideDialog(),c(b.id))})))})(g[q]);100==g.length&&(n.appendChild(l),p=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",p))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(v,t,!0):null!=t&&t({message:a.responseText})}))});v()});u()}; +TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};GitLabFile=function(a,c,d){GitHubFile.call(this,a,c,d);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(a){return null!=a&&400==a.status}; +GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(a){return a.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(a,c){a.last_commit_id=c};GitLabLibrary=function(a,c,d){GitLabFile.call(this,a,c,d)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(a,c,d){this.saveFile(a,!1,c,d)};GitLabLibrary.prototype.open=function(){};GitLabClient=function(a){GitHubClient.call(this,a,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.authToken="Bearer"; +GitLabClient.prototype.authenticate=function(a,c){if(null==window.onGitLabCallback){var d=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){var k=window.location.href,k=k.substring(0,k.lastIndexOf("/")),k=encodeURIComponent(k+"/gitlab.html");null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+k+"&response_type=token&state=123","gitlabauth")?window.onGitLabCallback=mxUtils.bind(this, +function(k,m){b?(window.onGitLabCallback=null,b=!1,null==k?c({message:mxResources.get("accessDenied"),retry:d}):(null!=e&&e(),this.token=k,this.setUser(null),g&&this.setPersistentToken(this.token),a())):null!=m&&m.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){b&&(window.onGitLabCallback=null,b=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})}; +GitLabClient.prototype.executeRequest=function(a,c,d,b){var g=mxUtils.bind(this,function(k){var n=!0,m=window.setTimeout(mxUtils.bind(this,function(){n=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),t=this.authToken+" "+this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",t);a.setRequestHeader("PRIVATE_TOKEN",t);a.setRequestHeader("Content-Type","application/json")};a.send(mxUtils.bind(this,function(){window.clearTimeout(m);if(n)if(200<= +a.getStatus()&&299>=a.getStatus()||b&&404==a.getStatus())c(a);else if(401===a.getStatus())k?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){g(!0)},d);else if(403===a.getStatus()){var f=!1;try{var l=JSON.parse(a.getText());null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code)}catch(p){}d({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?d({message:this.getErrorMessage(a, +mxResources.get("fileNotFound"))}):400===a.getStatus()?d({status:400}):d({status:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),d)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},d,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},d):e(!1)}; +GitLabClient.prototype.getRefIndex=function(a,c,d,b,g){if(null!=g)d(a,g);else{var e=a.length-2,k=mxUtils.bind(this,function(){if(2>e)b({message:mxResources.get("fileNotFound")});else{var g=Math.max(e-1,0),m=a.slice(0,g).join("/"),g=a[g],t=a[e],f=a.slice(e+1,a.length).join("/"),m=this.baseUrl+"/projects/"+encodeURIComponent(m+"/"+g)+"/repository/"+(c?"tree?path="+f+"&ref="+t:"files/"+encodeURIComponent(f)+"?ref="+t),l=new mxXmlRequest(m,null,"HEAD");this.executeRequest(l,mxUtils.bind(this,function(){200== +l.getStatus()?d(a,e):b({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==l.getStatus()?(e--,k()):b({message:mxResources.get("fileNotFound")})}))}});k()}}; +GitLabClient.prototype.getFile=function(a,c,d,b,g,e){b=null!=b?b:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(e,n){var k=Math.max(n-1,0),t=e.slice(0,k).join("/"),f=e[k],l=e[n];a=e.slice(n+1,e.length).join("/");k=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&k))if(null!=this.token){var k="&t="+(new Date).getTime(),p=this.baseUrl+"/projects/"+encodeURIComponent(t+"/"+f)+"/repository/files/"+encodeURIComponent(a)+ +"?ref="+l;e=a.split("/");this.ui.convertFile(p+k,0<e.length?e[e.length-1]:a,null,this.extension,c,d,mxUtils.bind(this,function(a,b,c){a=new mxXmlRequest(a,null,"GET");this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.getFileContent(JSON.parse(a.getText())))}catch(y){c(y)}}),c)}))}else d({message:mxResources.get("accessDenied")});else k="&t="+(new Date).getTime(),p=this.baseUrl+"/projects/"+encodeURIComponent(t+"/"+f)+"/repository/files/"+encodeURIComponent(a)+"?ref="+l,k=new mxXmlRequest(p+ +k,null,"GET"),this.executeRequest(k,mxUtils.bind(this,function(a){try{c(this.createGitLabFile(t,f,l,JSON.parse(a.getText()),b,n))}catch(v){d(v)}}),d)}),d,e)}; +GitLabClient.prototype.getFileContent=function(a){var c=a.file_name,d=a.content;"base64"===a.encoding&&(/\.jpe?g$/i.test(c)?d="data:image/jpeg;base64,"+d:/\.gif$/i.test(c)?d="data:image/gif;base64,"+d:/\.pdf$/i.test(c)?d="data:application/pdf;base64,"+d:/\.png$/i.test(c)?(a=this.ui.extractGraphModelFromPng(d),d=null!=a&&0<a.length?a:"data:image/png;base64,"+d):d=Base64.decode(d));return d}; +GitLabClient.prototype.createGitLabFile=function(a,c,d,b,g,e){var k=DRAWIO_GITLAB_URL+"/";a={org:a,repo:c,ref:d,name:b.file_name,path:b.file_path,html_url:k+a+"/"+c+"/blob/"+d+"/"+b.file_path,download_url:k+a+"/"+c+"/raw/"+d+"/"+b.file_path+"?inline=false",last_commit_id:b.last_commit_id,refPos:e};b=this.getFileContent(b);return g?new GitLabLibrary(this.ui,b,a):new GitLabFile(this.ui,b,a)}; +GitLabClient.prototype.insertFile=function(a,c,d,b,g,e,k){g=null!=g?g:!1;this.getRefIndex(e.split("/"),!0,mxUtils.bind(this,function(e,m){var n=Math.max(m-1,0),f=e.slice(0,n).join("/"),l=e[n],p=e[m];path=e.slice(m+1,e.length).join("/");0<path.length&&(path+="/");path+=a;this.checkExists(f+"/"+l+"/"+p+"/"+path,!0,mxUtils.bind(this,function(e,n){if(e)if(g)k||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(f,l,p,path,a,c,n,mxUtils.bind(this,function(a){try{var c= +JSON.parse(a.getText());d(this.createGitLabFile(f,l,p,c.content,g,m))}catch(I){b(I)}}),b)}),b);else{var q=DRAWIO_GITLAB_URL+"/";d(new GitLabFile(this.ui,c,{org:f,repo:l,ref:p,name:a,path:path,html_url:q+f+"/"+l+"/blob/"+p+"/"+path,download_url:q+f+"/"+l+"/raw/"+p+"/"+path+"?inline=false",refPos:m,last_commit_id:n,isNew:!0}))}else b()}))}),b)}; +GitLabClient.prototype.checkExists=function(a,c,d){this.getFile(a,mxUtils.bind(this,function(b){if(c){var g=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){g();d(!0,b.getCurrentEtag())},function(){g();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(a){d(!0)}),null,!0)}; +GitLabClient.prototype.writeFile=function(a,c,d,b,g,e,k,n,m){if(e.length>=this.maxFileSize)m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"});else{var t="POST";d={path:encodeURIComponent(b),branch:decodeURIComponent(d),commit_message:g,content:e,encoding:"base64"};null!=k&&(d.last_commit_id=k,t="PUT");a=this.baseUrl+"/projects/"+encodeURIComponent(a+"/"+c)+"/repository/files/"+encodeURIComponent(b);t=new mxXmlRequest(a,JSON.stringify(d),t);this.executeRequest(t, mxUtils.bind(this,function(a){n(a)}),m)}}; -GitLabClient.prototype.saveFile=function(a,d,c,b,g){var e=a.meta.org,k=a.meta.repo,n=a.meta.ref,m=a.meta.path,t=mxUtils.bind(this,function(b,f){this.writeFile(e,k,n,m,g,f,b,mxUtils.bind(this,function(b){delete a.meta.isNew;this.getFile(e+"/"+k+"/"+n+"/"+m,mxUtils.bind(this,function(b){b.getData()==a.getData()?d(b.getCurrentEtag()):d({content:a.getCurrentEtag()})}),c,null,null,a.meta.refPos)}),c)}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(m)?this.ui.getEmbeddedPng(mxUtils.bind(this, -function(b){t(a.meta.last_commit_id,b)}),c,this.ui.getCurrentFile()!=a?a.getData():null):t(a.meta.last_commit_id,Base64.encode(a.getData()))});b?this.getFile(e+"/"+k+"/"+n+"/"+m,mxUtils.bind(this,function(b){a.meta.last_commit_id=b.meta.last_commit_id;f()}),c):f()};GitLabClient.prototype.pickFolder=function(a){this.showGitLabDialog(!1,a)};GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)}; -GitLabClient.prototype.showGitLabDialog=function(a,d){var c=null,b=null,g=null,e=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(n);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.border="1px solid lightgray";m.style.boxSizing= -"border-box";m.style.padding="4px";m.style.overflow="auto";m.style.lineHeight="1.2em";m.style.height="274px";k.appendChild(m);var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.boxSizing="border-box";t.style.overflow="hidden";t.style.padding="4px";t.style.width="100%";var f=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){d(c+"/"+b+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(f.container,420,360,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var l= -mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=t.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),p=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(l(c+"/"+b,mxUtils.bind(this,function(){e=null;C()})));a||(mxUtils.write(d," / "),d.appendChild(l(decodeURIComponent(g),mxUtils.bind(this, -function(){e=null;y()}))));if(null!=e&&0<e.length){var f=e.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(l(f[a],mxUtils.bind(this,function(){e=f.slice(0,a+1).join("/");z()})))})(a)}m.appendChild(d)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(e=g=b=c=null,C()):this.ui.hideDialog()}))}),v=null,q=null,z=mxUtils.bind(this,function(k){null==k&&(m.innerHTML="",k=1);var n=new mxXmlRequest(this.baseUrl+ -"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/tree?path="+e+"&ref="+g+"&per_page=100&page="+k,null,"GET");this.ui.spinner.spin(m,mxResources.get("loading"));f.okButton.removeAttribute("disabled");null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var A=mxUtils.bind(this,function(){z(k+ +GitLabClient.prototype.saveFile=function(a,c,d,b,g){var e=a.meta.org,k=a.meta.repo,n=a.meta.ref,m=a.meta.path,t=mxUtils.bind(this,function(b,f){this.writeFile(e,k,n,m,g,f,b,mxUtils.bind(this,function(b){delete a.meta.isNew;this.getFile(e+"/"+k+"/"+n+"/"+m,mxUtils.bind(this,function(b){b.getData()==a.getData()?c(b.getCurrentEtag()):c({content:a.getCurrentEtag()})}),d,null,null,a.meta.refPos)}),d)}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(m)?this.ui.getEmbeddedPng(mxUtils.bind(this, +function(b){t(a.meta.last_commit_id,b)}),d,this.ui.getCurrentFile()!=a?a.getData():null):t(a.meta.last_commit_id,Base64.encode(a.getData()))});b?this.getFile(e+"/"+k+"/"+n+"/"+m,mxUtils.bind(this,function(b){a.meta.last_commit_id=b.meta.last_commit_id;f()}),d):f()};GitLabClient.prototype.pickFolder=function(a){this.showGitLabDialog(!1,a)};GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)}; +GitLabClient.prototype.showGitLabDialog=function(a,c){var d=null,b=null,g=null,e=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(n);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.border="1px solid lightgray";m.style.boxSizing= +"border-box";m.style.padding="4px";m.style.overflow="auto";m.style.lineHeight="1.2em";m.style.height="274px";k.appendChild(m);var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.boxSizing="border-box";t.style.overflow="hidden";t.style.padding="4px";t.style.width="100%";var f=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){c(d+"/"+b+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(f.container,420,360,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var l= +mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=t.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),p=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(l(d+"/"+b,mxUtils.bind(this,function(){e=null;C()})));a||(mxUtils.write(c," / "),c.appendChild(l(decodeURIComponent(g),mxUtils.bind(this, +function(){e=null;y()}))));if(null!=e&&0<e.length){var f=e.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(l(f[a],mxUtils.bind(this,function(){e=f.slice(0,a+1).join("/");z()})))})(a)}m.appendChild(c)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(e=g=b=d=null,C()):this.ui.hideDialog()}))}),v=null,q=null,z=mxUtils.bind(this,function(k){null==k&&(m.innerHTML="",k=1);var n=new mxXmlRequest(this.baseUrl+ +"/projects/"+encodeURIComponent(d+"/"+b)+"/repository/tree?path="+e+"&ref="+g+"&per_page=100&page="+k,null,"GET");this.ui.spinner.spin(m,mxResources.get("loading"));f.okButton.removeAttribute("disabled");null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var A=mxUtils.bind(this,function(){z(k+ 1)});mxEvent.addListener(v,"click",A);this.executeRequest(n,mxUtils.bind(this,function(f){this.ui.spinner.stop();1==k&&(p(!g),m.appendChild(l("../ [Up]",mxUtils.bind(this,function(){if(""==e)e=null,C();else{var a=e.split("/");e=a.slice(0,a.length-1).join("/");z()}}),"4px")));var n=JSON.parse(f.getText());if(null==n||0==n.length)mxUtils.write(m,mxResources.get("noFiles"));else{var x=!0,u=0;f=mxUtils.bind(this,function(f){for(var k=0;k<n.length;k++)mxUtils.bind(this,function(k){if(f==("tree"==k.type)){var n= -t.cloneNode();n.style.backgroundColor=x?"#eeeeee":"";x=!x;var p=document.createElement("img");p.src=IMAGE_PATH+"/"+("tree"==k.type?"folder.png":"file.png");p.setAttribute("align","absmiddle");p.style.marginRight="4px";p.style.marginTop="-4px";p.width=20;n.appendChild(p);n.appendChild(l(k.name+("tree"==k.type?"/":""),mxUtils.bind(this,function(){"tree"==k.type?(e=k.path,z()):a&&"blob"==k.type&&(this.ui.hideDialog(),d(c+"/"+b+"/"+g+"/"+k.path))})));m.appendChild(n);u++}})(n[k])});f(!0);a&&f(!1);100== -u&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&A()},mxEvent.addListener(m,"scroll",q))}}),u,!0)}),y=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&& -v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(p(!0),m.appendChild(l("../ [Up]",mxUtils.bind(this,function(){e=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles")); +t.cloneNode();n.style.backgroundColor=x?"#eeeeee":"";x=!x;var p=document.createElement("img");p.src=IMAGE_PATH+"/"+("tree"==k.type?"folder.png":"file.png");p.setAttribute("align","absmiddle");p.style.marginRight="4px";p.style.marginTop="-4px";p.width=20;n.appendChild(p);n.appendChild(l(k.name+("tree"==k.type?"/":""),mxUtils.bind(this,function(){"tree"==k.type?(e=k.path,z()):a&&"blob"==k.type&&(this.ui.hideDialog(),c(d+"/"+b+"/"+g+"/"+k.path))})));m.appendChild(n);u++}})(n[k])});f(!0);a&&f(!1);100== +u&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&A()},mxEvent.addListener(m,"scroll",q))}}),u,!0)}),y=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(d+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&& +v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(p(!0),m.appendChild(l("../ [Up]",mxUtils.bind(this,function(){e=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles")); else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=t.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(l(a.name,mxUtils.bind(this,function(){g=encodeURIComponent(a.name);e="";z()})));m.appendChild(c)})(b[c],c);100==b.length&&(m.appendChild(v),q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",q))}}),u)});f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));var C=mxUtils.bind(this, -function(a){this.ui.spinner.stop();null==a&&(m.innerHTML="",a=1);null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var d=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(v,"click",d);var f=mxUtils.bind(this,function(a){this.ui.spinner.spin(m,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+ +function(a){this.ui.spinner.stop();null==a&&(m.innerHTML="",a=1);null!=q&&(mxEvent.removeListener(m,"scroll",q),q=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(v,"click",c);var f=mxUtils.bind(this,function(a){this.ui.spinner.spin(m,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+ "/groups?per_page=100",null,"GET");this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),u)}),k=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(m,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),u)});f(mxUtils.bind(this,function(f){var n=new mxXmlRequest(this.baseUrl+"/users/"+ -this.user.id+"/projects?per_page=100&page="+a,null,"GET");this.ui.spinner.spin(m,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=f&&0!=f.length){1==a&&(m.appendChild(l(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(c=a[0],b=a[1],g="master", -e=null,2<a.length&&(e=encodeURIComponent(a.slice(2,a.length).join("/"))),z()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var x=!0,p=0;p<n.length;p++)mxUtils.bind(this,function(a,d){var f=t.cloneNode();f.style.backgroundColor=x?"#eeeeee":"";x=!x;f.appendChild(l(a.name_with_namespace,mxUtils.bind(this,function(){c=a.owner.username;b= -a.path;g=a.default_branch||"master";e="";z()})));m.appendChild(f)})(n[p],p);for(p=0;p<f.length;p++)k(f[p],mxUtils.bind(this,function(a,d){for(var f=0;f<d.length;f++){var k=t.cloneNode();k.style.backgroundColor=x?"#eeeeee":"";x=!x;mxUtils.bind(this,function(d){k.appendChild(l(d.name_with_namespace,mxUtils.bind(this,function(){c=a.full_path;b=d.path;g=d.default_branch||"master";e="";z()})));m.appendChild(k)})(d[f])}}))}else mxUtils.write(m,mxResources.get("noFiles"));100==n.length&&(m.appendChild(v), -q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&d()},mxEvent.addListener(m,"scroll",q))}),u)}))});this.token?this.user?C():this.updateUser(function(){C()},u,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){C()},u,!0)}),u)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,d,c,b,g,e,k){this.file=a;this.id=d;this.content=c;this.modifiedDate=b;this.createdDate=g;this.isResolved=e;this.user=k;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,d,c,b,g){d()};DrawioComment.prototype.editComment=function(a,d,c){d()};DrawioComment.prototype.deleteComment=function(a,d){a()};DriveComment=function(a,d,c,b,g,e,k,n){DrawioComment.call(this,a,d,c,b,g,e,k);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,d,c,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){d(a.replyId)}),c)}; -DriveComment.prototype.editComment=function(a,d,c){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},d,c)}; -DriveComment.prototype.deleteComment=function(a,d){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,d)};App=function(a,d,c){EditorUi.call(this,a,d,null!=c?c:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var c={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!= +this.user.id+"/projects?per_page=100&page="+a,null,"GET");this.ui.spinner.spin(m,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=f&&0!=f.length){1==a&&(m.appendChild(l(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(d=a[0],b=a[1],g="master", +e=null,2<a.length&&(e=encodeURIComponent(a.slice(2,a.length).join("/"))),z()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var x=!0,p=0;p<n.length;p++)mxUtils.bind(this,function(a,c){var f=t.cloneNode();f.style.backgroundColor=x?"#eeeeee":"";x=!x;f.appendChild(l(a.name_with_namespace,mxUtils.bind(this,function(){d=a.owner.username;b= +a.path;g=a.default_branch||"master";e="";z()})));m.appendChild(f)})(n[p],p);for(p=0;p<f.length;p++)k(f[p],mxUtils.bind(this,function(a,c){for(var f=0;f<c.length;f++){var k=t.cloneNode();k.style.backgroundColor=x?"#eeeeee":"";x=!x;mxUtils.bind(this,function(c){k.appendChild(l(c.name_with_namespace,mxUtils.bind(this,function(){d=a.full_path;b=c.path;g=c.default_branch||"master";e="";z()})));m.appendChild(k)})(c[f])}}))}else mxUtils.write(m,mxResources.get("noFiles"));100==n.length&&(m.appendChild(v), +q=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&c()},mxEvent.addListener(m,"scroll",q))}),u)}))});this.token?this.user?C():this.updateUser(function(){C()},u,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){C()},u,!0)}),u)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,d,b,g,e,k){this.file=a;this.id=c;this.content=d;this.modifiedDate=b;this.createdDate=g;this.isResolved=e;this.user=k;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,d,b,g){c()};DrawioComment.prototype.editComment=function(a,c,d){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,d,b,g,e,k,n){DrawioComment.call(this,a,c,d,b,g,e,k);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,d,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),d)}; +DriveComment.prototype.editComment=function(a,c,d){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},c,d)}; +DriveComment.prototype.deleteComment=function(a,c){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,c)};App=function(a,c,d){EditorUi.call(this,a,c,null!=d?d:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var c={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!= a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!=a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"}; a.constructor==DriveFile&&null!=a.desc&&null!=this.drive&&(c.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType);EditorUi.logEvent(c)}}));this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+a.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave? "on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=": @@ -9494,19 +9495,19 @@ App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";Ap App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"js/onedrive/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date; App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",ac148:"/plugins/cConf-1-4-8.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",update:"/plugins/update.js",trees:"/plugins/trees/trees.js", "import":"/plugins/import.js",replay:"/plugins/replay.js",anon:"/plugins/anonymize.js",tr:"/plugins/trello.js",f5:"/plugins/rackF5.js",tickets:"/plugins/tickets.js",flow:"/plugins/flow.js",webcola:"/plugins/webcola/webcola.js",rnd:"/plugins/random.js",page:"/plugins/page.js",gd:"/plugins/googledrive.js",tags:"/plugins/tags.js"}; -App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var d=document.cookie.split(";"),c=0;c<d.length;c++){var b=mxUtils.trim(d[c]);if("MODE="==b.substring(0,5)){a=b.substring(5);break}}null!=a&&isLocalStorage&&(d=new Date,d.setYear(d.getFullYear()-1),document.cookie="MODE=; expires="+d.toUTCString(),localStorage.setItem(".mode",a))}return a}; +App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var c=document.cookie.split(";"),d=0;d<c.length;d++){var b=mxUtils.trim(c[d]);if("MODE="==b.substring(0,5)){a=b.substring(5);break}}null!=a&&isLocalStorage&&(c=new Date,c.setYear(c.getFullYear()-1),document.cookie="MODE=; expires="+c.toUTCString(),localStorage.setItem(".mode",a))}return a}; (function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode),null==App.mode&&(App.mode=App.getStoredMode()),null!=window.mxscript&&("1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&& "#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0, 2)?(mxscript(App.DROPBOX_URL),mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient= null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?(mxscript(App.TRELLO_JQUERY_URL),mxscript(App.TRELLO_URL)):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})(); -App.main=function(a,d){function c(b){mxUtils.getAll("1"!=urlParams.dev?[b]:[b,STYLE_PATH+"/default.xml",STYLE_PATH+"/dark-default.xml"],function(b){mxResources.parse(b[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var c=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(!e[a[b]])throw Error(mxResources.get("invalidInput")+' "'+a[b])+'"';return!0},e={},f;for(f in App.pluginRegistry)e[App.pluginRegistry[f]]=!0; -var g=JSON.parse(Graph.decompress(window.location.hash.substring(9)));null!=g&&c(g.plugins)&&(EditorUi.debug("Setting configuration",JSON.stringify(g)),confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(".configuration",JSON.stringify(g)),window.location.hash="",window.location.reload()));window.location.hash=""}catch(z){window.location.hash="",alert(z)}2<b.length&&(Graph.prototype.defaultThemes["default-style2"]=b[1].getDocumentElement(), -Graph.prototype.defaultThemes.darkTheme=b[2].getDocumentElement());b=null!=d?d():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL, +App.main=function(a,c){function d(b){mxUtils.getAll("1"!=urlParams.dev?[b]:[b,STYLE_PATH+"/default.xml",STYLE_PATH+"/dark-default.xml"],function(b){mxResources.parse(b[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var d=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(!e[a[b]])throw Error(mxResources.get("invalidInput")+' "'+a[b])+'"';return!0},e={},f;for(f in App.pluginRegistry)e[App.pluginRegistry[f]]=!0; +var g=JSON.parse(Graph.decompress(window.location.hash.substring(9)));null!=g&&d(g.plugins)&&(EditorUi.debug("Setting configuration",JSON.stringify(g)),confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(".configuration",JSON.stringify(g)),window.location.hash="",window.location.reload()));window.location.hash=""}catch(z){window.location.hash="",alert(z)}2<b.length&&(Graph.prototype.defaultThemes["default-style2"]=b[1].getDocumentElement(), +Graph.prototype.defaultThemes.darkTheme=b[2].getDocumentElement());b=null!=c?c():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL, function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback): "undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!= -a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",[b,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))},function(a){a=document.getElementById("geStatus");null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function b(){try{if(null!= +a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",[b,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))},function(a){a=document.getElementById("geStatus");null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function b(){try{if(null!= mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var a=parseInt(mxSettings.settings.autosaveDelay);!isNaN(a)&&0<a?(DrawioFile.prototype.autosaveDelay=a,EditorUi.debug("Setting autosaveDelay",a)):EditorUi.debug("Invalid autosaveDelay",a)}null!=mxSettings.settings.defaultEdgeLength&&(a=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(a)&&0<a?(Graph.prototype.defaultEdgeLength=a,EditorUi.debug("Using defaultEdgeLength",a)):EditorUi.debug("Invalid defaultEdgeLength",a))}}catch(l){null!= -window.console&&console.error(l)}mxResources.loadDefaultBundle=!1;c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,e){EditorUi.logError("Global: "+(null!=a?a:""),b,c,d,e)};if("1"==urlParams.embed||"1"==urlParams.lightbox){var g=document.getElementById("geInfo");null!=g&&g.parentNode.removeChild(g)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0, +window.console&&console.error(l)}mxResources.loadDefaultBundle=!1;d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,e){EditorUi.logError("Global: "+(null!=a?a:""),b,c,d,e)};if("1"==urlParams.embed||"1"==urlParams.lightbox){var g=document.getElementById("geInfo");null!=g&&g.parentNode.removeChild(g)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0, 42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{"serviceWorker"in navigator&&("1"==urlParams.offline?(mxscript("js/shapes.min.js"),mxscript("js/stencils.min.js"),mxscript("js/extensions.min.js"),window.addEventListener("load",function(){navigator.serviceWorker.register("/service-worker.js")})):"0"==urlParams.offline?navigator.serviceWorker.getRegistrations().then(function(a){for(var b=0;b<a.length;b++)a[b].unregister()}):navigator.serviceWorker.controller&&window.addEventListener("load", function(){navigator.serviceWorker.register("/service-worker.js")}))}catch(f){null!=window.console&&console.error(f)}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){g=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&& isLocalStorage&&"undefined"!==typeof JSON)try{var e=JSON.parse(localStorage.getItem(mxSettings.key));null!=e&&(g=e.plugins)}catch(f){}e=urlParams.p;App.initPluginCallback();null!=e&&App.loadPlugins(e.split(";"));if(null!=g&&0<g.length&&"0"!=urlParams.plugins){for(var e=window.location.protocol+"//"+window.location.host,k=!0,n=0;n<g.length&&k;n++)"/"!=g[n].charAt(0)&&g[n].substring(0,e.length)!=e&&(k=!1);if(k||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n", @@ -9523,13 +9524,13 @@ App.prototype.formatShowImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgo App.prototype.formatHideImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdCREY5REI1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdCREY5REM1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0JERjlEOTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0JERjlEQTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqjT9SMAAAAGUExURQAAAP///6XZn90AAAACdFJOU/8A5bcwSgAAAB9JREFUeNpiYEQDDEQJMMABTAAmNdAC6A4j0XMAAQYAcbwA1Xvj1CgAAAAASUVORK5CYII=":IMAGE_PATH+ "/format-hide.png";App.prototype.fullscreenImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjgAAbGxAy4AEh5gNwBBGByoIBAIueBd12TUjqAAAAAElFTkSuQmCC":IMAGE_PATH+"/fullscreen.png";App.prototype.warnInterval=3E5;"1"!=urlParams.embed?App.prototype.menubarHeight=64:App.prototype.footerHeight=0;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(a){App.DrawPlugins.push(a)})}; App.pluginsLoaded={};App.embedModePluginsCount=0; -App.loadPlugins=function(a,d){EditorUi.debug("Loading plugins",a);for(var c=0;c<a.length;c++)if(null!=a[c]&&0<a[c].length)try{var b=App.pluginRegistry[a[c]];null!=b?null==App.pluginsLoaded[b]&&(App.pluginsLoaded[b]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?d?mxinclude(b):mxscript(b):d?mxinclude(b):mxscript(drawDevUrl+b)):null!=window.console&&console.log("Unknown plugin:",a[c])}catch(g){null!=window.console&&console.log("Error loading plugin:",a[c],g)}}; +App.loadPlugins=function(a,c){EditorUi.debug("Loading plugins",a);for(var d=0;d<a.length;d++)if(null!=a[d]&&0<a[d].length)try{var b=App.pluginRegistry[a[d]];null!=b?null==App.pluginsLoaded[b]&&(App.pluginsLoaded[b]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?c?mxinclude(b):mxscript(b):c?mxinclude(b):mxscript(drawDevUrl+b)):null!=window.console&&console.log("Unknown plugin:",a[d])}catch(g){null!=window.console&&console.log("Error loading plugin:",a[d],g)}}; App.prototype.initializeEmbedMode=function(){"1"!=urlParams.embed||0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments))};App.prototype.initializeViewerMode=function(){var a=window.opener||window.parent;null!=a&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){a.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))}; App.prototype.init=function(){EditorUi.prototype.init.apply(this,arguments);this.defaultLibraryName=mxResources.get("untitledLibrary");this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);this.gitHub=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this);null!=this.gitHub&&this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})); this.gitLab=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this);null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()}));if("1"!=urlParams.embed||"1"==urlParams.od){var a=mxUtils.bind(this,function(){"undefined"!==typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged", -mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=a)});a()}if("1"!=urlParams.embed||"1"==urlParams.tr){var d=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})), -this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(k){null!=window.console&&console.error(k)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=d)});d()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var c=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,function(){this.drive=new DriveClient(this);this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries();this.checkLicense()})); -this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.db){var b=mxUtils.bind(this,function(){if("function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this), +mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=a)});a()}if("1"!=urlParams.embed||"1"==urlParams.tr){var c=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})), +this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(k){null!=window.console&&console.error(k)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var d=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,function(){this.drive=new DriveClient(this);this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries();this.checkLicense()})); +this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=d)});d()}if("1"!=urlParams.embed||"1"==urlParams.db){var b=mxUtils.bind(this,function(){if("function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this), this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(k){null!=window.console&&console.error(k)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=b)});b()}if("1"!=urlParams.embed){this.bg=this.createBackground();document.body.appendChild(this.bg);this.diagramContainer.style.visibility="hidden";this.formatContainer.style.visibility= "hidden";this.hsplit.style.display="none";this.sidebarContainer.style.display="none";this.sidebarFooterContainer.style.display="none";"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode;if("1"==urlParams.offline&&"serviceWorker"in navigator&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var g=null;window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(a){if(!(this.footerShowing||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeAddToHomeScreenFooter)){g= a;var b=mxUtils.bind(this,function(){c.parentNode.removeChild(c);this.footerShowing=!1;g=null;isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeAddToHomeScreenFooter=Date.now(),mxSettings.save())}),c=this.createBanner('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="'+IMAGE_PATH+'/logo.png"><font size="3" style="color:#ffffff;">'+mxUtils.htmlEntities(mxResources.get("installDrawio",null,"Install draw.io"))+ @@ -9540,107 +9541,111 @@ action:"timeout",label:408})}),Editor.cacheTimeout);(new Date).getTime();mxUtils "0px",this.menubar.container.appendChild(this.buttonContainer));"atlas"==uiTheme&&null!=this.menubar&&(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display="none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.style.padding="6px",this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(a){this.appIconClicked(a)})), mxClient.IS_QUIRKS&&(this.icon.style.marginTop="12px"),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild));this.editor.graph.isViewer()&&this.initializeViewerMode()};App.prototype.scheduleSanityCheck=function(){null==this.sanityCheckThread&&(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,function(){this.sanityCheckThread=null;this.sanityCheck()}),this.warnInterval))}; App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)}; -App.prototype.sanityCheck=function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()&&a.isAutosave()&&a.isOverdue()){var d={category:"WARN-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!= -a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};a.constructor==DriveFile&&null!=a.desc&&null!=this.drive&&(d.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+a.desc.headRevisionId+ -"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType);EditorUi.logEvent(d);d=mxResources.get("ensureDataSaved");null!=a.lastSaved&&(d=this.timeSince(a.lastSaved),null==d&&(d=mxResources.get("lessThanAMinute")),d=mxResources.get("lastSaved",[d]));this.spinner.stop();this.showError(mxResources.get("unsavedChanges"),d,mxResources.get("ignore"),mxUtils.bind(this,function(){this.hideDialog()}),null,mxResources.get("save"),mxUtils.bind(this,function(){this.stopSanityCheck();this.actions.get(null!= +App.prototype.sanityCheck=function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()&&a.isAutosave()&&a.isOverdue()){var c={category:"WARN-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!= +a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};a.constructor==DriveFile&&null!=a.desc&&null!=this.drive&&(c.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+a.desc.headRevisionId+ +"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType);EditorUi.logEvent(c);c=mxResources.get("ensureDataSaved");null!=a.lastSaved&&(c=this.timeSince(a.lastSaved),null==c&&(c=mxResources.get("lessThanAMinute")),c=mxResources.get("lastSaved",[c]));this.spinner.stop();this.showError(mxResources.get("unsavedChanges"),c,mxResources.get("ignore"),mxUtils.bind(this,function(){this.hideDialog()}),null,mxResources.get("save"),mxUtils.bind(this,function(){this.stopSanityCheck();this.actions.get(null!= this.mode&&a.isEditable()?"save":"saveAs").funct()}),null,null,360,120,null,mxUtils.bind(this,function(){this.scheduleSanityCheck()}))}};App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname||"jgraph.github.io"==window.location.hostname)}; App.prototype.getPusher=function(){null==this.pusher&&"function"===typeof window.Pusher&&(this.pusher=new Pusher(App.PUSHER_KEY,{cluster:App.PUSHER_CLUSTER,encrypted:!0}));return this.pusher}; -App.prototype.showDownloadDesktopBanner=function(){if(!(this.downloadDesktopFooterShown||this.footerShowing||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeDesktopFooter)){this.downloadDesktopFooterShown=!0;var a=mxUtils.bind(this,function(){d.parentNode.removeChild(d);this.footerShowing=!1;isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeDesktopFooter=Date.now(),mxSettings.save())}),d=this.createBanner('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="'+ -IMAGE_PATH+'/logo.png"><font size="3" style="color:#ffffff;">'+mxUtils.htmlEntities(mxResources.get("downloadDesktop"))+"</font>","https://get.draw.io/","geStatusMessage geBtn gePrimaryBtn",a,null,a);d.style.zIndex=mxPopupMenu.prototype.zIndex;d.style.padding="18px 50px 12px 30px";d.getElementsByTagName("img")[1].style.filter="invert(1)";document.body.appendChild(d);this.footerShowing=!0;window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(d.style,"transform","translate(-50%,0%)")}), -500);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(d.style,"transform","translate(-50%,110%)");this.footerShowing=!1}),6E4);mxUtils.get("https://api.github.com/repos/jgraph/drawio-desktop/releases/latest",mxUtils.bind(this,function(a){try{var b=d.getElementsByTagName("a")[0],c=JSON.parse(a.getText());null!=c&&null!=c.tag_name&&null!=c.name&&null!=c.html_url&&(mxClient.IS_MAC?b.setAttribute("href","https://github.com/jgraph/drawio-desktop/releases/download/"+c.tag_name+"/draw.io-"+ -c.name+".dmg"):mxClient.IS_WIN&&b.setAttribute("href","https://github.com/jgraph/drawio-desktop/releases/download/"+c.tag_name+"/draw.io-"+c.name+"-windows-installer.exe"))}catch(e){}}))}}; -App.prototype.createBanner=function(a,d,c,b,g,e,k){var n=document.createElement("div");n.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";n.className=c;c="geStatusAlert"==c?'<img src="'+mxClient.imageBasePath+'/warning.gif" border="0" style="margin-top:-4px;margin-right:8px;margin-left:8px;" valign="middle"/>':"";mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(n.style,"transition", -"all 1s ease");n.style.whiteSpace="nowrap";n.innerHTML='<a href="'+(null!=d?d:"javascript:void(0)")+'" '+(k?"":'target="_blank" ')+'style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">'+c+a+c+"</a>"+(null!=g?'<a href="'+g+'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>':"");a=document.createElement("img");a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("close")); +App.prototype.showDiagramsDotNetBanner=function(){if(!(this.diagramsNetFooterShown||this.footerShowing||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeDiagramsFooter)){this.diagramsNetFooterShown=!0;var a=mxUtils.bind(this,function(){c.parentNode.removeChild(c);this.footerShowing=!1;isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeDiagramsFooter=Date.now(),mxSettings.save())}),c=this.createBanner('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="'+ +IMAGE_PATH+'/logo.png"><font size="3" style="color:#ffffff;">draw.io is now diagrams.net</font>',"https://www.diagrams.net/blog/move-diagrams-net","geStatusMessage geBtn gePrimaryBtn",a,null,mxUtils.bind(this,function(){window.open("https://www.diagrams.net/blog/move-diagrams-net");a()}));c.style.zIndex=mxPopupMenu.prototype.zIndex;c.style.padding="18px 50px 12px 30px";c.getElementsByTagName("img")[1].style.filter="invert(1)";document.body.appendChild(c);this.footerShowing=!0;window.setTimeout(mxUtils.bind(this, +function(){mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,110%)");this.footerShowing=!1}),2E4)}}; +App.prototype.showDownloadDesktopBanner=function(){if(!(this.downloadDesktopFooterShown||this.footerShowing||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeDesktopFooter)){this.downloadDesktopFooterShown=!0;var a=mxUtils.bind(this,function(){c.parentNode.removeChild(c);this.footerShowing=!1;isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeDesktopFooter=Date.now(),mxSettings.save())}),c=this.createBanner('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="'+ +IMAGE_PATH+'/logo.png"><font size="3" style="color:#ffffff;">'+mxUtils.htmlEntities(mxResources.get("downloadDesktop"))+"</font>","https://get.draw.io/","geStatusMessage geBtn gePrimaryBtn",a,null,a);c.style.zIndex=mxPopupMenu.prototype.zIndex;c.style.padding="18px 50px 12px 30px";c.getElementsByTagName("img")[1].style.filter="invert(1)";document.body.appendChild(c);this.footerShowing=!0;window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0%)")}), +500);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,110%)");this.footerShowing=!1}),6E4);mxUtils.get("https://api.github.com/repos/jgraph/drawio-desktop/releases/latest",mxUtils.bind(this,function(a){try{var b=c.getElementsByTagName("a")[0],d=JSON.parse(a.getText());null!=d&&null!=d.tag_name&&null!=d.name&&null!=d.html_url&&(mxClient.IS_MAC?b.setAttribute("href","https://github.com/jgraph/drawio-desktop/releases/download/"+d.tag_name+"/draw.io-"+ +d.name+".dmg"):mxClient.IS_WIN&&b.setAttribute("href","https://github.com/jgraph/drawio-desktop/releases/download/"+d.tag_name+"/draw.io-"+d.name+"-windows-installer.exe"))}catch(e){}}))}}; +App.prototype.createBanner=function(a,c,d,b,g,e,k){var n=document.createElement("div");n.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";n.className=d;d="geStatusAlert"==d?'<img src="'+mxClient.imageBasePath+'/warning.gif" border="0" style="margin-top:-4px;margin-right:8px;margin-left:8px;" valign="middle"/>':"";mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(n.style,"transition", +"all 1s ease");n.style.whiteSpace="nowrap";n.innerHTML='<a href="'+(null!=c?c:"javascript:void(0)")+'" '+(k?"":'target="_blank" ')+'style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">'+d+a+d+"</a>"+(null!=g?'<a href="'+g+'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>':"");a=document.createElement("img");a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("close")); a.style.position="absolute";a.style.cursor="pointer";a.style.right="10px";a.style.top="12px";n.appendChild(a);b&&mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){b(a);mxEvent.consume(a)}));null!=e&&(n.style.paddingRight="40px",mxEvent.addListener(n,"click",mxUtils.bind(this,function(a){e(a)})));return n}; -App.prototype.checkLicense=function(){var a=this.drive.getUser(),d=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=d){var c=d.lastIndexOf("@"),b=d;0<=c&&(b=d.substring(c+1),d=this.crc32(d.substring(0,c))+"@"+b);mxUtils.post("/license","domain="+encodeURIComponent(b)+"&email="+encodeURIComponent(d)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=a.getStatus()&&299>=a.getStatus()){var c= -a.getText();if(0<c.length){var d=JSON.parse(c);null!=d&&this.handleLicense(d,b)}}}catch(n){}}))}};App.prototype.handleLicense=function(a,d){null!=a&&null!=a.plugins&&App.loadPlugins(a.plugins.split(";"),!0)};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?a.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())}; -App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var d=this.getRecent();if(null==d)d=[];else for(var c=0;c<d.length;c++)d[c].id==a.id&&d.splice(c,1);null!=d&&(d.unshift(a),d=d.slice(0,10),localStorage.setItem(".recent",JSON.stringify(d)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(d){}return null}}; -App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(d){}}; +App.prototype.checkLicense=function(){var a=this.drive.getUser(),c=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=c){var d=c.lastIndexOf("@"),b=c;0<=d&&(b=c.substring(d+1),c=this.crc32(c.substring(0,d))+"@"+b);mxUtils.post("/license","domain="+encodeURIComponent(b)+"&email="+encodeURIComponent(c)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=a.getStatus()&&299>=a.getStatus()){var c= +a.getText();if(0<c.length){var d=JSON.parse(c);null!=d&&this.handleLicense(d,b)}}}catch(n){}}))}};App.prototype.handleLicense=function(a,c){null!=a&&null!=a.plugins&&App.loadPlugins(a.plugins.split(";"),!0)};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?a.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())}; +App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var c=this.getRecent();if(null==c)c=[];else for(var d=0;d<c.length;d++)c[d].id==a.id&&c.splice(d,1);null!=c&&(c.unshift(a),c=c.slice(0,10),localStorage.setItem(".recent",JSON.stringify(c)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(c){}return null}}; +App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(c){}}; App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var a=this.getCurrentFile();if(null!=a)if(a.constructor!=LocalFile||""!=a.getHash()||a.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()){if(a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")}; -App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,d=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=d&&(a=(null!=d.getTitle()?d.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],d,c=0;256>c;c++){d=c;for(var b=0;8>b;b++)d=d&1?3988292384^d>>>1:d>>>1;a[c]=d}return a}; -App.prototype.getThumbnail=function(a,d){var c=!1;try{var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;d(null)}),this.timeout),e=mxUtils.bind(this,function(a){window.clearTimeout(g);b&&d(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var k=this.editor.graph,n=null!=k.themes&&"darkTheme"==k.defaultThemeName;if(null!=this.pages&&(this.currentPage!=this.pages[0]||n)){var m=k.getGlobalVariable,k=this.createTemporaryGraph(n?k.getDefaultStylesheet():k.getStylesheet()),t=this.pages[0]; +App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,c=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=c&&(a=(null!=c.getTitle()?c.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],c,d=0;256>d;d++){c=d;for(var b=0;8>b;b++)c=c&1?3988292384^c>>>1:c>>>1;a[d]=c}return a}; +App.prototype.getThumbnail=function(a,c){var d=!1;try{var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;c(null)}),this.timeout),e=mxUtils.bind(this,function(a){window.clearTimeout(g);b&&c(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var k=this.editor.graph,n=null!=k.themes&&"darkTheme"==k.defaultThemeName;if(null!=this.pages&&(this.currentPage!=this.pages[0]||n)){var m=k.getGlobalVariable,k=this.createTemporaryGraph(n?k.getDefaultStylesheet():k.getStylesheet()),t=this.pages[0]; n&&(k.defaultThemeName="default");k.getGlobalVariable=function(a){return"page"==a?t.getName():"pagenumber"==a?1:m.apply(this,arguments)};k.getGlobalVariable=m;document.body.appendChild(k.container);k.model.setRoot(t.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,function(a){try{k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(A){a=null}e(a)}),a,this.thumbImageCache,"#ffffff",function(){e()},null, -null,null,null,null,null,k),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var f=document.createElement("canvas"),l=k.getGraphBounds(),p=a/l.width,p=Math.min(1,Math.min(3*a/(4*l.height),p)),u=Math.floor(l.x),v=Math.floor(l.y);f.setAttribute("width",Math.ceil(p*(l.width+4)));f.setAttribute("height",Math.ceil(p*(l.height+4)));var q=f.getContext("2d");q.scale(p,p);q.translate(-u,-v);var z=k.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";q.save();q.fillStyle=z;q.fillRect(u, +null,null,null,null,null,k),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var f=document.createElement("canvas"),l=k.getGraphBounds(),p=a/l.width,p=Math.min(1,Math.min(3*a/(4*l.height),p)),u=Math.floor(l.x),v=Math.floor(l.y);f.setAttribute("width",Math.ceil(p*(l.width+4)));f.setAttribute("height",Math.ceil(p*(l.height+4)));var q=f.getContext("2d");q.scale(p,p);q.translate(-u,-v);var z=k.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";q.save();q.fillStyle=z;q.fillRect(u, v,Math.ceil(l.width+4),Math.ceil(l.height+4));q.restore();var y=new mxJsCanvas(f),C=new mxAsyncCanvas(this.thumbImageCache);y.images=this.thumbImageCache.images;var I=new mxImageExport;I.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};I.drawText=function(a,b){};I.drawState(k.getView().getState(k.model.root),C);C.finish(mxUtils.bind(this,function(){try{I.drawState(k.getView().getState(k.model.root), -y),k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(x){f=null}e(f)}));c=!0}}catch(x){c=!1,null!=k&&k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}return c}; +y),k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(x){f=null}e(f)}));d=!0}}catch(x){d=!1,null!=k&&k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}return d}; App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a}; -(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(d,c){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var b=this.getCurrentFile();d=null!=b?b.getMode():d;d==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):d==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])), -this.appIcon.style.cursor="pointer"):d==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=d==App.MODE_DEVICE?"pointer":"default")}if(c)try{if(isLocalStorage)localStorage.setItem(".mode",d);else if("undefined"!=typeof Storage){var g=new Date;g.setYear(g.getFullYear()+1);document.cookie="MODE="+d+"; expires="+g.toUTCString()}}catch(e){}}})(); -App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var d=this.getCurrentFile(),c=null!=d?d.getMode():null;c==App.MODE_GOOGLE?null!=d&&null!=d.desc&&null!=d.desc.parents&&0<d.desc.parents.length&&!mxEvent.isShiftDown(a)?this.openLink("https://drive.google.com/drive/folders/"+d.desc.parents[0].id):null!=d&&null!=d.getId()?this.openLink("https://drive.google.com/open?id="+d.getId()):this.openLink("https://drive.google.com/?authuser=0"):c==App.MODE_ONEDRIVE?null!= -d&&null!=d.meta&&null!=d.meta.webUrl?(c=d.meta.webUrl,d=encodeURIComponent(d.meta.name),c.substring(c.length-d.length,c.length)==d&&(c=c.substring(0,c.length-d.length)),this.openLink(c)):this.openLink("https://onedrive.live.com/"):c==App.MODE_DROPBOX?null!=d&&null!=d.stat&&null!=d.stat.path_display?(c="https://www.dropbox.com/home/Apps/drawio"+d.stat.path_display,mxEvent.isShiftDown(a)||(c=c.substring(0,c.length-d.stat.name.length)),this.openLink(c)):this.openLink("https://www.dropbox.com/"):c==App.MODE_TRELLO? -this.openLink("https://trello.com/"):c==App.MODE_GITHUB?null!=d&&d.constructor==GitHubFile?this.openLink(d.meta.html_url):this.openLink("https://github.com/"):c==App.MODE_GITLAB?null!=d&&d.constructor==GitLabFile?this.openLink(d.meta.html_url):this.openLink(DRAWIO_GITLAB_URL):c==App.MODE_DEVICE&&this.openLink("https://get.draw.io/")}mxEvent.consume(a)}; -App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie="MODE=; expires="+a.toUTCString()}};App.prototype.getDiagramId=function(){var a=window.location.hash;null!=a&&0<a.length&&(a=a.substring(1));if(null!=a&&1<a.length&&"T"==a.charAt(0)){var d=a.indexOf("#");0<d&&(a=a.substring(0,d))}return a}; -App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create;null!=a&&(a=decodeURIComponent(a));if(null!=a&&0<a.length&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)){var d=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(d.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b,d){this.spinner.stop();null==b&&(b=urlParams.title,d=!0,b=null!=b?decodeURIComponent(b):this.defaultFilename);0<(this.useCanvasForExport? --1:".png"==b.substring(b.length-4))&&(b=b.substring(0,b.length-4)+".drawio");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,b):new LocalFile(this,a,b,d))}))}}catch(c){}};App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a)}; +(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(c,d){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var b=this.getCurrentFile();c=null!=b?b.getMode():c;c==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):c==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])), +this.appIcon.style.cursor="pointer"):c==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=c==App.MODE_DEVICE?"pointer":"default")}if(d)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var g=new Date;g.setYear(g.getFullYear()+1);document.cookie="MODE="+c+"; expires="+g.toUTCString()}}catch(e){}}})(); +App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var c=this.getCurrentFile(),d=null!=c?c.getMode():null;d==App.MODE_GOOGLE?null!=c&&null!=c.desc&&null!=c.desc.parents&&0<c.desc.parents.length&&!mxEvent.isShiftDown(a)?this.openLink("https://drive.google.com/drive/folders/"+c.desc.parents[0].id):null!=c&&null!=c.getId()?this.openLink("https://drive.google.com/open?id="+c.getId()):this.openLink("https://drive.google.com/?authuser=0"):d==App.MODE_ONEDRIVE?null!= +c&&null!=c.meta&&null!=c.meta.webUrl?(d=c.meta.webUrl,c=encodeURIComponent(c.meta.name),d.substring(d.length-c.length,d.length)==c&&(d=d.substring(0,d.length-c.length)),this.openLink(d)):this.openLink("https://onedrive.live.com/"):d==App.MODE_DROPBOX?null!=c&&null!=c.stat&&null!=c.stat.path_display?(d="https://www.dropbox.com/home/Apps/drawio"+c.stat.path_display,mxEvent.isShiftDown(a)||(d=d.substring(0,d.length-c.stat.name.length)),this.openLink(d)):this.openLink("https://www.dropbox.com/"):d==App.MODE_TRELLO? +this.openLink("https://trello.com/"):d==App.MODE_GITHUB?null!=c&&c.constructor==GitHubFile?this.openLink(c.meta.html_url):this.openLink("https://github.com/"):d==App.MODE_GITLAB?null!=c&&c.constructor==GitLabFile?this.openLink(c.meta.html_url):this.openLink(DRAWIO_GITLAB_URL):d==App.MODE_DEVICE&&this.openLink("https://get.draw.io/")}mxEvent.consume(a)}; +App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie="MODE=; expires="+a.toUTCString()}};App.prototype.getDiagramId=function(){var a=window.location.hash;null!=a&&0<a.length&&(a=a.substring(1));if(null!=a&&1<a.length&&"T"==a.charAt(0)){var c=a.indexOf("#");0<c&&(a=a.substring(0,c))}return a}; +App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create;null!=a&&(a=decodeURIComponent(a));if(null!=a&&0<a.length&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)){var c=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(c.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b,c){this.spinner.stop();null==b&&(b=urlParams.title,c=!0,b=null!=b?decodeURIComponent(b):this.defaultFilename);0<(this.useCanvasForExport? +-1:".png"==b.substring(b.length-4))&&(b=b.substring(0,b.length-4)+".drawio");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,b):new LocalFile(this,a,b,c))}))}}catch(d){}};App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a)}; App.prototype.load=function(){if("1"!=urlParams.embed){if(this.spinner.spin(document.body,mxResources.get("starting"))){try{this.stateArg=null!=urlParams.state&&null!=this.drive?JSON.parse(decodeURIComponent(urlParams.state)):null}catch(a){}this.editor.graph.setEnabled(null!=this.getCurrentFile());null!=window.location.hash&&0!=window.location.hash.length||null==this.drive||null==this.stateArg||null==this.stateArg.userId||this.drive.setUserId(this.stateArg.userId);null!=urlParams.fileId?(window.location.hash= "G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,function(){this.start()}))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})}; -App.prototype.showRefreshDialog=function(a,d){if(!this.showingRefreshDialog&&(this.showingRefreshDialog=!0,this.showError(a||mxResources.get("externalChanges"),d||mxResources.get("redirectToNewApp"),mxResources.get("refresh"),mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.setModified(!1);this.spinner.spin(document.body,mxResources.get("connecting"));this.editor.graph.setEnabled(!1);window.location.reload()}),null,null,null,null,null,340,180),null!=this.dialog&&null!=this.dialog.container)){var c= -this.createRealtimeNotice();c.style.left="0";c.style.right="0";c.style.borderRadius="0";c.style.borderLeftStyle="none";c.style.borderRightStyle="none";c.style.marginBottom="26px";c.style.padding="8px 0 8px 0";this.dialog.container.appendChild(c)}}; -App.prototype.showAlert=function(a){if(null!=a&&0<a.length){var d=document.createElement("div");d.className="geAlert";d.style.zIndex=2E9;d.style.left="50%";d.style.top="-100%";mxUtils.setPrefixedStyle(d.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(d.style,"transition","all 1s ease");d.innerHTML=a;a=document.createElement("a");a.className="geAlertLink";a.style.textAlign="right";a.style.marginTop="20px";a.style.display="block";a.setAttribute("title",mxResources.get("close"));a.innerHTML= -mxResources.get("close");d.appendChild(a);mxEvent.addListener(a,"click",function(a){null!=d.parentNode&&(d.parentNode.removeChild(d),mxEvent.consume(a))});document.body.appendChild(d);window.setTimeout(function(){d.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(d.style,"transition","all 2s ease");d.style.opacity="0";window.setTimeout(function(){null!=d.parentNode&&d.parentNode.removeChild(d)},2E3)},15E3)}}; +App.prototype.showRefreshDialog=function(a,c){if(!this.showingRefreshDialog&&(this.showingRefreshDialog=!0,this.showError(a||mxResources.get("externalChanges"),c||mxResources.get("redirectToNewApp"),mxResources.get("refresh"),mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.setModified(!1);this.spinner.spin(document.body,mxResources.get("connecting"));this.editor.graph.setEnabled(!1);window.location.reload()}),null,null,null,null,null,340,180),null!=this.dialog&&null!=this.dialog.container)){var d= +this.createRealtimeNotice();d.style.left="0";d.style.right="0";d.style.borderRadius="0";d.style.borderLeftStyle="none";d.style.borderRightStyle="none";d.style.marginBottom="26px";d.style.padding="8px 0 8px 0";this.dialog.container.appendChild(d)}}; +App.prototype.showAlert=function(a){if(null!=a&&0<a.length){var c=document.createElement("div");c.className="geAlert";c.style.zIndex=2E9;c.style.left="50%";c.style.top="-100%";mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(c.style,"transition","all 1s ease");c.innerHTML=a;a=document.createElement("a");a.className="geAlertLink";a.style.textAlign="right";a.style.marginTop="20px";a.style.display="block";a.setAttribute("title",mxResources.get("close"));a.innerHTML= +mxResources.get("close");c.appendChild(a);mxEvent.addListener(a,"click",function(a){null!=c.parentNode&&(c.parentNode.removeChild(c),mxEvent.consume(a))});document.body.appendChild(c);window.setTimeout(function(){c.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(c.style,"transition","all 2s ease");c.style.opacity="0";window.setTimeout(function(){null!=c.parentNode&&c.parentNode.removeChild(c)},2E3)},15E3)}}; App.prototype.start=function(){var a=this;window.onerror=function(b,c,d,g,t){EditorUi.logError("Uncaught: "+(null!=b?b:""),c,d,g,t);a.handleError({message:b},mxResources.get("unknownError"),null,null,null,null,!0)};null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);this.restoreLibraries();this.spinner.stop();try{if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(a){var b=this.getCurrentFile(); -EditorUi.debug("storage event",a,b);null!=b&&".draft-alive-check"==a.key&&null!=a.newValue&&null!=b.draftId&&(this.draftAliveCheck=a.newValue,b.saveDraft())}))}catch(e){}mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{this.hideDialog();var b=this.getDiagramId(),c=this.getCurrentFile();null!=c&&c.getHash()==b||this.loadFile(b,!0)}catch(m){null!=document.body&&this.handleError(m,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash= -null!=a?a.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var d=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a=mxUtils.bind(this,function(a){"data:image/png;base64,"==a.substring(0,22)&&(a=this.extractGraphModelFromPng(a));var b=urlParams.title,b=null!= -b?decodeURIComponent(b):this.defaultFilename;a=new LocalFile(this,a,b,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(a.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(a);this.getCurrentFile().setModified(!this.editor.chromeless)}),b=window.opener||window.parent;if(b!=window){var c=urlParams.create;null!=c?a(b[decodeURIComponent(c)]):(c=urlParams.data,null!=c?a(decodeURIComponent(c)):this.installMessageHandler(mxUtils.bind(this,function(c, -d){d.source==b&&a(c)})))}}else if(null==this.dialog)if("1"==urlParams.demo)c=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=c;else{c=!1;try{c=null!=window.opener&&null!=window.opener.openFile}catch(m){}c?this.spinner.spin(document.body,mxResources.get("loading")):(c=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=c&&0!=c.length?"0"!=urlParams.splash?this.loadFile(c):this.createFile(this.defaultFilename, -this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=c&&0<c.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),g=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this, -a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var b=urlParams.title,b=null!=b?decodeURIComponent(b):this.defaultFilename;a=this.getServiceCount(!0);isLocalStorage&&a++;var c=4>=a?2:6<a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage;this.createFile(0<a.length?a:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=c}else this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a, -this.getFileData(!0),null,b,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c,null,null,null,this.editor.fileExtensions);this.showDialog(b.container,400,a>c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8))try{null!=window.opener&&null!=window.opener[c]?g(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e, -mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){g(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),window.location.hash="G"+this.stateArg.ids[0]): -(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):d()}}catch(e){this.handleError(e)}};App.prototype.loadDraft=function(a,d){this.createFile(this.defaultFilename,a,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a.fileChanged(),null!=d&&d())}),0)}),null,null,!0)}; -App.prototype.checkDrafts=function(){try{var a=Editor.guid();localStorage.setItem(".draft-alive-check",a);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.getDatabaseItems(mxUtils.bind(this,function(d){for(var c=[],b=0;b<d.length;b++)try{var g=d[b].key;if(null!=g&&".draft_"==g.substring(0,7)){var e=JSON.parse(d[b].data);null!=e&&"draft"==e.type&&e.aliveCheck!=a&&(e.key=g,c.push(e))}}catch(k){}1==c.length?this.loadDraft(c[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(c[0].key)})): -1<c.length?(d=new Date(c[0].modified),d=new DraftDialog(this,1<c.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[d.toLocaleDateString()+" "+d.toLocaleTimeString()]),1<c.length?null:c[0].data,mxUtils.bind(this,function(a){this.hideDialog();a=""!=a?a:0;this.loadDraft(c[a].data,mxUtils.bind(this,function(){this.removeDatabaseItem(c[a].key)}))}),mxUtils.bind(this,function(a,b){a=""!=a?a:0;this.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){this.removeDatabaseItem(c[a].key); -null!=b&&b()}),mxResources.get("no"),mxResources.get("yes"))}),null,null,null,1<c.length?c:null),this.showDialog(d.container,640,480,!0,!1,mxUtils.bind(this,function(a){"0"==urlParams.splash?this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.loadFile()})),d.init()):"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}),mxUtils.bind(this,function(){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename, -this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(d){}}; -App.prototype.showSplash=function(a){var d=this.getServiceCount(!0,!0),c=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=a)}),!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()||this.mode!= -App.MODE_DEVICE&&this.mode!=App.MODE_BROWSER||this.showDownloadDesktopBanner()});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&c();else{a=4==d?2:3;var b=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();c()}),a);this.showDialog(b.container,3>a?240:300,4<=d?440:this.isOfflineApp()? +EditorUi.debug("storage event",a,b);null!=b&&".draft-alive-check"==a.key&&null!=a.newValue&&null!=b.draftId&&(this.draftAliveCheck=a.newValue,b.saveDraft())})),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()||this.editor.chromeless&&!this.editor.editable||this.showDiagramsDotNetBanner()}catch(e){}mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{this.hideDialog();var b=this.getDiagramId(),c=this.getCurrentFile();null!=c&&c.getHash()==b||this.loadFile(b,!0)}catch(m){null!= +document.body&&this.handleError(m,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var c=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a= +mxUtils.bind(this,function(a){"data:image/png;base64,"==a.substring(0,22)&&(a=this.extractGraphModelFromPng(a));var b=urlParams.title,b=null!=b?decodeURIComponent(b):this.defaultFilename;a=new LocalFile(this,a,b,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(a.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(a);this.getCurrentFile().setModified(!this.editor.chromeless)}),b=window.opener||window.parent;if(b!=window){var c=urlParams.create;null!= +c?a(b[decodeURIComponent(c)]):(c=urlParams.data,null!=c?a(decodeURIComponent(c)):this.installMessageHandler(mxUtils.bind(this,function(c,d){d.source==b&&a(c)})))}}else if(null==this.dialog)if("1"==urlParams.demo)c=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=c;else{c=!1;try{c=null!=window.opener&&null!=window.opener.openFile}catch(m){}c?this.spinner.spin(document.body,mxResources.get("loading")):(c=this.getDiagramId(),!EditorUi.enableDrafts|| +null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=c&&0!=c.length?"0"!=urlParams.splash?this.loadFile(c):this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),d=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=d&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&& +(window.location.search=this.getSearch(["create","title"]))}),g=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var b=urlParams.title,b=null!=b?decodeURIComponent(b):this.defaultFilename;a=this.getServiceCount(!0);isLocalStorage&&a++;var c=4>=a?2:6<a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage; +this.createFile(0<a.length?a:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=c}else this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,this.getFileData(!0),null,b,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c,null,null,null,this.editor.fileExtensions);this.showDialog(b.container,400,a>c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),d=decodeURIComponent(d); +if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{null!=window.opener&&null!=window.opener[d]?g(window.opener[d]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(a){g(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"== +this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):c()}}catch(e){this.handleError(e)}}; +App.prototype.loadDraft=function(a,c){this.createFile(this.defaultFilename,a,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a.fileChanged(),null!=c&&c())}),0)}),null,null,!0)}; +App.prototype.checkDrafts=function(){try{var a=Editor.guid();localStorage.setItem(".draft-alive-check",a);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.getDatabaseItems(mxUtils.bind(this,function(c){for(var d=[],b=0;b<c.length;b++)try{var g=c[b].key;if(null!=g&&".draft_"==g.substring(0,7)){var e=JSON.parse(c[b].data);null!=e&&"draft"==e.type&&e.aliveCheck!=a&&(e.key=g,d.push(e))}}catch(k){}1==d.length?this.loadDraft(d[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(d[0].key)})): +1<d.length?(c=new Date(d[0].modified),c=new DraftDialog(this,1<d.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[c.toLocaleDateString()+" "+c.toLocaleTimeString()]),1<d.length?null:d[0].data,mxUtils.bind(this,function(a){this.hideDialog();a=""!=a?a:0;this.loadDraft(d[a].data,mxUtils.bind(this,function(){this.removeDatabaseItem(d[a].key)}))}),mxUtils.bind(this,function(a,b){a=""!=a?a:0;this.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){this.removeDatabaseItem(d[a].key); +null!=b&&b()}),mxResources.get("no"),mxResources.get("yes"))}),null,null,null,1<d.length?d:null),this.showDialog(c.container,640,480,!0,!1,mxUtils.bind(this,function(a){"0"==urlParams.splash?this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.loadFile()})),c.init()):"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}),mxUtils.bind(this,function(){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename, +this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(c){}}; +App.prototype.showSplash=function(a){var c=this.getServiceCount(!0,!0),d=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=a)}),!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()||this.mode!= +App.MODE_DEVICE&&this.mode!=App.MODE_BROWSER||this.showDownloadDesktopBanner()});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&d();else{a=4==c?2:3;var b=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();d()}),a);this.showDialog(b.container,3>a?240:300,4<=c?440:this.isOfflineApp()? 300:320,!0,!1);b.init()}}; -App.prototype.addLanguageMenu=function(a,d){var c=null;if(null!=this.menus.get("language")){c=document.createElement("div");c.setAttribute("title",mxResources.get("language"));c.className="geIcon geSprite geSprite-globe";c.style.position="absolute";c.style.cursor="pointer";c.style.bottom="20px";c.style.right="20px";if(d){c.style.direction="rtl";c.style.textAlign="right";c.style.right="24px";var b=document.createElement("span");b.style.display="inline-block";b.style.fontSize="12px";b.style.margin= -"5px 24px 0 0";b.style.color="gray";b.style.userSelect="none";mxUtils.write(b,mxResources.get("language"));c.appendChild(b)}mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var d=mxUtils.getOffset(c); -b.popup(d.x,d.y+c.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(c)}return c}; -App.prototype.pickFile=function(a){try{if(a=null!=a?a:this.mode,a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var d=this.getPeerForMode(a);if(null!=d)d.pickFile();else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&& -(this.openFiles(c.files),c.type="",c.type="file",c.value="")}));c.style.display="none";document.body.appendChild(c);this.openFileInputElt=c}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var b=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,c){this.useCanvasForExport||".png"!=c.substring(c.length- +App.prototype.addLanguageMenu=function(a,c){var d=null;if(null!=this.menus.get("language")){d=document.createElement("div");d.setAttribute("title",mxResources.get("language"));d.className="geIcon geSprite geSprite-globe";d.style.position="absolute";d.style.cursor="pointer";d.style.bottom="20px";d.style.right="20px";if(c){d.style.direction="rtl";d.style.textAlign="right";d.style.right="24px";var b=document.createElement("span");b.style.display="inline-block";b.style.fontSize="12px";b.style.margin= +"5px 24px 0 0";b.style.color="gray";b.style.userSelect="none";mxUtils.write(b,mxResources.get("language"));d.appendChild(b)}mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var c=mxUtils.getOffset(d); +b.popup(c.x,c.y+d.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(d)}return d}; +App.prototype.pickFile=function(a){try{if(a=null!=a?a:this.mode,a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var c=this.getPeerForMode(a);if(null!=c)c.pickFile();else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){null!=d.files&& +(this.openFiles(d.files),d.type="",d.type="file",d.value="")}));d.style.display="none";document.body.appendChild(d);this.openFileInputElt=d}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var b=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,c){this.useCanvasForExport||".png"!=c.substring(c.length- 4)||(c=c.substring(0,c.length-4)+".drawio");this.fileLoaded(a==App.MODE_BROWSER?new StorageFile(this,b,c):new LocalFile(this,b,c))}));var g=this.dialog,e=g.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=b;e.apply(g,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(k){this.handleError(k)}}; -App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_GITLAB||a==App.MODE_TRELLO){var d=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_GITLAB?this.gitLab:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=d&&d.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body, -mxResources.get("loading"))&&d.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){if(null!= -c.files){for(var a=0;a<c.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(c.files[a]);c.type="";c.type="file";c.value=""}}));c.style.display="none";document.body.appendChild(c);this.libFileInputElt=c}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";var b=Editor.useLocalStorage; +App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_GITLAB||a==App.MODE_TRELLO){var c=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_GITLAB?this.gitLab:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=c&&c.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body, +mxResources.get("loading"))&&c.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if(null!= +d.files){for(var a=0;a<d.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(d.files[a]);d.type="";d.type="file";d.value=""}}));d.style.display="none";document.body.appendChild(d);this.libFileInputElt=d}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";var b=Editor.useLocalStorage; Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,c){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,c):new LocalLibrary(this,b,c))}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage= b;window.openFile=null})}}; -App.prototype.saveLibrary=function(a,d,c,b,g,e,k){try{b=null!=b?b:this.mode;g=null!=g?g:!1;e=null!=e?e:!1;var n=this.createLibraryDataFromImages(d),m=mxUtils.bind(this,function(a){this.spinner.stop();null!=k&&k();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==c&&b==App.MODE_DEVICE&&(c=new LocalLibrary(this,n,a));if(null==c)this.pickFolder(b,mxUtils.bind(this,function(c){b==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a, -n,c,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),m,this.drive.libraryMimeType):b==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),m,c):b==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(a,n,mxUtils.bind(this, -function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),m,c):b==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),m,c):b==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0); -this.libraryLoaded(a,d)}),m,c):b==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,d)}),m,c):b==App.MODE_BROWSER?(c=mxUtils.bind(this,function(){var b=new StorageLibrary(this,n,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,d)}),m)}),null==localStorage.getItem(a)?c():this.confirm(mxResources.get("replaceIt", -[a]),c)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(g||this.spinner.spin(document.body,mxResources.get("saving"))){c.setData(n);var t=mxUtils.bind(this,function(){c.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);e||this.libraryLoaded(c,d);null!=k&&k()}),m)});if(a!=c.getTitle()){var f=c.getHash();c.rename(a,mxUtils.bind(this,function(a){c.constructor!=LocalLibrary&&f!=c.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(c.getHash())); +App.prototype.saveLibrary=function(a,c,d,b,g,e,k){try{b=null!=b?b:this.mode;g=null!=g?g:!1;e=null!=e?e:!1;var n=this.createLibraryDataFromImages(c),m=mxUtils.bind(this,function(a){this.spinner.stop();null!=k&&k();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==d&&b==App.MODE_DEVICE&&(d=new LocalLibrary(this,n,a));if(null==d)this.pickFolder(b,mxUtils.bind(this,function(d){b==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a, +n,d,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),m,this.drive.libraryMimeType):b==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),m,d):b==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(a,n,mxUtils.bind(this, +function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),m,d):b==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),m,d):b==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0); +this.libraryLoaded(a,c)}),m,d):b==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),m,d):b==App.MODE_BROWSER?(d=mxUtils.bind(this,function(){var b=new StorageLibrary(this,n,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,c)}),m)}),null==localStorage.getItem(a)?d():this.confirm(mxResources.get("replaceIt", +[a]),d)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(g||this.spinner.spin(document.body,mxResources.get("saving"))){d.setData(n);var t=mxUtils.bind(this,function(){d.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);e||this.libraryLoaded(d,c);null!=k&&k()}),m)});if(a!=d.getTitle()){var f=d.getHash();d.rename(a,mxUtils.bind(this,function(a){d.constructor!=LocalLibrary&&f!=d.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(d.getHash())); this.removeLibrarySidebar(f);t()}),m)}else t()}}catch(l){this.handleError(l)}}; -App.prototype.saveFile=function(a,d){var c=this.getCurrentFile();if(null!=c){var b=mxUtils.bind(this,function(){EditorUi.enableDrafts&&c.removeDraft();this.getCurrentFile()==c||c.isModified()||(c.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=d&&d()});if(a||null==c.getTitle()||null==this.mode){var g=null!=c.getTitle()?c.getTitle():this.defaultFilename,e=!mxClient.IS_IOS||!navigator.standalone,k=this.mode, +App.prototype.saveFile=function(a,c){var d=this.getCurrentFile();if(null!=d){var b=mxUtils.bind(this,function(){EditorUi.enableDrafts&&d.removeDraft();this.getCurrentFile()==d||d.isModified()||(d.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==d.getTitle()||null==this.mode){var g=null!=d.getTitle()?d.getTitle():this.defaultFilename,e=!mxClient.IS_IOS||!navigator.standalone,k=this.mode, n=this.getServiceCount(!0);isLocalStorage&&n++;var m=4>=n?2:6<n?4:3,g=new CreateDialog(this,g,mxUtils.bind(this,function(a,c,d){null!=a&&0<a.length&&(/(\.pdf)$/i.test(a)?this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),mxUtils.bind(this,function(){d.value=a.split(".").slice(0,-1).join(".");d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?d.select():document.execCommand("selectAll", !1,null)}),mxResources.get("yes"),mxResources.get("no")):(this.hideDialog(),null==k&&c==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,b)):"download"==c?(new LocalFile(this,null,a)).save():"_blank"==c?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):k!=c?this.pickFolder(c,mxUtils.bind(this,function(d){this.createFile(a,this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")|| -/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,c,b,null==this.mode,d)})):null!=c&&this.save(a,b)))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,e,null,!0,m,null,null,null,this.editor.fileExtensions,!1);this.showDialog(g.container,400,n>m?390:270,!0,!0);g.init()}else this.save(c.getTitle(),b)}}; -App.prototype.loadTemplate=function(a,d,c,b){var g=!1,e=a;this.editor.isCorsEnabledForUrl(e)||(e="t="+(new Date).getTime(),e=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+e,g=!0);var k=null!=b?b:a;this.loadUrl(e,mxUtils.bind(this,function(b){try{var e=g?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b):b;if(/(\.v(dx|sdx?))($|\?)/i.test(k)||this.isVisioData(e))this.importVisio(this.base64ToBlob(b.substring(b.indexOf(",")+1)),function(a){d(a)},c,k);else if(!this.isOffline()&& -(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,k))this.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&d(a.responseText)}),a);else if(this.isLucidChartData(e))this.convertLucidChart(e,mxUtils.bind(this,function(a){d(a)}),mxUtils.bind(this,function(a){c(a)}));else{if(/(\.png)($|\?)/i.test(k)||this.isPngData(e))e=this.extractGraphModelFromPng(b);d(e)}}catch(t){c(t)}}), -c,/(\.png)($|\?)/i.test(k)||/(\.v(dx|sdx?))($|\?)/i.test(k),null,null,g)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_GITLAB?this.gitLab:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null}; -App.prototype.createFile=function(a,d,c,b,g,e,k,n,m){b=n?null:null!=b?b:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){d=null!=d?d:this.emptyDiagramXml;var t=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(a){t();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(b==App.MODE_GOOGLE&&null!=this.drive)null==k&&null!=this.stateArg&&null!=this.stateArg.folderId&&(k=this.stateArg.folderId), -this.drive.insertFile(a,d,k,mxUtils.bind(this,function(a){t();this.fileCreated(a,c,e,g,m)}),f);else if(b==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,d,mxUtils.bind(this,function(a){t();this.fileCreated(a,c,e,g,m)}),f,!1,k);else if(b==App.MODE_GITLAB&&null!=this.gitLab)this.gitLab.insertFile(a,d,mxUtils.bind(this,function(a){t();this.fileCreated(a,c,e,g,m)}),f,!1,k);else if(b==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,d,mxUtils.bind(this,function(a){t();this.fileCreated(a, -c,e,g,m)}),f,!1,k);else if(b==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,d,mxUtils.bind(this,function(a){t();this.fileCreated(a,c,e,g,m)}),f);else if(b==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,d,mxUtils.bind(this,function(a){t();this.fileCreated(a,c,e,g,m)}),f,!1,k);else if(b==App.MODE_BROWSER){t();var l=mxUtils.bind(this,function(){var b=new StorageFile(this,d,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(b,c,e,g,m)}),f)});null==localStorage.getItem(a)? -l():this.confirm(mxResources.get("replaceIt",[a]),l,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else t(),this.fileCreated(new LocalFile(this,d,a,null==b),c,e,g,m)}catch(p){t(),this.handleError(p)}}}; -App.prototype.fileCreated=function(a,d,c,b,g){var e=window.location.pathname;null!=d&&0<d.length&&(e+="?libs="+d);null!=g&&0<g.length&&(e+="?clibs="+g);e=this.getUrl(e);a.getMode()!=App.MODE_DEVICE&&(e+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var k=a.getData(),k=0<k.length?this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0):null,n=window.location.protocol+"//"+window.location.hostname+e,m=k,t=null;null!=k&&/\.svg$/i.test(a.getTitle())&& -(t=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(t.container),m=this.decodeNodeIntoGraph(m,t));a.setData(this.createFileData(k,t,a,n));null!=t&&t.container.parentNode.removeChild(t.container);var f=mxUtils.bind(this,function(){this.spinner.stop()}),l=mxUtils.bind(this,function(){f();var k=this.getCurrentFile();null==c&&null!=k&&(c=!k.isModified()&&null==k.getMode());var m=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);c&&a.addAllSavedStatus(); -null!=d&&this.sidebar.showEntries(d);if(null!=g){for(var b=[],e=g.split(";"),f=0;f<e.length;f++)b.push(decodeURIComponent(e[f]));this.loadLibraries(b)}}),l=mxUtils.bind(this,function(){c||null==k||!k.isModified()?m():this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=b&&b();null==c||c?l():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(), +/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,c,b,null==this.mode,d)})):null!=c&&this.save(a,b)))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,e,null,!0,m,null,null,null,this.editor.fileExtensions,!1);this.showDialog(g.container,400,n>m?390:270,!0,!0);g.init()}else this.save(d.getTitle(),b)}}; +App.prototype.loadTemplate=function(a,c,d,b){var g=!1,e=a;this.editor.isCorsEnabledForUrl(e)||(e="t="+(new Date).getTime(),e=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+e,g=!0);var k=null!=b?b:a;this.loadUrl(e,mxUtils.bind(this,function(b){try{var e=g?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b):b;if(/(\.v(dx|sdx?))($|\?)/i.test(k)||this.isVisioData(e))this.importVisio(this.base64ToBlob(b.substring(b.indexOf(",")+1)),function(a){c(a)},d,k);else if(!this.isOffline()&& +(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,k))this.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(e))this.convertLucidChart(e,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){d(a)}));else{if(/(\.png)($|\?)/i.test(k)||this.isPngData(e))e=this.extractGraphModelFromPng(b);c(e)}}catch(t){d(t)}}), +d,/(\.png)($|\?)/i.test(k)||/(\.v(dx|sdx?))($|\?)/i.test(k),null,null,g)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_GITLAB?this.gitLab:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null}; +App.prototype.createFile=function(a,c,d,b,g,e,k,n,m){b=n?null:null!=b?b:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var t=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(a){t();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(b==App.MODE_GOOGLE&&null!=this.drive)null==k&&null!=this.stateArg&&null!=this.stateArg.folderId&&(k=this.stateArg.folderId), +this.drive.insertFile(a,c,k,mxUtils.bind(this,function(a){t();this.fileCreated(a,d,e,g,m)}),f);else if(b==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,c,mxUtils.bind(this,function(a){t();this.fileCreated(a,d,e,g,m)}),f,!1,k);else if(b==App.MODE_GITLAB&&null!=this.gitLab)this.gitLab.insertFile(a,c,mxUtils.bind(this,function(a){t();this.fileCreated(a,d,e,g,m)}),f,!1,k);else if(b==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,c,mxUtils.bind(this,function(a){t();this.fileCreated(a, +d,e,g,m)}),f,!1,k);else if(b==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){t();this.fileCreated(a,d,e,g,m)}),f);else if(b==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){t();this.fileCreated(a,d,e,g,m)}),f,!1,k);else if(b==App.MODE_BROWSER){t();var l=mxUtils.bind(this,function(){var b=new StorageFile(this,c,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(b,d,e,g,m)}),f)});null==localStorage.getItem(a)? +l():this.confirm(mxResources.get("replaceIt",[a]),l,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else t(),this.fileCreated(new LocalFile(this,c,a,null==b),d,e,g,m)}catch(p){t(),this.handleError(p)}}}; +App.prototype.fileCreated=function(a,c,d,b,g){var e=window.location.pathname;null!=c&&0<c.length&&(e+="?libs="+c);null!=g&&0<g.length&&(e+="?clibs="+g);e=this.getUrl(e);a.getMode()!=App.MODE_DEVICE&&(e+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var k=a.getData(),k=0<k.length?this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0):null,n=window.location.protocol+"//"+window.location.hostname+e,m=k,t=null;null!=k&&/\.svg$/i.test(a.getTitle())&& +(t=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(t.container),m=this.decodeNodeIntoGraph(m,t));a.setData(this.createFileData(k,t,a,n));null!=t&&t.container.parentNode.removeChild(t.container);var f=mxUtils.bind(this,function(){this.spinner.stop()}),l=mxUtils.bind(this,function(){f();var k=this.getCurrentFile();null==d&&null!=k&&(d=!k.isModified()&&null==k.getMode());var m=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);d&&a.addAllSavedStatus(); +null!=c&&this.sidebar.showEntries(c);if(null!=g){for(var b=[],e=g.split(";"),f=0;f<e.length;f++)b.push(decodeURIComponent(e[f]));this.loadLibraries(b)}}),l=mxUtils.bind(this,function(){d||null==k||!k.isModified()?m():this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=b&&b();null==d||d?l():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(), null==a.getMode())),null!=b&&b(),window.openWindow(e,null,l))});a.constructor==LocalFile?l():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){l()}),mxUtils.bind(this,function(a){f();this.handleError(a)}))}}; -App.prototype.loadFile=function(a,d,c,b,g){this.hideDialog();var e=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var e=localStorage.getItem(a);if(null!=e)this.fileLoaded(new StorageFile(this,e,a)),null!=b&&b();else throw{message:mxResources.get("fileNotFound")};}catch(p){this.handleError(p, -mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=c)this.spinner.stop(),this.fileLoaded(c),null!=b&&b();else if("S"==a.charAt(0)){this.spinner.stop();try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))), +App.prototype.loadFile=function(a,c,d,b,g){this.hideDialog();var e=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var e=localStorage.getItem(a);if(null!=e)this.fileLoaded(new StorageFile(this,e,a)),null!=b&&b();else throw{message:mxResources.get("fileNotFound")};}catch(p){this.handleError(p, +mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=d)this.spinner.stop(),this.fileLoaded(d),null!=b&&b();else if("S"==a.charAt(0)){this.spinner.stop();try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))), b,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0))this.spinner.stop(),e=decodeURIComponent(a.substring(1)),"<"!=e.charAt(0)&&(e=Graph.decompress(e)),e=new LocalFile(this,e,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),e.getHash=function(){return a},this.fileLoaded(e),null!=b&&b();else if("U"==a.charAt(0)){var g=decodeURIComponent(a.substring(1)), -f=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+a,d,null,mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&this.editor.chromeless&&!this.editor.editable&&(c.getHash=function(){return"G"+a},window.location.hash="#"+c.getHash()); +f=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+a,c,null,mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&this.editor.chromeless&&!this.editor.editable&&(c.getHash=function(){return"G"+a},window.location.hash="#"+c.getHash()); null!=b&&b()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",a);return!0});this.loadTemplate(g,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=g,e=g.lastIndexOf("."),k=d.lastIndexOf("/");e>k&&0<k&&(d=d.substring(k+1,e),e=g.substring(e),this.useCanvasForExport||".png"!=e||(e=".drawio"),".svg"===e||".xml"===e||".html"=== e||".png"===e||".drawio"===e)&&(c=d+e)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||f()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else f()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){f()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")}, mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else if(e=null,"G"==a.charAt(0)?e=this.drive:"D"==a.charAt(0)?e=this.dropbox:"W"==a.charAt(0)?e=this.oneDrive:"H"==a.charAt(0)?e=this.gitHub:"A"==a.charAt(0)?e=this.gitLab:"T"==a.charAt(0)&&(e=this.trello),null==e)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile(); window.location.hash=null!=a?a.getHash():""}));else{var k=a.charAt(0);a=decodeURIComponent(a.substring(1));e.getFile(a,mxUtils.bind(this,function(c){this.spinner.stop();this.fileLoaded(c);var d=this.getCurrentFile();null==d?(window.location.hash="",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(d.getHash=function(){return k+a},window.location.hash="#"+d.getHash()):c==d&&null==c.getMode()&&(c=mxResources.get("copyCreated"),this.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="overflow:hidden;">'+ c+"</div>"));null!=b&&b()}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):window.location.hash="#"+a.getHash()}),null,null,"#"+k+a)}))}}),k=this.getCurrentFile(),n=mxUtils.bind(this,function(){g||null==k||!k.isModified()?e():this.confirm(mxResources.get("allChangesLost"), -mxUtils.bind(this,function(){null!=k&&(window.location.hash=k.getHash())}),e,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?n():null==k||d?n():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+a,null,n)).container,320,140,!0,!0)}; -App.prototype.getLibraryStorageHint=function(a){var d=a.getTitle();a.constructor!=LocalLibrary&&(d+="\n"+a.getHash());a.constructor==DriveLibrary?d+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?d+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?d+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?d+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?d+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?d+=" ("+ -mxResources.get("browser")+")":a.constructor==LocalLibrary&&(d+=" ("+mxResources.get("device")+")");return d};App.prototype.restoreLibraries=function(){this.loadLibraries(mxSettings.getCustomLibraries(),mxUtils.bind(this,function(){this.loadLibraries((urlParams.clibs||"").split(";"))}))}; -App.prototype.loadLibraries=function(a,d){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var c=mxUtils.bind(this,function(a,b){b||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=0,g=[],e=mxUtils.bind(this,function(){if(0==b){if(null!=a)for(var c=a.length-1;0<=c;c--)null!=g[c]&&this.loadLibrary(g[c]);null!=d&&d()}});if(null!=a)for(var k=0;k<a.length;k++){var n=encodeURIComponent(decodeURIComponent(a[k]));mxUtils.bind(this,function(a,d){if(null!= -a&&0<a.length&&null==this.pendingLibraries[a]&&null==this.sidebar.palettes[a]){b++;var f=mxUtils.bind(this,function(c){delete this.pendingLibraries[a];g[d]=c;b--;e()}),k=mxUtils.bind(this,function(d){c(a,d);b--;e()});this.pendingLibraries[a]=!0;var m=a.substring(0,1);if("L"==m)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var b=decodeURIComponent(a.substring(1));this.getLocalData(b,mxUtils.bind(this,function(a){".scratchpad"==b&&null==a&&(a=this.emptyLibraryXml); +mxUtils.bind(this,function(){null!=k&&(window.location.hash=k.getHash())}),e,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?n():null==k||c?n():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+a,null,n)).container,320,140,!0,!0)}; +App.prototype.getLibraryStorageHint=function(a){var c=a.getTitle();a.constructor!=LocalLibrary&&(c+="\n"+a.getHash());a.constructor==DriveLibrary?c+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?c+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?c+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?c+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?c+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?c+=" ("+ +mxResources.get("browser")+")":a.constructor==LocalLibrary&&(c+=" ("+mxResources.get("device")+")");return c};App.prototype.restoreLibraries=function(){this.loadLibraries(mxSettings.getCustomLibraries(),mxUtils.bind(this,function(){this.loadLibraries((urlParams.clibs||"").split(";"))}))}; +App.prototype.loadLibraries=function(a,c){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var d=mxUtils.bind(this,function(a,b){b||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=0,g=[],e=mxUtils.bind(this,function(){if(0==b){if(null!=a)for(var d=a.length-1;0<=d;d--)null!=g[d]&&this.loadLibrary(g[d]);null!=c&&c()}});if(null!=a)for(var k=0;k<a.length;k++){var n=encodeURIComponent(decodeURIComponent(a[k]));mxUtils.bind(this,function(a,c){if(null!= +a&&0<a.length&&null==this.pendingLibraries[a]&&null==this.sidebar.palettes[a]){b++;var f=mxUtils.bind(this,function(d){delete this.pendingLibraries[a];g[c]=d;b--;e()}),k=mxUtils.bind(this,function(c){d(a,c);b--;e()});this.pendingLibraries[a]=!0;var m=a.substring(0,1);if("L"==m)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var b=decodeURIComponent(a.substring(1));this.getLocalData(b,mxUtils.bind(this,function(a){".scratchpad"==b&&null==a&&(a=this.emptyLibraryXml); null!=a?f(new StorageLibrary(this,a,b)):k()}))}catch(y){k()}}),0);else if("U"==m){var n=decodeURIComponent(a.substring(1));if(!this.isOffline()){m=n;this.editor.isCorsEnabledForUrl(m)||(m="t="+(new Date).getTime(),m=PROXY_URL+"?url="+encodeURIComponent(n)+"&"+m);try{mxUtils.get(m,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{f(new UrlLibrary(this,a.getText(),n))}catch(y){k()}else k()}),function(){k()})}catch(z){k()}}}else if("R"==m){if(m=decodeURIComponent(a.substring(1)), !this.isOffline())try{var m=JSON.parse(m),t={id:m[0],title:m[1],downloadUrl:m[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(a){try{f(new RemoteLibrary(this,a,t))}catch(y){k()}}),function(){k()})}catch(z){k()}}else if("S"==m&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(a.substring(1)),function(a){f(a)},k)}catch(z){k()}else{var q=null;"G"==m?null!=this.drive&&null!=this.drive.user&&(q=this.drive):"H"==m?null!=this.gitHub&&null!=this.gitHub.getUser()&& (q=this.gitHub):"T"==m?null!=this.trello&&this.trello.isAuthorized()&&(q=this.trello):"D"==m?null!=this.dropbox&&null!=this.dropbox.getUser()&&(q=this.dropbox):"W"==m&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(q=this.oneDrive);null!=q?q.getLibrary(decodeURIComponent(a.substring(1)),mxUtils.bind(this,function(a){try{f(a)}catch(y){k()}}),function(a){k()}):k(!0)}}})(n,k)}e()}}; @@ -9649,22 +9654,22 @@ Editor.commentImage+");","atlas"==uiTheme?(this.commentButton.style.marginRight= this.commentButton=null);null!=a&&a.constructor==DriveFile?null==this.shareButton&&(this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.backgroundColor="#F2931E",this.shareButton.style.borderColor="#F08705",this.shareButton.style.backgroundImage="none",this.shareButton.style.padding="2px 10px 0 10px",this.shareButton.style.marginTop="-10px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight= "28px",this.shareButton.style.minWidth="0px",this.shareButton.style.cssFloat="right",this.shareButton.setAttribute("title",mxResources.get("share")),a=document.createElement("img"),a.setAttribute("src",this.shareImage),a.setAttribute("align","absmiddle"),a.style.marginRight="4px",a.style.marginTop="-3px",this.shareButton.appendChild(a),"dark"!=uiTheme&&"atlas"!=uiTheme&&(this.shareButton.style.color="black",a.style.filter="invert(100%)"),mxUtils.write(this.shareButton,mxResources.get("share")),mxEvent.addListener(this.shareButton, "click",mxUtils.bind(this,function(){this.actions.get("share").funct()})),this.buttonContainer.appendChild(this.shareButton)):null!=this.shareButton&&(this.shareButton.parentNode.removeChild(this.shareButton),this.shareButton=null)}}; -App.prototype.save=function(a,d){var c=this.getCurrentFile(),b=mxResources.get("saving");if(null!=c&&this.spinner.spin(document.body,b)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.bind(this,function(){c.handleFileSuccess(!0);null!=d&&d()}),g=mxUtils.bind(this,function(a){c.handleFileError(a,!0)});try{a==c.getTitle()?c.save(!0,b,g):c.saveAs(a,b,g)}catch(e){g(e)}}}; -App.prototype.pickFolder=function(a,d,c,b,g){c=null!=c?c:!0;var e=this.spinner.pause();c&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){e();if(a.action==google.picker.Action.PICKED){var b=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(b=a.docs[0].id);d(b)}}),g):c&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){e();null!=a&&null!=a.value&&0<a.value.length&&(a=OneDriveFile.prototype.getIdOf(a.value[0]), -d(a))}),b):c&&a==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){e();d(a)})):c&&a==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(a){e();d(a)})):c&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){e();d(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)}; -App.prototype.exportFile=function(a,d,c,b,g,e){g==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(d,b?this.base64ToBlob(a,c):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):g==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(d,a,e,mxUtils.bind(this,function(a){this.spinner.stop()}), -mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),c,b):g==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(d,b?this.base64ToBlob(a,c):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(d,a,mxUtils.bind(this, -function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,e,b):g==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(d,b?this.base64ToBlob(a,c):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_BROWSER&&(c=mxUtils.bind(this,function(){localStorage.setItem(d,a)}),null==localStorage.getItem(d)? -c():this.confirm(mxResources.get("replaceIt",[d]),c))}; -App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var d=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,d);this.fname.setAttribute("title",d+" - "+mxResources.get("rename"))}var d=this.editor.graph,c=a.isEditable()&&!a.invalidChecksum;d.isEnabled()&&!c&&d.reset();d.setEnabled(c);null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length? +App.prototype.save=function(a,c){var d=this.getCurrentFile(),b=mxResources.get("saving");if(null!=d&&this.spinner.spin(document.body,b)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.bind(this,function(){d.handleFileSuccess(!0);null!=c&&c()}),g=mxUtils.bind(this,function(a){d.handleFileError(a,!0)});try{a==d.getTitle()?d.save(!0,b,g):d.saveAs(a,b,g)}catch(e){g(e)}}}; +App.prototype.pickFolder=function(a,c,d,b,g){d=null!=d?d:!0;var e=this.spinner.pause();d&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){e();if(a.action==google.picker.Action.PICKED){var b=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(b=a.docs[0].id);c(b)}}),g):d&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){e();null!=a&&null!=a.value&&0<a.value.length&&(a=OneDriveFile.prototype.getIdOf(a.value[0]), +c(a))}),b):d&&a==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):d&&a==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):d&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)}; +App.prototype.exportFile=function(a,c,d,b,g,e){g==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(c,b?this.base64ToBlob(a,d):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):g==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(c,a,e,mxUtils.bind(this,function(a){this.spinner.stop()}), +mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),d,b):g==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(c,b?this.base64ToBlob(a,d):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(c,a,mxUtils.bind(this, +function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,e,b):g==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(c,b?this.base64ToBlob(a,d):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_BROWSER&&(d=mxUtils.bind(this,function(){localStorage.setItem(c,a)}),null==localStorage.getItem(c)? +d():this.confirm(mxResources.get("replaceIt",[c]),d))}; +App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var c=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,c);this.fname.setAttribute("title",c+" - "+mxResources.get("rename"))}var c=this.editor.graph,d=a.isEditable()&&!a.invalidChecksum;c.isEnabled()&&!d&&c.reset();c.setEnabled(d);null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length? window.location.hash=a:0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null!=this.format&&this.editor.graph.isSelectionEmpty()&&this.format.refresh()}; -App.prototype.showAuthDialog=function(a,d,c,b){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,d,mxUtils.bind(this,function(a){try{null!=c&&c(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(k){this.editor.setStatus(mxUtils.htmlEntities(k.message))}}))).container,300,d?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}; -App.prototype.convertFile=function(a,d,c,b,g,e,k,n){var m=d;/\.svg$/i.test(m)||(m=m.substring(0,d.lastIndexOf("."))+b);var t=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(t=!0);if(/\.v(dx|sdx?)$/i.test(d)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var f=new XMLHttpRequest;f.open("GET",a,!0);t||(f.responseType="blob");if(n)for(var l in n)f.setRequestHeader(l,n[l]);f.onload=mxUtils.bind(this,function(){if(200<= -f.status&&299>=f.status){var a=null;t?(a=JSON.parse(f.responseText),a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([f.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,m,!0))}),e,d)}else null!=e&&e({message:mxResources.get("errorLoadingFile")})});f.onerror=e;f.send()}else{var p=mxUtils.bind(this,function(b){try{if(/\.pdf$/i.test(d)){var c=Editor.extractGraphModelFromPdf(b);null!=c&&0<c.length&&g(new LocalFile(this, -c,m,!0))}else/\.png$/i.test(d)?(c=this.extractGraphModelFromPng(b),null!=c?g(new LocalFile(this,c,m,!0)):g(new LocalFile(this,b,d,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(new LocalFile(this,a.responseText,m,!0)):null!=e&&e({message:mxResources.get("errorLoadingFile")}))}),d):g(new LocalFile(this,b,m,!0))}catch(q){null!= -e&&e(q)}});c=/\.png$/i.test(d)||/\.jpe?g$/i.test(d)||/\.pdf$/i.test(d)||null!=c&&"image/"==c.substring(0,6);t?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=g){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(d)?"data:image/png;base64,"+b:/\.pdf$/i.test(d)?"data:application/pdf;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));p(b)}}else null!=e&&e({code:App.ERROR_UNKNOWN})}),function(){null!= -e&&e({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=e&&e({code:App.ERROR_TIMEOUT,retry:fn})},n):null!=k?k(a,p,e,c):this.loadUrl(a,p,e,c,null,null,null,n)}}; -App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="28px";this.appIcon.style.height=this.menubarHeight-28+"px";this.appIcon.style.margin="14px 0px 8px 20px";this.appIcon.style.opacity="0.85";this.appIcon.style.borderRadius="3px";"dark"!=uiTheme&&(this.appIcon.style.backgroundColor="#f08705");mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon, +App.prototype.showAuthDialog=function(a,c,d,b){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,c,mxUtils.bind(this,function(a){try{null!=d&&d(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(k){this.editor.setStatus(mxUtils.htmlEntities(k.message))}}))).container,300,c?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}; +App.prototype.convertFile=function(a,c,d,b,g,e,k,n){var m=c;/\.svg$/i.test(m)||(m=m.substring(0,c.lastIndexOf("."))+b);var t=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(t=!0);if(/\.v(dx|sdx?)$/i.test(c)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var f=new XMLHttpRequest;f.open("GET",a,!0);t||(f.responseType="blob");if(n)for(var l in n)f.setRequestHeader(l,n[l]);f.onload=mxUtils.bind(this,function(){if(200<= +f.status&&299>=f.status){var a=null;t?(a=JSON.parse(f.responseText),a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([f.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,m,!0))}),e,c)}else null!=e&&e({message:mxResources.get("errorLoadingFile")})});f.onerror=e;f.send()}else{var p=mxUtils.bind(this,function(b){try{if(/\.pdf$/i.test(c)){var d=Editor.extractGraphModelFromPdf(b);null!=d&&0<d.length&&g(new LocalFile(this, +d,m,!0))}else/\.png$/i.test(c)?(d=this.extractGraphModelFromPng(b),null!=d?g(new LocalFile(this,d,m,!0)):g(new LocalFile(this,b,c,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(new LocalFile(this,a.responseText,m,!0)):null!=e&&e({message:mxResources.get("errorLoadingFile")}))}),c):g(new LocalFile(this,b,m,!0))}catch(q){null!= +e&&e(q)}});d=/\.png$/i.test(c)||/\.jpe?g$/i.test(c)||/\.pdf$/i.test(c)||null!=d&&"image/"==d.substring(0,6);t?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=g){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(c)?"data:image/png;base64,"+b:/\.pdf$/i.test(c)?"data:application/pdf;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));p(b)}}else null!=e&&e({code:App.ERROR_UNKNOWN})}),function(){null!= +e&&e({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=e&&e({code:App.ERROR_TIMEOUT,retry:fn})},n):null!=k?k(a,p,e,d):this.loadUrl(a,p,e,d,null,null,null,n)}}; +App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="32px";this.appIcon.style.height=this.menubarHeight-28+"px";this.appIcon.style.margin="14px 0px 8px 16px";this.appIcon.style.opacity="0.85";this.appIcon.style.borderRadius="3px";"dark"!=uiTheme&&(this.appIcon.style.backgroundColor="#f08705");mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon, "click",mxUtils.bind(this,function(a){this.appIconClicked(a)}));var a=mxClient.IS_SVG?"dark"==uiTheme?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+)": "url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJFYmVuZV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMjI1IDIyNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjI1IDIyNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MXtmaWxsOiNERjZDMEM7fQoJLnN0MntmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMjI1LDIxNS40YzAsNS4zLTQuMyw5LjYtOS41LDkuNmwwLDBINzcuMWwtNDQuOC00NS41TDYwLjIsMTM0bDgyLjctMTAyLjdsODIuMSw4NC41VjIxNS40eiIvPgo8cGF0aCBjbGFzcz0ic3QyIiBkPSJNMTg0LjYsMTI1LjhoLTIzLjdsLTI1LTQyLjdjNS43LTEuMiw5LjgtNi4yLDkuNy0xMlYzOWMwLTYuOC01LjQtMTIuMy0xMi4yLTEyLjNoLTAuMUg5MS42CgljLTYuOCwwLTEyLjMsNS40LTEyLjMsMTIuMlYzOXYzMi4xYzAsNS44LDQsMTAuOCw5LjcsMTJsLTI1LDQyLjdINDAuNGMtNi44LDAtMTIuMyw1LjQtMTIuMywxMi4ydjAuMXYzMi4xCgljMCw2LjgsNS40LDEyLjMsMTIuMiwxMi4zaDAuMWg0MS43YzYuOCwwLDEyLjMtNS40LDEyLjMtMTIuMnYtMC4xdi0zMi4xYzAtNi44LTUuNC0xMi4zLTEyLjItMTIuM2gtMC4xaC00bDI0LjgtNDIuNGgxOS4zCglsMjQuOSw0Mi40SDE0M2MtNi44LDAtMTIuMyw1LjQtMTIuMywxMi4ydjAuMXYzMi4xYzAsNi44LDUuNCwxMi4zLDEyLjIsMTIuM2gwLjFoNDEuN2M2LjgsMCwxMi4zLTUuNCwxMi4zLTEyLjJ2LTAuMXYtMzIuMQoJYzAtNi44LTUuNC0xMi4zLTEyLjItMTIuM0MxODQuNywxMjUuOCwxODQuNywxMjUuOCwxODQuNiwxMjUuOHoiLz4KPC9zdmc+Cg==)": "url('"+IMAGE_PATH+"/logo-white.png')";this.appIcon.style.backgroundImage=a;this.appIcon.style.backgroundPosition="center center";this.appIcon.style.backgroundSize="100% 100%";this.appIcon.style.backgroundRepeat="no-repeat";mxUtils.setPrefixedStyle(this.appIcon.style,"transition","all 125ms linear");mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&(a=a.getMode(),a==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)", @@ -9674,11 +9679,11 @@ this.fnameWrapper=document.createElement("div");this.fnameWrapper.style.position "2px 8px 2px 8px";this.fname.style.display="inline";this.fname.style.fontSize="18px";this.fname.style.whiteSpace="nowrap";mxEvent.addListener(this.fname,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(this.fname,"click",mxUtils.bind(this,function(a){var b=this.getCurrentFile();null!=b&&b.isRenamable()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),this.actions.get("rename").funct());mxEvent.consume(a)}));this.fnameWrapper.appendChild(this.fname); "1"!=urlParams.embed&&(this.menubarContainer.appendChild(this.fnameWrapper),this.menubar.container.style.position="absolute",this.menubar.container.style.paddingLeft="59px",this.toolbar.container.style.paddingLeft="16px",this.menubar.container.style.boxSizing="border-box",this.menubar.container.style.top="34px");this.toggleFormatElement=document.createElement("a");this.toggleFormatElement.setAttribute("title",mxResources.get("formatPanel")+" ("+Editor.ctrlKey+"+Shift+P)");this.toggleFormatElement.style.position= "absolute";this.toggleFormatElement.style.display="inline-block";this.toggleFormatElement.style.top="atlas"==uiTheme?"8px":"6px";this.toggleFormatElement.style.right="atlas"!=uiTheme&&"1"!=urlParams.embed?"30px":"10px";this.toggleFormatElement.style.padding="2px";this.toggleFormatElement.style.fontSize="14px";this.toggleFormatElement.className="atlas"!=uiTheme?"geButton":"";this.toggleFormatElement.style.width="16px";this.toggleFormatElement.style.height="16px";this.toggleFormatElement.style.backgroundPosition= -"50% 50%";this.toggleFormatElement.style.backgroundRepeat="no-repeat";this.toolbarContainer.appendChild(this.toggleFormatElement);"dark"==uiTheme&&(this.toggleFormatElement.style.filter="invert(100%)");mxEvent.addListener(this.toggleFormatElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(this.toggleFormatElement,"click",mxUtils.bind(this,function(a){this.actions.get("formatPanel").funct();mxEvent.consume(a)}));var d=mxUtils.bind(this, -function(){this.toggleFormatElement.style.backgroundImage=0<this.formatWidth?"url('"+this.formatShowImage+"')":"url('"+this.formatHideImage+"')"});this.addListener("formatWidthChanged",d);d();this.fullscreenElement=document.createElement("a");this.fullscreenElement.setAttribute("title",mxResources.get("fullscreen"));this.fullscreenElement.style.position="absolute";this.fullscreenElement.style.display="inline-block";this.fullscreenElement.style.top="atlas"==uiTheme?"8px":"6px";this.fullscreenElement.style.right= +"50% 50%";this.toggleFormatElement.style.backgroundRepeat="no-repeat";this.toolbarContainer.appendChild(this.toggleFormatElement);"dark"==uiTheme&&(this.toggleFormatElement.style.filter="invert(100%)");mxEvent.addListener(this.toggleFormatElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(this.toggleFormatElement,"click",mxUtils.bind(this,function(a){this.actions.get("formatPanel").funct();mxEvent.consume(a)}));var c=mxUtils.bind(this, +function(){this.toggleFormatElement.style.backgroundImage=0<this.formatWidth?"url('"+this.formatShowImage+"')":"url('"+this.formatHideImage+"')"});this.addListener("formatWidthChanged",c);c();this.fullscreenElement=document.createElement("a");this.fullscreenElement.setAttribute("title",mxResources.get("fullscreen"));this.fullscreenElement.style.position="absolute";this.fullscreenElement.style.display="inline-block";this.fullscreenElement.style.top="atlas"==uiTheme?"8px":"6px";this.fullscreenElement.style.right= "atlas"!=uiTheme&&"1"!=urlParams.embed?"50px":"30px";this.fullscreenElement.style.padding="2px";this.fullscreenElement.style.fontSize="14px";this.fullscreenElement.className="atlas"!=uiTheme?"geButton":"";this.fullscreenElement.style.width="16px";this.fullscreenElement.style.height="16px";this.fullscreenElement.style.backgroundPosition="50% 50%";this.fullscreenElement.style.backgroundRepeat="no-repeat";this.fullscreenElement.style.backgroundImage="url('"+this.fullscreenImage+"')";this.toolbarContainer.appendChild(this.fullscreenElement); -mxEvent.addListener(this.fullscreenElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));"atlas"==uiTheme&&(mxUtils.setOpacity(this.toggleFormatElement,70),mxUtils.setOpacity(this.fullscreenElement,70));var c=this.hsplitPosition,b=!1;"dark"==uiTheme&&(this.fullscreenElement.style.filter="invert(100%)");mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,function(a){"atlas"!=uiTheme&&"1"!=urlParams.embed&&this.toggleCompactMode(!b); -this.toggleFormatPanel(!b);this.hsplitPosition=b?c:0;b=!b;mxEvent.consume(a)}));"1"!=urlParams.embed&&(this.toggleElement=document.createElement("a"),this.toggleElement.setAttribute("title",mxResources.get("collapseExpand")),this.toggleElement.className="geButton",this.toggleElement.style.position="absolute",this.toggleElement.style.display="inline-block",this.toggleElement.style.width="16px",this.toggleElement.style.height="16px",this.toggleElement.style.color="#666",this.toggleElement.style.top= +mxEvent.addListener(this.fullscreenElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));"atlas"==uiTheme&&(mxUtils.setOpacity(this.toggleFormatElement,70),mxUtils.setOpacity(this.fullscreenElement,70));var d=this.hsplitPosition,b=!1;"dark"==uiTheme&&(this.fullscreenElement.style.filter="invert(100%)");mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,function(a){"atlas"!=uiTheme&&"1"!=urlParams.embed&&this.toggleCompactMode(!b); +this.toggleFormatPanel(!b);this.hsplitPosition=b?d:0;b=!b;mxEvent.consume(a)}));"1"!=urlParams.embed&&(this.toggleElement=document.createElement("a"),this.toggleElement.setAttribute("title",mxResources.get("collapseExpand")),this.toggleElement.className="geButton",this.toggleElement.style.position="absolute",this.toggleElement.style.display="inline-block",this.toggleElement.style.width="16px",this.toggleElement.style.height="16px",this.toggleElement.style.color="#666",this.toggleElement.style.top= "atlas"==uiTheme?"8px":"6px",this.toggleElement.style.right="10px",this.toggleElement.style.padding="2px",this.toggleElement.style.fontSize="14px",this.toggleElement.style.textDecoration="none",this.toggleElement.style.backgroundImage="url('"+this.chevronUpImage+"')",this.toggleElement.style.backgroundPosition="50% 50%",this.toggleElement.style.backgroundRepeat="no-repeat","dark"==uiTheme&&(this.toggleElement.style.filter="invert(100%)"),mxEvent.addListener(this.toggleElement,mxClient.IS_POINTER? "pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()})),mxEvent.addListener(this.toggleElement,"click",mxUtils.bind(this,function(a){this.toggleCompactMode();mxEvent.consume(a)})),"atlas"!=uiTheme&&this.toolbarContainer.appendChild(this.toggleElement),!mxClient.IS_FF&&740>=screen.height&&"undefined"!==typeof this.toggleElement.click&&window.setTimeout(mxUtils.bind(this,function(){this.toggleElement.click()}),0))}}; App.prototype.toggleCompactMode=function(a){a||"none"!=this.appIcon.style.display?(this.menubar.container.style.position="relative",this.menubar.container.style.paddingLeft="4px",this.menubar.container.style.paddingTop="0px",this.menubar.container.style.paddingBottom="0px",this.menubar.container.style.top="0px",this.toolbar.container.style.paddingLeft="8px",this.buttonContainer.style.visibility="hidden",this.appIcon.style.display="none",this.fnameWrapper.style.display="none",this.fnameWrapper.style.visibility= @@ -9687,12 +9692,12 @@ App.prototype.toggleCompactMode=function(a){a||"none"!=this.appIcon.style.displa App.prototype.updateUserElement=function(){if(null!=this.drive&&null!=this.drive.getUser()||null!=this.oneDrive&&null!=this.oneDrive.getUser()||null!=this.dropbox&&null!=this.dropbox.getUser()||null!=this.gitHub&&null!=this.gitHub.getUser()||null!=this.gitLab&&null!=this.gitLab.getUser()||null!=this.trello&&this.trello.isAuthorized()){null==this.userElement&&(this.userElement=document.createElement("a"),this.userElement.className="geItem",this.userElement.style.position="absolute",this.userElement.style.fontSize= "8pt",this.userElement.style.top="atlas"==uiTheme?"8px":"2px",this.userElement.style.right="30px",this.userElement.style.margin="4px",this.userElement.style.padding="2px",this.userElement.style.paddingRight="16px",this.userElement.style.verticalAlign="middle",this.userElement.style.backgroundImage="url("+IMAGE_PATH+"/expanded.gif)",this.userElement.style.backgroundPosition="100% 60%",this.userElement.style.backgroundRepeat="no-repeat",this.menubarContainer.appendChild(this.userElement),mxEvent.addListener(this.userElement, mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()})),mxEvent.addListener(this.userElement,"click",mxUtils.bind(this,function(a){if(null==this.userPanel){var c=document.createElement("div");c.className="geDialog";c.style.position="absolute";c.style.top=this.userElement.clientTop+this.userElement.clientHeight+6+"px";c.style.right="36px";c.style.padding="0px";c.style.cursor="default";this.userPanel=c}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel); -else{var b=!1;this.userPanel.innerHTML="";c=document.createElement("img");c.setAttribute("src",Dialog.prototype.closeImage);c.setAttribute("title",mxResources.get("close"));c.className="geDialogClose";c.style.top="8px";c.style.right="8px";mxEvent.addListener(c,"click",mxUtils.bind(this,function(){null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)}));this.userPanel.appendChild(c);if(null!=this.drive&&(c=this.drive.getUsersList(),0<c.length)){var d=mxUtils.bind(this, +else{var b=!1;this.userPanel.innerHTML="";c=document.createElement("img");c.setAttribute("src",Dialog.prototype.closeImage);c.setAttribute("title",mxResources.get("close"));c.className="geDialogClose";c.style.top="8px";c.style.right="8px";mxEvent.addListener(c,"click",mxUtils.bind(this,function(){null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)}));this.userPanel.appendChild(c);if(null!=this.drive&&(c=this.drive.getUsersList(),0<c.length)){var g=mxUtils.bind(this, function(a,b){var c=this.getCurrentFile();null!=c&&c.constructor==DriveFile?(this.spinner.spin(document.body,b),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();a()}),2E3)):a()}),e=mxUtils.bind(this,function(a){var b=document.createElement("tr");b.style.cssText=a.isCurrent?"":"background-color: whitesmoke; cursor: pointer";b.setAttribute("title","User ID: "+a.id);b.innerHTML='<td valign="middle" style="height: 59px;width: 66px;'+(a.isCurrent?"":"border-top: 1px solid rgb(224, 224, 224);")+ '"><img width="50" height="50" style="margin: 4px 8px 0 8px;border-radius:50%;" src="'+(null!=a.pictureUrl?a.pictureUrl:this.defaultUserPicture)+'"/></td><td valign="middle" style="white-space:nowrap;'+(null!=a.pictureUrl?"padding-top:4px;":"")+(a.isCurrent?"":"border-top: 1px solid rgb(224, 224, 224);")+'">'+mxUtils.htmlEntities(a.displayName)+'<br><small style="color:gray;">'+mxUtils.htmlEntities(a.email)+'</small><div style="margin-top:4px;"><i>'+mxResources.get("googleDrive")+"</i></div>";a.isCurrent|| -mxEvent.addListener(b,"click",mxUtils.bind(this,function(b){d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(a);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}),mxResources.get("closingFile")+"...");mxEvent.consume(b)}));return b}),b=!0,k=document.createElement("table");k.style.cssText="font-size:10pt;padding: 20px 0 0 0;min-width: 300px;border-spacing: 0;"; -for(var n=0;n<c.length;n++)k.appendChild(e(c[n]));this.userPanel.appendChild(k);c=document.createElement("div");c.style.textAlign="left";c.style.padding="8px";c.style.whiteSpace="nowrap";c.style.borderTop="1px solid rgb(224, 224, 224)";e=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}), -mxResources.get("signOut"))}))}));e.className="geBtn";e.style["float"]="right";c.appendChild(e);e=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var a=this.drive.createAuthWin();a.blur();window.focus();d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0,a)}),mxResources.get("closingFile")+"...")})); +mxEvent.addListener(b,"click",mxUtils.bind(this,function(b){g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(a);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}),mxResources.get("closingFile")+"...");mxEvent.consume(b)}));return b}),b=!0,k=document.createElement("table");k.style.cssText="font-size:10pt;padding: 20px 0 0 0;min-width: 300px;border-spacing: 0;"; +for(var n=0;n<c.length;n++)k.appendChild(e(c[n]));this.userPanel.appendChild(k);c=document.createElement("div");c.style.textAlign="left";c.style.padding="8px";c.style.whiteSpace="nowrap";c.style.borderTop="1px solid rgb(224, 224, 224)";e=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}), +mxResources.get("signOut"))}))}));e.className="geBtn";e.style["float"]="right";c.appendChild(e);e=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var a=this.drive.createAuthWin();a.blur();window.focus();g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0,a)}),mxResources.get("closingFile")+"...")})); e.className="geBtn";e.style.margin="0px";c.appendChild(e);this.userPanel.appendChild(c)}c=mxUtils.bind(this,function(a,c,d,e){if(null!=a){b&&this.userPanel.appendChild(document.createElement("hr"));b=!0;var f=document.createElement("table");f.style.cssText="font-size:10pt;padding:"+(b?"10":"20")+"px 20px 10px 10px;";f.innerHTML+='<tr><td valign="top">'+(null!=c?'<img style="margin-right:6px;" src="'+c+'" width="40" height="40"/></td>':"")+'<td valign="middle" style="white-space:nowrap;">'+mxUtils.htmlEntities(a.displayName)+ (null!=a.email?'<br><small style="color:gray;">'+mxUtils.htmlEntities(a.email)+"</small>":"")+(null!=e?'<div style="margin-top:4px;"><i>'+mxUtils.htmlEntities(e)+"</i></div>":"")+"</td></tr>";this.userPanel.appendChild(f);a=document.createElement("div");a.style.textAlign="center";a.style.paddingBottom="12px";a.style.whiteSpace="nowrap";null!=d&&(d=mxUtils.button(mxResources.get("signOut"),d),d.className="geBtn",a.appendChild(d));this.userPanel.appendChild(a)}});null!=this.dropbox&&c(this.dropbox.getUser(), IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==DropboxFile){var b=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&c(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",mxUtils.bind(this,function(){var a= @@ -9706,20 +9711,20 @@ var a=null;null!=this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():n App.prototype.getCurrentUser=function(){var a=null;null!=this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?a=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?a=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(a=this.gitHub.getUser());return a};var editorResetGraph=Editor.prototype.resetGraph; Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);this.graph.pageFormat=mxSettings.getPageFormat()};(function(){var a=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){a.apply(this,arguments);this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px"};Menus.prototype.createHelpLink=function(a){var b=document.createElement("span");b.setAttribute("title",mxResources.get("help"));b.style.cssText="color:blue;text-decoration:underline;margin-left:8px;cursor:help;"; var c=document.createElement("img");mxUtils.setOpacity(c,50);c.style.height="16px";c.style.width="16px";c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);b.appendChild(c);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){null!=this.editorUi.menubar&&this.editorUi.menubar.hideMenu();this.editorUi.openLink(a);mxEvent.consume(b)}));return b};Menus.prototype.addLinkToItem=function(a,b){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(b))}; -var d=Menus.prototype.init;Menus.prototype.init=function(){function a(a,b){this.ui=a;this.previousExtFonts=this.extFonts=b}d.apply(this,arguments);var b=this.editorUi,g=b.editor.graph,e=mxUtils.bind(g,g.isEnabled),k=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),n=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null== +var c=Menus.prototype.init;Menus.prototype.init=function(){function a(a,b){this.ui=a;this.previousExtFonts=this.extFonts=b}c.apply(this,arguments);var b=this.editorUi,g=b.editor.graph,e=mxUtils.bind(g,g.isEnabled),k=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),n=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null== document.documentMode||9<document.documentMode),m=("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),t=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode|| 9<document.documentMode);mxClient.IS_SVG||b.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");b.actions.addAction("new...",function(){var a=b.isOffline(),c=new NewDialog(b,a);b.showDialog(c.container,a?350:620,a?70:440,!0,!0,function(a){a&&null==b.getCurrentFile()&&b.showSplash()});c.init()});b.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files", -mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n){a=parseInt(a);!isNaN(a)&&0<a&&b.exportSvg(a/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));b.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var a=new NewDialog(b,null,!1,function(a){b.hideDialog();if(null!=a){var c=b.editor.graph.getFreeInsertPoint();g.setSelectionCells(b.importXml(a,Math.max(c.x,20),Math.max(c.y,20),!0));g.scrollCellToVisible(g.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null, +mxUtils.bind(this,function(a,c,d,e,f,g,k,m,l,n){a=parseInt(a);!isNaN(a)&&0<a&&b.exportSvg(a/100,c,d,e,f,g,k,!m,l,n)}),!0,null,"svg")}));b.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var a=new NewDialog(b,null,!1,function(a){b.hideDialog();if(null!=a){var c=b.editor.graph.getFreeInsertPoint();g.setSelectionCells(b.importXml(a,Math.max(c.x,20),Math.max(c.y,20),!0));g.scrollCellToVisible(g.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null, !1,mxResources.get("insert"));b.showDialog(a.container,620,440,!0,!0)})).isEnabled=e;var f=b.actions.addAction("points",function(){b.editor.graph.view.setUnit(mxConstants.POINTS)});f.setToggleAction(!0);f.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.POINTS});f=b.actions.addAction("inches",function(){b.editor.graph.view.setUnit(mxConstants.INCHES)});f.setToggleAction(!0);f.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.INCHES});f=b.actions.addAction("millimeters", function(){b.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});f.setToggleAction(!0);f.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.MILLIMETERS});this.put("units",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["points","millimeters"],b)})));f=b.actions.addAction("ruler",function(){mxSettings.setRulerOn(!mxSettings.isRulerOn());mxSettings.save();null!=b.ruler?(b.ruler.destroy(),b.ruler=null):b.ruler=new mxDualRuler(b,b.editor.graph.view.unit);b.refresh()}); f.setEnabled(b.canvasSupported&&9!=document.documentMode);f.setToggleAction(!0);f.setSelectedCallback(function(){return null!=b.ruler});window.mxFreehand&&(b.actions.put("insertFreehand",new Action(mxResources.get("freehand")+"...",function(a){g.isEnabled()&&(null==this.freehandWindow&&(this.freehandWindow=new FreehandWindow(b,document.body.offsetWidth-420,102,176,104)),g.freehand.isDrawing()?g.freehand.stopDrawing():g.freehand.startDrawing(),this.freehandWindow.window.setVisible(g.freehand.isDrawing()))})).isEnabled= function(){return e()&&mxClient.IS_SVG});b.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var a=document.createElement("div");a.style.whiteSpace="nowrap";var c=null==b.pages||1>=b.pages.length,d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatXml"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";a.appendChild(d);var e=b.addCheckbox(a,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),f=b.addCheckbox(a,mxResources.get("compressed"), !0),k=b.addCheckbox(a,mxResources.get("allPages"),!c,c);k.style.marginBottom="16px";mxEvent.addListener(e,"change",function(){e.checked?k.setAttribute("disabled","disabled"):k.removeAttribute("disabled")});a=new CustomDialog(b,a,mxUtils.bind(this,function(){b.downloadFile("xml",!f.checked,null,!e.checked,c||!k.checked)}),null,mxResources.get("export"));b.showDialog(a.container,300,180,!0,!0)}));b.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){b.showPublishLinkDialog(mxResources.get("url"), -!0,null,null,function(a,c,d,e,f,g){a=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,null,!0));b.showDialog(a.container,440,240,!0,!0);a.init()})}));b.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("export"),null,a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e,f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d= +!0,null,null,function(a,c,d,e,f,g){a=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,null,!0));b.showDialog(a.container,440,240,!0,!0);a.init()})}));b.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("export"),null,a,function(a,c,d,e,f,g,k,m,l,n){b.createHtml(a,c,d,e,f,g,k,m,l,n,mxUtils.bind(this,function(a,c){var d= b.getBaseFilename(k),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+a+"\n"+c+"\n</body>\n</html>";b.saveData(d+".html","html",e,"text/html")}))})})}));b.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if("undefined"!==typeof mxIsElectron5&&mxIsElectron5||!b.isOffline()&&!b.printPdfExport){var a=null==b.pages|| -1>=b.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatPdf"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(d);var e=function(){f!=this&&this.checked?l.removeAttribute("disabled"):(l.setAttribute("disabled","disabled"),l.checked=!1)},d=180;if(b.pdfPageExport&&!a){var f=b.addRadiobox(c,"pages",mxResources.get("allPages"),!0),d=b.addRadiobox(c,"pages",mxResources.get("currentPage"), -!1),k=b.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),l=b.addCheckbox(c,mxResources.get("crop"),!1,!0),m=b.addCheckbox(c,mxResources.get("grid"),!1,!1);mxEvent.addListener(f,"change",e);mxEvent.addListener(d,"change",e);mxEvent.addListener(k,"change",e);d=240}else k=b.addCheckbox(c,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),l=b.addCheckbox(c,mxResources.get("crop"),!g.pageVisible||!b.pdfPageExport,!b.pdfPageExport),m=b.addCheckbox(c,mxResources.get("grid"), -!1,!1),b.pdfPageExport||mxEvent.addListener(k,"change",e);var n=(e=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"draw.io"==b.getServiceName())?b.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0):null;e&&(d+=30);c=new CustomDialog(b,c,mxUtils.bind(this,function(){b.downloadFile("pdf",null,null,!k.checked,a?!0:!f.checked,!l.checked,null,null,null,m.checked,null!=n&&n.checked)}),null,mxResources.get("export"));b.showDialog(c.container,300,d,!0,!0)}else b.showDialog((new PrintDialog(b,mxResources.get("formatPdf"))).container, +1>=b.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatPdf"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(d);var e=function(){f!=this&&this.checked?m.removeAttribute("disabled"):(m.setAttribute("disabled","disabled"),m.checked=!1)},d=180;if(b.pdfPageExport&&!a){var f=b.addRadiobox(c,"pages",mxResources.get("allPages"),!0),d=b.addRadiobox(c,"pages",mxResources.get("currentPage"), +!1),k=b.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),m=b.addCheckbox(c,mxResources.get("crop"),!1,!0),l=b.addCheckbox(c,mxResources.get("grid"),!1,!1);mxEvent.addListener(f,"change",e);mxEvent.addListener(d,"change",e);mxEvent.addListener(k,"change",e);d=240}else k=b.addCheckbox(c,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),m=b.addCheckbox(c,mxResources.get("crop"),!g.pageVisible||!b.pdfPageExport,!b.pdfPageExport),l=b.addCheckbox(c,mxResources.get("grid"), +!1,!1),b.pdfPageExport||mxEvent.addListener(k,"change",e);var n=(e=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"draw.io"==b.getServiceName())?b.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0):null;e&&(d+=30);c=new CustomDialog(b,c,mxUtils.bind(this,function(){b.downloadFile("pdf",null,null,!k.checked,a?!0:!f.checked,!m.checked,null,null,null,l.checked,null!=n&&n.checked)}),null,mxResources.get("export"));b.showDialog(c.container,300,d,!0,!0)}else b.showDialog((new PrintDialog(b,mxResources.get("formatPdf"))).container, 360,null!=b.pages&&1<b.pages.length?450:370,!0,!0)}));b.actions.addAction("open...",function(){b.pickFile()});b.actions.addAction("close",function(){function a(){null!=c&&c.removeDraft();b.fileLoaded(null)}var c=b.getCurrentFile();null!=c&&c.isModified()?b.confirm(mxResources.get("allChangesLost"),null,a,mxResources.get("cancel"),mxResources.get("discardChanges")):a()});b.actions.addAction("editShape...",mxUtils.bind(this,function(){g.getSelectionCells();if(1==g.getSelectionCount()){var a=g.getSelectionCell(), c=g.view.getState(a);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())}}));b.actions.addAction("revisionHistory...",function(){b.isRevisionHistorySupported()?b.spinner.spin(document.body,mxResources.get("loading"))&&b.getRevisions(mxUtils.bind(this,function(a,c){b.spinner.stop();var d=new RevisionDialog(b,a,c);b.showDialog(d.container,640,480,!0,!0);d.init()}),mxUtils.bind(this,function(a){b.handleError(a)})): b.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});b.actions.addAction("createRevision",function(){b.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");f=b.actions.addAction("synchronize",function(){b.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(f.label=mxResources.get("refresh"));b.actions.addAction("upload...",function(){var a=b.getCurrentFile();null!=a&&(window.drawdata=b.getFileData(),a= @@ -9729,8 +9734,8 @@ function(){var a=b.getCurrentFile();null!=a&&(a.isCompressed()?a.decompress():a. null,null,Editor.ctrlKey+"+Shift+M");var p="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing arcSize".split(" ");b.actions.addAction("copyStyle",function(){var a= g.view.getState(g.getSelectionCell());if(g.isEnabled()&&null!=a){b.copiedStyle=mxUtils.clone(a.style);for(var a=g.getModel().getStyle(a.cell),a=null!=a?a.split(";"):[],c=0;c<a.length;c++){var d=a[c],e=d.indexOf("=");if(0<=e){var f=d.substring(0,e),d=d.substring(e+1);null==b.copiedStyle[f]&&"none"==d&&(b.copiedStyle[f]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");b.actions.addAction("pasteStyle",function(){if(g.isEnabled()&&!g.isSelectionEmpty()&&null!=b.copiedStyle){g.getModel().beginUpdate(); try{for(var a=g.getSelectionCells(),c=0;c<a.length;c++)for(var d=g.view.getState(a[c]),e=0;e<p.length;e++){var f=p[e],k=b.copiedStyle[f];d.style[f]!=k&&g.setCellStyles(f,k,[a[c]])}}finally{g.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");b.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!b.isOffline()){var a=new BackgroundImageDialog(b,function(a){b.setBackgroundImage(a)});b.showDialog(a.container,320,170,!0,!0);a.init()}}));b.actions.put("exportPng", -new Action(mxResources.get("formatPng")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,c,d,e,f,k,!l,m,null,q)}),!0,!0,"png"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile(c? -"xmlpng":"png",null,null,a,null,null,d,e,f)}),!1,!0)}));b.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,!1,d,e,!1,k,!l,!1,"jpeg",q)}),!0,!1,"jpeg"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"), +new Action(mxResources.get("formatPng")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(a,c,d,e,f,g,k,m,l,n,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,c,d,e,f,k,!m,l,null,q)}),!0,!0,"png"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile(c? +"xmlpng":"png",null,null,a,null,null,d,e,f)}),!1,!0)}));b.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(a,c,d,e,f,g,k,m,l,n,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,!1,d,e,!1,k,!m,!1,"jpeg",q)}),!0,!1,"jpeg"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"), null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile("jpeg",null,null,a,null,null,null,e,f)}),!0,!0)}));f=b.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){g.setShadowVisible(!g.shadowVisible)}));f.setToggleAction(!0);f.setSelectedCallback(function(){return g.shadowVisible});var u=!1;b.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){u||(b.showDialog((new AboutDialog(b)).container,220,300,!0,!0,function(){u=!1}),u=!0)},null,null,"F1")); b.actions.addAction("userManual...",function(){b.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")});b.actions.addAction("support...",function(){b.openLink("https://about.draw.io/support/")});b.actions.addAction("exportOptionsDisabled...",function(){b.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});b.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.openLink("https://www.draw.io/shortcuts.svg"): mxClient.IS_SVG?b.openLink("shortcuts.svg"):b.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});b.actions.addAction("feedback...",function(){var a=new FeedbackDialog(b);b.showDialog(a.container,610,360,!0,!1);a.init()});b.actions.addAction("quickStart...",function(){b.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});f=b.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(b,document.body.offsetWidth- @@ -9744,8 +9749,8 @@ c),(d==mxLanguage||""==d&&null==mxLanguage)&&a.addCheckmark(f,Editor.checkmarkIm c.style.display="block";c.style.cursor="pointer";c.style.right="17px";"atlas"==uiTheme?(c.style.top="6px",c.style.right="15px"):c.style.top="min"==uiTheme?"2px":"0px";if(mxClient.IS_VML)c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>';else{var d=document.createElement("div");d.style.backgroundImage="url("+Editor.globeImage+")";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="19px 19px";d.style.position="absolute";d.style.height="19px"; d.style.width="19px";d.style.marginTop="2px";d.style.zIndex="1";c.appendChild(d);mxUtils.setOpacity(c,40);if("atlas"==uiTheme||"dark"==uiTheme)c.style.opacity="0.85",c.style.filter="invert(100%)"}document.body.appendChild(c)}}return b}}b.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];b.actions.addAction("runLayout",function(){var a=new TextareaDialog(b,"Run Layouts:",JSON.stringify(b.customLayoutConfig, null,2),function(a){if(0<a.length)try{var c=JSON.parse(a);b.executeLayoutList(c);b.customLayoutConfig=c}catch(B){b.handleError(B),null!=window.console&&console.error(B)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()});var f=this.get("layout"),q=f.funct;f.funct=function(a,c){q.apply(this,arguments);a.addSeparator(c);a.addItem(mxResources.get("orgChart")+"...",null,function(){var a=null,c=20,d=20,e=!0,f=function(){b.loadingOrgChart= -!1;b.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&null!=a&&e){var f=b.editor.graph;(new mxOrgChartLayout(f,a,c,d)).execute(f.getDefaultParent());e=!1}},g=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("orgChartType")+": ");g.appendChild(k);var l=document.createElement("select");l.style.width="200px";l.style.boxSizing="border-box";for(var k=[mxResources.get("linear"), -mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],m=0;m<k.length;m++){var n=document.createElement("option");mxUtils.write(n,k[m]);n.value=m;2==m&&n.setAttribute("selected","selected");l.appendChild(n)}mxEvent.addListener(l,"change",function(){a=l.value});g.appendChild(l);k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block"; +!1;b.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&null!=a&&e){var f=b.editor.graph;(new mxOrgChartLayout(f,a,c,d)).execute(f.getDefaultParent());e=!1}},g=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("orgChartType")+": ");g.appendChild(k);var m=document.createElement("select");m.style.width="200px";m.style.boxSizing="border-box";for(var k=[mxResources.get("linear"), +mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],l=0;l<k.length;l++){var n=document.createElement("option");mxUtils.write(n,k[l]);n.value=l;2==l&&n.setAttribute("selected","selected");m.appendChild(n)}mxEvent.addListener(m,"change",function(){a=m.value});g.appendChild(m);k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block"; k.style.width="140px";mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");g.appendChild(k);var q=document.createElement("input");q.type="number";q.value=c;q.style.width="200px";q.style.boxSizing="border-box";g.appendChild(q);mxEvent.addListener(q,"change",function(){c=q.value});k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");g.appendChild(k);var p=document.createElement("input"); p.type="number";p.value=d;p.style.width="200px";p.style.boxSizing="border-box";g.appendChild(p);mxEvent.addListener(p,"change",function(){d=p.value});g=new CustomDialog(b,g,function(){null==a&&(a=2);"undefined"!==typeof mxOrgChartLayout||b.loadingOrgChart||b.isOffline(!0)?f():b.spinner.spin(document.body,mxResources.get("loading"))&&(b.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart.min.js",f):mxscript("js/extensions.min.js",f))});b.showDialog(g.container,355,125,!0,!0)},c,null,e());a.addSeparator(c); b.menus.addMenuItem(a,"runLayout",c,null,null,mxResources.get("apply")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(a,c){if(!mxClient.IS_CHROMEAPP&&b.isOffline())this.addMenuItems(a,["about"],c);else{var d=a.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown", @@ -9753,33 +9758,33 @@ mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.len e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(a,["-","keyboardShortcuts","quickStart","userManual","-"],c);EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(a,["downloadDesktop"],c);mxClient.IS_CHROMEAPP||this.addMenuItems(a,["feedback","support"],c);this.addMenuItems(a,["-","about"],c)}"1"==urlParams.test&&(a.addSeparator(c),this.addSubmenu("testDevelop", a,c))})));"1"==urlParams.test&&(mxResources.parse("testDevelop=Develop"),mxResources.parse("showBoundingBox=Show bounding box"),mxResources.parse("createSidebarEntry=Create Sidebar Entry"),mxResources.parse("testCheckFile=Check File"),mxResources.parse("testDiff=Diff"),mxResources.parse("testInspect=Inspect"),mxResources.parse("testShowConsole=Show Console"),mxResources.parse("testXmlImageExport=XML Image Export"),mxResources.parse("testDownloadRtModel=Export RT model"),mxResources.parse("testImportRtModel=Import RT model"), b.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){g.isSelectionEmpty()||b.showTextDialog("Create Sidebar Entry","sb.createVertexTemplateFromData('"+Graph.compress(mxUtils.getXml(g.encodeCells(g.getSelectionCells())))+"', width, height, 'Title');")})),b.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=g.getGraphBounds(),b=g.view.translate,c=g.view.scale;g.insertVertex(g.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.height/c,"fillColor=none;strokeColor=red;")})), -b.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var a=null!=b.pages&&null!=b.getCurrentFile()?b.getCurrentFile().getAnonymizedXmlForPages(b.pages):"",a=new TextareaDialog(b,"Paste Data:",a,function(a){if(0<a.length)try{var c=function(a){function b(a){if(null==n[a]){if(n[a]=!0,null!=e[a]){for(;0<e[a].length;){var d=e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var l=d[k];if(null!= -l.id&&0<l.id.length)if(null==a[l.id]){a[l.id]=l.id;var m=l.getAttribute("parent");null==m?null!=f?mxLog.debug(c+": Multiple roots: "+l.id):f=l.id:(null==e[m]&&(e[m]=[]),e[m].push(l.id))}else g[l.id]=l.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null==f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"), +b.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var a=null!=b.pages&&null!=b.getCurrentFile()?b.getCurrentFile().getAnonymizedXmlForPages(b.pages):"",a=new TextareaDialog(b,"Paste Data:",a,function(a){if(0<a.length)try{var c=function(a){function b(a){if(null==n[a]){if(n[a]=!0,null!=e[a]){for(;0<e[a].length;){var d=e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var m=d[k];if(null!= +m.id&&0<m.id.length)if(null==a[m.id]){a[m.id]=m.id;var l=m.getAttribute("parent");null==l?null!=f?mxLog.debug(c+": Multiple roots: "+m.id):f=m.id:(null==e[l]&&(e[l]=[]),e[l].push(m.id))}else g[m.id]=m.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null==f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"), console.log(c+": Invalid tree",e)))};"<"!=a.charAt(0)&&(a=Graph.decompress(a),mxLog.debug("See console for uncompressed XML"),console.log("xml",a));var d=mxUtils.parseXml(a),e=b.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=b.getHashValueForPages(e);mxLog.debug("Checksum: ",f)}catch(J){mxLog.debug("Error: ",J.message)}else mxLog.debug("No pages found for checksum");var g=d.getElementsByTagName("root");for(a=0;a<g.length;a++)c(g[a]);mxLog.show()}catch(J){b.handleError(J), null!=window.console&&console.error(J)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()})),b.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=b.pages){var a=new TextareaDialog(b,"Paste Data:","",function(a){if(0<a.length)try{console.log(JSON.stringify(b.diffPages(b.pages,b.getPagesForNode(mxUtils.parseXml(a).documentElement)),null,2))}catch(D){b.handleError(D),null!=window.console&&console.error(D)}});a.textarea.style.width= "600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()}else b.alert("No pages")})),b.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(b,g.getModel())})),b.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=g.getGraphBounds(),c=g.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/ -c);var f=0,k=d.save;d.save=function(){f++;k.apply(this,arguments)};var l=d.restore;d.restore=function(){f--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,f);m.apply(this,arguments);mxLog.debug("leaving shape",a,f)};a.drawState(g.getView().getState(g.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",f)})),b.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==b.drive?b.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}): +c);var f=0,k=d.save;d.save=function(){f++;k.apply(this,arguments)};var m=d.restore;d.restore=function(){f--;m.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,f);l.apply(this,arguments);mxLog.debug("leaving shape",a,f)};a.drawState(g.getView().getState(g.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",f)})),b.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==b.drive?b.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}): b.drive.execute(mxUtils.bind(this,function(){var a=prompt("File ID","");if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+a+"/realtime?supportsAllDrives=true",null,"GET");c.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);a.setRequestHeader("authorization","Bearer "+b.drive.token)};c.send(function(c){b.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()? b.saveLocalFile(c.getText(),"json-"+a+".txt","text/plain"):b.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),b.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,"createSidebarEntry showBoundingBox - testCheckFile testDiff - testInspect - testXmlImageExport - testDownloadRtModel".split(" "), c);a.addItem(mxResources.get("testImportRtModel")+"...",null,function(){var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",mxUtils.bind(this,function(){if(null!=a.files){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{b.openLocalFile(mxUtils.getXml(b.drive.convertJsonToXml(JSON.parse(c.target.result).data)),a.files[0].name,!0)}catch(G){b.handleError(G,mxResources.get("errorLoadingFile"))}});c.readAsText(a.files[0])}}));a.click()},c); this.addMenuItems(a,["-","testShowConsole"],c)}))));b.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!b.isOffline()?b.showDialog((new MoreShapesDialog(b,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):b.showDialog((new MoreShapesDialog(b,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});b.actions.put("createShape",new Action(mxResources.get("shape")+"...",function(a){g.isEnabled()&&(a=new mxCell("",new mxGeometry(0,0,120,120),b.defaultCustomShapeStyle), -a.vertex=!0,a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())})).isEnabled=e;b.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e, -f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d=new EmbedDialog(b,a+"\n"+c,null,null,function(){var d=window.open(),e=d.document;if(null!=e){"CSS1Compat"===document.compatMode&&e.writeln("<!DOCTYPE html>");e.writeln("<html>");e.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');e.writeln("<body>");e.writeln(a);var f=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;f&&e.writeln(c);e.writeln("</body>");e.writeln("</html>"); +a.vertex=!0,a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())})).isEnabled=e;b.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",a,function(a,c,d,e,f,g,k,m,l,n){b.createHtml(a,c,d,e, +f,g,k,m,l,n,mxUtils.bind(this,function(a,c){var d=new EmbedDialog(b,a+"\n"+c,null,null,function(){var d=window.open(),e=d.document;if(null!=e){"CSS1Compat"===document.compatMode&&e.writeln("<!DOCTYPE html>");e.writeln("<html>");e.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');e.writeln("<body>");e.writeln(a);var f=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;f&&e.writeln(c);e.writeln("</body>");e.writeln("</html>"); e.close();if(!f){var g=d.document.createElement("div");g.marginLeft="26px";g.marginTop="26px";mxUtils.write(g,mxResources.get("updatingDocument"));f=d.document.createElement("img");f.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");f.style.marginLeft="6px";g.appendChild(f);d.document.body.insertBefore(g,d.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1]; e.body.appendChild(a);g.parentNode.removeChild(g)},20)}}else b.handleError({message:mxResources.get("errorUpdatingPreview")})});b.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));b.actions.put("liveImage",new Action("Live image...",function(){var a=b.getCurrentFile();null!=a&&b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(c){b.spinner.stop();null!=c?(c=new EmbedDialog(b,'<img src="'+(a.constructor!=DriveFile?c:"https://drive.google.com/uc?id="+ a.getId())+'"/>'),b.showDialog(c.container,440,240,!0,!0),c.init()):b.handleError({message:mxResources.get("invalidPublicUrl")})})}));b.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){b.showEmbedImageDialog(function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.createEmbedImage(a,c,d,e,f,g,function(a){b.spinner.stop();a=new EmbedDialog(b,a);b.showDialog(a.container,440,240,!0,!0);a.init()},function(a){b.spinner.stop();b.handleError(a)})},mxResources.get("image"), mxResources.get("retina"),b.isExportToCanvas())}));b.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showEmbedImageDialog(function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.createEmbedSvg(a,c,d,e,f,g,function(a){b.spinner.stop();a=new EmbedDialog(b,a);b.showDialog(a.container,440,240,!0,!0);a.init()},function(a){b.spinner.stop();b.handleError(a)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")})); -b.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var a=g.getGraphBounds();b.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((a.y+a.height-g.view.translate.y)/g.view.scale)+2,function(a,c,d,e,f,g,k,l){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(m){b.spinner.stop();m=new EmbedDialog(b,'<iframe frameborder="0" style="width:'+k+";height:"+l+';" src="'+b.createLink(a,c,d,e,f,g,m)+'"></iframe>'); -b.showDialog(m.container,440,240,!0,!0);m.init()})},!0)}));b.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){b.showPublishLinkDialog(null,null,null,null,function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(k){b.spinner.stop();k=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,k));b.showDialog(k.container,440,240,!0,!0);k.init()})})}));b.actions.addAction("microsoftOffice...",function(){b.openLink("https://office.draw.io")}); +b.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var a=g.getGraphBounds();b.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((a.y+a.height-g.view.translate.y)/g.view.scale)+2,function(a,c,d,e,f,g,k,m){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(l){b.spinner.stop();l=new EmbedDialog(b,'<iframe frameborder="0" style="width:'+k+";height:"+m+';" src="'+b.createLink(a,c,d,e,f,g,l)+'"></iframe>'); +b.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));b.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){b.showPublishLinkDialog(null,null,null,null,function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(k){b.spinner.stop();k=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,k));b.showDialog(k.container,440,240,!0,!0);k.init()})})}));b.actions.addAction("microsoftOffice...",function(){b.openLink("https://office.draw.io")}); b.actions.addAction("googleDocs...",function(){b.openLink("http://docsaddon.draw.io")});b.actions.addAction("googleSlides...",function(){b.openLink("https://slidesaddon.draw.io")});b.actions.addAction("googleSheets...",function(){b.openLink("https://sheetsaddon.draw.io")});b.actions.addAction("googleSites...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();a=new GoogleSitesDialog(b,a);b.showDialog(a.container,420, 256,!0,!0);a.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)f=b.actions.addAction("scratchpad",function(){b.toggleScratchpad()}),f.setToggleAction(!0),f.setSelectedCallback(function(){return null!=b.scratchpad}),b.actions.addAction("plugins...",function(){b.showDialog((new PluginsDialog(b)).container,360,170,!0,!1)});f=b.actions.addAction("search",function(){var a=b.sidebar.isEntryVisible("search");b.sidebar.showPalette("search",!a);isLocalStorage&&(mxSettings.settings.search=!a,mxSettings.save())}); f.setToggleAction(!0);f.setSelectedCallback(function(){return b.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(b.actions.get("save").funct=function(a){g.isEditing()&&g.stopEditing();var c="0"!=urlParams.pages||null!=b.pages&&1<b.pages.length?b.getFileData(!0):mxUtils.getXml(b.editor.getGraphXml());if("json"==urlParams.proto){var d=b.createLoadMessage("save");d.xml=c;a&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&& (b.editor.modified=!1,b.editor.setStatus(""));null!=b.getCurrentFile()&&b.saveFile()},b.actions.addAction("saveAndExit",function(){b.actions.get("save").funct(!0)}),b.actions.addAction("exit",function(){var a=function(){b.editor.modified=!1;var a="json"==urlParams.proto?JSON.stringify({event:"exit",modified:b.editor.modified}):"";(window.opener||window.parent).postMessage(a,"*")};b.editor.modified?b.confirm(mxResources.get("allChangesLost"),null,a,mxResources.get("cancel"),mxResources.get("discardChanges")): a()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){b.isExportToCanvas()?(this.addMenuItems(a,["exportPng"],c),b.jpgSupported&&this.addMenuItems(a,["exportJpg"],c)):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(a,["exportPng","exportJpg"],c);this.addMenuItems(a,["exportSvg","-"],c);b.isOffline()||b.printPdfExport?this.addMenuItems(a,["exportPdf"],c):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(a,["exportPdf"],c);mxClient.IS_IE|| "undefined"===typeof VsdxExport&&b.isOffline()||this.addMenuItems(a,["exportVsdx"],c);this.addMenuItems(a,["-","exportHtml","exportXml","exportUrl"],c);b.isOffline()||(a.addSeparator(c),this.addMenuItem(a,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(a,c){function d(a){a.pickFile(function(c){b.spinner.spin(document.body,mxResources.get("loading"))&&a.getFile(c,function(a){var c="data:image/"==a.getData().substring(0, -11)?f(a.getTitle()):"text/xml";/\.svg$/i.test(a.getTitle())&&!b.editor.isDataSvg(a.getData())&&(a.setData(b.createSvgDataUri(a.getData())),c="image/svg+xml");e(a.getData(),c,a.getTitle())},function(a){b.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)},a==b.drive)},!0)}var e=mxUtils.bind(this,function(a,c,d){var e=g.view,f=g.getGraphBounds(),k=g.snap(Math.ceil(Math.max(0,f.x/e.scale-e.translate.x)+4*g.gridSize)),l=g.snap(Math.ceil(Math.max(0,(f.y+f.height)/e.scale-e.translate.y)+4* -g.gridSize));"data:image/"==a.substring(0,11)?b.loadImage(a,mxUtils.bind(this,function(e){var f=!0,m=mxUtils.bind(this,function(){b.resizeImage(e,a,mxUtils.bind(this,function(e,m,n){e=f?Math.min(1,Math.min(b.maxImageSize/m,b.maxImageSize/n)):1;b.importFile(a,c,k,l,Math.round(m*e),Math.round(n*e),d,function(a){b.spinner.stop();g.setSelectionCells(a);g.scrollCellToVisible(g.getSelectionCell())})}),f)});a.length>b.resampleThreshold?b.confirmImageResize(function(a){f=a;m()}):m()}),mxUtils.bind(this,function(){b.handleError({message:mxResources.get("cannotOpenFile")})})): -b.importFile(a,c,k,l,0,0,d,function(a){b.spinner.stop();g.setSelectionCells(a);g.scrollCellToVisible(g.getSelectionCell())})}),f=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)?b="image/gif":/\.pdf$/i.test(a)&&(b="application/pdf");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=b.drive?a.addItem(mxResources.get("googleDrive")+"...",null,function(){d(b.drive)},c):k&&"function"===typeof window.DriveClient&& +11)?f(a.getTitle()):"text/xml";/\.svg$/i.test(a.getTitle())&&!b.editor.isDataSvg(a.getData())&&(a.setData(b.createSvgDataUri(a.getData())),c="image/svg+xml");e(a.getData(),c,a.getTitle())},function(a){b.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)},a==b.drive)},!0)}var e=mxUtils.bind(this,function(a,c,d){var e=g.view,f=g.getGraphBounds(),k=g.snap(Math.ceil(Math.max(0,f.x/e.scale-e.translate.x)+4*g.gridSize)),m=g.snap(Math.ceil(Math.max(0,(f.y+f.height)/e.scale-e.translate.y)+4* +g.gridSize));"data:image/"==a.substring(0,11)?b.loadImage(a,mxUtils.bind(this,function(e){var f=!0,l=mxUtils.bind(this,function(){b.resizeImage(e,a,mxUtils.bind(this,function(e,l,n){e=f?Math.min(1,Math.min(b.maxImageSize/l,b.maxImageSize/n)):1;b.importFile(a,c,k,m,Math.round(l*e),Math.round(n*e),d,function(a){b.spinner.stop();g.setSelectionCells(a);g.scrollCellToVisible(g.getSelectionCell())})}),f)});a.length>b.resampleThreshold?b.confirmImageResize(function(a){f=a;l()}):l()}),mxUtils.bind(this,function(){b.handleError({message:mxResources.get("cannotOpenFile")})})): +b.importFile(a,c,k,m,0,0,d,function(a){b.spinner.stop();g.setSelectionCells(a);g.scrollCellToVisible(g.getSelectionCell())})}),f=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)?b="image/gif":/\.pdf$/i.test(a)&&(b="application/pdf");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=b.drive?a.addItem(mxResources.get("googleDrive")+"...",null,function(){d(b.drive)},c):k&&"function"===typeof window.DriveClient&& a.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=b.oneDrive?a.addItem(mxResources.get("oneDrive")+"...",null,function(){d(b.oneDrive)},c):m&&"function"===typeof window.OneDriveClient&&a.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=b.dropbox?a.addItem(mxResources.get("dropbox")+"...",null,function(){d(b.dropbox)},c):n&&"function"===typeof window.DropboxClient&&a.addItem(mxResources.get("dropbox")+ " ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);null!=b.gitHub&&a.addItem(mxResources.get("github")+"...",null,function(){d(b.gitHub)},c);null!=b.gitLab&&a.addItem(mxResources.get("gitlab")+"...",null,function(){d(b.gitLab)},c);null!=b.trello?a.addItem(mxResources.get("trello")+"...",null,function(){d(b.trello)},c):t&&"function"===typeof window.TrelloClient&&a.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1); a.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&a.addItem(mxResources.get("browser")+"...",null,function(){b.importLocalFile(!1)},c);a.addItem(mxResources.get("device")+"...",null,function(){b.importLocalFile(!0)},c);b.isOffline()||(a.addSeparator(c),a.addItem(mxResources.get("url")+"...",null,function(){var a=new FilenameDialog(b,"",mxResources.get("import"),function(a){if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(a)?"image/png": @@ -9794,7 +9799,7 @@ null!=a.desc.parents)for(var d=0;d<a.desc.parents.length;d++)if(a.desc.parents[d "...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&b.drive.showPermissions(a.getId())}catch(A){b.handleError(A)}}));this.put("embed",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB|| !/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||b.isOffline()||this.addMenuItems(a,["embedIframe"],c);"1"==urlParams.embed||b.isOffline()||this.addMenuItems(a,"- googleDocs googleSlides googleSheets - microsoftOffice".split(" "),c)})));var z=function(a,c,d,f){("plantUml"!=f||EditorUi.enablePlantUml&&!b.isOffline())&&a.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==f||"formatSql"== f||"plantUml"==f||"mermaid"==f){var a=new ParseDialog(b,d,f);b.showDialog(a.container,620,420,!0,!1);b.dialog.container.style.overflow="auto"}else a=new CreateGraphDialog(b,d,f),b.showDialog(a.container,620,420,!0,!1);a.init()}),c,null,e())},y=function(a,b,c,d){var e=g.isMouseInsertPoint()?g.getInsertPoint():g.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(e.x,e.y,b,c),d);a.vertex=!0;g.getModel().beginUpdate();try{a=g.addCell(a),g.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{g.getModel().endUpdate()}g.scrollCellToVisible(a); -g.setSelectionCell(a);g.container.focus();g.editAfterInsert&&g.startEditing(a);return a};b.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n){a=parseInt(a);!isNaN(a)&&0<a&&b.exportSvg(a/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));b.actions.put("insertText",new Action(mxResources.get("text"),function(){g.isEnabled()&& +g.setSelectionCell(a);g.container.focus();g.editAfterInsert&&g.startEditing(a);return a};b.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(a,c,d,e,f,g,k,m,l,n){a=parseInt(a);!isNaN(a)&&0<a&&b.exportSvg(a/100,c,d,e,f,g,k,!m,l,n)}),!0,null,"svg")}));b.actions.put("insertText",new Action(mxResources.get("text"),function(){g.isEnabled()&& !g.isCellLocked(g.getDefaultParent())&&g.startEditingAtCell(y("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+"+Shift+X").isEnabled=e;b.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&y("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=e;b.actions.put("insertEllipse", new Action(mxResources.get("ellipse"),function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=e;b.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=e;var C=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):z(a,b,mxResources.get(c[d])+ "...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - createShape insertFreehand - insertImage".split(" "),c);b.insertTemplateEnabled&&!b.isOffline()&&this.addMenuItems(a,["insertTemplate"],c);a.addSeparator(c);this.addSubmenu("insertLayout",a,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,c,mxResources.get("advanced"))})));this.put("insertLayout",new Menu(mxUtils.bind(this, @@ -9831,71 +9836,71 @@ b&&c<b.length;c++){var d=document.getElementById("extFont_"+b[c].name);null!=d&& (this.customFonts.push(f[e]),k=!0);k&&this.editorUi.fireEvent(new mxEventObject("customFontsChanged"))}if(0<this.customFonts.length){for(e=0;e<this.customFonts.length;e++)f=this.customFonts[e].name,g=this.customFonts[e].url,d(f,g),this.editorUi.editor.graph.addExtFont(f,g,!0);b.addSeparator(c);b.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){var b=new a(this.editorUi,[]);this.editorUi.editor.graph.model.execute(b);this.customFonts=[];this.editorUi.fireEvent(new mxEventObject("customFontsChanged"))}), c);b.addSeparator(c)}b.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var a=this.editorUi.editor.graph,b=mxConstants.DEFAULT_FONTFAMILY,c="s",d=null,e=a.getView().getState(a.getSelectionCell());null!=e&&(b=e.style[mxConstants.STYLE_FONTFAMILY]||b,c=e.style.FType||c,"w"==c&&(d=this.editorUi.editor.graph.extFonts,e=null,null!=d&&(e=d.find(function(a){return a.name==b})),d=null!=e?e.url:mxResources.get("urlNofFound",null,"URL not found"),0==d.indexOf(PROXY_URL)&&(d=decodeURIComponent(d.substr((PROXY_URL+ "?url=").length)))));c=new FontDialog(this.editorUi,b,d,c,mxUtils.bind(this,function(b,c,d){if(null!=b&&0<b.length){a.getModel().beginUpdate();try{a.stopEditing(!1);a.setCellStyles(mxConstants.STYLE_FONTFAMILY,b);"s"!=d&&(a.setCellStyles("FType",d),0==c.indexOf("http://")&&(c=PROXY_URL+"?url="+encodeURIComponent(c)),this.editorUi.editor.graph.addExtFont(b,c));d=!0;for(var e=0;e<this.customFonts.length;e++)if(this.customFonts[e].name==b){d=!1;break}d&&(this.customFonts.push({name:b,url:c}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged")))}finally{a.getModel().endUpdate()}}})); -this.editorUi.showDialog(c.container,380,250,!0,!0);c.init()}),c,null,!0)})))}})();function DiagramPage(a,d){this.node=a;null!=d?this.node.setAttribute("id",d):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; -DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,d,c){this.ui=a;this.page=d;this.previous=this.name=c}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; -function MovePage(a,d,c){this.ui=a;this.oldIndex=d;this.newIndex=c}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; -function SelectPage(a,d,c){this.ui=a;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d),null!=c&&(d.viewState=c,this.neverShown=!1))} -SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,d=this.ui.editor,c=d.graph,b=Graph.compressNode(d.getGraphXml(!0));mxUtils.setTextContent(a.node,b);a.viewState=c.getViewState();a.root=c.model.root;null!=a.model&&a.model.rootChanged(a.root);c.view.clear(a.root,!0);c.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;c.model.prefix=Editor.guid()+"-";c.model.rootChanged(a.root); -c.setViewState(a.viewState);c.gridEnabled=c.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);d.updateGraphComponents();c.view.validate();c.blockMathRender=!0;c.sizeDidChange();c.blockMathRender=!1;this.neverShown&&(this.neverShown=!1,c.selectUnlockedLayer());d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}}; -function ChangePage(a,d,c,b,g){SelectPage.call(this,a,c);this.relatedPage=d;this.index=b;this.previousIndex=null;this.noSelect=g}mxUtils.extend(ChangePage,SelectPage); +this.editorUi.showDialog(c.container,380,250,!0,!0);c.init()}),c,null,!0)})))}})();function DiagramPage(a,c){this.node=a;null!=c?this.node.setAttribute("id",c):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; +DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,c,d){this.ui=a;this.page=c;this.previous=this.name=d}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; +function MovePage(a,c,d){this.ui=a;this.oldIndex=c;this.newIndex=d}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; +function SelectPage(a,c,d){this.ui=a;this.previousPage=this.page=c;this.neverShown=!0;null!=c&&(this.neverShown=null==c.viewState,this.ui.updatePageRoot(c),null!=d&&(c.viewState=d,this.neverShown=!1))} +SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,c=this.ui.editor,d=c.graph,b=Graph.compressNode(c.getGraphXml(!0));mxUtils.setTextContent(a.node,b);a.viewState=d.getViewState();a.root=d.model.root;null!=a.model&&a.model.rootChanged(a.root);d.view.clear(a.root,!0);d.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;d.model.prefix=Editor.guid()+"-";d.model.rootChanged(a.root); +d.setViewState(a.viewState);d.gridEnabled=d.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);c.updateGraphComponents();d.view.validate();d.blockMathRender=!0;d.sizeDidChange();d.blockMathRender=!1;this.neverShown&&(this.neverShown=!1,d.selectUnlockedLayer());c.graph.fireEvent(new mxEventObject(mxEvent.ROOT));c.fireEvent(new mxEventObject("pageSelected","change",this))}}; +function ChangePage(a,c,d,b,g){SelectPage.call(this,a,d);this.relatedPage=c;this.index=b;this.previousIndex=null;this.noSelect=g}mxUtils.extend(ChangePage,SelectPage); ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var a=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(a,1);this.index=a}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};EditorUi.prototype.tabContainerHeight=38; -EditorUi.prototype.getSelectedPageIndex=function(){var a=null;if(null!=this.pages&&null!=this.currentPage)for(var d=0;d<this.pages.length;d++)if(this.pages[d]==this.currentPage){a=d;break}return a};EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var d=0;d<this.pages.length;d++)if(this.pages[d].getId()==a)return this.pages[d];return null}; -EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,d=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height; -this.tabContainer.style.height=null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";b!=this.tabContainer.style.height&&this.refresh(!1)}d.apply(a.view,arguments)});var c=null,b=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=c&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0, -a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),c=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?1!=MathJax.Hub.queue.pending||null==this.editor||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){null!=this.editor&&this.editor.graph.refresh()})): +EditorUi.prototype.getSelectedPageIndex=function(){var a=null;if(null!=this.pages&&null!=this.currentPage)for(var c=0;c<this.pages.length;c++)if(this.pages[c]==this.currentPage){a=c;break}return a};EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var c=0;c<this.pages.length;c++)if(this.pages[c].getId()==a)return this.pages[c];return null}; +EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,c=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height; +this.tabContainer.style.height=null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";b!=this.tabContainer.style.height&&this.refresh(!1)}c.apply(a.view,arguments)});var d=null,b=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=d&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0, +a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft=a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),d=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?1!=MathJax.Hub.queue.pending||null==this.editor||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){null!=this.editor&&this.editor.graph.refresh()})): "undefined"===typeof Editor.MathJaxClear||null!=this.editor&&this.editor.graph.mathEnabled||Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,c){for(var d=c.getProperty("edit").changes,e=0;e<d.length;e++)if(d[e]instanceof SelectPage||d[e]instanceof RenamePage||d[e]instanceof MovePage||d[e]instanceof mxRootChange){b();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}}; -EditorUi.prototype.restoreViewState=function(a,d,c){a=null!=a?this.getPageById(a.getId()):null;var b=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,d):(b.setViewState(d),this.editor.updateGraphComponents(),b.view.revalidate(),b.sizeDidChange()),b.container.scrollLeft=b.view.translate.x*b.view.scale+d.scrollLeft,b.container.scrollTop=b.view.translate.y*b.view.scale+d.scrollTop,b.restoreSelection(c))}; -Graph.prototype.createViewState=function(a){var d=a.getAttribute("page"),c=parseFloat(a.getAttribute("pageScale")),b=parseFloat(a.getAttribute("pageWidth")),g=parseFloat(a.getAttribute("pageHeight")),e=a.getAttribute("background"),k=a.getAttribute("backgroundImage"),k=null!=k&&0<k.length?JSON.parse(k):null,n=a.getAttribute("extFonts");if(n)try{n=n.split("|").map(function(a){a=a.split("^");return{name:a[0],url:a[1]}})}catch(m){console.log("ExtFonts format error: "+m.message)}return{gridEnabled:"0"!= -a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=e&&0<e.length?e:null,backgroundImage:null!=k?new mxImage(k.src,k.width,k.height):null,pageScale:isNaN(c)?mxGraph.prototype.pageScale:c,pageFormat:isNaN(b)||isNaN(g)?"undefined"=== +EditorUi.prototype.restoreViewState=function(a,c,d){a=null!=a?this.getPageById(a.getId()):null;var b=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,c):(b.setViewState(c),this.editor.updateGraphComponents(),b.view.revalidate(),b.sizeDidChange()),b.container.scrollLeft=b.view.translate.x*b.view.scale+c.scrollLeft,b.container.scrollTop=b.view.translate.y*b.view.scale+c.scrollTop,b.restoreSelection(d))}; +Graph.prototype.createViewState=function(a){var c=a.getAttribute("page"),d=parseFloat(a.getAttribute("pageScale")),b=parseFloat(a.getAttribute("pageWidth")),g=parseFloat(a.getAttribute("pageHeight")),e=a.getAttribute("background"),k=a.getAttribute("backgroundImage"),k=null!=k&&0<k.length?JSON.parse(k):null,n=a.getAttribute("extFonts");if(n)try{n=n.split("|").map(function(a){a=a.split("^");return{name:a[0],url:a[1]}})}catch(m){console.log("ExtFonts format error: "+m.message)}return{gridEnabled:"0"!= +a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"==a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=c?"0"!=c:this.defaultPageVisible,background:null!=e&&0<e.length?e:null,backgroundImage:null!=k?new mxImage(k.src,k.width,k.height):null,pageScale:isNaN(d)?mxGraph.prototype.pageScale:d,pageFormat:isNaN(b)||isNaN(g)?"undefined"=== typeof mxSettings?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,b,g),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,extFonts:n||[]}}; -Graph.prototype.saveViewState=function(a,d,c){c||(d.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),d.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),d.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),d.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),d.setAttribute("connect",null==a||a.connect?"1":"0"),d.setAttribute("arrows",null==a||a.arrows?"1":"0"),d.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),d.setAttribute("fold", -null==a||a.foldingEnabled?"1":"0"));d.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);c=null!=a?a.pageFormat:"undefined"===typeof mxSettings?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=c&&(d.setAttribute("pageWidth",c.width),d.setAttribute("pageHeight",c.height));null!=a&&null!=a.background&&d.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&d.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));d.setAttribute("math", -null!=a&&a.mathEnabled?"1":"0");d.setAttribute("shadow",null!=a&&a.shadowVisible?"1":"0");null!=a&&null!=a.extFonts&&0<a.extFonts.length&&d.setAttribute("extFonts",a.extFonts.map(function(a){return a.name+"^"+a.url}).join("|"))}; +Graph.prototype.saveViewState=function(a,c,d){d||(c.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),c.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),c.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),c.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),c.setAttribute("connect",null==a||a.connect?"1":"0"),c.setAttribute("arrows",null==a||a.arrows?"1":"0"),c.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),c.setAttribute("fold", +null==a||a.foldingEnabled?"1":"0"));c.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);d=null!=a?a.pageFormat:"undefined"===typeof mxSettings?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=d&&(c.setAttribute("pageWidth",d.width),c.setAttribute("pageHeight",d.height));null!=a&&null!=a.background&&c.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));c.setAttribute("math", +null!=a&&a.mathEnabled?"1":"0");c.setAttribute("shadow",null!=a&&a.shadowVisible?"1":"0");null!=a&&null!=a.extFonts&&0<a.extFonts.length&&c.setAttribute("extFonts",a.extFonts.map(function(a){return a.name+"^"+a.url}).join("|"))}; Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(), arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled,extFonts:this.extFonts}}; -Graph.prototype.setViewState=function(a,d){if(null!=a){this.lastPasteXml=a.lastPasteXml;this.pasteCounter=a.pasteCounter||0;this.mathEnabled=a.mathEnabled;this.gridEnabled=a.gridEnabled;this.gridSize=a.gridSize;this.graphHandler.guidesEnabled=a.guidesEnabled;this.foldingEnabled=a.foldingEnabled;this.setShadowVisible(a.shadowVisible,!1);this.scrollbars=a.scrollbars;this.pageVisible=!this.isViewer()&&a.pageVisible;this.background=a.background;this.backgroundImage=a.backgroundImage;this.pageScale=a.pageScale; -this.pageFormat=a.pageFormat;this.view.currentRoot=a.currentRoot;this.defaultParent=a.defaultParent;this.connectionArrowsEnabled=a.arrows;this.setTooltips(a.tooltips);this.setConnectable(a.connect);var c=this.extFonts;this.extFonts=a.extFonts||[];if(d&&null!=c)for(var b=0;b<c.length;b++){var g=document.getElementById("extFont_"+c[b].name);null!=g&&g.parentNode.removeChild(g)}for(b=0;b<this.extFonts.length;b++)this.addExtFont(this.extFonts[b].name,this.extFonts[b].url,!0);this.view.scale=null!=a.scale? +Graph.prototype.setViewState=function(a,c){if(null!=a){this.lastPasteXml=a.lastPasteXml;this.pasteCounter=a.pasteCounter||0;this.mathEnabled=a.mathEnabled;this.gridEnabled=a.gridEnabled;this.gridSize=a.gridSize;this.graphHandler.guidesEnabled=a.guidesEnabled;this.foldingEnabled=a.foldingEnabled;this.setShadowVisible(a.shadowVisible,!1);this.scrollbars=a.scrollbars;this.pageVisible=!this.isViewer()&&a.pageVisible;this.background=a.background;this.backgroundImage=a.backgroundImage;this.pageScale=a.pageScale; +this.pageFormat=a.pageFormat;this.view.currentRoot=a.currentRoot;this.defaultParent=a.defaultParent;this.connectionArrowsEnabled=a.arrows;this.setTooltips(a.tooltips);this.setConnectable(a.connect);var d=this.extFonts;this.extFonts=a.extFonts||[];if(c&&null!=d)for(var b=0;b<d.length;b++){var g=document.getElementById("extFont_"+d[b].name);null!=g&&g.parentNode.removeChild(g)}for(b=0;b<this.extFonts.length;b++)this.addExtFont(this.extFonts[b].name,this.extFonts[b].url,!0);this.view.scale=null!=a.scale? a.scale:1;null==this.view.currentRoot||this.model.contains(this.view.currentRoot)||(this.view.currentRoot=null);null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer());null!=a.translate&&(this.view.translate=a.translate)}else this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=!0,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat="undefined"===typeof mxSettings?mxGraph.prototype.pageFormat: mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=!1,this.connectionArrowsEnabled=!0,this.extFonts=[];this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged", "state",a))}; -Graph.prototype.addExtFont=function(a,d,c){if(a&&d){var b="extFont_"+a;if(null==document.getElementById(b))if(0==d.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",d,null,b);else{document.getElementsByTagName("head");var g=document.createElement("style");g.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+a+'";\n\tsrc: url("'+d+'");\n}'));g.setAttribute("id",b);document.getElementsByTagName("head")[0].appendChild(g)}if(!c){null==this.extFonts&&(this.extFonts=[]);c=this.extFonts; -b=!0;for(g=0;g<c.length;g++)if(c[g].name==a){b=!1;break}b&&this.extFonts.push({name:a,url:d})}}}; -EditorUi.prototype.updatePageRoot=function(a,d){if(null==a.root){var c=this.editor.extractGraphModel(a.node,null,d),b=Editor.extractParserError(c);if(b)throw Error(b);null!=c?(a.graphModelNode=c,a.viewState=this.editor.graph.createViewState(c),b=new mxCodec(c.ownerDocument),a.root=b.decode(c).root):a.root=this.editor.graph.model.createRoot()}else if(null==a.viewState){if(null==a.graphModelNode){c=this.editor.extractGraphModel(a.node);if(b=Editor.extractParserError(c))throw Error(b);null!=c&&(a.graphModelNode= -c)}null!=a.graphModelNode&&(a.viewState=this.editor.graph.createViewState(a.graphModelNode))}return a}; -EditorUi.prototype.selectPage=function(a,d,c){try{if(a!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d=null!=d?d:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var b=this.editor.graph.model.createUndoableEdit();b.ignoreEdit=!0;var g=new SelectPage(this,a,c);g.execute();b.add(g);b.notify();this.editor.graph.tooltipHandler.hide();d||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",b))}}catch(e){this.handleError(e)}}; -EditorUi.prototype.selectNextPage=function(a){var d=this.currentPage;null!=d&&null!=this.pages&&(d=mxUtils.indexOf(this.pages,d),a?this.selectPage(this.pages[mxUtils.mod(d+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(d-1,this.pages.length)]))}; -EditorUi.prototype.insertPage=function(a,d){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage(null,this.createPageId());d=null!=d?d:this.pages.length;var c=new ChangePage(this,a,a,d);this.editor.graph.model.execute(c)}return a};EditorUi.prototype.createPageId=function(){var a;do a=Editor.guid();while(null!=this.getPageById(a));return a}; -EditorUi.prototype.createPage=function(a,d){var c=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"),d);c.setName(null!=a?a:this.createPageName());return c};EditorUi.prototype.createPageName=function(){for(var a={},d=0;d<this.pages.length;d++){var c=this.pages[d].getName();null!=c&&0<c.length&&(a[c]=c)}d=this.pages.length;do c=mxResources.get("pageWithNumber",[++d]);while(null!=a[c]);return c}; -EditorUi.prototype.removePage=function(a){try{var d=this.editor.graph,c=mxUtils.indexOf(this.pages,a);if(d.isEnabled()&&0<=c){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d.model.beginUpdate();try{var b=this.currentPage;b==a&&1<this.pages.length?(c==this.pages.length-1?c--:c++,b=this.pages[c]):1>=this.pages.length&&(b=this.insertPage(),d.model.execute(new RenamePage(this,b,mxResources.get("pageWithNumber",[1]))));d.model.execute(new ChangePage(this,a,b))}finally{d.model.endUpdate()}}}catch(g){this.handleError(g)}return a}; -EditorUi.prototype.duplicatePage=function(a,d){var c=null;try{var b=this.editor.graph;if(b.isEnabled()){b.isEditing()&&b.stopEditing();var g=a.node.cloneNode(!1);g.removeAttribute("id");c=new DiagramPage(g);c.root=b.cloneCell(b.model.root);c.viewState=b.getViewState();c.viewState.scale=1;c.viewState.scrollLeft=null;c.viewState.scrollTop=null;c.viewState.currentRoot=null;c.viewState.defaultParent=null;c.setName(d);c=this.insertPage(c,mxUtils.indexOf(this.pages,a)+1)}}catch(e){this.handleError(e)}return c}; -EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(c){null!=c&&0<c.length&&this.editor.graph.model.execute(new RenamePage(this,a,c))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return a};EditorUi.prototype.movePage=function(a,d){this.editor.graph.model.execute(new MovePage(this,a,d))}; +Graph.prototype.addExtFont=function(a,c,d){if(a&&c){var b="extFont_"+a;if(null==document.getElementById(b))if(0==c.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",c,null,b);else{document.getElementsByTagName("head");var g=document.createElement("style");g.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+a+'";\n\tsrc: url("'+c+'");\n}'));g.setAttribute("id",b);document.getElementsByTagName("head")[0].appendChild(g)}if(!d){null==this.extFonts&&(this.extFonts=[]);d=this.extFonts; +b=!0;for(g=0;g<d.length;g++)if(d[g].name==a){b=!1;break}b&&this.extFonts.push({name:a,url:c})}}}; +EditorUi.prototype.updatePageRoot=function(a,c){if(null==a.root){var d=this.editor.extractGraphModel(a.node,null,c),b=Editor.extractParserError(d);if(b)throw Error(b);null!=d?(a.graphModelNode=d,a.viewState=this.editor.graph.createViewState(d),b=new mxCodec(d.ownerDocument),a.root=b.decode(d).root):a.root=this.editor.graph.model.createRoot()}else if(null==a.viewState){if(null==a.graphModelNode){d=this.editor.extractGraphModel(a.node);if(b=Editor.extractParserError(d))throw Error(b);null!=d&&(a.graphModelNode= +d)}null!=a.graphModelNode&&(a.viewState=this.editor.graph.createViewState(a.graphModelNode))}return a}; +EditorUi.prototype.selectPage=function(a,c,d){try{if(a!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c=null!=c?c:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var b=this.editor.graph.model.createUndoableEdit();b.ignoreEdit=!0;var g=new SelectPage(this,a,d);g.execute();b.add(g);b.notify();this.editor.graph.tooltipHandler.hide();c||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",b))}}catch(e){this.handleError(e)}}; +EditorUi.prototype.selectNextPage=function(a){var c=this.currentPage;null!=c&&null!=this.pages&&(c=mxUtils.indexOf(this.pages,c),a?this.selectPage(this.pages[mxUtils.mod(c+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(c-1,this.pages.length)]))}; +EditorUi.prototype.insertPage=function(a,c){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage(null,this.createPageId());c=null!=c?c:this.pages.length;var d=new ChangePage(this,a,a,c);this.editor.graph.model.execute(d)}return a};EditorUi.prototype.createPageId=function(){var a;do a=Editor.guid();while(null!=this.getPageById(a));return a}; +EditorUi.prototype.createPage=function(a,c){var d=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"),c);d.setName(null!=a?a:this.createPageName());return d};EditorUi.prototype.createPageName=function(){for(var a={},c=0;c<this.pages.length;c++){var d=this.pages[c].getName();null!=d&&0<d.length&&(a[d]=d)}c=this.pages.length;do d=mxResources.get("pageWithNumber",[++c]);while(null!=a[d]);return d}; +EditorUi.prototype.removePage=function(a){try{var c=this.editor.graph,d=mxUtils.indexOf(this.pages,a);if(c.isEnabled()&&0<=d){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c.model.beginUpdate();try{var b=this.currentPage;b==a&&1<this.pages.length?(d==this.pages.length-1?d--:d++,b=this.pages[d]):1>=this.pages.length&&(b=this.insertPage(),c.model.execute(new RenamePage(this,b,mxResources.get("pageWithNumber",[1]))));c.model.execute(new ChangePage(this,a,b))}finally{c.model.endUpdate()}}}catch(g){this.handleError(g)}return a}; +EditorUi.prototype.duplicatePage=function(a,c){var d=null;try{var b=this.editor.graph;if(b.isEnabled()){b.isEditing()&&b.stopEditing();var g=a.node.cloneNode(!1);g.removeAttribute("id");d=new DiagramPage(g);d.root=b.cloneCell(b.model.root);d.viewState=b.getViewState();d.viewState.scale=1;d.viewState.scrollLeft=null;d.viewState.scrollTop=null;d.viewState.currentRoot=null;d.viewState.defaultParent=null;d.setName(c);d=this.insertPage(d,mxUtils.indexOf(this.pages,a)+1)}}catch(e){this.handleError(e)}return d}; +EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var c=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(c){null!=c&&0<c.length&&this.editor.graph.model.execute(new RenamePage(this,a,c))}),mxResources.get("rename"));this.showDialog(c.container,300,80,!0,!0);c.init()}return a};EditorUi.prototype.movePage=function(a,c){this.editor.graph.model.execute(new MovePage(this,a,c))}; EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.className="geTabContainer";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a}; -EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,d=document.createElement("div");d.style.position="relative";d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.style.verticalAlign="top";d.style.height=this.tabContainer.style.height;d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.fontSize="13px";d.style.marginLeft="30px";for(var c=this.editor.isChromelessView()?29:59,b=Math.min(140,Math.max(20,(this.tabContainer.clientWidth- -c)/this.pages.length)+1),g=null,e=0;e<this.pages.length;e++)mxUtils.bind(this,function(b,c){this.pages[b]==this.currentPage?(c.className="geActivePage",c.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):c.className="geInactivePage";c.setAttribute("draggable","true");mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),g=b):mxEvent.consume(c)}));mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(a){g= -null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null!=g&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=g&&b!=g&&this.movePage(g,b);a.stopPropagation();a.preventDefault()}));d.appendChild(c)})(e,this.createTabForPage(this.pages[e],b,this.pages[e]!=this.currentPage,e+1));this.tabContainer.innerHTML="";this.tabContainer.appendChild(d);b=this.createPageMenuTab(); -this.tabContainer.appendChild(b);b=null;this.isPageInsertTabVisible()&&(b=this.createPageInsertTab(),this.tabContainer.appendChild(b));if(d.clientWidth>this.tabContainer.clientWidth-c){null!=b&&(b.style.position="absolute",b.style.right="0px",d.style.marginRight="30px");var k=this.createControlTab(4," ❮ ");k.style.position="absolute";k.style.right=this.editor.chromeless?"29px":"55px";k.style.fontSize="13pt";this.tabContainer.appendChild(k);var n=this.createControlTab(4," ❯"); -n.style.position="absolute";n.style.right=this.editor.chromeless?"0px":"29px";n.style.fontSize="13pt";this.tabContainer.appendChild(n);var m=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));d.style.width=m+"px";mxEvent.addListener(k,"click",mxUtils.bind(this,function(a){d.scrollLeft-=Math.max(20,m-20);mxUtils.setOpacity(k,0<d.scrollLeft?100:50);mxUtils.setOpacity(n,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(k,0<d.scrollLeft?100: -50);mxUtils.setOpacity(n,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.addListener(n,"click",mxUtils.bind(this,function(a){d.scrollLeft+=Math.max(20,m-20);mxUtils.setOpacity(k,0<d.scrollLeft?100:50);mxUtils.setOpacity(n,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()}; -EditorUi.prototype.createTab=function(a){var d=document.createElement("div");d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.style.whiteSpace="nowrap";d.style.boxSizing="border-box";d.style.position="relative";d.style.overflow="hidden";d.style.textAlign="center";d.style.marginLeft="-1px";d.style.height=this.tabContainer.clientHeight+"px";d.style.padding="12px 4px 8px 4px";d.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #e8eaed";d.style.borderTopStyle="none";d.style.borderBottomStyle= -"none";d.style.backgroundColor=this.tabContainer.style.backgroundColor;d.style.cursor="move";d.style.color="gray";a&&(mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(d.style.backgroundColor="dark"==uiTheme?"black":"#e8eaed",mxEvent.consume(a))})),mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,function(a){d.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return d}; -EditorUi.prototype.createControlTab=function(a,d){var c=this.createTab(!0);c.style.lineHeight=this.tabContainerHeight+"px";c.style.paddingTop=a+"px";c.style.cursor="pointer";c.style.width="30px";c.innerHTML=d;null!=c.firstChild&&null!=c.firstChild.style&&mxUtils.setOpacity(c.firstChild,40);return c}; +EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,c=document.createElement("div");c.style.position="relative";c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";c.style.verticalAlign="top";c.style.height=this.tabContainer.style.height;c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.fontSize="13px";c.style.marginLeft="30px";for(var d=this.editor.isChromelessView()?29:59,b=Math.min(140,Math.max(20,(this.tabContainer.clientWidth- +d)/this.pages.length)+1),g=null,e=0;e<this.pages.length;e++)mxUtils.bind(this,function(b,d){this.pages[b]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),g=b):mxEvent.consume(c)}));mxEvent.addListener(d,"dragend",mxUtils.bind(this,function(a){g= +null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=g&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=g&&b!=g&&this.movePage(g,b);a.stopPropagation();a.preventDefault()}));c.appendChild(d)})(e,this.createTabForPage(this.pages[e],b,this.pages[e]!=this.currentPage,e+1));this.tabContainer.innerHTML="";this.tabContainer.appendChild(c);b=this.createPageMenuTab(); +this.tabContainer.appendChild(b);b=null;this.isPageInsertTabVisible()&&(b=this.createPageInsertTab(),this.tabContainer.appendChild(b));if(c.clientWidth>this.tabContainer.clientWidth-d){null!=b&&(b.style.position="absolute",b.style.right="0px",c.style.marginRight="30px");var k=this.createControlTab(4," ❮ ");k.style.position="absolute";k.style.right=this.editor.chromeless?"29px":"55px";k.style.fontSize="13pt";this.tabContainer.appendChild(k);var n=this.createControlTab(4," ❯"); +n.style.position="absolute";n.style.right=this.editor.chromeless?"0px":"29px";n.style.fontSize="13pt";this.tabContainer.appendChild(n);var m=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));c.style.width=m+"px";mxEvent.addListener(k,"click",mxUtils.bind(this,function(a){c.scrollLeft-=Math.max(20,m-20);mxUtils.setOpacity(k,0<c.scrollLeft?100:50);mxUtils.setOpacity(n,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(k,0<c.scrollLeft?100: +50);mxUtils.setOpacity(n,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.addListener(n,"click",mxUtils.bind(this,function(a){c.scrollLeft+=Math.max(20,m-20);mxUtils.setOpacity(k,0<c.scrollLeft?100:50);mxUtils.setOpacity(n,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()}; +EditorUi.prototype.createTab=function(a){var c=document.createElement("div");c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";c.style.whiteSpace="nowrap";c.style.boxSizing="border-box";c.style.position="relative";c.style.overflow="hidden";c.style.textAlign="center";c.style.marginLeft="-1px";c.style.height=this.tabContainer.clientHeight+"px";c.style.padding="12px 4px 8px 4px";c.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #e8eaed";c.style.borderTopStyle="none";c.style.borderBottomStyle= +"none";c.style.backgroundColor=this.tabContainer.style.backgroundColor;c.style.cursor="move";c.style.color="gray";a&&(mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(c.style.backgroundColor="dark"==uiTheme?"black":"#e8eaed",mxEvent.consume(a))})),mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(a){c.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return c}; +EditorUi.prototype.createControlTab=function(a,c){var d=this.createTab(!0);d.style.lineHeight=this.tabContainerHeight+"px";d.style.paddingTop=a+"px";d.style.cursor="pointer";d.style.width="30px";d.innerHTML=c;null!=d.firstChild&&null!=d.firstChild.style&&mxUtils.setOpacity(d.firstChild,40);return d}; EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;margin-top:5px;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.marginLeft="0px";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var c=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var c= 0;c<this.pages.length;c++)mxUtils.bind(this,function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[c])}),b);this.pages[c]==this.currentPage&&a.addCheckmark(d,Editor.checkmarkImage)})(c);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var d=this.currentPage;null!=d&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this, function(){this.removePage(d)}),b),a.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(d,d.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(d,mxResources.get("copyOf",[d.getName()]))}),b))}}));c.div.className+=" geMenubarMenu";c.smartSeparators=!0;c.showDisabled=!0;c.autoExpand=!0;c.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(c,arguments);c.destroy()});var b= -mxEvent.getClientX(a),d=mxEvent.getClientY(a);c.popup(b,d,null,a);this.setCurrentMenu(c);mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a}; -EditorUi.prototype.createTabForPage=function(a,d,c,b){c=this.createTab(c);var g=a.getName()||mxResources.get("untitled"),e=a.getId();c.setAttribute("title",g+(null!=e?" ("+e+")":"")+" ["+b+"]");mxUtils.write(c,g);c.style.maxWidth=d+"px";c.style.width=d+"px";this.addTabListeners(a,c);42<d&&(c.style.textOverflow="ellipsis");return c}; -EditorUi.prototype.addTabListeners=function(a,d){mxEvent.disableContextMenu(d);var c=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,g=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(d){b=null!=this.currentMenu;g=a==this.currentPage;c.isMouseDown||g||this.selectPage(a)}),null,mxUtils.bind(this,function(e){if(c.isEnabled()&&!c.isMouseDown&&(mxEvent.isTouchEvent(e)&&g||mxEvent.isPopupTrigger(e))){c.popupMenuHandler.hideMenu(); -this.hideCurrentMenu();if(!mxEvent.isTouchEvent(e)||!b){var k=new mxPopupMenu(this.createPageMenu(a));k.div.className+=" geMenubarMenu";k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);this.resetCurrentMenu();k.destroy()});var n=mxEvent.getClientX(e),m=mxEvent.getClientY(e);k.popup(n,m,null,e);this.setCurrentMenu(k,d)}mxEvent.consume(e)}}))}; -EditorUi.prototype.getLinkForPage=function(a){if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var d=this.getCurrentFile();if(null!=d&&d.constructor!=LocalFile&&"draw.io"==this.getServiceName()){var c=this.getSearch("create title mode url drive splash state".split(" ")),c=c+((0==c.length?"?":"&")+"page-id="+a.getId());return window.location.protocol+"//"+window.location.host+"/"+c+"#"+d.getHash()}}return null}; -EditorUi.prototype.createPageMenu=function(a,d){return mxUtils.bind(this,function(c,b){c.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),b);c.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),b);c.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,d)}),b);var g=this.getLinkForPage(a);null!=g&&(c.addSeparator(b),c.addItem(mxResources.get("link"),null, -mxUtils.bind(this,function(){var a=new EmbedDialog(this,g);this.showDialog(a.container,440,240,!0,!0);a.init()}),b));c.addSeparator(b);c.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,mxResources.get("copyOf",[a.getName()]))}),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||(c.addSeparator(b),c.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null, -null,null,!0,!0))}),b))})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(d){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){a=b.oldIndex;b.oldIndex=b.newIndex;b.newIndex=a;return b};mxCodecRegistry.register(a)})(); -(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){a=b.previous;b.previous=b.name;b.name=a;return b};mxCodecRegistry.register(a)})(); -(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),d="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,b,g){g.setAttribute("relatedPage",b.relatedPage.getId());null==b.index&&(g.setAttribute("name",b.relatedPage.getName()),null!=b.relatedPage.viewState&&g.setAttribute("viewState",JSON.stringify(b.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(d, -a)?b:void 0})),null!=b.relatedPage.root&&a.encodeCell(b.relatedPage.root,g));return g};a.beforeDecode=function(a,b,d){d.ui=a.ui;d.relatedPage=d.ui.getPageById(b.getAttribute("relatedPage"));if(null==d.relatedPage){var c=b.ownerDocument.createElement("diagram");c.setAttribute("id",b.getAttribute("relatedPage"));c.setAttribute("name",b.getAttribute("name"));d.relatedPage=new DiagramPage(c);c=b.getAttribute("viewState");null!=c&&(d.relatedPage.viewState=JSON.parse(c),b.removeAttribute("viewState")); -b=b.cloneNode(!0);c=b.firstChild;if(null!=c)for(d.relatedPage.root=a.decodeCell(c,!1),d=c.nextSibling,c.parentNode.removeChild(c),c=d;null!=c;){d=c.nextSibling;if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var g=c.getAttribute("id");null==a.lookup(g)&&a.decodeCell(c)}c.parentNode.removeChild(c);c=d}}return b};a.afterDecode=function(a,b,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png";EditorUi.prototype.altShiftActions[68]= -"selectDescendants";var d=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,b,c,n,m){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var e=c.slice(),f=[],g=0;g<c.length;g++){var k=this.view.getState(c[g]),u=null!=k?k.style:this.getCellStyle(c[g]);"1"==mxUtils.getValue(u,"treeFolding","0")&&(this.traverse(c[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=c[g]&&f.push(a);return a==c[g]||!this.model.isCollapsed(a)})), -this.model.setCollapsed(c[g],a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);c=e;c=d.apply(this,arguments)}finally{this.model.endUpdate()}return c};var c=EditorUi.prototype.init;EditorUi.prototype.init=function(){c.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return z.isVertex(a)&&d(a)}function c(a){var b=!1;null!=a&&(b=q.view.getState(a),b="1"==(null!=b?b.style:q.getCellStyle(a)).treeMoving); +mxEvent.getClientX(a),g=mxEvent.getClientY(a);c.popup(b,g,null,a);this.setCurrentMenu(c);mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a}; +EditorUi.prototype.createTabForPage=function(a,c,d,b){d=this.createTab(d);var g=a.getName()||mxResources.get("untitled"),e=a.getId();d.setAttribute("title",g+(null!=e?" ("+e+")":"")+" ["+b+"]");mxUtils.write(d,g);d.style.maxWidth=c+"px";d.style.width=c+"px";this.addTabListeners(a,d);42<c&&(d.style.textOverflow="ellipsis");return d}; +EditorUi.prototype.addTabListeners=function(a,c){mxEvent.disableContextMenu(c);var d=this.editor.graph;mxEvent.addListener(c,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,g=!1;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(c){b=null!=this.currentMenu;g=a==this.currentPage;d.isMouseDown||g||this.selectPage(a)}),null,mxUtils.bind(this,function(e){if(d.isEnabled()&&!d.isMouseDown&&(mxEvent.isTouchEvent(e)&&g||mxEvent.isPopupTrigger(e))){d.popupMenuHandler.hideMenu(); +this.hideCurrentMenu();if(!mxEvent.isTouchEvent(e)||!b){var k=new mxPopupMenu(this.createPageMenu(a));k.div.className+=" geMenubarMenu";k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);this.resetCurrentMenu();k.destroy()});var n=mxEvent.getClientX(e),m=mxEvent.getClientY(e);k.popup(n,m,null,e);this.setCurrentMenu(k,c)}mxEvent.consume(e)}}))}; +EditorUi.prototype.getLinkForPage=function(a){if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var c=this.getCurrentFile();if(null!=c&&c.constructor!=LocalFile&&"draw.io"==this.getServiceName()){var d=this.getSearch("create title mode url drive splash state".split(" ")),d=d+((0==d.length?"?":"&")+"page-id="+a.getId());return window.location.protocol+"//"+window.location.host+"/"+d+"#"+c.getHash()}}return null}; +EditorUi.prototype.createPageMenu=function(a,c){return mxUtils.bind(this,function(d,b){d.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),b);d.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),b);d.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,c)}),b);var g=this.getLinkForPage(a);null!=g&&(d.addSeparator(b),d.addItem(mxResources.get("link"),null, +mxUtils.bind(this,function(){var a=new EmbedDialog(this,g);this.showDialog(a.container,440,240,!0,!0);a.init()}),b));d.addSeparator(b);d.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,mxResources.get("copyOf",[a.getName()]))}),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||(d.addSeparator(b),d.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null, +null,null,!0,!0))}),b))})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){a=b.oldIndex;b.oldIndex=b.newIndex;b.newIndex=a;return b};mxCodecRegistry.register(a)})(); +(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,d,b){b.ui=a.ui;return d};a.afterDecode=function(a,d,b){a=b.previous;b.previous=b.name;b.name=a;return b};mxCodecRegistry.register(a)})(); +(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),c="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,b,g){g.setAttribute("relatedPage",b.relatedPage.getId());null==b.index&&(g.setAttribute("name",b.relatedPage.getName()),null!=b.relatedPage.viewState&&g.setAttribute("viewState",JSON.stringify(b.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(c, +a)?b:void 0})),null!=b.relatedPage.root&&a.encodeCell(b.relatedPage.root,g));return g};a.beforeDecode=function(a,b,c){c.ui=a.ui;c.relatedPage=c.ui.getPageById(b.getAttribute("relatedPage"));if(null==c.relatedPage){var d=b.ownerDocument.createElement("diagram");d.setAttribute("id",b.getAttribute("relatedPage"));d.setAttribute("name",b.getAttribute("name"));c.relatedPage=new DiagramPage(d);d=b.getAttribute("viewState");null!=d&&(c.relatedPage.viewState=JSON.parse(d),b.removeAttribute("viewState")); +b=b.cloneNode(!0);d=b.firstChild;if(null!=d)for(c.relatedPage.root=a.decodeCell(d,!1),c=d.nextSibling,d.parentNode.removeChild(d),d=c;null!=d;){c=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var g=d.getAttribute("id");null==a.lookup(g)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=c}}return b};a.afterDecode=function(a,b,c){c.index=c.previousIndex;return c};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png";EditorUi.prototype.altShiftActions[68]= +"selectDescendants";var c=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,b,d,n,m){b=null!=b?b:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var e=d.slice(),f=[],g=0;g<d.length;g++){var k=this.view.getState(d[g]),u=null!=k?k.style:this.getCellStyle(d[g]);"1"==mxUtils.getValue(u,"treeFolding","0")&&(this.traverse(d[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=d[g]&&f.push(a);return a==d[g]||!this.model.isCollapsed(a)})), +this.model.setCollapsed(d[g],a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);d=e;d=c.apply(this,arguments)}finally{this.model.endUpdate()}return d};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return z.isVertex(a)&&d(a)}function c(a){var b=!1;null!=a&&(b=q.view.getState(a),b="1"==(null!=b?b.style:q.getCellStyle(a)).treeMoving); return b}function d(a){var b=!1;null!=a&&(a=z.getParent(a),b=q.view.getState(a),b="tree"==(null!=b?b.style:q.getCellStyle(a)).containerType);return b}function n(a){var b=!1;null!=a&&(a=z.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function m(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y== a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function t(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=q.cloneCells([d[0],a]);q.model.setTerminal(e[0],q.model.getTerminal(d[0],!0),!0);var f=m(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH|| f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;q.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=q.view.getState(a),l=q.view.scale;if(null!=k){var n=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=q.getOutgoingEdges(q.model.getTerminal(d[0], @@ -9911,10 +9916,10 @@ v.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);if(1==q.getSelec !1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");v.actions.addAction("selectParent",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");v.actions.addAction("selectDescendants",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}}, null,null,"Alt+Shift+D");var C=q.removeCells;q.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];z.isEdge(g)&&d(g)&&(e.push(g),g=z.getTerminal(g,!1));if(b(g)){var k=[];q.traverse(g,!0,function(a,b){null!=b&&k.push(b);if(1==q.getIncomingEdges(a).length)return k.push(a),!0;k=[];return!1});0<k.length&&(e=e.concat(k),g=q.getIncomingEdges(a[f]),a=a.concat(g))}else null!= g&&e.push(a[f])}a=e;return C.apply(this,arguments)};v.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var I=q.duplicateCells;q.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=I.call(this,a,c);if(k.length==a.length)for(e= -0;e<a.length;e++)if(b(a[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var x=q.moveCells;q.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var t=0;t<a.length;t++)if(b(a[t])|| -q.model.isEdge(a[t])&&null==q.model.getTerminal(a[t],!0)){f=q.model.getParent(a[t]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=q.getIncomingEdges(a[0]);if(0<u.length){var v=q.view.getState(q.model.getTerminal(u[0],!0));if(null!=v){var z=q.view.getState(m);null!=z&&(c=(z.getCenterX()-v.getCenterX())/q.view.scale,d=(z.getCenterY()-v.getCenterY())/q.view.scale)}}}}l=x.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(t=0;t<l.length;t++)if(this.model.isEdge(l[t]))b(m)&& -0>mxUtils.indexOf(l,this.model.getTerminal(l[t],!0))&&this.model.setTerminal(l[t],m,!0);else if(b(a[t])&&(u=q.getIncomingEdges(a[t]),0<u.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],m,!0);else if(0==q.getIncomingEdges(l[t]).length){n=m;if(null==n||n==q.model.getParent(a[t]))n=q.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,q.getDefaultParent(),n,l[t])}}finally{this.model.endUpdate()}return l};if(null!=v.sidebar){var A=v.sidebar.dropAndConnect; -v.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=A.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var D={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},B= +0;e<a.length;e++)if(b(a[e])){var m=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(a[e]);if(0==m.length&&0<g.length){var l=this.cloneCell(g[0]);this.addEdge(l,q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var x=q.moveCells;q.moveCells=function(a,c,d,e,f,g,k){var m=null;this.model.beginUpdate();try{var l=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var t=0;t<a.length;t++)if(b(a[t])|| +q.model.isEdge(a[t])&&null==q.model.getTerminal(a[t],!0)){f=q.model.getParent(a[t]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var u=q.getIncomingEdges(a[0]);if(0<u.length){var v=q.view.getState(q.model.getTerminal(u[0],!0));if(null!=v){var z=q.view.getState(l);null!=z&&(c=(z.getCenterX()-v.getCenterX())/q.view.scale,d=(z.getCenterY()-v.getCenterY())/q.view.scale)}}}}m=x.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(t=0;t<m.length;t++)if(this.model.isEdge(m[t]))b(l)&& +0>mxUtils.indexOf(m,this.model.getTerminal(m[t],!0))&&this.model.setTerminal(m[t],l,!0);else if(b(a[t])&&(u=q.getIncomingEdges(a[t]),0<u.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],l,!0);else if(0==q.getIncomingEdges(m[t]).length){n=l;if(null==n||n==q.model.getParent(a[t]))n=q.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,q.getDefaultParent(),n,m[t])}}finally{this.model.endUpdate()}return m};if(null!=v.sidebar){var A=v.sidebar.dropAndConnect; +v.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=A.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var m=q.getCellGeometry(g[k]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var D={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},B= v.onKeyDown;v.onKeyDown=function(a){try{if(q.isEnabled()&&!q.isEditing()&&b(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?f(q.getSelectionCell()):l(q.getSelectionCell()):13==a.which&&(c=t(q.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=v.hoverIcons&&v.hoverIcons.update(q.view.getState(q.getSelectionCell())), q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=D[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH), mxEvent.consume(a))}}catch(X){console.log("error",X)}mxEvent.isConsumed(a)||B.apply(this,arguments)};var F=q.connectVertex;q.connectVertex=function(a,c,d,e,g,k){var n=q.getIncomingEdges(a);return b(a)&&0<n.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?l(a):e==g?f(a):t(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):F.call(this,a,c,d,e,g,k)};q.getSubtree=function(a){var d=[a];!c(a)&& @@ -9938,12 +9943,12 @@ new mxGeometry(20,40,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign= function(){var a=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var c=new mxCell("Sub Section", new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");d.geometry.setTerminalPoint(new mxPoint(110,-40),!0);d.geometry.relative=!0;d.edge=!0;c.insertEdge(d,!1);return sb.createVertexTemplateFromCells([b,d,a,c],220,60, "Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new g(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&& -a.formatWindow.window.fit()}function d(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,218);a.sidebarWindow=new g(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;cusor:pointer;"; +a.formatWindow.window.fit()}function c(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,218);a.sidebarWindow=new g(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;cusor:pointer;"; g.className="geTitle";b.appendChild(g);return g}var d=document.createElement("div");d.style.cssText="position:absolute;left:0;right:0;border-top:1px solid lightgray;height:24px;bottom:31px;text-align:center;cursor:pointer;padding:6px 0 0 0;";d.className="geTitle";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var e=new Menubar(a,b);if(!Editor.enableCustomLibraries|| "1"==urlParams.embed&&"1"!=urlParams.libraries)d.style.bottom="0";else if(null!=a.actions.get("newLibrary")){d=document.createElement("div");d.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;";d.className="geTitle";var f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("newLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d, "click",a.actions.get("newLibrary").funct);d=document.createElement("div");d.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;";d.className="geTitle";f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("openLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d= c("newLibrary",mxResources.get("newLibrary")),d.style.boxSizing="border-box",d.style.paddingRight="6px",d.style.paddingLeft="6px",d.style.height="32px",d.style.left="0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.boxSizing="border-box",d.style.paddingRight="6px",d.style.paddingLeft="6px",d.style.height="32px",d.style.left="50%";b.appendChild(a.sidebar.container);b.style.overflow="hidden";return b});a.sidebarWindow.window.minimumSize=new mxRectangle(0, -0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth; +0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth; try{var b=document.createElement("style");b.type="text/css";b.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }table.mxWindow * :not(svg *) { font-size:13px; }html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }html body a.geMenuItem { opacity: 0.75; cursor: pointer; user-select:none; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton { opacity: 0.3; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity:0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; border: none !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:0px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }.geToolbarContainer { background:#fff !important; }div.geSidebarContainer { background-color: #ffffff; }div.geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color: #A0A0A0 !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.4) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }"+ (mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(b)}catch(q){}var g=function(a,b,c,d,e,f,g){var k=document.createElement("div");k.className="geSidebarContainer";k.style.position="absolute";k.style.width="100%";k.style.height="100%";k.style.border="1px solid whiteSmoke";k.style.overflowX="hidden";k.style.overflowY="auto";g(k);this.window=new mxWindow(b,k,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1); this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.setLocation=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};mxClient.IS_SF&& @@ -9952,7 +9957,7 @@ mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 "#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=35;mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";Format.prototype.inactiveTabBackgroundColor= "#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var e=EditorUi.prototype.updateTabContainer; EditorUi.prototype.updateTabContainer=function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");e.apply(this,arguments)};var k=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){k.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var n=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,b){null!=b.shortcut&&900> -c&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",b.shortcut):n.apply(this,arguments)};var m=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){m.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+a.style.display;a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat= +d&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",b.shortcut):n.apply(this,arguments)};var m=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){m.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+a.style.display;a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat= "no-repeat";a.style.backgroundSize="24px 24px";a.style.height="24px";a.style.width="24px";a.style.cssFloat="right";a.setAttribute("title",mxResources.get("changeUser"));"none"!=a.style.display&&(a.style.display="inline-block")}};var t=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){t.apply(this,arguments);if(null!=this.shareButton){var a=this.shareButton;a.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;"; a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.shareImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height="24px";a.style.width="24px"}};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer){var a=document.createElement("div");a.style.display="inline-block";a.style.position="relative";a.style.marginTop="8px";a.style.marginRight="4px";var b=document.createElement("a"); b.className="geMenuItem gePrimaryBtn";b.style.marginLeft="8px";b.style.padding="6px";"1"==urlParams.noSaveBtn?(mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})), @@ -9962,9 +9967,9 @@ a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUt "lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),a.addSeparator(),this.addSubmenu("insert",a),this.addMenuItems(a,["-","exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow? this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var l=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&& (this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(), -this.menus.findWindow=null);l.apply(this,arguments)};var p=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){p.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var u=Menus.prototype.init;Menus.prototype.init=function(){u.apply(this,arguments);var b=this.editorUi,c=b.editor.graph;b.actions.get("editDiagram").label= -mxResources.get("formatXml")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label=mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){c.popupMenuHandler.hideMenu();b.showImportCsvDialog()}));b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container, -620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){d(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+ +this.menus.findWindow=null);l.apply(this,arguments)};var p=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){p.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var u=Menus.prototype.init;Menus.prototype.init=function(){u.apply(this,arguments);var b=this.editorUi,d=b.editor.graph;b.actions.get("editDiagram").label= +mxResources.get("formatXml")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label=mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();b.showImportCsvDialog()}));b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container, +620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){c(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+ "...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(b.menus.addMenuItems(a,["new","open","-"],c),EditorUi.isElectronApp&&b.menus.addMenuItems(a,["synchronize","-"],c),b.menus.addMenuItems(a,["save","saveAs","-"],c)): "1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),isLocalStorage&&this.addSubmenu("openRecent",a,c),a.addSeparator(c),null!=d&&d.constructor==DriveFile&&b.menus.addMenuItems(a,["share"],c),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||b.menus.addMenuItems(a,["synchronize"],c),a.addSeparator(c), b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,["import"],c):b.menus.addSubmenu("importFrom",a,c);b.menus.addMenuItems(a,["-","outline","layers"],c);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c);b.menus.addMenuItems(a,["-","find","tags"],c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a, @@ -9975,28 +9980,28 @@ c)})));mxUtils.bind(this,function(){var a=this.get("insert"),c=a.funct;a.funct=f b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):k(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides ruler - connectionArrows connectionPoints -".split(" "),c);if("undefined"!==typeof MathJax){var d=b.menus.addMenuItem(a,"mathematicalTypesetting",c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"], c)})))};var v=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=k.menus.get(a),e=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),n);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight="6px";e.style.height="30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));k.menus.menuCreated(d, e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.width="34px",e.innerHTML=""):b||(e.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",e.style.backgroundPosition="right 6px center",e.style.backgroundRepeat="no-repeat",e.style.paddingRight="22px");return e}function b(a,b,c,d,e,f){var g=document.createElement("a");g.className="geMenuItem";g.style.display= -"inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";null!=k.statusContainer?m.insertBefore(g,k.statusContainer):m.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,mxClient.IS_POINTER?"pointerdown":"mousedown", +"inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";null!=k.statusContainer?l.insertBefore(g,k.statusContainer):l.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,mxClient.IS_POINTER?"pointerdown":"mousedown", mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),g.style.cursor="pointer"):(g.setAttribute("disabled","disabled"),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function e(a,b){var c=document.createElement("div");c.className= -"geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c,b);null!=k.statusContainer?m.insertBefore(c,k.statusContainer):m.appendChild(c);return c}function f(){for(var d=m.firstChild;null!=d;){var f=d.nextSibling;"geMenuItem"!= -d.className&&"geItem"!=d.className||d.parentNode.removeChild(d);d=f}n=m.firstChild;c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(d=1E3>c)||a("diagram");e([d?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,b(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+": -null),b(mxResources.get("format"),k.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+k.actions.get("formatPanel").shortcut+")",k.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==": -null)],d?60:null);f=a("insert",!0,d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);e([f,b(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==": -null)],d?60:null);if(411<=c&&(f=k.actions.get("undo"),d=k.actions.get("redo"),f=b("",f.funct,null,mxResources.get("undo")+" ("+f.shortcut+")",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),d=b("", -d.funct,null,mxResources.get("redo")+" ("+d.shortcut+")",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),e([f,d],60),480<=c)){var d=k.actions.get("zoomIn"),f=k.actions.get("zoomOut"),g=k.actions.get("resetView"); -e([b("",function(){l.popupMenuHandler.hideMenu();var a=l.view.scale,b=l.view.translate.x,c=l.view.translate.y;k.actions.get("resetView").funct();1E-5>Math.abs(a-l.view.scale)&&b==l.view.translate.x&&c==l.view.translate.y&&k.actions.get(l.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="), -640<=c?b("",d.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="): -null,640<=c?b("",f.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="): -null],60)}d=k.menus.get("language");null!=d&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=c?(null==O&&(f=p.addMenu("",d.funct),f.setAttribute("title",mxResources.get("language")),f.className="geToolbarButton",f.style.backgroundImage="url("+Editor.globeImage+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.position="absolute",f.style.height="24px",f.style.width="24px",f.style.zIndex="1",f.style.right="8px",f.style.cursor= -"pointer",f.style.top="1"==urlParams.embed?"12px":"11px",m.appendChild(f),O=f),k.buttonContainer.style.paddingRight="34px"):(k.buttonContainer.style.paddingRight="4px",null!=O&&(O.parentNode.removeChild(O),O=null))}v.apply(this,arguments);var g=document.createElement("div");g.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";g.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(g);null==urlParams.clibs&& -null==urlParams.libs||d(this);var k=this,l=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));k.defaultLibraryName=mxResources.get("untitledLibrary");var m=document.createElement("div");m.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var n=null,p=new Menubar(k,m);k.statusContainer=k.createStatusContainer();k.statusContainer.style.position="relative"; +"geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c,b);null!=k.statusContainer?l.insertBefore(c,k.statusContainer):l.appendChild(c);return c}function f(){for(var c=l.firstChild;null!=c;){var f=c.nextSibling;"geMenuItem"!= +c.className&&"geItem"!=c.className||c.parentNode.removeChild(c);c=f}n=l.firstChild;d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(c=1E3>d)||a("diagram");e([c?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,b(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+": +null),b(mxResources.get("format"),k.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+k.actions.get("formatPanel").shortcut+")",k.actions.get("image"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==": +null)],c?60:null);f=a("insert",!0,c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);e([f,b(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==": +null)],c?60:null);if(411<=d&&(f=k.actions.get("undo"),c=k.actions.get("redo"),f=b("",f.funct,null,mxResources.get("undo")+" ("+f.shortcut+")",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),c=b("", +c.funct,null,mxResources.get("redo")+" ("+c.shortcut+")",c,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),e([f,c],60),480<=d)){var c=k.actions.get("zoomIn"),f=k.actions.get("zoomOut"),g=k.actions.get("resetView"); +e([b("",function(){m.popupMenuHandler.hideMenu();var a=m.view.scale,b=m.view.translate.x,c=m.view.translate.y;k.actions.get("resetView").funct();1E-5>Math.abs(a-m.view.scale)&&b==m.view.translate.x&&c==m.view.translate.y&&k.actions.get(m.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="), +640<=d?b("",c.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",c,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="): +null,640<=d?b("",f.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="): +null],60)}c=k.menus.get("language");null!=c&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=d?(null==O&&(f=p.addMenu("",c.funct),f.setAttribute("title",mxResources.get("language")),f.className="geToolbarButton",f.style.backgroundImage="url("+Editor.globeImage+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.position="absolute",f.style.height="24px",f.style.width="24px",f.style.zIndex="1",f.style.right="8px",f.style.cursor= +"pointer",f.style.top="1"==urlParams.embed?"12px":"11px",l.appendChild(f),O=f),k.buttonContainer.style.paddingRight="34px"):(k.buttonContainer.style.paddingRight="4px",null!=O&&(O.parentNode.removeChild(O),O=null))}v.apply(this,arguments);var g=document.createElement("div");g.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";g.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(g);null==urlParams.clibs&& +null==urlParams.libs||c(this);var k=this,m=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));k.defaultLibraryName=mxResources.get("untitledLibrary");var l=document.createElement("div");l.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var n=null,p=new Menubar(k,l);k.statusContainer=k.createStatusContainer();k.statusContainer.style.position="relative"; k.statusContainer.style.maxWidth="";k.statusContainer.style.marginTop="7px";k.statusContainer.style.marginLeft="6px";k.statusContainer.style.color="gray";k.statusContainer.style.cursor="default";k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));var t=k.descriptorChanged;k.descriptorChanged=function(){t.apply(this,arguments);var a=k.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub": -"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);m.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else m.removeAttribute("title")};k.setStatusText(k.editor.getStatus());m.appendChild(k.statusContainer);k.buttonContainer=document.createElement("div");k.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";m.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer; +"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);l.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else l.removeAttribute("title")};k.setStatusText(k.editor.getStatus());l.appendChild(k.statusContainer);k.buttonContainer=document.createElement("div");k.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";l.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer; k.tabContainer=document.createElement("div");k.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;visibility:hidden;";var g=k.diagramContainer.parentNode,u=document.createElement("div");u.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var J=k.menus.get("viewZoom"); if(null!=J){this.tabContainer.style.right="70px";var E=p.addMenu("100%",J.funct);E.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");E.style.whiteSpace="nowrap";E.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";E.style.backgroundPosition="right 6px center";E.style.backgroundRepeat="no-repeat";E.style.backgroundColor="#ffffff";E.style.paddingRight="10px";E.style.display="block";E.style.position="absolute";E.style.textDecoration="none";E.style.textDecoration="none"; E.style.right="0px";E.style.bottom="0px";E.style.overflow="hidden";E.style.visibility="hidden";E.style.textAlign="center";E.style.color="#000";E.style.fontSize="12px";E.style.color="#707070";E.style.width="59px";E.style.cursor="pointer";E.style.borderTop="1px solid lightgray";E.style.borderLeft="1px solid lightgray";E.style.height=parseInt(k.tabContainerHeight)-1+"px";E.style.lineHeight=parseInt(k.tabContainerHeight)+1+"px";u.appendChild(E);J=mxUtils.bind(this,function(){E.innerHTML=Math.round(100* -k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,J);k.editor.addListener("resetGraphView",J);k.editor.addListener("pageSelected",J);var K=k.setGraphEnabled;k.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(E.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}u.appendChild(k.tabContainer);u.appendChild(m);u.appendChild(k.diagramContainer); +k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,J);k.editor.addListener("resetGraphView",J);k.editor.addListener("pageSelected",J);var K=k.setGraphEnabled;k.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(E.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}u.appendChild(k.tabContainer);u.appendChild(l);u.appendChild(k.diagramContainer); g.appendChild(u);k.updateTabContainer();var O=null;f();mxEvent.addListener(window,"resize",function(){f();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}}; -(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,d,k){var e=c.y,g=c.x,t=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var l=this,p=new mxCellState,u=this.graph.getView().scale,v=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+g;p.y=b.y+e;p.width=b.width;p.height=b.height;for(var q=[],z=[],y=0;y<this.states.length;y++){var C=this.states[y];C instanceof mxCellState&&(k||!this.graph.isCellSelected(C.cell))&&((p.x>=C.x&&p.x<=C.x+C.width||C.x>=p.x&&C.x<=p.x+p.width)&&(p.y> +(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,d,k){var e=c.y,g=c.x,t=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var l=this,p=new mxCellState,u=this.graph.getView().scale,v=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+g;p.y=b.y+e;p.width=b.width;p.height=b.height;for(var q=[],z=[],y=0;y<this.states.length;y++){var C=this.states[y];C instanceof mxCellState&&(k||!this.graph.isCellSelected(C.cell))&&((p.x>=C.x&&p.x<=C.x+C.width||C.x>=p.x&&C.x<=p.x+p.width)&&(p.y> C.y+C.height+4||p.y+p.height+4<C.y)?q.push(C):(p.y>=C.y&&p.y<=C.y+C.height||C.y>=p.y&&C.y<=p.y+p.height)&&(p.x>C.x+C.width+4||p.x+p.width+4<C.x)&&z.push(C))}var I=0,x=0,A=C=0,D=0,B=0,F=0,G=0,H=5*u;if(1<q.length){q.push(p);q.sort(function(a,b){return a.y-b.y});var J=!1,y=p==q[0],u=p==q[q.length-1];if(!y&&!u)for(y=1;y<q.length-1;y++)if(p==q[y]){u=q[y-1];y=q[y+1];C=x=A=(y.y-u.y-u.height-p.height)/2;break}for(y=0;y<q.length-1;y++){var u=q[y],E=q[y+1],K=p==u||p==E,E=E.y-u.y-u.height,J=J|p==u;if(0==x&& 0==I)x=E,I=1;else if(Math.abs(x-E)<=(K||1==y&&J?v:0))I+=1;else if(1<I&&J){q=q.slice(0,y+1);break}else if(3<=q.length-y&&!J)I=0,C=x=0!=A?A:0,q.splice(0,0==y?1:y),y=-1;else break;0!=C||K||(x=C=E)}3==q.length&&q[1]==p&&(C=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});J=!1;y=p==z[0];u=p==z[z.length-1];if(!y&&!u)for(y=1;y<z.length-1;y++)if(p==z[y]){u=z[y-1];y=z[y+1];F=B=G=(y.x-u.x-u.width-p.width)/2;break}for(y=0;y<z.length-1;y++){u=z[y];E=z[y+1];K=p==u||p==E;E=E.x-u.x-u.width;J|=p== u;if(0==B&&0==D)B=E,D=1;else if(Math.abs(B-E)<=(K||1==y&&J?v:0))D+=1;else if(1<D&&J){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!J)D=0,F=B=0!=G?G:0,z.splice(0,0==y?1:y),y=-1;else break;0!=F||K||(B=F=E)}3==z.length&&z[1]==p&&(F=0)}v=function(a,b,c,d){var e=[],f;d?(d=H,f=0):(d=0,f=H);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR, @@ -10004,28 +10009,28 @@ mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents z[y],E=z[y+1],p==u?(g=E.x-u.width-F,t.push(new mxPoint(g+u.width+H,J)),t.push(new mxPoint(E.x-H,J))):p==E?(t.push(new mxPoint(u.x+u.width+H,J)),g=u.x+u.width+F,t.push(new mxPoint(g-H,J))):(t.push(new mxPoint(u.x+u.width+H,J)),t.push(new mxPoint(E.x-H,J)));else u=z[0],y=z[2],g=u.x+u.width+(y.x-u.x-u.width-p.width)/2,t.push(new mxPoint(u.x+u.width+H,J)),t.push(new mxPoint(g-H,J)),t.push(new mxPoint(g+p.width+H,J)),t.push(new mxPoint(y.x-H,J));for(y=0;y<t.length;y+=2)z=t[y],F=t[y+1],z=v(z,F,null!=G? G[y/2]:null),z.node.style.visibility="visible",z.redraw(),D.push(z);for(y=t.length/2;null!=G&&y<G.length;y++)G[y].destroy();l.guidesArrHor=D;g-=b.x;t=!0}else B(!0);if(1<I&&I==q.length-1){D=[];G=l.guidesArrVer;f=[];e=0;y=q[0]==p?1:0;I=q[y].x+q[y].width;if(0<C)for(y=0;y<q.length-1;y++)u=q[y],E=q[y+1],p==u?(e=E.y-u.height-C,f.push(new mxPoint(I,e+u.height+H)),f.push(new mxPoint(I,E.y-H))):p==E?(f.push(new mxPoint(I,u.y+u.height+H)),e=u.y+u.height+C,f.push(new mxPoint(I,e-H))):(f.push(new mxPoint(I,u.y+ u.height+H)),f.push(new mxPoint(I,E.y-H)));else u=q[0],y=q[2],e=u.y+u.height+(y.y-u.y-u.height-p.height)/2,f.push(new mxPoint(I,u.y+u.height+H)),f.push(new mxPoint(I,e-H)),f.push(new mxPoint(I,e+p.height+H)),f.push(new mxPoint(I,y.y-H));for(y=0;y<f.length;y+=2)z=f[y],F=f[y+1],z=v(z,F,null!=G?G[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),D.push(z);for(y=f.length/2;null!=G&&y<G.length;y++)G[y].destroy();l.guidesArrVer=D;e-=b.y;f=!0}else B(!1,!0)}if(t||f)return p=new mxPoint(g,e),q=a.call(this, -b,p,d,k),t&&!f?p.y=q.y:f&&!t&&(p.x=q.x),q.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),q.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;B(!0,!0);return a.apply(this,arguments)};var d=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){d.call(this,a);var b=this.guidesArrVer,c=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!= -c)for(k=0;k<c.length;k++)c[k].node.style.visibility=a?"visible":"hidden"};var c=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){c.call(this);var a=this.guidesArrVer,d=this.guidesArrHor;if(null!=a){for(var e=0;e<a.length;e++)a[e].destroy();this.guidesArrVer=null}if(null!=d){for(e=0;e<d.length;e++)d[e].destroy();this.guidesArrHor=null}}})();function mxRuler(a,d,c,b){function g(){var b=a.diagramContainer;t.style.top=b.offsetTop-k+"px";t.style.left=b.offsetLeft-k+"px";t.style.width=(c?0:b.offsetWidth)+k+"px";t.style.height=(c?b.offsetHeight:0)+k+"px"}function e(a,b,c){var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var k=this.RULER_THICKNESS,n=this;this.unit=d;var m="dark"!=window.uiTheme?{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb", -strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"}:{bkgClr:"#202020",outBkgClr:"#2a2a2a",cornerClr:"#2a2a2a",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"},t=document.createElement("div");t.style.position="absolute";t.style.background=m.bkgClr;t.style[c?"borderRight":"borderBottom"]="0.5px solid "+m.strokeClr;t.style.borderLeft="0.5px solid "+m.strokeClr;document.body.appendChild(t);mxEvent.disableContextMenu(t);this.editorUiRefresh=a.refresh;a.refresh=function(b){n.editorUiRefresh.apply(a, -arguments);g()};g();var f=document.createElement("canvas");f.width=t.offsetWidth;f.height=t.offsetHeight;t.style.overflow="hidden";f.style.position="relative";t.appendChild(f);var l=f.getContext("2d");this.ui=a;var p=a.editor.graph;this.graph=p;this.container=t;this.canvas=f;var u=function(a,b,d,e,f){a=Math.round(a);b=Math.round(b);d=Math.round(d);e=Math.round(e);l.beginPath();l.moveTo(a+.5,b+.5);l.lineTo(d+.5,e+.5);l.stroke();f&&(c?(l.save(),l.translate(a,b),l.rotate(-Math.PI/2),l.fillText(f,0,0), -l.restore()):l.fillText(f,a,b))},v=function(){l.clearRect(0,0,f.width,f.height);l.beginPath();l.lineWidth=.7;l.strokeStyle=m.strokeClr;l.setLineDash([]);l.font="9px Arial";l.textAlign="center";var a=p.view.scale,b=p.view.getBackgroundPageBounds(),d=p.view.translate,e=p.view.getGraphBounds(),g=p.pageVisible,t=g?k+(c?b.y-p.container.scrollTop:b.x-p.container.scrollLeft):k+(c?d.y-p.container.scrollTop:d.x-p.container.scrollLeft),v=0;g&&(v=c?Math.floor(((e.y+1)/a-d.y)/p.pageFormat.height)*p.pageFormat.height* -a:Math.floor(((e.x+1)/a-d.x)/p.pageFormat.width)*p.pageFormat.width*a);var D,B,F;switch(n.unit){case mxConstants.POINTS:D=F=10;B=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:F=10;D=mxConstants.PIXELS_PER_MM;B=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:F=.5>=a||4<=a?8:16,D=mxConstants.PIXELS_PER_INCH/F,B=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}d=D;2<=a?d=D/(2*Math.floor(a/2)):.5>=a&&(d=D*Math.floor(1/a/2)*(n.unit==mxConstants.MILLIMETERS?2:1));D=null;b=g?Math.min(t+(c?b.height:b.width), -c?f.height:f.width):c?f.height:f.width;g&&(l.fillStyle=m.outBkgClr,c?(l.fillRect(0,k,k,t-k),l.fillRect(0,b,k,f.height)):(l.fillRect(k,0,t-k,k),l.fillRect(b,0,f.width,k)));l.fillStyle=m.fontClr;for(g=g?t:t%(d*a);g<=b;g+=d*a)if(e=Math.round((g-t)/a/d),!(g<k||e==D)){D=e;var G=null;0==e%F&&(G=n.formatText(v+e*d)+"");c?u(k-B[Math.abs(e)%F],g,k,g,G):u(g,k-B[Math.abs(e)%F],g,k,G)}l.lineWidth=1;u(c?0:k,c?k:0,k,k);l.fillStyle=m.cornerClr;l.fillRect(0,0,k,k)};this.drawRuler=v;this.sizeListener=d=e(function(){var a= -p.container;c?(a=a.offsetHeight+k,f.height!=a&&(f.height=a,t.style.height=a+"px",v())):(a=a.offsetWidth+k,f.width!=a&&(f.width=a,t.style.width=a+"px",v()))},10);this.pageListener=function(){v()};this.scrollListener=b=e(function(){var a=c?p.container.scrollTop:p.container.scrollLeft;n.lastScroll!=a&&(n.lastScroll=a,v())},10);this.unitListener=function(a,b){n.setUnit(b.getProperty("unit"))};p.addListener(mxEvent.SIZE,d);p.container.addEventListener("scroll",b);p.view.addListener("unitChanged",this.unitListener); -a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){m=a;t.style.background=m.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,b,d,e){var f;if(c&&4<a.height||!c&&4<a.width){if(null!=n.guidePart)try{l.putImageData(n.guidePart.imgData1,n.guidePart.x1,n.guidePart.y1),l.putImageData(n.guidePart.imgData2,n.guidePart.x2,n.guidePart.y2),l.putImageData(n.guidePart.imgData3, -n.guidePart.x3,n.guidePart.y3)}catch(K){}f=n.origGuideMove.apply(this,arguments);try{var g,p,q,t,v,y,z,C,E;l.lineWidth=.5;l.strokeStyle=m.guideClr;l.setLineDash([2]);c?(p=a.y+f.y+k-this.graph.container.scrollTop,g=0,v=p+a.height/2,t=k/2,C=p+a.height,z=0,q=l.getImageData(g,p-1,k,3),u(g,p,k,p),p--,y=l.getImageData(t,v-1,k,3),u(t,v,k,v),v--,E=l.getImageData(z,C-1,k,3),u(z,C,k,C),C--):(p=0,g=a.x+f.x+k-this.graph.container.scrollLeft,v=k/2,t=g+a.width/2,C=0,z=g+a.width,q=l.getImageData(g-1,p,3,k),u(g, +b,p,d,k),t&&!f?p.y=q.y:f&&!t&&(p.x=q.x),q.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),q.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;B(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!= +d)for(k=0;k<d.length;k++)d[k].node.style.visibility=a?"visible":"hidden"};var d=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){d.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var e=0;e<a.length;e++)a[e].destroy();this.guidesArrVer=null}if(null!=c){for(e=0;e<c.length;e++)c[e].destroy();this.guidesArrHor=null}}})();function mxRuler(a,c,d,b){function g(){var b=a.diagramContainer;t.style.top=b.offsetTop-k+"px";t.style.left=b.offsetLeft-k+"px";t.style.width=(d?0:b.offsetWidth)+k+"px";t.style.height=(d?b.offsetHeight:0)+k+"px"}function e(a,b,c){var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var k=this.RULER_THICKNESS,n=this;this.unit=c;var m="dark"!=window.uiTheme?{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb", +strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"}:{bkgClr:"#202020",outBkgClr:"#2a2a2a",cornerClr:"#2a2a2a",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"},t=document.createElement("div");t.style.position="absolute";t.style.background=m.bkgClr;t.style[d?"borderRight":"borderBottom"]="0.5px solid "+m.strokeClr;t.style.borderLeft="0.5px solid "+m.strokeClr;document.body.appendChild(t);mxEvent.disableContextMenu(t);this.editorUiRefresh=a.refresh;a.refresh=function(b){n.editorUiRefresh.apply(a, +arguments);g()};g();var f=document.createElement("canvas");f.width=t.offsetWidth;f.height=t.offsetHeight;t.style.overflow="hidden";f.style.position="relative";t.appendChild(f);var l=f.getContext("2d");this.ui=a;var p=a.editor.graph;this.graph=p;this.container=t;this.canvas=f;var u=function(a,b,c,e,f){a=Math.round(a);b=Math.round(b);c=Math.round(c);e=Math.round(e);l.beginPath();l.moveTo(a+.5,b+.5);l.lineTo(c+.5,e+.5);l.stroke();f&&(d?(l.save(),l.translate(a,b),l.rotate(-Math.PI/2),l.fillText(f,0,0), +l.restore()):l.fillText(f,a,b))},v=function(){l.clearRect(0,0,f.width,f.height);l.beginPath();l.lineWidth=.7;l.strokeStyle=m.strokeClr;l.setLineDash([]);l.font="9px Arial";l.textAlign="center";var a=p.view.scale,b=p.view.getBackgroundPageBounds(),c=p.view.translate,e=p.view.getGraphBounds(),g=p.pageVisible,t=g?k+(d?b.y-p.container.scrollTop:b.x-p.container.scrollLeft):k+(d?c.y-p.container.scrollTop:c.x-p.container.scrollLeft),v=0;g&&(v=d?Math.floor(((e.y+1)/a-c.y)/p.pageFormat.height)*p.pageFormat.height* +a:Math.floor(((e.x+1)/a-c.x)/p.pageFormat.width)*p.pageFormat.width*a);var D,B,F;switch(n.unit){case mxConstants.POINTS:D=F=10;B=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:F=10;D=mxConstants.PIXELS_PER_MM;B=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:F=.5>=a||4<=a?8:16,D=mxConstants.PIXELS_PER_INCH/F,B=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}c=D;2<=a?c=D/(2*Math.floor(a/2)):.5>=a&&(c=D*Math.floor(1/a/2)*(n.unit==mxConstants.MILLIMETERS?2:1));D=null;b=g?Math.min(t+(d?b.height:b.width), +d?f.height:f.width):d?f.height:f.width;g&&(l.fillStyle=m.outBkgClr,d?(l.fillRect(0,k,k,t-k),l.fillRect(0,b,k,f.height)):(l.fillRect(k,0,t-k,k),l.fillRect(b,0,f.width,k)));l.fillStyle=m.fontClr;for(g=g?t:t%(c*a);g<=b;g+=c*a)if(e=Math.round((g-t)/a/c),!(g<k||e==D)){D=e;var G=null;0==e%F&&(G=n.formatText(v+e*c)+"");d?u(k-B[Math.abs(e)%F],g,k,g,G):u(g,k-B[Math.abs(e)%F],g,k,G)}l.lineWidth=1;u(d?0:k,d?k:0,k,k);l.fillStyle=m.cornerClr;l.fillRect(0,0,k,k)};this.drawRuler=v;this.sizeListener=c=e(function(){var a= +p.container;d?(a=a.offsetHeight+k,f.height!=a&&(f.height=a,t.style.height=a+"px",v())):(a=a.offsetWidth+k,f.width!=a&&(f.width=a,t.style.width=a+"px",v()))},10);this.pageListener=function(){v()};this.scrollListener=b=e(function(){var a=d?p.container.scrollTop:p.container.scrollLeft;n.lastScroll!=a&&(n.lastScroll=a,v())},10);this.unitListener=function(a,b){n.setUnit(b.getProperty("unit"))};p.addListener(mxEvent.SIZE,c);p.container.addEventListener("scroll",b);p.view.addListener("unitChanged",this.unitListener); +a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){m=a;t.style.background=m.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,b,c,e){var f;if(d&&4<a.height||!d&&4<a.width){if(null!=n.guidePart)try{l.putImageData(n.guidePart.imgData1,n.guidePart.x1,n.guidePart.y1),l.putImageData(n.guidePart.imgData2,n.guidePart.x2,n.guidePart.y2),l.putImageData(n.guidePart.imgData3, +n.guidePart.x3,n.guidePart.y3)}catch(K){}f=n.origGuideMove.apply(this,arguments);try{var g,p,q,t,v,y,z,C,E;l.lineWidth=.5;l.strokeStyle=m.guideClr;l.setLineDash([2]);d?(p=a.y+f.y+k-this.graph.container.scrollTop,g=0,v=p+a.height/2,t=k/2,C=p+a.height,z=0,q=l.getImageData(g,p-1,k,3),u(g,p,k,p),p--,y=l.getImageData(t,v-1,k,3),u(t,v,k,v),v--,E=l.getImageData(z,C-1,k,3),u(z,C,k,C),C--):(p=0,g=a.x+f.x+k-this.graph.container.scrollLeft,v=k/2,t=g+a.width/2,C=0,z=g+a.width,q=l.getImageData(g-1,p,3,k),u(g, p,g,k),g--,y=l.getImageData(t-1,v,3,k),u(t,v,t,k),t--,E=l.getImageData(z-1,C,3,k),u(z,C,z,k),z--);if(null==n.guidePart||n.guidePart.x1!=g||n.guidePart.y1!=p)n.guidePart={imgData1:q,x1:g,y1:p,imgData2:y,x2:t,y2:v,imgData3:E,x3:z,y3:C}}catch(K){}}else f=n.origGuideMove.apply(this,arguments);return f};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=n.origGuideDestroy.apply(this,arguments);if(null!=n.guidePart)try{l.putImageData(n.guidePart.imgData1,n.guidePart.x1, n.guidePart.y1),l.putImageData(n.guidePart.imgData2,n.guidePart.x2,n.guidePart.y2),l.putImageData(n.guidePart.imgData3,n.guidePart.x3,n.guidePart.y3),n.guidePart=null}catch(z){}return a}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()}; mxRuler.prototype.formatText=function(a){switch(this.unit){case mxConstants.POINTS:return Math.round(a);case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}}; mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener("unitChanged",this.unitListener);this.ui.removeListener("pageViewChanged",this.pageListener);this.ui.removeListener("pageScaleChanged",this.pageListener);this.ui.removeListener("pageFormatChanged", this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)}; -function mxDualRuler(a,d){var c=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=a.getDiagramContainerOffset;a.getDiagramContainerOffset=function(){return c};this.editorUiRefresh=a.refresh;this.ui=a;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(a,d,!0);this.hRuler=new mxRuler(a,d,!1,!0);var b=mxUtils.bind(this,function(b){var c=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this, +function mxDualRuler(a,c){var d=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=a.getDiagramContainerOffset;a.getDiagramContainerOffset=function(){return d};this.editorUiRefresh=a.refresh;this.ui=a;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(a,c,!0);this.hRuler=new mxRuler(a,c,!1,!0);var b=mxUtils.bind(this,function(b){var c=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this, function(b){c=null!=a.currentMenu;mxEvent.consume(b)}),null,mxUtils.bind(this,function(d){if(a.editor.graph.isEnabled()&&!a.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(d)||mxEvent.isPopupTrigger(d))){a.editor.graph.popupMenuHandler.hideMenu();a.hideCurrentMenu();if(!mxEvent.isTouchEvent(d)||!c){var e=new mxPopupMenu(mxUtils.bind(this,function(b,c){a.menus.addMenuItems(b,["points","millimeters"],c)}));e.div.className+=" geMenubarMenu";e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu= mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);a.resetCurrentMenu();e.destroy()});var g=mxEvent.getClientX(d),k=mxEvent.getClientY(d);e.popup(g,k,null,d);a.setCurrentMenu(e,b)}mxEvent.consume(d)}}))});b(this.hRuler.container);b(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.setUnit=function(a){this.vRuler.setUnit(a);this.hRuler.setUnit(a)};mxDualRuler.prototype.setStyle=function(a){this.vRuler.setStyle(a);this.hRuler.setStyle(a)}; -mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(a){var d=null!=a.view&&null!=a.view.canvas?a.view.canvas.ownerSVGElement:null;if(null!=a.container&&null!=d){var c=mxFreehand.prototype.NORMAL_SMOOTHING,b=null,g=[],e,k=[],n,m=!1,t=!0,f=[],l=!1,p=!0;this.setClosedPath=function(a){m=a};this.setAutoClose=function(a){t=a};this.setStopClickEnabled=function(a){p=a};this.setSmoothing=function(a){c=a};var u=function(b){l=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor= +mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(a){var c=null!=a.view&&null!=a.view.canvas?a.view.canvas.ownerSVGElement:null;if(null!=a.container&&null!=c){var d=mxFreehand.prototype.NORMAL_SMOOTHING,b=null,g=[],e,k=[],n,m=!1,t=!0,f=[],l=!1,p=!0;this.setClosedPath=function(a){m=a};this.setAutoClose=function(a){t=a};this.setStopClickEnabled=function(a){p=a};this.setSmoothing=function(a){d=a};var u=function(b){l=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor= b?"crosshair":"";a.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){u(!0)};this.isDrawing=function(){return l};var v=mxUtils.bind(this,function(a){if(b){var c=p&&0<k.length&&null!=n&&2>n.length;c||k.push.apply(k,n);n=[];k.push(null);g.push(b);b=null;c&&this.stopDrawing();mxEvent.consume(a)}});this.stopDrawing=function(){if(0<g.length){for(var c=k[0].x,d=k[0].x,e=k[0].y,f=k[0].y,l=1;l<k.length;l++)null!=k[l]&&(c=Math.max(c,k[l].x),d=Math.min(d,k[l].x),e=Math.max(e, k[l].y),f=Math.min(f,k[l].y));c-=d;e-=f;if(0<c&&0<e){var n=100/c,p=100/e;k.map(function(a){if(null==a)return a;a.x=(a.x-d)*n;a.y=(a.y-f)*p;return a});for(var q='<shape strokewidth="inherit"><foreground>',v=0,l=0;l<k.length;l++){var y=k[l];if(null==y){var y=!1,v=k[v],z=k[l-1];!m&&t&&(y=v.x-z.x,z=v.y-z.y,y=Math.sqrt(y*y+z*z)<=a.tolerance);if(m||y)q+='<line x="'+v.x.toFixed(2)+'" y="'+v.y.toFixed(2)+'"/>';q+="</path>"+(m||y?"<fillstroke/>":"<stroke/>");v=l+1}else q=l==v?q+('<path><move x="'+y.x.toFixed(2)+ '" y="'+y.y.toFixed(2)+'"/>'):q+('<line x="'+y.x.toFixed(2)+'" y="'+y.y.toFixed(2)+'"/>')}var l=mxConstants.STYLE_SHAPE+"=stencil("+Graph.compress(q+"</foreground></shape>")+");fillColor=none;",q=a.view.scale,v=a.view.translate,K=new mxCell("",new mxGeometry(d/q-v.x,f/q-v.y,c/q,e/q),l);K.vertex=1;a.model.beginUpdate();try{K=a.addCell(K)}finally{a.model.endUpdate()}a.fireEvent(new mxEventObject("cellsInserted","cells",[K]));a.fireEvent(new mxEventObject("freehandInserted","cell",K));setTimeout(function(){a.setSelectionCells([K])}, -10)}for(l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);b=null;g=[];k=[]}u(!1)};mxEvent.addGestureListeners(d,function(c){if(l){var g=parseFloat(a.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1),g=Math.max(1,g*a.view.scale);b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("fill","none");b.setAttribute("stroke",a.currentVertexStyle[mxConstants.STYLE_STROKECOLOR]||"#000");b.setAttribute("stroke-width",g);if("1"==a.currentVertexStyle[mxConstants.STYLE_DASHED]){var m= -a.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",m=m.split(" ").map(function(a){return parseFloat(a)*g}).join(" ");b.setAttribute("stroke-dasharray",m)}f=[];m=q(c);z(m);e="M"+m.x+" "+m.y;k.push(m);n=[];b.setAttribute("d",e);d.appendChild(b);mxEvent.consume(c)}},function(a){if(b){z(q(a));var c=y(0);if(c){e+=" L"+c.x+" "+c.y;k.push(c);var d="";n=[];for(var g=2;g<f.length;g+=2)c=y(g),d+=" L"+c.x+" "+c.y,n.push(c);b.setAttribute("d",e+d)}mxEvent.consume(a)}},v);var q=function(b){return mxUtils.convertPoint(a.container, -mxEvent.getClientX(b),mxEvent.getClientY(b))},z=function(a){for(f.push(a);f.length>c;)f.shift()},y=function(a){var b=f.length;if(1===b%2||b>=c){var d=0,e=0,g,k=0;for(g=a;g<b;g++)k++,a=f[g],d+=a.x,e+=a.y;return{x:d/k,y:e/k}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20; +10)}for(l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);b=null;g=[];k=[]}u(!1)};mxEvent.addGestureListeners(c,function(d){if(l){var g=parseFloat(a.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1),g=Math.max(1,g*a.view.scale);b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("fill","none");b.setAttribute("stroke",a.currentVertexStyle[mxConstants.STYLE_STROKECOLOR]||"#000");b.setAttribute("stroke-width",g);if("1"==a.currentVertexStyle[mxConstants.STYLE_DASHED]){var m= +a.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",m=m.split(" ").map(function(a){return parseFloat(a)*g}).join(" ");b.setAttribute("stroke-dasharray",m)}f=[];m=q(d);z(m);e="M"+m.x+" "+m.y;k.push(m);n=[];b.setAttribute("d",e);c.appendChild(b);mxEvent.consume(d)}},function(a){if(b){z(q(a));var c=y(0);if(c){e+=" L"+c.x+" "+c.y;k.push(c);var d="";n=[];for(var g=2;g<f.length;g+=2)c=y(g),d+=" L"+c.x+" "+c.y,n.push(c);b.setAttribute("d",e+d)}mxEvent.consume(a)}},v);var q=function(b){return mxUtils.convertPoint(a.container, +mxEvent.getClientX(b),mxEvent.getClientY(b))},z=function(a){for(f.push(a);f.length>d;)f.shift()},y=function(a){var b=f.length;if(1===b%2||b>=d){var c=0,e=0,g,k=0;for(g=a;g<b;g++)k++,a=f[g],c+=a.x,e+=a.y;return{x:c/k,y:e/k}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20; diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js index 16e4812c6..7b9c2765b 100644 --- a/src/main/webapp/js/diagramly/App.js +++ b/src/main/webapp/js/diagramly/App.js @@ -1730,6 +1730,58 @@ App.prototype.getPusher = function() return this.pusher; }; +/** + * Shows a footer to download the desktop version once per session. + */ +App.prototype.showDiagramsDotNetBanner = function() +{ + if (!this.diagramsNetFooterShown && !this.footerShowing && (!isLocalStorage || + mxSettings.settings == null || mxSettings.settings.closeDiagramsFooter == null)) + { + this.diagramsNetFooterShown = true; + var href = 'https://www.diagrams.net/blog/move-diagrams-net'; + + var closeHandler = mxUtils.bind(this, function() + { + footer.parentNode.removeChild(footer); + this.footerShowing = false; + + // Close permanently + if (isLocalStorage && mxSettings.settings != null) + { + mxSettings.settings.closeDiagramsFooter = Date.now(); + mxSettings.save(); + } + }); + + var footer = this.createBanner('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' + + IMAGE_PATH + '/logo.png' + '"><font size="3" style="color:#ffffff;">draw.io is now diagrams.net</font>', + href, 'geStatusMessage geBtn gePrimaryBtn', closeHandler, null, mxUtils.bind(this, function() + { + window.open(href); + closeHandler(); + })); + + // Push to after splash dialog background + footer.style.zIndex = mxPopupMenu.prototype.zIndex; + footer.style.padding = '18px 50px 12px 30px'; + footer.getElementsByTagName('img')[1].style.filter = 'invert(1)'; + document.body.appendChild(footer); + this.footerShowing = true; + + window.setTimeout(mxUtils.bind(this, function() + { + mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)'); + }), 500); + + window.setTimeout(mxUtils.bind(this, function() + { + mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)'); + this.footerShowing = false; + }), 20000); + } +}; + /** * Shows a footer to download the desktop version once per session. */ @@ -2831,7 +2883,8 @@ App.prototype.start = function() { EditorUi.logError('Uncaught: ' + ((message != null) ? message : ''), url, linenumber, colno, err); - ui.handleError({message: message}, mxResources.get('unknownError'), null, null, null, null, true); + ui.handleError({message: message}, mxResources.get('unknownError'), + null, null, null, null, true); }; if (this.bg != null && this.bg.parentNode != null) @@ -2841,7 +2894,7 @@ App.prototype.start = function() this.restoreLibraries(); this.spinner.stop(); - + try { // Listens to changes of the hash if not in embed or client mode @@ -2864,6 +2917,12 @@ App.prototype.start = function() } })); } + + if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && !this.isOfflineApp() && + (!this.editor.chromeless || this.editor.editable)) + { + this.showDiagramsDotNetBanner(); + } } catch (e) { @@ -3350,7 +3409,7 @@ App.prototype.showSplash = function(force) } }), true); - if ((!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp) && !this.isOfflineApp() && + if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && !this.isOfflineApp() && (this.mode == App.MODE_DEVICE || this.mode == App.MODE_BROWSER)) { this.showDownloadDesktopBanner(); @@ -5798,9 +5857,9 @@ App.prototype.updateHeader = function() this.appIcon = document.createElement('a'); this.appIcon.style.display = 'block'; this.appIcon.style.position = 'absolute'; - this.appIcon.style.width = '28px'; + this.appIcon.style.width = '32px'; this.appIcon.style.height = (this.menubarHeight - 28) + 'px'; - this.appIcon.style.margin = '14px 0px 8px 20px'; + this.appIcon.style.margin = '14px 0px 8px 16px'; this.appIcon.style.opacity = '0.85'; this.appIcon.style.borderRadius = '3px'; diff --git a/src/main/webapp/js/diagramly/vsdx/mxVsdxCanvas2D.js b/src/main/webapp/js/diagramly/vsdx/mxVsdxCanvas2D.js index e7fc1424a..9e07f4c6a 100644 --- a/src/main/webapp/js/diagramly/vsdx/mxVsdxCanvas2D.js +++ b/src/main/webapp/js/diagramly/vsdx/mxVsdxCanvas2D.js @@ -238,14 +238,14 @@ mxVsdxCanvas2D.prototype.rect = function(x, y, w, h) h = h * s.scale; var geo = this.xmGeo; - x = ((x - geo.x + s.dx) * s.scale) /w; - y = ((geo.height - y + geo.y - s.dy) * s.scale) /h; - - this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x, y)); - this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x + 1, y)); - this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x + 1, y - 1)); - this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x, y - 1)); - this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x, y)); + x = ((x - geo.x + s.dx) * s.scale); + y = ((geo.height - y + geo.y - s.dy) * s.scale); + + this.geoSec.appendChild(this.createRowScaled("MoveTo", this.geoStepIndex++, x, y)); + this.geoSec.appendChild(this.createRowScaled("LineTo", this.geoStepIndex++, x + w, y)); + this.geoSec.appendChild(this.createRowScaled("LineTo", this.geoStepIndex++, x + w, y - h)); + this.geoSec.appendChild(this.createRowScaled("LineTo", this.geoStepIndex++, x, y - h)); + this.geoSec.appendChild(this.createRowScaled("LineTo", this.geoStepIndex++, x, y)); }; /** diff --git a/src/main/webapp/js/extensions.min.js b/src/main/webapp/js/extensions.min.js index 37dc36ca2..c26d8bb77 100644 --- a/src/main/webapp/js/extensions.min.js +++ b/src/main/webapp/js/extensions.min.js @@ -747,8 +747,8 @@ mxVsdxCanvas2D.prototype.createCellElemScaled=function(c,n,m){return this.create mxVsdxCanvas2D.prototype.createRowScaled=function(c,n,m,k,f,e,b,a,d,h,p,y,z,x){return this.createRowRel(c,n,m/VsdxExport.prototype.CONVERSION_FACTOR,k/VsdxExport.prototype.CONVERSION_FACTOR,f/VsdxExport.prototype.CONVERSION_FACTOR,e/VsdxExport.prototype.CONVERSION_FACTOR,b/VsdxExport.prototype.CONVERSION_FACTOR,a/VsdxExport.prototype.CONVERSION_FACTOR,d,h,p,y,z,x)}; mxVsdxCanvas2D.prototype.createRowRel=function(c,n,m,k,f,e,b,a,d,h,p,y,z,x){var A=this.createElt("Row");A.setAttribute("T",c);A.setAttribute("IX",n);A.appendChild(this.createCellElem("X",m,d));A.appendChild(this.createCellElem("Y",k,h));null!=f&&A.appendChild(this.createCellElem("A",f,p));null!=e&&A.appendChild(this.createCellElem("B",e,y));null!=b&&A.appendChild(this.createCellElem("C",b,z));null!=a&&A.appendChild(this.createCellElem("D",a,x));return A}; mxVsdxCanvas2D.prototype.begin=function(){1<this.geoStepIndex&&this.createGeoSec()}; -mxVsdxCanvas2D.prototype.rect=function(c,n,m,k){1<this.geoStepIndex&&this.createGeoSec();var f=this.state;m*=f.scale;k*=f.scale;var e=this.xmGeo;c=(c-e.x+f.dx)*f.scale/m;n=(e.height-n+e.y-f.dy)*f.scale/k;this.geoSec.appendChild(this.createRowRel("RelMoveTo",this.geoStepIndex++,c,n));this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,c+1,n));this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,c+1,n-1));this.geoSec.appendChild(this.createRowRel("RelLineTo", -this.geoStepIndex++,c,n-1));this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,c,n))};mxVsdxCanvas2D.prototype.roundrect=function(c,n,m,k,f,e){this.rect(c,n,m,k);this.shape.appendChild(this.createCellElemScaled("Rounding",f))}; +mxVsdxCanvas2D.prototype.rect=function(c,n,m,k){1<this.geoStepIndex&&this.createGeoSec();var f=this.state;m*=f.scale;k*=f.scale;var e=this.xmGeo;c=(c-e.x+f.dx)*f.scale;n=(e.height-n+e.y-f.dy)*f.scale;this.geoSec.appendChild(this.createRowScaled("MoveTo",this.geoStepIndex++,c,n));this.geoSec.appendChild(this.createRowScaled("LineTo",this.geoStepIndex++,c+m,n));this.geoSec.appendChild(this.createRowScaled("LineTo",this.geoStepIndex++,c+m,n-k));this.geoSec.appendChild(this.createRowScaled("LineTo",this.geoStepIndex++, +c,n-k));this.geoSec.appendChild(this.createRowScaled("LineTo",this.geoStepIndex++,c,n))};mxVsdxCanvas2D.prototype.roundrect=function(c,n,m,k,f,e){this.rect(c,n,m,k);this.shape.appendChild(this.createCellElemScaled("Rounding",f))}; mxVsdxCanvas2D.prototype.ellipse=function(c,n,m,k){1<this.geoStepIndex&&this.createGeoSec();var f=this.state;m*=f.scale;k*=f.scale;var e=this.xmGeo,b=e.height*f.scale,a=e.width*f.scale;c=(c-e.x+f.dx)*f.scale;n=b+(-n+e.y-f.dy)*f.scale;this.geoSec.appendChild(this.createRowScaled("Ellipse",this.geoStepIndex++,c+m/2,n-k/2,c,n-k/2,c+m/2,n,"Width*"+(c+m/2)/a,"Height*"+(n-k/2)/b,"Width*"+c/a,"Height*"+(n-k/2)/b,"Width*"+(c+m/2)/a,"Height*"+n/b))}; mxVsdxCanvas2D.prototype.moveTo=function(c,n){1<this.geoStepIndex&&this.createGeoSec();this.lastMoveToX=c;this.lastMoveToY=n;this.lastX=c;this.lastY=n;var m=this.xmGeo,k=this.state;c=(c-m.x+k.dx)*k.scale;n=(m.height-n+m.y-k.dy)*k.scale;var f=m.height*k.scale,m=m.width*k.scale;this.geoSec.appendChild(this.createRowRel("RelMoveTo",this.geoStepIndex++,c/m,n/f))}; mxVsdxCanvas2D.prototype.lineTo=function(c,n){this.lastX=c;this.lastY=n;var m=this.xmGeo,k=this.state;c=(c-m.x+k.dx)*k.scale;n=(m.height-n+m.y-k.dy)*k.scale;var f=m.height*k.scale,m=m.width*k.scale;this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,c/m,n/f))}; diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js index 5a1d67396..c296ce207 100644 --- a/src/main/webapp/js/viewer.min.js +++ b/src/main/webapp/js/viewer.min.js @@ -643,7 +643,7 @@ mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.roun this.node.style.borderColor=b;a=document.createElement(mxClient.IS_IE6||(null==document.documentMode||8>=document.documentMode)&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&& (b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"==a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)}; function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape);mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))}; -mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection);mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; +mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1))}; mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER? a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-l):a+l;b=f==mxConstants.ALIGN_TOP?b+l:f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):b+(d-k)/2;return new mxRectangle(a,b,g,k)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))}; @@ -1075,8 +1075,9 @@ mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShap a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]}; mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))}; mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a), -this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points= -null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)}; +this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a), +null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?this.doRedrawShape(a):a.shape.updateBoundingBox(),e=!0);return e}; +mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)}; mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(a,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)}; var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1],k=!1;if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var n=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);n!=mxConstants.DIRECTION_MASK_NONE&&n!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?k=n==mxConstants.DIRECTION_MASK_WEST:(l=g.getCellGeometry(b.cell), l.relative?k=.5>=l.x:null!=c&&(k=c.x+c.width<b.x))}else return;l=!0;null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(n=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),n!=mxConstants.DIRECTION_MASK_NONE&&n!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?l=n==mxConstants.DIRECTION_MASK_WEST:(a=g.getCellGeometry(c.cell),a.relative?l=.5>=a.x:null!=b&&(l=b.x+b.width<c.x)));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),g=l?c.x:c.x+c.width,c=f.getRoutingCenterY(c), diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.js index 097e87a97..c78990494 100644 --- a/src/main/webapp/service-worker.js +++ b/src/main/webapp/service-worker.js @@ -6,11 +6,11 @@ if (workbox) workbox.precaching.precacheAndRoute([ { "url": "js/app.min.js", - "revision": "16a81eaa17338dd133d83b45c76227b1" + "revision": "4defe785fc3a0d1d91b0c6c1e221d86e" }, { "url": "js/extensions.min.js", - "revision": "4aefbe4b829a81f2fbb072db53f401dd" + "revision": "67ad6bddc50bdd1d80e26924919804c2" }, { "url": "js/diagramly/ElectronApp.js", -- GitLab