7.4.3 release

This commit is contained in:
David Benson 2017-09-19 13:44:26 +01:00
parent bdc03168d1
commit ba68d7c9e3
11 changed files with 344 additions and 317 deletions

View file

@ -1,3 +1,11 @@
19-SEP-2017: 7.4.3
- Improvements for Trello integration
19-SEP-2017: 7.4.2
- Hard codes Dropbox SDK version to work around their bug
18-SEP-2017: 7.4.1
- Hides footer in embed mode

View file

@ -1 +1 @@
7.4.1
7.4.3

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 09/18/2017 08:45 PM
# 09/19/2017 01:34 PM
app.html
index.html?offline=1

158
war/js/app.min.js vendored
View file

@ -6215,7 +6215,7 @@ Q.setAttribute("min","1");Q.setAttribute("type","number");Q.style.width="40px";V
P.appendChild(V);P.appendChild(K);M.appendChild(W);M.appendChild(S);M.appendChild(X);O.appendChild(P);O.appendChild(M);t.appendChild(O);n.appendChild(t);h.appendChild(n);n=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));n.appendChild(l);l=document.createElement("div");l.style.marginBottom="12px";var U=PageSetupDialog.addPageFormatPanel(l,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);
n.appendChild(l);l=document.createElement("span");mxUtils.write(l,mxResources.get("pageScale"));n.appendChild(l);var R=document.createElement("input");R.style.cssText="margin:0 8px 0 8px;";R.setAttribute("value","100 %");R.style.width="60px";n.appendChild(R);h.appendChild(n);l=document.createElement("div");l.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&l.appendChild(n);a.isOffline()||
(t=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),t.className="geBtn",l.appendChild(t));PrintDialog.previewEnabled&&(t=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),t.className="geBtn",l.appendChild(t));t=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});t.className="geBtn gePrimaryBtn";l.appendChild(t);a.editor.cancelFirst||l.appendChild(n);
h.appendChild(l);this.container=h}})();(function(){EditorUi.VERSION="7.4.1";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
h.appendChild(l);this.container=h}})();(function(){EditorUi.VERSION="7.4.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=
1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b,0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=
null!=c&&6<c.length}catch(q){}};b.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}try{a=document.createElement("canvas");a.width=a.height=1;var c=a.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(n){}})();
@ -6290,48 +6290,48 @@ EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,f){if(window.Blob&&navigator
b,c,d,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,f,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(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,e=Math.ceil(d/1024),f=Array(e),h=0;h<e;++h){for(var g=1024*h,k=Math.min(g+1024,d),m=Array(k-g),y=0;g<k;++y,++g)m[y]=
c[g].charCodeAt(0);f[h]=new Uint8Array(m)}return new Blob(f,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,f,g){g=null!=g?g:!1;var e="vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,
c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(f){try{this.exportFile(a,b,c,d,e,f)}catch(x){this.handleError(x)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,e,null,null,4<f?3:4,a,c,d);this.showDialog(b.container,380,4<f?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||
11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):(d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){b.apply(this,arguments);if(this.isExportToCanvas()){this.exportDialog=
null;var c=a(mxUtils.bind(this,function(a){if(null!=this.exportDialog)this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null;else{this.exportDialog=document.createElement("div");var b=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=
"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=b.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=b.zIndex;var d=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});d.spin(this.exportDialog);var e=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",e);this.exportDialog.parentNode.removeChild(this.exportDialog);this.exportDialog=null});this.exportToCanvas(mxUtils.bind(this,function(a){d.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var b=this.createImageDataUri(a,null,"png");a=document.createElement("img");
a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",b);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(b.substring(b.indexOf(",")+1),"image/png",!0);e.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",e);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(a,b,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,a,d,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,e){return this.createEchoRequest(c,a,d,f,b,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,f,g){var e=!mxClient.IS_IOS||!navigator.standalone,h=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,
function(a,e){if("_blank"==e||null!=a&&0<a.length){var f=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=f&&(e==App.MODE_DEVICE||"_blank"==e?f.simulate(document,"_blank"):this.pickFolder(e,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,e,c)}catch(B){this.handleError(B)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=
f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,e,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,e,null,null,4<h?3:4,d,g,f);this.showDialog(a.container,380,4<h?390:270,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,c,d,f,g){};EditorUi.prototype.pickFolder=
function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,f,g,k,m,w){if(this.spinner.spin(document.body,mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=b?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==b&&(e="#ffffff");var h=this.editor.graph.getSvg(e,a,k,m,null,c);d&&this.editor.graph.addSvgShadow(h);var l=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,
null,null,null,c,w));var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,h,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),
this.convertImages(h,n,this.thumbImageCache)):n(h)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,f,g){g=null!=g?g:!0;var e=document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled","disabled");g&&(a.appendChild(e),mxUtils.write(a,b),f||mxUtils.br(a));return e};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+
":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));f.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,
mxResources.get("custom")+"...");f.appendChild(d);a.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"==f.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled",
"disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":e:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=f&&f!=mxConstants.NONE?"border:1px solid black;background-color:"+f:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+
"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option");
e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var f="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(f||"none",function(a){f=a;c()});mxEvent.consume(a)}));c();g.style.padding=
mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width="22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,f,g,k,m){var e=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=a&&h.push("target="+
a),null!=b&&b!=mxConstants.NONE&&h.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&h.push("edit="+encodeURIComponent(f)),g&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&h.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(e=this.getCurrentFile(),m||null==e||e.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+e.getHash(),a=!1));a&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,f,g,k,m,w,v,y){var e=this.getBasenames(),h={};
""!=f&&f!=mxConstants.NONE&&(h.highlight=f);"auto"!==d&&(h.target=d);w||(h.lightbox=!1);h.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(h.zoom=c/100);c=[];k&&(c.push("pages"),h.resize=!0,null!=this.pages&&null!=this.currentPage&&(h.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),h.resize=!0);m&&c.push("layers");0<c.length&&(w&&c.push("lightbox"),h.toolbar=c.join(" "));null!=v&&0<v.length&&(h.edit=v);null!=a?h.url=a:h.xml=this.getFileData(!0,null,null,
null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(h))+'"></div>';e=0<e.length?"s="+e.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";y(b,'<script type="text/javascript" src="'+(0<e.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+e:"https://www.draw.io/embed2.js?"+e)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var h=document.createElement("input");h.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
h.setAttribute("value","url");h.setAttribute("type","radio");h.setAttribute("name","type-embedhtmldialog");f=h.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var l=document.createElement("span");mxUtils.write(l,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(l);mxUtils.br(g);g.appendChild(h);l=document.createElement("span");mxUtils.write(l,mxResources.get("publicDiagramUrl"));g.appendChild(l);var k=this.getCurrentFile();null==c&&null!=k&&k.constructor==window.DriveFile&&(l=
document.createElement("a"),l.style.paddingLeft="12px",l.style.color="gray",l.setAttribute("href","javascript:void(0);"),mxUtils.write(l,mxResources.get("share")),g.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));f.setAttribute("checked","checked");null==c&&h.setAttribute("disabled","disabled");e.appendChild(g);var m=this.addLinkSection(e),n=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,
":");var B=document.createElement("input");B.setAttribute("type","text");B.style.marginRight="16px";B.style.width="60px";B.style.marginLeft="4px";B.style.marginRight="12px";B.value="100%";e.appendChild(B);var D=this.addCheckbox(e,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,z=z=this.addCheckbox(e,mxResources.get("allPages"),g,!g),A=this.addCheckbox(e,mxResources.get("layers"),!0),C=this.addCheckbox(e,mxResources.get("lightbox"),!0),F=this.addEditButton(e,C),E=F.getEditInput();
E.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled");E.checked&&C.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(h.checked?c:null,n.checked,B.value,m.getTarget(),m.getColor(),D.checked,z.checked,A.checked,C.checked,F.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,a||mxResources.get("link"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var l=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=l&&l.constructor==window.DriveFile&&!b){a=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",
k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var m=document.createElement("div");m.style.whiteSpace="normal";mxUtils.write(m,mxResources.get("linkAccountRequired"));k.appendChild(m);m=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(l.getId())}));m.style.marginTop="12px";m.className="geBtn";k.appendChild(m);e.appendChild(k);m=document.createElement("a");
m.style.paddingLeft="12px";m.style.color="gray";m.style.fontSize="11px";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("check"));k.appendChild(m);mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var n=null,q=null;if(null!=c||null!=d)a+=30,mxUtils.write(e,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",e.appendChild(n),mxUtils.write(e,mxResources.get("height")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px",
q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",e.appendChild(q),mxUtils.br(e);var u=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var z=null;if(null==l||l.constructor!=window.DriveFile||b)z=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var A=this.addCheckbox(e,mxResources.get("lightbox"),!0),C=this.addEditButton(e,A),F=C.getEditInput(),E=this.addCheckbox(e,mxResources.get("layers"),!0);E.style.marginLeft=F.style.marginLeft;E.style.marginBottom="16px";
E.style.marginTop="8px";mxEvent.addListener(A,"change",function(){A.checked?(E.removeAttribute("disabled"),F.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"));F.checked&&A.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){f(u.getTarget(),u.getColor(),null==z?!0:z.checked,A.checked,C.getLink(),E.checked,null!=n?n.value:null,null!=
q?q.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,246+a,!0,!0);null!=n?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
e.appendChild(f);var g=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),h=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=h&&(h.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!g.checked,null!=h?h.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,f,g,k,m){k=null!=k?k:!0;var e=document.createElement("div");e.style.whiteSpace=
"nowrap";var h=this.editor.graph,l="jpeg"==m?170:280,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(n);mxUtils.write(e,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";e.appendChild(q);mxUtils.write(e,mxResources.get("borderWidth")+
":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";e.appendChild(p);mxUtils.br(e);var t=this.addCheckbox(e,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=m),u=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight=
"8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");g&&(e.appendChild(C),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26,mxEvent.addListener(u,"change",function(){u.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(C.setAttribute("checked","checked"),C.defaultChecked=!0);var F=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible),E=document.createElement("input");E.style.marginTop=
"16px";E.style.marginRight="8px";E.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||E.setAttribute("disabled","disabled");b&&(e.appendChild(E),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),l+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(e,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);I.style.marginLeft="24px";I.style.marginBottom="16px";G||(I.style.visibility=
"hidden");mxEvent.addListener(H,"change",function(){H.checked&&G?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});k&&G||I.setAttribute("disabled","disabled");a=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=q.value;f(q.value,t.checked,!u.checked,F.checked,H.checked,E.checked,p.value,C.checked,!I.checked)}),null,c,d);this.showDialog(a.container,320,l,!0,!0);q.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(h)}var l=this.addCheckbox(e,mxResources.get("fit"),!0),k=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d,!d),m=this.addCheckbox(e,
c),n=this.addCheckbox(e,mxResources.get("lightbox"),!0),q=this.addEditButton(e,n),D=q.getEditInput(),z=1<g.model.getChildCount(g.model.getRoot()),A=this.addCheckbox(e,mxResources.get("layers"),z,!z);A.style.marginLeft=D.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(z&&A.removeAttribute("disabled"),D.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"));D.checked&&n.checked?
q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){a(l.checked,k.checked,m.checked,n.checked,q.getLink(),A.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,f,g,k,m){function e(b){var e=" ",l="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):(d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=
null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign=
"center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);
this.exportDialog.style.zIndex=d.zIndex;var e=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});e.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";
a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),
Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,a,d,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,e){return this.createEchoRequest(c,a,d,f,b,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,f,g){var e=!mxClient.IS_IOS||!navigator.standalone,h=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var f=
c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=f&&(e==App.MODE_DEVICE||"_blank"==e?f.simulate(document,"_blank"):this.pickFolder(e,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,e,c)}catch(B){this.handleError(B)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),
a,g,!0,e,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,e,null,null,4<h?3:4,d,g,f);this.showDialog(a.container,380,4<h?390:270,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,c,d,f,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=
function(a,b,c,d,f,g,k,m,w){if(this.spinner.spin(document.body,mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=b?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==b&&(e="#ffffff");var h=this.editor.graph.getSvg(e,a,k,m,null,c);d&&this.editor.graph.addSvgShadow(h);var l=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,w));var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,h,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(h,n,this.thumbImageCache)):n(h)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,f,g){g=null!=g?g:!0;var e=
document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled","disabled");g&&(a.appendChild(e),mxUtils.write(a,b),f||mxUtils.br(a));return e};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=
App.MODE_BROWSER&&(e=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));f.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");f.appendChild(d);a.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,
function(){if("custom"==f.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":
e:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=f&&f!=mxConstants.NONE?"border:1px solid black;background-color:"+f:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");
d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&
(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var f="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(f||"none",function(a){f=a;c()});mxEvent.consume(a)}));c();g.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width=
"22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,f,g,k,m){var e=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=a&&h.push("target="+a),null!=b&&b!=mxConstants.NONE&&h.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),
null!=f&&0<f.length&&h.push("edit="+encodeURIComponent(f)),g&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&h.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):(e=this.getCurrentFile(),m||null==e||e.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):
(c="#"+e.getHash(),a=!1));a&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,f,g,k,m,w,v,y){var e=this.getBasenames(),h={};""!=f&&f!=mxConstants.NONE&&(h.highlight=f);"auto"!==d&&(h.target=d);w||(h.lightbox=!1);h.nav=this.editor.graph.foldingEnabled;
c=parseInt(c);isNaN(c)||100==c||(h.zoom=c/100);c=[];k&&(c.push("pages"),h.resize=!0,null!=this.pages&&null!=this.currentPage&&(h.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),h.resize=!0);m&&c.push("layers");0<c.length&&(w&&c.push("lightbox"),h.toolbar=c.join(" "));null!=v&&0<v.length&&(h.edit=v);null!=a?h.url=a:h.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(h))+'"></div>';e=0<e.length?"s="+e.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";y(b,'<script type="text/javascript" src="'+(0<e.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+e:"https://www.draw.io/embed2.js?"+e)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");
e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var h=document.createElement("input");h.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";h.setAttribute("value","url");h.setAttribute("type","radio");h.setAttribute("name",
"type-embedhtmldialog");f=h.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var l=document.createElement("span");mxUtils.write(l,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(l);mxUtils.br(g);g.appendChild(h);l=document.createElement("span");mxUtils.write(l,mxResources.get("publicDiagramUrl"));g.appendChild(l);var k=this.getCurrentFile();null==c&&null!=k&&k.constructor==window.DriveFile&&(l=document.createElement("a"),l.style.paddingLeft="12px",l.style.color="gray",l.setAttribute("href",
"javascript:void(0);"),mxUtils.write(l,mxResources.get("share")),g.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));f.setAttribute("checked","checked");null==c&&h.setAttribute("disabled","disabled");e.appendChild(g);var m=this.addLinkSection(e),n=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var B=document.createElement("input");B.setAttribute("type","text");B.style.marginRight="16px";
B.style.width="60px";B.style.marginLeft="4px";B.style.marginRight="12px";B.value="100%";e.appendChild(B);var D=this.addCheckbox(e,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,z=z=this.addCheckbox(e,mxResources.get("allPages"),g,!g),A=this.addCheckbox(e,mxResources.get("layers"),!0),C=this.addCheckbox(e,mxResources.get("lightbox"),!0),F=this.addEditButton(e,C),E=F.getEditInput();E.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?E.removeAttribute("disabled"):
E.setAttribute("disabled","disabled");E.checked&&C.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(h.checked?c:null,n.checked,B.value,m.getTarget(),m.getColor(),D.checked,z.checked,A.checked,C.checked,F.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace=
"nowrap";var h=document.createElement("h3");mxUtils.write(h,a||mxResources.get("link"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var l=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=l&&l.constructor==window.DriveFile&&!b){a=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
var m=document.createElement("div");m.style.whiteSpace="normal";mxUtils.write(m,mxResources.get("linkAccountRequired"));k.appendChild(m);m=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(l.getId())}));m.style.marginTop="12px";m.className="geBtn";k.appendChild(m);e.appendChild(k);m=document.createElement("a");m.style.paddingLeft="12px";m.style.color="gray";m.style.fontSize="11px";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("check"));
k.appendChild(m);mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var n=null,q=null;if(null!=c||null!=d)a+=30,mxUtils.write(e,mxResources.get("width")+":"),n=document.createElement("input"),
n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",e.appendChild(n),mxUtils.write(e,mxResources.get("height")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px",q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=d+"px",e.appendChild(q),mxUtils.br(e);var u=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var z=null;
if(null==l||l.constructor!=window.DriveFile||b)z=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var A=this.addCheckbox(e,mxResources.get("lightbox"),!0),C=this.addEditButton(e,A),F=C.getEditInput(),E=this.addCheckbox(e,mxResources.get("layers"),!0);E.style.marginLeft=F.style.marginLeft;E.style.marginBottom="16px";E.style.marginTop="8px";mxEvent.addListener(A,"change",function(){A.checked?(E.removeAttribute("disabled"),F.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),F.setAttribute("disabled",
"disabled"));F.checked&&A.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){f(u.getTarget(),u.getColor(),null==z?!0:z.checked,A.checked,C.getLink(),E.checked,null!=n?n.value:null,null!=q?q.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,246+a,!0,!0);null!=n?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",
!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(f);var g=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),h=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=h&&
(h.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!g.checked,null!=h?h.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,f,g,k,m){k=null!=k?k:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph,l="jpeg"==m?170:280,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(n);
mxUtils.write(e,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";e.appendChild(q);mxUtils.write(e,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";e.appendChild(p);
mxUtils.br(e);var t=this.addCheckbox(e,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=m),u=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight="8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");g&&(e.appendChild(C),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26,mxEvent.addListener(u,
"change",function(){u.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(C.setAttribute("checked","checked"),C.defaultChecked=!0);var F=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible),E=document.createElement("input");E.style.marginTop="16px";E.style.marginRight="8px";E.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||E.setAttribute("disabled","disabled");b&&(e.appendChild(E),mxUtils.write(e,mxResources.get("embedImages")),
mxUtils.br(e),l+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(e,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);I.style.marginLeft="24px";I.style.marginBottom="16px";G||(I.style.visibility="hidden");mxEvent.addListener(H,"change",function(){H.checked&&G?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});k&&G||I.setAttribute("disabled","disabled");a=new CustomDialog(this,
e,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=q.value;f(q.value,t.checked,!u.checked,F.checked,H.checked,E.checked,p.value,C.checked,!I.checked)}),null,c,d);this.showDialog(a.container,320,l,!0,!0);q.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;
if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(h)}var l=this.addCheckbox(e,mxResources.get("fit"),!0),k=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d,!d),m=this.addCheckbox(e,c),n=this.addCheckbox(e,mxResources.get("lightbox"),!0),q=this.addEditButton(e,n),D=q.getEditInput(),z=1<g.model.getChildCount(g.model.getRoot()),A=this.addCheckbox(e,mxResources.get("layers"),z,
!z);A.style.marginLeft=D.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(z&&A.removeAttribute("disabled"),D.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"));D.checked&&n.checked?q.getEditSelect().removeAttribute("disabled"):q.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){a(l.checked,k.checked,m.checked,n.checked,
q.getLink(),A.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,f,g,k,m){function e(b){var e=" ",l="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");a&&(l+="max-width:100%;");var m="";c&&(m=' width="'+Math.round(h.width)+'" height="'+Math.round(h.height)+'"');k('<img src="'+b+'"'+m+(""!=l?' style="'+l+'"':"")+e+"/>")}var h=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");e(a)}),null,null,null,mxUtils.bind(this,function(a){m({message:mxResources.get("unknownError")})}),
null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),h.width*h.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*h.width)+"&h="+Math.round(2*h.height));var n=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+l+"&xml="+encodeURIComponent(b));n.send(mxUtils.bind(this,function(){200<=n.getStatus()&&299>=n.getStatus()?e("data:image/png;base64,"+n.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(a,b,c,d,f,g,k){var e=this.editor.graph.getSvg(),h=e.getElementsByTagName("a");if(null!=h)for(var l=0;l<h.length;l++){var m=h[l].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==h[l].getAttribute("target")&&h[l].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(e);if(c){var n=" ",q="";d&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
@ -6440,41 +6440,41 @@ this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.g
("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=
this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),
"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
"12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",
data:JSON.stringify(h)}),"*");return}}h=k(h);c=!0;try{a(h,e)}catch(H){this.handleError(H)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var E=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=E();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=E();if(d!=f&&!c){var e=this.createLoadMessage("autosave");e.xml=d;d=JSON.stringify(e);(window.opener||window.parent).postMessage(d,
"*")}f=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var g=window.opener||window.parent,e="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(e,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?
"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),
mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight=
"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),
null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},f=null,e=null,g="auto",k="auto",m=40,v=40,y=0,x=this.editor.graph;x.getGraphBounds();for(var B=function(){x.setSelectionCells(T);x.scrollCellToVisible(x.getSelectionCell())},D=x.getFreeInsertPoint(),z=D.x,A=D.y,D=A,C=null,F="auto",E=[],H=null,G=null,I=0;I<b.length&&
"#"==b[I].charAt(0);){a=b[I];for(I++;I<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[I].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[I].substring(1)),I++;if("#"!=a.charAt(1)){var J=a.indexOf(":");if(0<J){var L=mxUtils.trim(a.substring(1,J)),O=mxUtils.trim(a.substring(J+1));"label"==L?C=x.sanitizeHtml(O):"style"==L?f=O:"identity"==L&&0<O.length&&"-"!=O?e=O:"width"==L?g=O:"height"==L?k=O:"ignore"==L?G=O.split(","):"connect"==L?E.push(JSON.parse(O)):"link"==L?H=O:"padding"==L?y=parseFloat(O):
"edgespacing"==L?m=parseFloat(O):"nodespacing"==L?v=parseFloat(O):"layout"==L&&(F=O)}}}var P=this.editor.csvToArray(b[I]);a=null;if(null!=e)for(var M=0;M<P.length;M++)if(e==P[M]){a=M;break}null==C&&(C="%"+P[0]+"%");if(null!=E)for(var N=0;N<E.length;N++)null==d[E[N].to]&&(d[E[N].to]={});x.model.beginUpdate();try{for(M=I+1;M<b.length;M++){var V=this.editor.csvToArray(b[M]);if(V.length==P.length){var K=null,W=null!=a?V[a]:null;null!=W&&(K=x.model.getCell(W));null==K&&(K=new mxCell(C,new mxGeometry(z,
D,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=W);for(var S=0;S<V.length;S++)x.setAttributeForCell(K,P[S],V[S]);x.setAttributeForCell(K,"placeholders","1");K.style=x.replacePlaceholders(K,K.style);for(N=0;N<E.length;N++)d[E[N].to][K.getAttribute(E[N].to)]=K;null!=H&&"link"!=H&&(x.setLinkForCell(K,K.getAttribute(H)),x.setAttributeForCell(K,H,null));var X=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==g?X.width+y:parseFloat(g);K.geometry.height="auto"==k?X.height+y:parseFloat(k);
D+=K.geometry.height+v;c.push(x.addCell(K))}}null==f&&x.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var Q=c.slice(),T=c.slice(),N=0;N<E.length;N++)for(var U=E[N],M=0;M<c.length;M++){var K=c[M],R=K.getAttribute(U.from);if(null!=R){x.setAttributeForCell(K,U.from,null);for(var aa=R.split(","),S=0;S<aa.length;S++){var ba=d[U.to][aa[S]];null!=ba&&(T.push(x.insertEdge(null,null,U.label||"",U.invert?ba:K,U.invert?K:ba,U.style||x.createCurrentEdgeStyle())),mxUtils.remove(U.invert?K:ba,Q))}}}if(null!=
G)for(M=0;M<c.length;M++)for(K=c[M],S=0;S<G.length;S++)x.setAttributeForCell(K,mxUtils.trim(G[S]),null);var ca=new mxParallelEdgeLayout(x);ca.spacing=m;var fa=function(){ca.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==g&&(b.width=Math.round(x.snap(b.width)));"auto"==k&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==F){var da=new mxCircleLayout(x);da.resetEdges=!1;var ha=da.isVertexIgnored;
da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(x.getDefaultParent());fa()},!0,B);B=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&T.length==2*c.length-1&&1==Q.length){x.view.validate();var Y=new mxCompactTreeLayout(x,"horizontaltree"==F);Y.levelDistance=v;Y.edgeRouting=!1;Y.resetEdges=!1;this.executeLayout(function(){Y.execute(x.getDefaultParent(),0<Q.length?Q[0]:null)},!0,B);B=null}else if("horizontalflow"==
F||"verticalflow"==F||"auto"==F&&1==Q.length){x.view.validate();var ea=new mxHierarchicalLayout(x,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=v;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(x.getDefaultParent(),T);x.moveCells(T,z,A)},!0,B);B=null}else if("organic"==F||"auto"==F&&T.length>c.length){x.view.validate();var Z=new mxFastOrganicLayout(x);Z.forceConstant=3*v;Z.resetEdges=!1;var ia=Z.isVertexIgnored;Z.isVertexIgnored=function(a){return ia.apply(this,
arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(x);ca.spacing=m;this.executeLayout(function(){Z.execute(x.getDefaultParent());fa()},!0,B);B=null}this.hideDialog()}finally{x.model.endUpdate()}null!=B&&B()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=
window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,
!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-
2*a.y/b))}return d.apply(this,arguments)};var f=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return f.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=
this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var e=b.init;b.init=function(){e.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+
a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&
null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||
b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);
this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);
this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var d=applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,
function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,f=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b=
'<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=f&&(this.offlineStatus.innerHTML=b,f=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,
"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),c=null!=b&&b.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled();
this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("editData").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());
this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());this.actions.get("tags").setEnabled("1"==
urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&!b.isRestricted());this.actions.get("close").setEnabled(null!=b);this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,f,g){var e=a.editor.graph;if("xml"==c)a.hideDialog(),
a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=e.getGraphBounds(),m=Math.floor(h.width*f/e.view.scale),l=Math.floor(h.height*f/e.view.scale);k.length<=MAX_REQUEST_SIZE&&m*l<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):
"")+"&bg="+(null!=d?d:"none")+"&w="+m+"&h="+l+"&border="+g+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("loadFile"==h.action&&this.loadFile)"T"==h.type&&(null==this.trello?this.addListener("clientLoaded",function(){this.loadFile(h.file,!0)}):this.loadFile(h.file,!0));else if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=
h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):
null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=k(h);c=!0;try{a(h,e)}catch(H){this.handleError(H)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var E=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=E();d&&null==b&&(b=mxUtils.bind(this,
function(a,b){var d=E();if(d!=f&&!c){var e=this.createLoadMessage("autosave");e.xml=d;d=JSON.stringify(e);(window.opener||window.parent).postMessage(d,"*")}f=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",
b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var g=window.opener||window.parent,e="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(e,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=
document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,
function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));
b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=
new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},f=null,e=null,g="auto",k="auto",m=40,v=40,y=0,x=this.editor.graph;x.getGraphBounds();for(var B=function(){x.setSelectionCells(T);x.scrollCellToVisible(x.getSelectionCell())},
D=x.getFreeInsertPoint(),z=D.x,A=D.y,D=A,C=null,F="auto",E=[],H=null,G=null,I=0;I<b.length&&"#"==b[I].charAt(0);){a=b[I];for(I++;I<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[I].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[I].substring(1)),I++;if("#"!=a.charAt(1)){var J=a.indexOf(":");if(0<J){var L=mxUtils.trim(a.substring(1,J)),O=mxUtils.trim(a.substring(J+1));"label"==L?C=x.sanitizeHtml(O):"style"==L?f=O:"identity"==L&&0<O.length&&"-"!=O?e=O:"width"==L?g=O:"height"==L?k=O:"ignore"==L?
G=O.split(","):"connect"==L?E.push(JSON.parse(O)):"link"==L?H=O:"padding"==L?y=parseFloat(O):"edgespacing"==L?m=parseFloat(O):"nodespacing"==L?v=parseFloat(O):"layout"==L&&(F=O)}}}var P=this.editor.csvToArray(b[I]);a=null;if(null!=e)for(var M=0;M<P.length;M++)if(e==P[M]){a=M;break}null==C&&(C="%"+P[0]+"%");if(null!=E)for(var N=0;N<E.length;N++)null==d[E[N].to]&&(d[E[N].to]={});x.model.beginUpdate();try{for(M=I+1;M<b.length;M++){var V=this.editor.csvToArray(b[M]);if(V.length==P.length){var K=null,
W=null!=a?V[a]:null;null!=W&&(K=x.model.getCell(W));null==K&&(K=new mxCell(C,new mxGeometry(z,D,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=W);for(var S=0;S<V.length;S++)x.setAttributeForCell(K,P[S],V[S]);x.setAttributeForCell(K,"placeholders","1");K.style=x.replacePlaceholders(K,K.style);for(N=0;N<E.length;N++)d[E[N].to][K.getAttribute(E[N].to)]=K;null!=H&&"link"!=H&&(x.setLinkForCell(K,K.getAttribute(H)),x.setAttributeForCell(K,H,null));var X=this.editor.graph.getPreferredSizeForCell(K);
K.geometry.width="auto"==g?X.width+y:parseFloat(g);K.geometry.height="auto"==k?X.height+y:parseFloat(k);D+=K.geometry.height+v;c.push(x.addCell(K))}}null==f&&x.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var Q=c.slice(),T=c.slice(),N=0;N<E.length;N++)for(var U=E[N],M=0;M<c.length;M++){var K=c[M],R=K.getAttribute(U.from);if(null!=R){x.setAttributeForCell(K,U.from,null);for(var aa=R.split(","),S=0;S<aa.length;S++){var ba=d[U.to][aa[S]];null!=ba&&(T.push(x.insertEdge(null,null,U.label||
"",U.invert?ba:K,U.invert?K:ba,U.style||x.createCurrentEdgeStyle())),mxUtils.remove(U.invert?K:ba,Q))}}}if(null!=G)for(M=0;M<c.length;M++)for(K=c[M],S=0;S<G.length;S++)x.setAttributeForCell(K,mxUtils.trim(G[S]),null);var ca=new mxParallelEdgeLayout(x);ca.spacing=m;var fa=function(){ca.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==g&&(b.width=Math.round(x.snap(b.width)));"auto"==k&&(b.height=Math.round(x.snap(b.height)))}};
if("circle"==F){var da=new mxCircleLayout(x);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(x.getDefaultParent());fa()},!0,B);B=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&T.length==2*c.length-1&&1==Q.length){x.view.validate();var Y=new mxCompactTreeLayout(x,"horizontaltree"==F);Y.levelDistance=v;Y.edgeRouting=!1;Y.resetEdges=!1;this.executeLayout(function(){Y.execute(x.getDefaultParent(),
0<Q.length?Q[0]:null)},!0,B);B=null}else if("horizontalflow"==F||"verticalflow"==F||"auto"==F&&1==Q.length){x.view.validate();var ea=new mxHierarchicalLayout(x,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=v;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(x.getDefaultParent(),T);x.moveCells(T,z,A)},!0,B);B=null}else if("organic"==F||"auto"==F&&T.length>c.length){x.view.validate();var Z=new mxFastOrganicLayout(x);Z.forceConstant=3*v;
Z.resetEdges=!1;var ia=Z.isVertexIgnored;Z.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(x);ca.spacing=m;this.executeLayout(function(){Z.execute(x.getDefaultParent());fa()},!0,B);B=null}this.hideDialog()}finally{x.model.endUpdate()}null!=B&&B()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>
mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};
EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var f=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return f.apply(this,
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var e=b.init;b.init=function(){e.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=
mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var d=
applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,f=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=f&&(this.offlineStatus.innerHTML=b,f=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",
b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),c=null!=b&&b.isEditable()||
"1"==urlParams.embed&&this.editor.graph.isEnabled();this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("editData").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&
!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=
b&&!b.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&!b.isRestricted());this.actions.get("close").setEnabled(null!=b);this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,
b,c,d,f,g){var e=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=e.getGraphBounds(),m=Math.floor(h.width*f/e.view.scale),l=Math.floor(h.height*f/e.view.scale);k.length<=MAX_REQUEST_SIZE&&m*l<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,
"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+m+"&h="+l+"&border="+g+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
@ -6798,7 +6798,7 @@ ChatWindow.prototype.collaboratorListener=function(a){if(!a.collaborator.isMe){i
this.chatArea.innerHTML+a+"<br>";this.chatArea.scrollTop=this.chatArea.scrollHeight}};ChatWindow.prototype.configCollabInfo=function(){for(var a=this.doc.getCollaborators(),b=0;b<a.length;b++){var d=a[b];d.isMe&&(this.collabColor=d.color,this.displayName=d.displayName)}};ChatWindow.prototype.destroy=function(){this.window.destroy()};ChatWindow.prototype.htmlEscape=function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")};App=function(a,b,d){EditorUi.call(this,a,b,null!=d?d:"1"==urlParams.lightbox);mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,b,d){var c=null;try{c=window.open(a)}catch(m){}null==c||void 0===c?this.showDialog((new PopupDialog(this,a,b,d)).container,320,140,!0,!0):null!=b&&b()});this.updateDocumentTitle();this.updateUi();a=document.createElement("canvas");this.canvasSupported=!(!a.getContext||!a.getContext("2d"));window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});
this.isOffline()||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(c){null!=window.console&&console.log("Plugin Error:",c,App.DrawPlugins[a])}window.Draw.loadPlugin=mxUtils.bind(this,function(a){a(this)})}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";
App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL="https://js.live.net/v7.2/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";
App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="https://unpkg.com/dropbox@2.5.7/dist/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL="https://js.live.net/v7.2/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";
App.FOOTER_PLUGIN_URL="https://www.jgraph.com/drawio-footer.js";
App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",doors:"/plugins/doors.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",update:"/plugins/update.js",trees:"/plugins/trees/trees.js","import":"/plugins/import.js",
replay:"/plugins/replay.js",anon:"/plugins/anonymize.js"};App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var b=document.cookie.split(";"),d=0;d<b.length;d++){var c=mxUtils.trim(b[d]);if("MODE="==c.substring(0,5)){a=c.substring(5);break}}null!=a&&isLocalStorage&&(b=new Date,b.setYear(b.getFullYear()-1),document.cookie="MODE=; expires="+b.toUTCString(),localStorage.setItem(".mode",a))}return a};

View file

@ -2709,48 +2709,48 @@ EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,n){if(window.Blob&&navigator
b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),q=0;q<f;++q){for(var k=1024*q,g=Math.min(k+1024,d),m=Array(g-k),l=0;k<g;++l,++k)m[l]=
c[k].charCodeAt(0);e[q]=new Uint8Array(m)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,g){g=null!=g?g:!1;var c="vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,
d,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(x){this.handleError(x)}}))}catch(D){this.handleError(D)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,c,null,null,4<n?3:4,a,d,e);this.showDialog(b.container,380,4<n?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||
11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):(c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){b.apply(this,arguments);if(this.isExportToCanvas()){this.exportDialog=
null;var c=a(mxUtils.bind(this,function(a){if(null!=this.exportDialog)this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null;else{this.exportDialog=document.createElement("div");var b=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=
"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=b.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=b.zIndex;var d=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});d.spin(this.exportDialog);var f=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",f);this.exportDialog.parentNode.removeChild(this.exportDialog);this.exportDialog=null});this.exportToCanvas(mxUtils.bind(this,function(a){d.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");
a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);f.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",f);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,g){var c=!mxClient.IS_IOS||!navigator.standalone,f=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,
function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,c,d)}catch(u){this.handleError(u)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=
f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,c,d)}catch(u){this.handleError(u)}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,c,null,null,4<f?3:4,e,g,n);this.showDialog(a.container,380,4<f?390:270,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,d,e,n,g){};EditorUi.prototype.pickFolder=
function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,g,q,k,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,q,k,null,d);e&&this.editor.graph.addSvgShadow(f);var h=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,
null,null,null,d,m));var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),
this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+
":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,
mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled",
"disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+
"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");
f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();g.style.padding=
mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width="22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,g,m,q,k){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=g&&0<g.length&&f.push("edit="+encodeURIComponent(g)),m&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=q?d="#U"+encodeURIComponent(q):(c=this.getCurrentFile(),k||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,g,m,q,k,l,t,r){var c=this.getBasenames(),f={};
""!=g&&g!=mxConstants.NONE&&(f.highlight=g);"auto"!==e&&(f.target=e);l||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(f.zoom=d/100);d=[];q&&(d.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),f.resize=!0);k&&d.push("layers");0<d.length&&(l&&d.push("lightbox"),f.toolbar=d.join(" "));null!=t&&0<t.length&&(f.edit=t);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,
null,null,!q);b='<div class="mxgraph" style="'+(m?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';c=0<c.length?"s="+c.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";r(b,'<script type="text/javascript" src="'+(0<c.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+c:"https://www.draw.io/embed2.js?"+c)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(p);mxUtils.br(h);h.appendChild(k);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));h.appendChild(p);var g=this.getCurrentFile();null==d&&null!=g&&g.constructor==window.DriveFile&&(p=
document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),h.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(g.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(h);var m=this.addLinkSection(c),l=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";c.appendChild(r);var B=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,A=A=this.addCheckbox(c,mxResources.get("allPages"),h,!h),y=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),F=this.addEditButton(c,C),z=F.getEditInput();
z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&C.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,l.checked,r.value,m.getTarget(),m.getColor(),B.checked,A.checked,y.checked,C.checked,F.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,g,m){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");
n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,r=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",c.appendChild(l),mxUtils.write(c,mxResources.get("height")+":"),r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="50px",
r.style.marginLeft="6px",r.style.marginBottom="10px",r.value=e+"px",c.appendChild(r),mxUtils.br(c);var v=this.addLinkSection(c,m);d=null!=this.pages&&1<this.pages.length;var A=null;if(null==h||h.constructor!=window.DriveFile||b)A=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var y=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,y),F=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=F.style.marginLeft;z.style.marginBottom="16px";
z.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(z.removeAttribute("disabled"),F.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"));F.checked&&y.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){g(v.getTarget(),v.getColor(),null==A?!0:A.checked,y.checked,C.getLink(),z.checked,null!=l?l.value:null,null!=
r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=l?(l.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,g,m,q,k){q=null!=q?q:!0;var c=document.createElement("div");c.style.whiteSpace=
"nowrap";var f=this.editor.graph,h="jpeg"==k?170:280,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(p);mxUtils.write(c,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+
":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);mxUtils.br(c);var r=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=k),v=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight=
"8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");m&&(c.appendChild(C),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(v,"change",function(){v.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(C.setAttribute("checked","checked"),C.defaultChecked=!0);var F=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop=
"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),h+=26);var G=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),q,null,null,"jpeg"!=k),J=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=k);K.style.marginLeft="24px";K.style.marginBottom="16px";J||(K.style.visibility=
"hidden");mxEvent.addListener(G,"change",function(){G.checked&&J?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});q&&J||K.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=l.value;this.lastExportZoom=n.value;g(n.value,r.checked,!v.checked,F.checked,G.checked,z.checked,l.value,C.checked,!K.checked)}),null,d,e);this.showDialog(a.container,320,h,!0,!0);n.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var p=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,
d),l=this.addCheckbox(c,mxResources.get("lightbox"),!0),r=this.addEditButton(c,l),B=r.getEditInput(),A=1<f.model.getChildCount(f.model.getRoot()),y=this.addCheckbox(c,mxResources.get("layers"),A,!A);y.style.marginLeft=B.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(l,"change",function(){l.checked?(A&&y.removeAttribute("disabled"),B.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"));B.checked&&l.checked?
r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(p.checked,n.checked,m.checked,l.checked,r.getLink(),y.checked)}),null,mxResources.get("embed"),g);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,g,m,q,k){function c(c){var b=" ",h="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):(c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=
null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign=
"center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);
this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";
a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),
Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,g){var c=!mxClient.IS_IOS||!navigator.standalone,f=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=
d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,c,d)}catch(u){this.handleError(u)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),
a,g,!0,c,d)}catch(u){this.handleError(u)}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,c,null,null,4<f?3:4,e,g,n);this.showDialog(a.container,380,4<f?390:270,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,d,e,n,g){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=
function(a,b,d,e,n,g,q,k,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,q,k,null,d);e&&this.editor.graph.addSvgShadow(f);var h=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,m));var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=
document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=
App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,
function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":
f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");
d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&
(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();g.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width=
"22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,g,m,q,k){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),
null!=g&&0<g.length&&f.push("edit="+encodeURIComponent(g)),m&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=q?d="#U"+encodeURIComponent(q):(c=this.getCurrentFile(),k||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):
(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,g,m,q,k,l,t,r){var c=this.getBasenames(),f={};""!=g&&g!=mxConstants.NONE&&(f.highlight=g);"auto"!==e&&(f.target=e);l||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;
d=parseInt(d);isNaN(d)||100==d||(f.zoom=d/100);d=[];q&&(d.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),f.resize=!0);k&&d.push("layers");0<d.length&&(l&&d.push("lightbox"),f.toolbar=d.join(" "));null!=t&&0<t.length&&(f.edit=t);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!q);b='<div class="mxgraph" style="'+(m?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';c=0<c.length?"s="+c.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";r(b,'<script type="text/javascript" src="'+(0<c.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+c:"https://www.draw.io/embed2.js?"+c)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");
c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name",
"type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(p);mxUtils.br(h);h.appendChild(k);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));h.appendChild(p);var g=this.getCurrentFile();null==d&&null!=g&&g.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href",
"javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),h.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(g.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(h);var m=this.addLinkSection(c),l=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";
r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";c.appendChild(r);var B=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,A=A=this.addCheckbox(c,mxResources.get("allPages"),h,!h),y=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),F=this.addEditButton(c,C),z=F.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):
z.setAttribute("disabled","disabled");z.checked&&C.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,l.checked,r.value,m.getTarget(),m.getColor(),B.checked,A.checked,y.checked,C.checked,F.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,g,m){var c=document.createElement("div");c.style.whiteSpace=
"nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));
p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,r=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),l=document.createElement("input"),
l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",c.appendChild(l),mxUtils.write(c,mxResources.get("height")+":"),r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="50px",r.style.marginLeft="6px",r.style.marginBottom="10px",r.value=e+"px",c.appendChild(r),mxUtils.br(c);var v=this.addLinkSection(c,m);d=null!=this.pages&&1<this.pages.length;var A=null;
if(null==h||h.constructor!=window.DriveFile||b)A=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var y=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,y),F=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=F.style.marginLeft;z.style.marginBottom="16px";z.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(z.removeAttribute("disabled"),F.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),F.setAttribute("disabled",
"disabled"));F.checked&&y.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){g(v.getTarget(),v.getColor(),null==A?!0:A.checked,y.checked,C.getLink(),z.checked,null!=l?l.value:null,null!=r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=l?(l.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",
!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&
(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,g,m,q,k){q=null!=q?q:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph,h="jpeg"==k?170:280,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(p);
mxUtils.write(c,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);
mxUtils.br(c);var r=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=k),v=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight="8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");m&&(c.appendChild(C),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(v,
"change",function(){v.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(C.setAttribute("checked","checked"),C.defaultChecked=!0);var F=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop="16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),
mxUtils.br(c),h+=26);var G=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),q,null,null,"jpeg"!=k),J=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=k);K.style.marginLeft="24px";K.style.marginBottom="16px";J||(K.style.visibility="hidden");mxEvent.addListener(G,"change",function(){G.checked&&J?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});q&&J||K.setAttribute("disabled","disabled");a=new CustomDialog(this,
c,mxUtils.bind(this,function(){this.lastExportBorder=l.value;this.lastExportZoom=n.value;g(n.value,r.checked,!v.checked,F.checked,G.checked,z.checked,l.value,C.checked,!K.checked)}),null,d,e);this.showDialog(a.container,320,h,!0,!0);n.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;
if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var p=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,d),l=this.addCheckbox(c,mxResources.get("lightbox"),!0),r=this.addEditButton(c,l),B=r.getEditInput(),A=1<f.model.getChildCount(f.model.getRoot()),y=this.addCheckbox(c,mxResources.get("layers"),A,
!A);y.style.marginLeft=B.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(l,"change",function(){l.checked?(A&&y.removeAttribute("disabled"),B.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"));B.checked&&l.checked?r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(p.checked,n.checked,m.checked,l.checked,
r.getLink(),y.checked)}),null,mxResources.get("embed"),g);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,g,m,q,k){function c(c){var b=" ",h="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(g?"&edit=_blank":"")+(m?"&layers=1":"")+"');}})(this);\"",h+="cursor:pointer;");a&&(h+="max-width:100%;");var k="";d&&(k=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');q('<img src="'+c+'"'+k+(""!=h?' style="'+h+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){k({message:mxResources.get("unknownError")})}),
null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var h="";d&&(h="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+h+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?c("data:image/png;base64,"+p.getText()):k({message:mxResources.get("unknownError")})}))}else k({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(a,b,d,e,g,m,q){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var h=0;h<f.length;h++){var p=f[h].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[h].getAttribute("target")&&f[h].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",l="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
@ -2859,35 +2859,35 @@ this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.g
("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);l=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=
this.getFileData(null,null,!0,null,null,null,k),l.format=g.format;else if("html"==g.format)p=this.editor.getGraphXml(),l.data=this.getHtml(p,this.editor.graph),l.xml=mxUtils.getXml(p),l.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),
"xmlsvg"==g.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);m.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));m.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}m.postMessage(JSON.stringify(l),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
"12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{m.postMessage(JSON.stringify({error:"unknownMessage",
data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{a(g,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var z=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=z();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=z();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,
"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||m.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var m=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?
"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),
mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight=
"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),
null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,m="auto",k="auto",l=40,r=40,D=0,x=this.editor.graph;x.getGraphBounds();for(var u=function(){x.setSelectionCells(W);x.scrollCellToVisible(x.getSelectionCell())},B=x.getFreeInsertPoint(),A=B.x,y=B.y,B=y,C=null,F="auto",z=[],G=null,J=null,K=0;K<b.length&&
"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var L=mxUtils.trim(a.substring(1,P)),M=mxUtils.trim(a.substring(P+1));"label"==L?C=x.sanitizeHtml(M):"style"==L?e=M:"identity"==L&&0<M.length&&"-"!=M?g=M:"width"==L?m=M:"height"==L?k=M:"ignore"==L?J=M.split(","):"connect"==L?z.push(JSON.parse(M)):"link"==L?G=M:"padding"==L?D=parseFloat(M):
"edgespacing"==L?l=parseFloat(M):"nodespacing"==L?r=parseFloat(M):"layout"==L&&(F=M)}}}var R=this.editor.csvToArray(b[K]);a=null;if(null!=g)for(var H=0;H<R.length;H++)if(g==R[H]){a=H;break}null==C&&(C="%"+R[0]+"%");if(null!=z)for(var I=0;I<z.length;I++)null==d[z[I].to]&&(d[z[I].to]={});x.model.beginUpdate();try{for(H=K+1;H<b.length;H++){var X=this.editor.csvToArray(b[H]);if(X.length==R.length){var E=null,U=null!=a?X[a]:null;null!=U&&(E=x.model.getCell(U));null==E&&(E=new mxCell(C,new mxGeometry(A,
B,0,0),e||"whiteSpace=wrap;html=1;"),E.vertex=!0,E.id=U);for(var Q=0;Q<X.length;Q++)x.setAttributeForCell(E,R[Q],X[Q]);x.setAttributeForCell(E,"placeholders","1");E.style=x.replacePlaceholders(E,E.style);for(I=0;I<z.length;I++)d[z[I].to][E.getAttribute(z[I].to)]=E;null!=G&&"link"!=G&&(x.setLinkForCell(E,E.getAttribute(G)),x.setAttributeForCell(E,G,null));var V=this.editor.graph.getPreferredSizeForCell(E);E.geometry.width="auto"==m?V.width+D:parseFloat(m);E.geometry.height="auto"==k?V.height+D:parseFloat(k);
B+=E.geometry.height+r;c.push(x.addCell(E))}}null==e&&x.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var N=c.slice(),W=c.slice(),I=0;I<z.length;I++)for(var S=z[I],H=0;H<c.length;H++){var E=c[H],T=E.getAttribute(S.from);if(null!=T){x.setAttributeForCell(E,S.from,null);for(var ha=T.split(","),Q=0;Q<ha.length;Q++){var Y=d[S.to][ha[Q]];null!=Y&&(W.push(x.insertEdge(null,null,S.label||"",S.invert?Y:E,S.invert?E:Y,S.style||x.createCurrentEdgeStyle())),mxUtils.remove(S.invert?E:Y,N))}}}if(null!=
J)for(H=0;H<c.length;H++)for(E=c[H],Q=0;Q<J.length;Q++)x.setAttributeForCell(E,mxUtils.trim(J[Q]),null);var Z=new mxParallelEdgeLayout(x);Z.spacing=l;var ia=function(){Z.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==k&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==F){var aa=new mxCircleLayout(x);aa.resetEdges=!1;var ma=aa.isVertexIgnored;
aa.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){aa.execute(x.getDefaultParent());ia()},!0,u);u=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&W.length==2*c.length-1&&1==N.length){x.view.validate();var ba=new mxCompactTreeLayout(x,"horizontaltree"==F);ba.levelDistance=r;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(x.getDefaultParent(),0<N.length?N[0]:null)},!0,u);u=null}else if("horizontalflow"==
F||"verticalflow"==F||"auto"==F&&1==N.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),W);x.moveCells(W,A,y)},!0,u);u=null}else if("organic"==F||"auto"==F&&W.length>c.length){x.view.validate();var ca=new mxFastOrganicLayout(x);ca.forceConstant=3*r;ca.resetEdges=!1;var qa=ca.isVertexIgnored;ca.isVertexIgnored=
function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};Z=new mxParallelEdgeLayout(x);Z.spacing=l;this.executeLayout(function(){ca.execute(x.getDefaultParent());ia()},!0,u);u=null}this.hideDialog()}finally{x.model.endUpdate()}null!=u&&u()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&
(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,
b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-
2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&
null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*
(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;
null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&
"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());
this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);
this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=
document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,
"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+
'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}m.postMessage(JSON.stringify(l),"*")}return}if("loadFile"==g.action&&this.loadFile)"T"==g.type&&(null==this.trello?this.addListener("clientLoaded",function(){this.loadFile(g.file,!0)}):this.loadFile(g.file,!0));else if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=
g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):
null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{a(g,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var z=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=z();d&&null==b&&(b=mxUtils.bind(this,
function(a,b){var d=z();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",
b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||m.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var m=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=
document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,
function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));
b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=
new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,m="auto",k="auto",l=40,r=40,D=0,x=this.editor.graph;x.getGraphBounds();for(var u=function(){x.setSelectionCells(W);x.scrollCellToVisible(x.getSelectionCell())},
B=x.getFreeInsertPoint(),A=B.x,y=B.y,B=y,C=null,F="auto",z=[],G=null,J=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var L=mxUtils.trim(a.substring(1,P)),M=mxUtils.trim(a.substring(P+1));"label"==L?C=x.sanitizeHtml(M):"style"==L?e=M:"identity"==L&&0<M.length&&"-"!=M?g=M:"width"==L?m=M:"height"==L?k=M:"ignore"==L?
J=M.split(","):"connect"==L?z.push(JSON.parse(M)):"link"==L?G=M:"padding"==L?D=parseFloat(M):"edgespacing"==L?l=parseFloat(M):"nodespacing"==L?r=parseFloat(M):"layout"==L&&(F=M)}}}var R=this.editor.csvToArray(b[K]);a=null;if(null!=g)for(var H=0;H<R.length;H++)if(g==R[H]){a=H;break}null==C&&(C="%"+R[0]+"%");if(null!=z)for(var I=0;I<z.length;I++)null==d[z[I].to]&&(d[z[I].to]={});x.model.beginUpdate();try{for(H=K+1;H<b.length;H++){var X=this.editor.csvToArray(b[H]);if(X.length==R.length){var E=null,
U=null!=a?X[a]:null;null!=U&&(E=x.model.getCell(U));null==E&&(E=new mxCell(C,new mxGeometry(A,B,0,0),e||"whiteSpace=wrap;html=1;"),E.vertex=!0,E.id=U);for(var Q=0;Q<X.length;Q++)x.setAttributeForCell(E,R[Q],X[Q]);x.setAttributeForCell(E,"placeholders","1");E.style=x.replacePlaceholders(E,E.style);for(I=0;I<z.length;I++)d[z[I].to][E.getAttribute(z[I].to)]=E;null!=G&&"link"!=G&&(x.setLinkForCell(E,E.getAttribute(G)),x.setAttributeForCell(E,G,null));var V=this.editor.graph.getPreferredSizeForCell(E);
E.geometry.width="auto"==m?V.width+D:parseFloat(m);E.geometry.height="auto"==k?V.height+D:parseFloat(k);B+=E.geometry.height+r;c.push(x.addCell(E))}}null==e&&x.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var N=c.slice(),W=c.slice(),I=0;I<z.length;I++)for(var S=z[I],H=0;H<c.length;H++){var E=c[H],T=E.getAttribute(S.from);if(null!=T){x.setAttributeForCell(E,S.from,null);for(var ha=T.split(","),Q=0;Q<ha.length;Q++){var Y=d[S.to][ha[Q]];null!=Y&&(W.push(x.insertEdge(null,null,S.label||
"",S.invert?Y:E,S.invert?E:Y,S.style||x.createCurrentEdgeStyle())),mxUtils.remove(S.invert?E:Y,N))}}}if(null!=J)for(H=0;H<c.length;H++)for(E=c[H],Q=0;Q<J.length;Q++)x.setAttributeForCell(E,mxUtils.trim(J[Q]),null);var Z=new mxParallelEdgeLayout(x);Z.spacing=l;var ia=function(){Z.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==k&&(b.height=Math.round(x.snap(b.height)))}};
if("circle"==F){var aa=new mxCircleLayout(x);aa.resetEdges=!1;var ma=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){aa.execute(x.getDefaultParent());ia()},!0,u);u=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&W.length==2*c.length-1&&1==N.length){x.view.validate();var ba=new mxCompactTreeLayout(x,"horizontaltree"==F);ba.levelDistance=r;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(x.getDefaultParent(),
0<N.length?N[0]:null)},!0,u);u=null}else if("horizontalflow"==F||"verticalflow"==F||"auto"==F&&1==N.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),W);x.moveCells(W,A,y)},!0,u);u=null}else if("organic"==F||"auto"==F&&W.length>c.length){x.view.validate();var ca=new mxFastOrganicLayout(x);ca.forceConstant=3*
r;ca.resetEdges=!1;var qa=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};Z=new mxParallelEdgeLayout(x);Z.spacing=l;this.executeLayout(function(){ca.execute(x.getDefaultParent());ia()},!0,u);u=null}this.hideDialog()}finally{x.model.endUpdate()}null!=u&&u()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;
for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var r=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),d=null!=b&&b.isEditable()||
"1"==urlParams.embed&&this.editor.graph.isEnabled();this.actions.get("pageSetup").setEnabled(d);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(d);this.actions.get("editData").setEnabled(d);this.actions.get("shadowVisible").setEnabled(d);this.actions.get("connectionArrows").setEnabled(d);this.actions.get("connectionPoints").setEnabled(d);this.actions.get("copyStyle").setEnabled(d&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(d&&
!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(d);this.actions.get("createRevision").setEnabled(d);this.actions.get("moveToFolder").setEnabled(null!=b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=

158
war/js/atlas.min.js vendored
View file

@ -6215,7 +6215,7 @@ Q.setAttribute("min","1");Q.setAttribute("type","number");Q.style.width="40px";V
P.appendChild(V);P.appendChild(K);M.appendChild(W);M.appendChild(S);M.appendChild(X);O.appendChild(P);O.appendChild(M);w.appendChild(O);g.appendChild(w);l.appendChild(g);g=document.createElement("div");d=document.createElement("div");d.style.fontWeight="bold";d.style.marginBottom="12px";mxUtils.write(d,mxResources.get("paperSize"));g.appendChild(d);d=document.createElement("div");d.style.marginBottom="12px";var U=PageSetupDialog.addPageFormatPanel(d,"printdialog",b.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);
g.appendChild(d);d=document.createElement("span");mxUtils.write(d,mxResources.get("pageScale"));g.appendChild(d);var R=document.createElement("input");R.style.cssText="margin:0 8px 0 8px;";R.setAttribute("value","100 %");R.style.width="60px";g.appendChild(R);l.appendChild(g);d=document.createElement("div");d.style.cssText="text-align:right;margin:62px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});g.className="geBtn";b.editor.cancelFirst&&d.appendChild(g);b.isOffline()||
(w=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),w.className="geBtn",d.appendChild(w));PrintDialog.previewEnabled&&(w=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();c(!1)}),w.className="geBtn",d.appendChild(w));w=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});w.className="geBtn gePrimaryBtn";d.appendChild(w);b.editor.cancelFirst||d.appendChild(g);
l.appendChild(d);this.container=l}})();(function(){EditorUi.VERSION="7.4.1";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
l.appendChild(d);this.container=l}})();(function(){EditorUi.VERSION="7.4.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=
1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var b=document.createElement("canvas"),a=new Image;a.onload=function(){try{b.getContext("2d").drawImage(a,0,0);var e=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=
null!=e&&6<e.length}catch(t){}};a.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(l){}try{b=document.createElement("canvas");b.width=b.height=1;var c=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(l){}})();
@ -6290,48 +6290,48 @@ EditorUi.prototype.doSaveLocalFile=function(b,a,c,d,f){if(window.Blob&&navigator
a,c,d,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(b,a,c,d,f,g){b="xml="+encodeURIComponent(b);return new mxXmlRequest(SAVE_URL,b+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=a?"&filename="+encodeURIComponent(a):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(b,a){a=a||"";for(var c=atob(b),e=c.length,d=Math.ceil(e/1024),f=Array(d),g=0;g<d;++g){for(var k=1024*g,u=Math.min(k+1024,e),q=Array(u-k),m=0;k<u;++m,++k)q[m]=
c[k].charCodeAt(0);f[g]=new Uint8Array(q)}return new Blob(f,{type:a})};EditorUi.prototype.saveLocalFile=function(b,a,c,d,f,g){g=null!=g?g:!1;var e="vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(g);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var h=window.open("about:blank");null==h?mxUtils.popup(b,!0):(h.document.write(mxUtils.htmlEntities(b,!1)),h.document.close())}else this.openInNewWindow(b,
c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(b,a,c,d):null!=a&&0<a.length&&this.pickFolder(e,mxUtils.bind(this,function(h){try{this.exportFile(b,a,c,d,e,h)}catch(y){this.handleError(y)}}))}catch(x){this.handleError(x)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,e,null,null,4<f?3:4,b,c,d);this.showDialog(a.container,380,4<f?390:270,!0,!0);a.init()};EditorUi.prototype.openInNewWindow=function(b,a,c){if(mxClient.IS_GC||mxClient.IS_EDGE||
11==document.documentMode||10==document.documentMode){var e=window.open("about:blank");null==e?mxUtils.popup(b,!0):(e.document.write('<html><img src="data:'+a+(c?";base64,"+b:";charset=utf8,"+encodeURIComponent(b))+'"/></html>'),e.document.close())}else e=window.open("data:"+a+(c?";base64,"+b:";charset=utf8,"+encodeURIComponent(b))),null==e&&mxUtils.popup(b,!0)};var f=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(b){f.apply(this,arguments);if(this.isExportToCanvas()){this.exportDialog=
null;var a=b(mxUtils.bind(this,function(b){if(null!=this.exportDialog)this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null;else{this.exportDialog=document.createElement("div");var c=a.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=c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=c.zIndex;var e=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",
speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});e.spin(this.exportDialog);var h=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",h);this.exportDialog.parentNode.removeChild(this.exportDialog);this.exportDialog=null});this.exportToCanvas(mxUtils.bind(this,function(b){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var a=this.createImageDataUri(b,null,"png");b=document.createElement("img");
b.style.maxWidth="140px";b.style.maxHeight="140px";b.style.cursor="pointer";b.setAttribute("title",mxResources.get("openInNewWindow"));b.setAttribute("border","0");b.setAttribute("src",a);this.exportDialog.appendChild(b);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.openInNewWindow(a.substring(a.indexOf(",")+1),"image/png",!0);h.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}));mxEvent.addListener(this.editor.graph.container,
"click",h);document.body.appendChild(this.exportDialog)}mxEvent.consume(b)}),Editor.cameraLargeImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(b,a,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,b,d,f,a):this.saveRequest(b,a,mxUtils.bind(this,function(b,e){return this.createEchoRequest(c,b,d,f,a,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(b,a,c,d,f,g){var e=!mxClient.IS_IOS||!navigator.standalone,h=this.getServiceCount(!1);b=new CreateDialog(this,b,mxUtils.bind(this,
function(b,e){if("_blank"==e||null!=b&&0<b.length){var h=c("_blank"==e?null:b,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=h&&(e==App.MODE_DEVICE||"_blank"==e?h.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==a?"application/pdf":"image/"+a;if(null!=d)try{this.exportFile(d,b,g,!0,e,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&h.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=
h.getStatus()&&299>=h.getStatus())try{this.exportFile(h.getText(),b,g,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(b){this.spinner.stop();this.handleError(b)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,e,null,null,4<h?3:4,d,g,f);this.showDialog(b.container,380,4<h?390:270,!0,!0);b.init()};EditorUi.prototype.exportFile=function(b,a,c,d,f,g){};EditorUi.prototype.pickFolder=
function(b,a,c){a(null)};EditorUi.prototype.exportSvg=function(b,a,c,d,f,g,k,m,u){if(this.spinner.spin(document.body,mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=a?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==a&&(e="#ffffff");var h=this.editor.graph.getSvg(e,b,k,m,null,c);d&&this.editor.graph.addSvgShadow(h);var l=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(b){this.spinner.stop();f&&b.setAttribute("content",this.getFileData(!0,
null,null,null,c,u));var a='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(b);this.isLocalFileSave()||a.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(a)}))});this.convertMath(this.editor.graph,h,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),
this.convertImages(h,t,this.thumbImageCache)):t(h)}))}};EditorUi.prototype.addCheckbox=function(b,a,c,d,f,g){g=null!=g?g:!0;var e=document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled","disabled");g&&(b.appendChild(e),mxUtils.write(b,a),f||mxUtils.br(b));return e};EditorUi.prototype.addEditButton=function(b,a){var c=this.addCheckbox(b,mxResources.get("edit")+
":",!0,null,!0);c.style.marginLeft="24px";var e=this.getCurrentFile(),d="";null!=e&&e.getMode()!=App.MODE_DEVICE&&e.getMode()!=App.MODE_BROWSER&&(d=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("makeCopy"));f.appendChild(e);e=document.createElement("option");e.setAttribute("value","custom");mxUtils.write(e,
mxResources.get("custom")+"...");f.appendChild(e);b.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"==f.value){var b=new FilenameDialog(this,d,mxResources.get("ok"),function(b){null!=b?d=b:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(b.container,300,80,!0,!1);b.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==a||a.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled",
"disabled")}));mxUtils.br(b);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":d:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(b,a){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=f&&f!=mxConstants.NONE?"border:1px solid black;background-color:"+f:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+
"')")+';"></div>'}mxUtils.write(b,mxResources.get("links")+":");var e=document.createElement("select");e.style.width="100px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";var d=document.createElement("option");d.setAttribute("value","auto");mxUtils.write(d,mxResources.get("automatic"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("openInNewWindow"));e.appendChild(d);d=document.createElement("option");
d.setAttribute("value","self");mxUtils.write(d,mxResources.get("openInThisWindow"));e.appendChild(d);a&&(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),e.appendChild(d));b.appendChild(e);mxUtils.write(b,mxResources.get("borderColor")+":");var f="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(b){this.pickColor(f||"none",function(b){f=b;c()});mxEvent.consume(b)}));c();g.style.padding=
mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width="22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";b.appendChild(g);mxUtils.br(b);return{getColor:function(){return f},getTarget:function(){return e.value},focus:function(){e.focus()}}};EditorUi.prototype.createLink=function(b,a,c,d,f,g,k,m){var e=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=b&&h.push("target="+
b),null!=a&&a!=mxConstants.NONE&&h.push("highlight="+("#"==a.charAt(0)?a.substring(1):a)),null!=f&&0<f.length&&h.push("edit="+encodeURIComponent(f)),g&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(b=0;b<this.pages.length;b++)if(this.pages[b]==this.currentPage){0<b&&h.push("page="+b);break}b=!0;null!=k?c="#U"+encodeURIComponent(k):(e=this.getCurrentFile(),m||null==e||e.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+e.getHash(),b=!1));b&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(b,a,c,d,f,g,k,m,u,q,n){var e=this.getBasenames(),h={};
""!=f&&f!=mxConstants.NONE&&(h.highlight=f);"auto"!==d&&(h.target=d);u||(h.lightbox=!1);h.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(h.zoom=c/100);c=[];k&&(c.push("pages"),h.resize=!0,null!=this.pages&&null!=this.currentPage&&(h.page=mxUtils.indexOf(this.pages,this.currentPage)));a&&(c.push("zoom"),h.resize=!0);m&&c.push("layers");0<c.length&&(u&&c.push("lightbox"),h.toolbar=c.join(" "));null!=q&&0<q.length&&(h.edit=q);null!=b?h.url=b:h.xml=this.getFileData(!0,null,null,
null,null,!k);a='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(h))+'"></div>';e=0<e.length?"s="+e.join(";"):"";b=null!=b?"fetch="+encodeURIComponent(b):"";n(a,'<script type="text/javascript" src="'+(0<e.length||0<b.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+e:"https://www.draw.io/embed2.js?"+e)+"&"+b:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("html"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var f=document.createElement("div");f.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","type-embedhtmldialog");h=l.cloneNode(!0);h.setAttribute("value","copy");f.appendChild(h);var g=document.createElement("span");mxUtils.write(g,mxResources.get("includeCopyOfMyDiagram"));f.appendChild(g);mxUtils.br(f);f.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("publicDiagramUrl"));f.appendChild(g);var q=this.getCurrentFile();null==c&&null!=q&&q.constructor==window.DriveFile&&(g=
document.createElement("a"),g.style.paddingLeft="12px",g.style.color="gray",g.setAttribute("href","javascript:void(0);"),mxUtils.write(g,mxResources.get("share")),f.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(q.getId())})));h.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");e.appendChild(f);var k=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,
":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value="100%";e.appendChild(n);var B=this.addCheckbox(e,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(e,mxResources.get("allPages"),f,!f),E=this.addCheckbox(e,mxResources.get("layers"),!0),z=this.addCheckbox(e,mxResources.get("lightbox"),!0),F=this.addEditButton(e,z),A=F.getEditInput();
A.style.marginBottom="16px";mxEvent.addListener(z,"change",function(){z.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&z.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){d(l.checked?c:null,m.checked,n.value,k.getTarget(),k.getColor(),B.checked,D.checked,E.checked,z.checked,F.getLink())}),null,b,a);this.showDialog(b.container,340,360,!0,!0);h.focus()};
EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,b||mxResources.get("link"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var l=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=l&&l.constructor==window.DriveFile&&!a){b=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",
q=document.createElement("div");q.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));q.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(l.getId())}));k.style.marginTop="12px";k.className="geBtn";q.appendChild(k);e.appendChild(q);k=document.createElement("a");
k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));q.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(b){this.spinner.stop();b=new ErrorDialog(this,null,mxResources.get(null!=b?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
this.showDialog(b.container,300,80,!0,!1);b.init()}))}))}var m=null,n=null;if(null!=c||null!=d)b+=30,mxUtils.write(e,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",e.appendChild(m),mxUtils.write(e,mxResources.get("height")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px",
n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=d+"px",e.appendChild(n),mxUtils.br(e);var t=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var w=null;if(null==l||l.constructor!=window.DriveFile||a)w=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var E=this.addCheckbox(e,mxResources.get("lightbox"),!0),z=this.addEditButton(e,E),F=z.getEditInput(),A=this.addCheckbox(e,mxResources.get("layers"),!0);A.style.marginLeft=F.style.marginLeft;A.style.marginBottom="16px";
A.style.marginTop="8px";mxEvent.addListener(E,"change",function(){E.checked?(A.removeAttribute("disabled"),F.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"));F.checked&&E.checked?z.getEditSelect().removeAttribute("disabled"):z.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(t.getTarget(),t.getColor(),null==w?!0:w.checked,E.checked,z.getLink(),A.checked,null!=m?m.value:null,null!=
n?n.value:null)}),null,mxResources.get("create"),h);this.showDialog(a.container,340,246+b,!0,!0);null!=m?(m.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("image"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
e.appendChild(h);var f=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=l&&(l.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!f.checked,null!=l?l.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,f,g,k,m){k=null!=k?k:!0;var e=document.createElement("div");e.style.whiteSpace=
"nowrap";var h=this.editor.graph,l="jpeg"==m?170:280,n=document.createElement("h3");mxUtils.write(n,b);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(n);mxUtils.write(e,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value=this.lastExportZoom||"100%";e.appendChild(p);mxUtils.write(e,mxResources.get("borderWidth")+
":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.value=this.lastExportBorder||"0";e.appendChild(t);mxUtils.br(e);var w=this.addCheckbox(e,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=m),v=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),z=document.createElement("input");z.style.marginTop="16px";z.style.marginRight=
"8px";z.style.marginLeft="24px";z.setAttribute("disabled","disabled");z.setAttribute("type","checkbox");g&&(e.appendChild(z),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26,mxEvent.addListener(v,"change",function(){v.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(z.setAttribute("checked","checked"),z.defaultChecked=!0);var F=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible),A=document.createElement("input");A.style.marginTop=
"16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");a&&(e.appendChild(A),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),l+=26);var I=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,H=this.addCheckbox(e,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);H.style.marginLeft="24px";H.style.marginBottom="16px";G||(H.style.visibility=
"hidden");mxEvent.addListener(I,"change",function(){I.checked&&G?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});k&&G||H.setAttribute("disabled","disabled");b=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=p.value;f(p.value,w.checked,!v.checked,F.checked,I.checked,A.checked,t.value,z.checked,!H.checked)}),null,c,d);this.showDialog(b.container,320,l,!0,!0);p.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph;if(null!=a){var l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(l)}var g=this.addCheckbox(e,mxResources.get("fit"),!0),q=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible&&d,!d),k=this.addCheckbox(e,
c),m=this.addCheckbox(e,mxResources.get("lightbox"),!0),n=this.addEditButton(e,m),t=n.getEditInput(),D=1<h.model.getChildCount(h.model.getRoot()),E=this.addCheckbox(e,mxResources.get("layers"),D,!D);E.style.marginLeft=t.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(D&&E.removeAttribute("disabled"),t.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&m.checked?
n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(g.checked,q.checked,k.checked,m.checked,n.getLink(),E.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,g,k,m){function e(a){var e=" ",l="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
11==document.documentMode||10==document.documentMode){var e=window.open("about:blank");null==e?mxUtils.popup(b,!0):(e.document.write('<html><img src="data:'+a+(c?";base64,"+b:";charset=utf8,"+encodeURIComponent(b))+'"/></html>'),e.document.close())}else e=window.open("data:"+a+(c?";base64,"+b:";charset=utf8,"+encodeURIComponent(b))),null==e&&mxUtils.popup(b,!0)};var f=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(b){if(this.isExportToCanvas()){this.exportDialog=
null;var a=b(mxUtils.bind(this,function(b){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 e=a.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=e.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";e=mxUtils.getCurrentStyle(this.editor.graph.container);
this.exportDialog.style.zIndex=e.zIndex;var h=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});h.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(b){h.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var a=this.createImageDataUri(b,null,"png");b=document.createElement("img");b.style.maxWidth="140px";b.style.maxHeight="140px";
b.style.cursor="pointer";b.setAttribute("title",mxResources.get("openInNewWindow"));b.setAttribute("border","0");b.setAttribute("src",a);this.exportDialog.appendChild(b);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.openInNewWindow(a.substring(a.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(b)}),
Editor.cameraLargeImage,mxResources.get("export"))}f.apply(this,arguments)};EditorUi.prototype.saveData=function(b,a,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,b,d,f,a):this.saveRequest(b,a,mxUtils.bind(this,function(b,e){return this.createEchoRequest(c,b,d,f,a,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(b,a,c,d,f,g){var e=!mxClient.IS_IOS||!navigator.standalone,h=this.getServiceCount(!1);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){if("_blank"==e||null!=b&&0<b.length){var h=
c("_blank"==e?null:b,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=h&&(e==App.MODE_DEVICE||"_blank"==e?h.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==a?"application/pdf":"image/"+a;if(null!=d)try{this.exportFile(d,b,g,!0,e,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&h.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=h.getStatus()&&299>=h.getStatus())try{this.exportFile(h.getText(),
b,g,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(b){this.spinner.stop();this.handleError(b)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,e,null,null,4<h?3:4,d,g,f);this.showDialog(b.container,380,4<h?390:270,!0,!0);b.init()};EditorUi.prototype.exportFile=function(b,a,c,d,f,g){};EditorUi.prototype.pickFolder=function(b,a,c){a(null)};EditorUi.prototype.exportSvg=
function(b,a,c,d,f,g,k,m,u){if(this.spinner.spin(document.body,mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=a?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==a&&(e="#ffffff");var h=this.editor.graph.getSvg(e,b,k,m,null,c);d&&this.editor.graph.addSvgShadow(h);var l=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(b){this.spinner.stop();f&&b.setAttribute("content",this.getFileData(!0,null,null,null,c,u));var a='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
mxUtils.getXml(b);this.isLocalFileSave()||a.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(a)}))});this.convertMath(this.editor.graph,h,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(h,t,this.thumbImageCache)):t(h)}))}};EditorUi.prototype.addCheckbox=function(b,a,c,d,f,g){g=null!=g?g:!0;var e=
document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled","disabled");g&&(b.appendChild(e),mxUtils.write(b,a),f||mxUtils.br(b));return e};EditorUi.prototype.addEditButton=function(b,a){var c=this.addCheckbox(b,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var e=this.getCurrentFile(),d="";null!=e&&e.getMode()!=App.MODE_DEVICE&&e.getMode()!=
App.MODE_BROWSER&&(d=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("makeCopy"));f.appendChild(e);e=document.createElement("option");e.setAttribute("value","custom");mxUtils.write(e,mxResources.get("custom")+"...");f.appendChild(e);b.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,
function(){if("custom"==f.value){var b=new FilenameDialog(this,d,mxResources.get("ok"),function(b){null!=b?d=b:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(b.container,300,80,!0,!1);b.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==a||a.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")}));mxUtils.br(b);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":
d:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(b,a){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=f&&f!=mxConstants.NONE?"border:1px solid black;background-color:"+f:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(b,mxResources.get("links")+":");var e=document.createElement("select");
e.style.width="100px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";var d=document.createElement("option");d.setAttribute("value","auto");mxUtils.write(d,mxResources.get("automatic"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("openInNewWindow"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","self");mxUtils.write(d,mxResources.get("openInThisWindow"));e.appendChild(d);a&&
(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),e.appendChild(d));b.appendChild(e);mxUtils.write(b,mxResources.get("borderColor")+":");var f="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(b){this.pickColor(f||"none",function(b){f=b;c()});mxEvent.consume(b)}));c();g.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width=
"22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";b.appendChild(g);mxUtils.br(b);return{getColor:function(){return f},getTarget:function(){return e.value},focus:function(){e.focus()}}};EditorUi.prototype.createLink=function(b,a,c,d,f,g,k,m){var e=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=b&&h.push("target="+b),null!=a&&a!=mxConstants.NONE&&h.push("highlight="+("#"==a.charAt(0)?a.substring(1):a)),
null!=f&&0<f.length&&h.push("edit="+encodeURIComponent(f)),g&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(b=0;b<this.pages.length;b++)if(this.pages[b]==this.currentPage){0<b&&h.push("page="+b);break}b=!0;null!=k?c="#U"+encodeURIComponent(k):(e=this.getCurrentFile(),m||null==e||e.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):
(c="#"+e.getHash(),b=!1));b&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(b,a,c,d,f,g,k,m,u,q,n){var e=this.getBasenames(),h={};""!=f&&f!=mxConstants.NONE&&(h.highlight=f);"auto"!==d&&(h.target=d);u||(h.lightbox=!1);h.nav=this.editor.graph.foldingEnabled;
c=parseInt(c);isNaN(c)||100==c||(h.zoom=c/100);c=[];k&&(c.push("pages"),h.resize=!0,null!=this.pages&&null!=this.currentPage&&(h.page=mxUtils.indexOf(this.pages,this.currentPage)));a&&(c.push("zoom"),h.resize=!0);m&&c.push("layers");0<c.length&&(u&&c.push("lightbox"),h.toolbar=c.join(" "));null!=q&&0<q.length&&(h.edit=q);null!=b?h.url=b:h.xml=this.getFileData(!0,null,null,null,null,!k);a='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(h))+'"></div>';e=0<e.length?"s="+e.join(";"):"";b=null!=b?"fetch="+encodeURIComponent(b):"";n(a,'<script type="text/javascript" src="'+(0<e.length||0<b.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+e:"https://www.draw.io/embed2.js?"+e)+"&"+b:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(b,a,c,d){var e=document.createElement("div");
e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("html"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var f=document.createElement("div");f.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name",
"type-embedhtmldialog");h=l.cloneNode(!0);h.setAttribute("value","copy");f.appendChild(h);var g=document.createElement("span");mxUtils.write(g,mxResources.get("includeCopyOfMyDiagram"));f.appendChild(g);mxUtils.br(f);f.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("publicDiagramUrl"));f.appendChild(g);var q=this.getCurrentFile();null==c&&null!=q&&q.constructor==window.DriveFile&&(g=document.createElement("a"),g.style.paddingLeft="12px",g.style.color="gray",g.setAttribute("href",
"javascript:void(0);"),mxUtils.write(g,mxResources.get("share")),f.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(q.getId())})));h.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");e.appendChild(f);var k=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";
n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value="100%";e.appendChild(n);var B=this.addCheckbox(e,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(e,mxResources.get("allPages"),f,!f),E=this.addCheckbox(e,mxResources.get("layers"),!0),z=this.addCheckbox(e,mxResources.get("lightbox"),!0),F=this.addEditButton(e,z),A=F.getEditInput();A.style.marginBottom="16px";mxEvent.addListener(z,"change",function(){z.checked?A.removeAttribute("disabled"):
A.setAttribute("disabled","disabled");A.checked&&z.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){d(l.checked?c:null,m.checked,n.value,k.getTarget(),k.getColor(),B.checked,D.checked,E.checked,z.checked,F.getLink())}),null,b,a);this.showDialog(b.container,340,360,!0,!0);h.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace=
"nowrap";var h=document.createElement("h3");mxUtils.write(h,b||mxResources.get("link"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var l=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=l&&l.constructor==window.DriveFile&&!a){b=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",q=document.createElement("div");q.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));q.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(l.getId())}));k.style.marginTop="12px";k.className="geBtn";q.appendChild(k);e.appendChild(q);k=document.createElement("a");k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));
q.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(b){this.spinner.stop();b=new ErrorDialog(this,null,mxResources.get(null!=b?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(b.container,300,80,!0,!1);b.init()}))}))}var m=null,n=null;if(null!=c||null!=d)b+=30,mxUtils.write(e,mxResources.get("width")+":"),m=document.createElement("input"),
m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",e.appendChild(m),mxUtils.write(e,mxResources.get("height")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px",n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=d+"px",e.appendChild(n),mxUtils.br(e);var t=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var w=null;
if(null==l||l.constructor!=window.DriveFile||a)w=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var E=this.addCheckbox(e,mxResources.get("lightbox"),!0),z=this.addEditButton(e,E),F=z.getEditInput(),A=this.addCheckbox(e,mxResources.get("layers"),!0);A.style.marginLeft=F.style.marginLeft;A.style.marginBottom="16px";A.style.marginTop="8px";mxEvent.addListener(E,"change",function(){E.checked?(A.removeAttribute("disabled"),F.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),F.setAttribute("disabled",
"disabled"));F.checked&&E.checked?z.getEditSelect().removeAttribute("disabled"):z.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(t.getTarget(),t.getColor(),null==w?!0:w.checked,E.checked,z.getLink(),A.checked,null!=m?m.value:null,null!=n?n.value:null)}),null,mxResources.get("create"),h);this.showDialog(a.container,340,246+b,!0,!0);null!=m?(m.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",
!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("image"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(h);var f=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=l&&
(l.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!f.checked,null!=l?l.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,f,g,k,m){k=null!=k?k:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph,l="jpeg"==m?170:280,n=document.createElement("h3");mxUtils.write(n,b);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(n);
mxUtils.write(e,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value=this.lastExportZoom||"100%";e.appendChild(p);mxUtils.write(e,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.value=this.lastExportBorder||"0";e.appendChild(t);
mxUtils.br(e);var w=this.addCheckbox(e,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=m),v=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),z=document.createElement("input");z.style.marginTop="16px";z.style.marginRight="8px";z.style.marginLeft="24px";z.setAttribute("disabled","disabled");z.setAttribute("type","checkbox");g&&(e.appendChild(z),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26,mxEvent.addListener(v,
"change",function(){v.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(z.setAttribute("checked","checked"),z.defaultChecked=!0);var F=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");a&&(e.appendChild(A),mxUtils.write(e,mxResources.get("embedImages")),
mxUtils.br(e),l+=26);var I=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,H=this.addCheckbox(e,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);H.style.marginLeft="24px";H.style.marginBottom="16px";G||(H.style.visibility="hidden");mxEvent.addListener(I,"change",function(){I.checked&&G?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});k&&G||H.setAttribute("disabled","disabled");b=new CustomDialog(this,
e,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=p.value;f(p.value,w.checked,!v.checked,F.checked,I.checked,A.checked,t.value,z.checked,!H.checked)}),null,c,d);this.showDialog(b.container,320,l,!0,!0);p.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph;
if(null!=a){var l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(l)}var g=this.addCheckbox(e,mxResources.get("fit"),!0),q=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible&&d,!d),k=this.addCheckbox(e,c),m=this.addCheckbox(e,mxResources.get("lightbox"),!0),n=this.addEditButton(e,m),t=n.getEditInput(),D=1<h.model.getChildCount(h.model.getRoot()),E=this.addCheckbox(e,mxResources.get("layers"),D,
!D);E.style.marginLeft=t.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(D&&E.removeAttribute("disabled"),t.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&m.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(g.checked,q.checked,k.checked,m.checked,
n.getLink(),E.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,g,k,m){function e(a){var e=" ",l="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");b&&(l+="max-width:100%;");var q="";c&&(q=' width="'+Math.round(h.width)+'" height="'+Math.round(h.height)+'"');k('<img src="'+a+'"'+q+(""!=l?' style="'+l+'"':"")+e+"/>")}var h=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(b){var a=d?this.getFileData(!0):null;b=this.createImageDataUri(b,a,"png");e(b)}),null,null,null,mxUtils.bind(this,function(b){m({message:mxResources.get("unknownError")})}),
null,!0,c?2:1,null,a);else if(a=this.getFileData(!0),h.width*h.height<=MAX_AREA&&a.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*h.width)+"&h="+Math.round(2*h.height));var n=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+l+"&xml="+encodeURIComponent(a));n.send(mxUtils.bind(this,function(){200<=n.getStatus()&&299>=n.getStatus()?e("data:image/png;base64,"+n.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(b,a,c,d,f,g,k){var e=this.editor.graph.getSvg(),h=e.getElementsByTagName("a");if(null!=h)for(var l=0;l<h.length;l++){var m=h[l].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==h[l].getAttribute("target")&&h[l].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));a&&this.editor.graph.addSvgShadow(e);if(c){var n=" ",t="";d&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
@ -6440,41 +6440,41 @@ this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.g
("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?t("data:image/png;base64,"+b.getText()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);l=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))m=this.getXmlFileData(),l.xml=mxUtils.getXml(m),l.data=
this.getFileData(null,null,!0,null,null,null,m),l.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),l.data=this.getHtml(n,this.editor.graph),l.xml=mxUtils.getXml(n),l.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);l.xml=this.getFileData(!0);l.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),
"xmlsvg"==g.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(b);k.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(m),mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(b));k.postMessage(JSON.stringify(l),"*")}));return}m="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(m));l.data=this.createSvgDataUri(m)}k.postMessage(JSON.stringify(l),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(m=document.createElement("span"),mxUtils.write(m,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
"12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(m),this.embedFilenameSpan=m),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",
data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{b(g,e)}catch(I){this.handleError(I)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var A=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=A();d&&null==a&&(a=mxUtils.bind(this,function(b,a){var e=A();if(e!=f&&!c){var d=this.createLoadMessage("autosave");d.xml=e;e=JSON.stringify(d);(window.opener||window.parent).postMessage(e,
"*")}f=e}),this.editor.graph.model.addListener(mxEvent.CHANGE,a),this.editor.graph.addListener("gridSizeChanged",a),this.editor.graph.addListener("shadowVisibleChanged",a),this.addListener("pageFormatChanged",a),this.addListener("pageScaleChanged",a),this.addListener("backgroundColorChanged",a),this.addListener("backgroundImageChanged",a),this.addListener("foldingEnabledChanged",a),this.addListener("mathEnabledChanged",a),this.addListener("gridEnabledChanged",a),this.addListener("guidesEnabledChanged",
a),this.addListener("pageViewChanged",a));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var k=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var b=document.createElement("div");b.style.display="inline-block";b.style.position="absolute";b.style.paddingTop="atlas"==uiTheme?
"2px":"3px";b.style.paddingLeft="8px";b.style.paddingBottom="2px";var a=document.createElement("button");mxUtils.write(a,mxResources.get("save"));a.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");a.className="geBigButton";a.style.fontSize="12px";a.style.padding="4px 6px 4px 6px";a.style.borderRadius="3px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));b.appendChild(a);"1"==urlParams.saveAndExit&&(a=document.createElement("a"),
mxUtils.write(a,mxResources.get("saveAndExit")),a.setAttribute("title",mxResources.get("saveAndExit")),a.style.fontSize="12px",a.style.marginLeft="6px",a.style.padding="4px",a.style.cursor="pointer",mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),b.appendChild(a));a=document.createElement("a");mxUtils.write(a,mxResources.get("exit"));a.setAttribute("title",mxResources.get("exit"));a.style.fontSize="12px";a.style.marginLeft="6px";a.style.marginRight=
"20px";a.style.padding="4px";a.style.cursor="pointer";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));b.appendChild(a);this.toolbar.container.appendChild(b);this.toolbar.staticElements.push(b);b.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(b){this.importCsv(b)}),
null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(b){try{var a=b.split("\n"),c=[];if(0<a.length){var d={},f=null,g=null,k="auto",m="auto",u=40,n=40,x=0,y=this.editor.graph;y.getGraphBounds();for(var C=function(){y.setSelectionCells(T);y.scrollCellToVisible(y.getSelectionCell())},B=y.getFreeInsertPoint(),D=B.x,E=B.y,B=E,z=null,F="auto",A=[],I=null,G=null,H=0;H<a.length&&
"#"==a[H].charAt(0);){b=a[H];for(H++;H<a.length&&"\\"==b.charAt(b.length-1)&&"#"==a[H].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(a[H].substring(1)),H++;if("#"!=b.charAt(1)){var J=b.indexOf(":");if(0<J){var L=mxUtils.trim(b.substring(1,J)),O=mxUtils.trim(b.substring(J+1));"label"==L?z=y.sanitizeHtml(O):"style"==L?f=O:"identity"==L&&0<O.length&&"-"!=O?g=O:"width"==L?k=O:"height"==L?m=O:"ignore"==L?G=O.split(","):"connect"==L?A.push(JSON.parse(O)):"link"==L?I=O:"padding"==L?x=parseFloat(O):
"edgespacing"==L?u=parseFloat(O):"nodespacing"==L?n=parseFloat(O):"layout"==L&&(F=O)}}}var P=this.editor.csvToArray(a[H]);b=null;if(null!=g)for(var M=0;M<P.length;M++)if(g==P[M]){b=M;break}null==z&&(z="%"+P[0]+"%");if(null!=A)for(var N=0;N<A.length;N++)null==d[A[N].to]&&(d[A[N].to]={});y.model.beginUpdate();try{for(M=H+1;M<a.length;M++){var V=this.editor.csvToArray(a[M]);if(V.length==P.length){var K=null,W=null!=b?V[b]:null;null!=W&&(K=y.model.getCell(W));null==K&&(K=new mxCell(z,new mxGeometry(D,
B,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=W);for(var S=0;S<V.length;S++)y.setAttributeForCell(K,P[S],V[S]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(N=0;N<A.length;N++)d[A[N].to][K.getAttribute(A[N].to)]=K;null!=I&&"link"!=I&&(y.setLinkForCell(K,K.getAttribute(I)),y.setAttributeForCell(K,I,null));var X=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==k?X.width+x:parseFloat(k);K.geometry.height="auto"==m?X.height+x:parseFloat(m);
B+=K.geometry.height+n;c.push(y.addCell(K))}}null==f&&y.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var Q=c.slice(),T=c.slice(),N=0;N<A.length;N++)for(var U=A[N],M=0;M<c.length;M++){var K=c[M],R=K.getAttribute(U.from);if(null!=R){y.setAttributeForCell(K,U.from,null);for(var aa=R.split(","),S=0;S<aa.length;S++){var ba=d[U.to][aa[S]];null!=ba&&(T.push(y.insertEdge(null,null,U.label||"",U.invert?ba:K,U.invert?K:ba,U.style||y.createCurrentEdgeStyle())),mxUtils.remove(U.invert?K:ba,Q))}}}if(null!=
G)for(M=0;M<c.length;M++)for(K=c[M],S=0;S<G.length;S++)y.setAttributeForCell(K,mxUtils.trim(G[S]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=u;var fa=function(){ca.execute(y.getDefaultParent());for(var b=0;b<c.length;b++){var a=y.getCellGeometry(c[b]);a.x=Math.round(y.snap(a.x));a.y=Math.round(y.snap(a.y));"auto"==k&&(a.width=Math.round(y.snap(a.width)));"auto"==m&&(a.height=Math.round(y.snap(a.height)))}};if("circle"==F){var da=new mxCircleLayout(y);da.resetEdges=!1;var ha=da.isVertexIgnored;
da.isVertexIgnored=function(b){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,b)};this.executeLayout(function(){da.execute(y.getDefaultParent());fa()},!0,C);C=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&T.length==2*c.length-1&&1==Q.length){y.view.validate();var Y=new mxCompactTreeLayout(y,"horizontaltree"==F);Y.levelDistance=n;Y.edgeRouting=!1;Y.resetEdges=!1;this.executeLayout(function(){Y.execute(y.getDefaultParent(),0<Q.length?Q[0]:null)},!0,C);C=null}else if("horizontalflow"==
F||"verticalflow"==F||"auto"==F&&1==Q.length){y.view.validate();var ea=new mxHierarchicalLayout(y,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=n;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),T);y.moveCells(T,D,E)},!0,C);C=null}else if("organic"==F||"auto"==F&&T.length>c.length){y.view.validate();var Z=new mxFastOrganicLayout(y);Z.forceConstant=3*n;Z.resetEdges=!1;var ia=Z.isVertexIgnored;Z.isVertexIgnored=function(b){return ia.apply(this,
arguments)||0>mxUtils.indexOf(c,b)};ca=new mxParallelEdgeLayout(y);ca.spacing=u;this.executeLayout(function(){Z.execute(y.getDefaultParent());fa()},!0,C);C=null}this.hideDialog()}finally{y.model.endUpdate()}null!=C&&C()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=
window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(b=0==a?b+"?":b+"&",null!=urlParams[d]&&(b+=d+"="+urlParams[d],a++))}return b};EditorUi.prototype.showLinkDialog=function(b,a,c){b=new LinkDialog(this,b,a,c,
!0);this.showDialog(b.container,420,120,!0,!0);b.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(b){var a=m.apply(this,arguments),c=this.editor.graph,d=a.getSourceGraphBounds;a.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*b.x/a),Math.ceil(this.source.minimumGraphSize.height-
2*b.y/a))}return d.apply(this,arguments)};var f=a.getSourceContainerSize;a.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*a-2*b.x),Math.ceil(this.source.minimumGraphSize.height*a-2*b.y))}return f.apply(this,arguments)};a.getOutlineOffset=function(b){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var e=
this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(a.outline.container.clientWidth/b-(this.source.minimumGraphSize.width-2*e.x))/2)-e.x),Math.round(Math.max(0,(a.outline.container.clientHeight/b-(this.source.minimumGraphSize.height-2*e.y))/2)-e.y-5/b))}return new mxPoint(8/b,8/b)};var g=a.init;a.init=function(){g.apply(this,arguments);a.outline.view.getBackgroundPageBounds=function(){var b=c.getPageLayout(),a=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+
b.x*a.width),this.scale*(this.translate.y+b.y*a.height),this.scale*b.width*a.width,this.scale*b.height*a.height)};a.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(b,c){var e=c.getProperty("change"),d=a.source,f=a.outline;f.pageScale=d.pageScale;f.pageFormat=d.pageFormat;f.background=d.background;f.pageVisible=d.pageVisible;f.background=d.background;var g=mxUtils.getCurrentStyle(d.container);f.container.style.backgroundColor=g.backgroundColor;null!=d.view.backgroundPageShape&&
null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=d.view.backgroundPageShape.fill);a.outline.view.clear(e.previousPage.root,!0);a.outline.view.validate()});return a};EditorUi.prototype.getServiceCount=function(b){var a=0;null==this.drive&&"function"!==typeof window.DriveClient||a++;null==this.dropbox&&"function"!==typeof window.DropboxClient||a++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||a++;null!=this.gitHub&&a++;null==this.trello&&"function"!==typeof window.TrelloClient||
a++;b&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&a++;mxClient.IS_IOS||a++;return a};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var b=this.getCurrentFile(),a=null!=b||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(a);this.menus.get("viewZoom").setEnabled(a);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==b||b.isRestricted());this.actions.get("makeCopy").setEnabled(!c);
this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);b="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&b.isEditable();this.actions.get("image").setEnabled(a);this.actions.get("zoomIn").setEnabled(a);this.actions.get("zoomOut").setEnabled(a);
this.actions.get("resetView").setEnabled(a);this.menus.get("edit").setEnabled(a);this.menus.get("view").setEnabled(a);this.menus.get("importFrom").setEnabled(b);this.menus.get("arrange").setEnabled(b);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(b),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(b));if(this.isOfflineApp()){var d=applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,
function(){var b=this.offlineStatus.getElementsByTagName("img");null!=b&&0<b.length&&this.alert(b[0].getAttribute("title"))}));var d=window.applicationCache,f=null,a=mxUtils.bind(this,function(){var b=d.status,a;b==d.CHECKING&&(b=d.DOWNLOADING);switch(b){case d.UNCACHED:a="";break;case d.IDLE:a='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:a='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:a=
'<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:a='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:a='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}b!=f&&(this.offlineStatus.innerHTML=a,f=b)});mxEvent.addListener(d,"checking",a);mxEvent.addListener(d,"noupdate",a);mxEvent.addListener(d,"downloading",a);mxEvent.addListener(d,"progress",a);mxEvent.addListener(d,
"cached",a);mxEvent.addListener(d,"updateready",a);mxEvent.addListener(d,"obsolete",a);mxEvent.addListener(d,"error",a);a()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);var b=this.editor.graph,a=this.getCurrentFile(),c=null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled();
this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=a&&a.isEditable()&&a.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("editData").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!b.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!b.isSelectionEmpty());
this.actions.get("editGeometry").setEnabled(b.getModel().isVertex(b.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=a);this.actions.get("makeCopy").setEnabled(null!=a&&!a.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&!a.isRestricted());this.actions.get("publishLink").setEnabled(null!=a&&!a.isRestricted());this.actions.get("tags").setEnabled("1"==
urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&!a.isRestricted());this.actions.get("close").setEnabled(null!=a);this.menus.get("publish").setEnabled(null!=a&&!a.isRestricted());b=b.view.getState(b.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=b&&null!=b.shape&&null!=b.shape.stencil)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,a,c,d,f,g){var e=b.editor.graph;if("xml"==c)b.hideDialog(),
b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var h=b.getFileData(!0,null,null,null,null,!0),k=e.getGraphBounds(),m=Math.floor(k.width*f/e.view.scale),l=Math.floor(k.height*f/e.view.scale);h.length<=MAX_REQUEST_SIZE&&m*l<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+(null!=b?"&filename="+encodeURIComponent(b):
"")+"&bg="+(null!=d?d:"none")+"&w="+m+"&h="+l+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(m));l.data=this.createSvgDataUri(m)}k.postMessage(JSON.stringify(l),"*")}return}if("loadFile"==g.action&&this.loadFile)"T"==g.type&&(null==this.trello?this.addListener("clientLoaded",function(){this.loadFile(g.file,!0)}):this.loadFile(g.file,!0));else if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=
g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(m=document.createElement("span"),mxUtils.write(m,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(m),this.embedFilenameSpan=m),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):
null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{b(g,e)}catch(I){this.handleError(I)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var A=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=A();d&&null==a&&(a=mxUtils.bind(this,
function(b,a){var e=A();if(e!=f&&!c){var d=this.createLoadMessage("autosave");d.xml=e;e=JSON.stringify(d);(window.opener||window.parent).postMessage(e,"*")}f=e}),this.editor.graph.model.addListener(mxEvent.CHANGE,a),this.editor.graph.addListener("gridSizeChanged",a),this.editor.graph.addListener("shadowVisibleChanged",a),this.addListener("pageFormatChanged",a),this.addListener("pageScaleChanged",a),this.addListener("backgroundColorChanged",a),this.addListener("backgroundImageChanged",a),this.addListener("foldingEnabledChanged",
a),this.addListener("mathEnabledChanged",a),this.addListener("gridEnabledChanged",a),this.addListener("guidesEnabledChanged",a),this.addListener("pageViewChanged",a));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var k=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var b=
document.createElement("div");b.style.display="inline-block";b.style.position="absolute";b.style.paddingTop="atlas"==uiTheme?"2px":"3px";b.style.paddingLeft="8px";b.style.paddingBottom="2px";var a=document.createElement("button");mxUtils.write(a,mxResources.get("save"));a.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");a.className="geBigButton";a.style.fontSize="12px";a.style.padding="4px 6px 4px 6px";a.style.borderRadius="3px";mxEvent.addListener(a,"click",mxUtils.bind(this,
function(){this.actions.get("save").funct()}));b.appendChild(a);"1"==urlParams.saveAndExit&&(a=document.createElement("a"),mxUtils.write(a,mxResources.get("saveAndExit")),a.setAttribute("title",mxResources.get("saveAndExit")),a.style.fontSize="12px",a.style.marginLeft="6px",a.style.padding="4px",a.style.cursor="pointer",mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),b.appendChild(a));a=document.createElement("a");mxUtils.write(a,mxResources.get("exit"));
a.setAttribute("title",mxResources.get("exit"));a.style.fontSize="12px";a.style.marginLeft="6px";a.style.marginRight="20px";a.style.padding="4px";a.style.cursor="pointer";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));b.appendChild(a);this.toolbar.container.appendChild(b);this.toolbar.staticElements.push(b);b.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=
new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(b){this.importCsv(b)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(b){try{var a=b.split("\n"),c=[];if(0<a.length){var d={},f=null,g=null,k="auto",m="auto",u=40,n=40,x=0,y=this.editor.graph;y.getGraphBounds();for(var C=function(){y.setSelectionCells(T);y.scrollCellToVisible(y.getSelectionCell())},
B=y.getFreeInsertPoint(),D=B.x,E=B.y,B=E,z=null,F="auto",A=[],I=null,G=null,H=0;H<a.length&&"#"==a[H].charAt(0);){b=a[H];for(H++;H<a.length&&"\\"==b.charAt(b.length-1)&&"#"==a[H].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(a[H].substring(1)),H++;if("#"!=b.charAt(1)){var J=b.indexOf(":");if(0<J){var L=mxUtils.trim(b.substring(1,J)),O=mxUtils.trim(b.substring(J+1));"label"==L?z=y.sanitizeHtml(O):"style"==L?f=O:"identity"==L&&0<O.length&&"-"!=O?g=O:"width"==L?k=O:"height"==L?m=O:"ignore"==L?
G=O.split(","):"connect"==L?A.push(JSON.parse(O)):"link"==L?I=O:"padding"==L?x=parseFloat(O):"edgespacing"==L?u=parseFloat(O):"nodespacing"==L?n=parseFloat(O):"layout"==L&&(F=O)}}}var P=this.editor.csvToArray(a[H]);b=null;if(null!=g)for(var M=0;M<P.length;M++)if(g==P[M]){b=M;break}null==z&&(z="%"+P[0]+"%");if(null!=A)for(var N=0;N<A.length;N++)null==d[A[N].to]&&(d[A[N].to]={});y.model.beginUpdate();try{for(M=H+1;M<a.length;M++){var V=this.editor.csvToArray(a[M]);if(V.length==P.length){var K=null,
W=null!=b?V[b]:null;null!=W&&(K=y.model.getCell(W));null==K&&(K=new mxCell(z,new mxGeometry(D,B,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=W);for(var S=0;S<V.length;S++)y.setAttributeForCell(K,P[S],V[S]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(N=0;N<A.length;N++)d[A[N].to][K.getAttribute(A[N].to)]=K;null!=I&&"link"!=I&&(y.setLinkForCell(K,K.getAttribute(I)),y.setAttributeForCell(K,I,null));var X=this.editor.graph.getPreferredSizeForCell(K);
K.geometry.width="auto"==k?X.width+x:parseFloat(k);K.geometry.height="auto"==m?X.height+x:parseFloat(m);B+=K.geometry.height+n;c.push(y.addCell(K))}}null==f&&y.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var Q=c.slice(),T=c.slice(),N=0;N<A.length;N++)for(var U=A[N],M=0;M<c.length;M++){var K=c[M],R=K.getAttribute(U.from);if(null!=R){y.setAttributeForCell(K,U.from,null);for(var aa=R.split(","),S=0;S<aa.length;S++){var ba=d[U.to][aa[S]];null!=ba&&(T.push(y.insertEdge(null,null,U.label||
"",U.invert?ba:K,U.invert?K:ba,U.style||y.createCurrentEdgeStyle())),mxUtils.remove(U.invert?K:ba,Q))}}}if(null!=G)for(M=0;M<c.length;M++)for(K=c[M],S=0;S<G.length;S++)y.setAttributeForCell(K,mxUtils.trim(G[S]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=u;var fa=function(){ca.execute(y.getDefaultParent());for(var b=0;b<c.length;b++){var a=y.getCellGeometry(c[b]);a.x=Math.round(y.snap(a.x));a.y=Math.round(y.snap(a.y));"auto"==k&&(a.width=Math.round(y.snap(a.width)));"auto"==m&&(a.height=Math.round(y.snap(a.height)))}};
if("circle"==F){var da=new mxCircleLayout(y);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(b){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,b)};this.executeLayout(function(){da.execute(y.getDefaultParent());fa()},!0,C);C=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&T.length==2*c.length-1&&1==Q.length){y.view.validate();var Y=new mxCompactTreeLayout(y,"horizontaltree"==F);Y.levelDistance=n;Y.edgeRouting=!1;Y.resetEdges=!1;this.executeLayout(function(){Y.execute(y.getDefaultParent(),
0<Q.length?Q[0]:null)},!0,C);C=null}else if("horizontalflow"==F||"verticalflow"==F||"auto"==F&&1==Q.length){y.view.validate();var ea=new mxHierarchicalLayout(y,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=n;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),T);y.moveCells(T,D,E)},!0,C);C=null}else if("organic"==F||"auto"==F&&T.length>c.length){y.view.validate();var Z=new mxFastOrganicLayout(y);Z.forceConstant=3*n;
Z.resetEdges=!1;var ia=Z.isVertexIgnored;Z.isVertexIgnored=function(b){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,b)};ca=new mxParallelEdgeLayout(y);ca.spacing=u;this.executeLayout(function(){Z.execute(y.getDefaultParent());fa()},!0,C);C=null}this.hideDialog()}finally{y.model.endUpdate()}null!=C&&C()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>
mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(b=0==a?b+"?":b+"&",null!=urlParams[d]&&(b+=d+"="+urlParams[d],a++))}return b};
EditorUi.prototype.showLinkDialog=function(b,a,c){b=new LinkDialog(this,b,a,c,!0);this.showDialog(b.container,420,120,!0,!0);b.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(b){var a=m.apply(this,arguments),c=this.editor.graph,d=a.getSourceGraphBounds;a.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,
0,Math.ceil(this.source.minimumGraphSize.width-2*b.x/a),Math.ceil(this.source.minimumGraphSize.height-2*b.y/a))}return d.apply(this,arguments)};var f=a.getSourceContainerSize;a.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*a-2*b.x),Math.ceil(this.source.minimumGraphSize.height*a-2*b.y))}return f.apply(this,
arguments)};a.getOutlineOffset=function(b){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var e=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(a.outline.container.clientWidth/b-(this.source.minimumGraphSize.width-2*e.x))/2)-e.x),Math.round(Math.max(0,(a.outline.container.clientHeight/b-(this.source.minimumGraphSize.height-2*e.y))/2)-e.y-5/b))}return new mxPoint(8/b,8/b)};var g=a.init;a.init=function(){g.apply(this,arguments);a.outline.view.getBackgroundPageBounds=
function(){var b=c.getPageLayout(),a=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+b.x*a.width),this.scale*(this.translate.y+b.y*a.height),this.scale*b.width*a.width,this.scale*b.height*a.height)};a.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(b,c){var e=c.getProperty("change"),d=a.source,f=a.outline;f.pageScale=d.pageScale;f.pageFormat=d.pageFormat;f.background=d.background;f.pageVisible=d.pageVisible;f.background=d.background;var g=
mxUtils.getCurrentStyle(d.container);f.container.style.backgroundColor=g.backgroundColor;null!=d.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=d.view.backgroundPageShape.fill);a.outline.view.clear(e.previousPage.root,!0);a.outline.view.validate()});return a};EditorUi.prototype.getServiceCount=function(b){var a=0;null==this.drive&&"function"!==typeof window.DriveClient||a++;null==this.dropbox&&"function"!==typeof window.DropboxClient||a++;null==this.oneDrive&&
"function"!==typeof window.OneDriveClient||a++;null!=this.gitHub&&a++;null==this.trello&&"function"!==typeof window.TrelloClient||a++;b&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&a++;mxClient.IS_IOS||a++;return a};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var b=this.getCurrentFile(),a=null!=b||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(a);this.menus.get("viewZoom").setEnabled(a);var c=
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==b||b.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);b="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&b.isEditable();
this.actions.get("image").setEnabled(a);this.actions.get("zoomIn").setEnabled(a);this.actions.get("zoomOut").setEnabled(a);this.actions.get("resetView").setEnabled(a);this.menus.get("edit").setEnabled(a);this.menus.get("view").setEnabled(a);this.menus.get("importFrom").setEnabled(b);this.menus.get("arrange").setEnabled(b);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(b),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(b));if(this.isOfflineApp()){var d=
applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var b=this.offlineStatus.getElementsByTagName("img");null!=b&&0<b.length&&this.alert(b[0].getAttribute("title"))}));var d=window.applicationCache,f=null,a=mxUtils.bind(this,function(){var b=d.status,a;b==d.CHECKING&&(b=d.DOWNLOADING);switch(b){case d.UNCACHED:a="";break;case d.IDLE:a='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:a='<img title="Downloading new version..." border="0" src="'+
IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:a='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:a='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:a='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}b!=f&&(this.offlineStatus.innerHTML=a,f=b)});mxEvent.addListener(d,"checking",a);mxEvent.addListener(d,"noupdate",a);mxEvent.addListener(d,"downloading",
a);mxEvent.addListener(d,"progress",a);mxEvent.addListener(d,"cached",a);mxEvent.addListener(d,"updateready",a);mxEvent.addListener(d,"obsolete",a);mxEvent.addListener(d,"error",a);a()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);var b=this.editor.graph,a=this.getCurrentFile(),c=null!=a&&a.isEditable()||
"1"==urlParams.embed&&this.editor.graph.isEnabled();this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=a&&a.isEditable()&&a.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("editData").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!b.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&
!b.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(b.getModel().isVertex(b.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=a);this.actions.get("makeCopy").setEnabled(null!=a&&!a.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&!a.isRestricted());this.actions.get("publishLink").setEnabled(null!=
a&&!a.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&!a.isRestricted());this.actions.get("close").setEnabled(null!=a);this.menus.get("publish").setEnabled(null!=a&&!a.isRestricted());b=b.view.getState(b.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=b&&null!=b.shape&&null!=b.shape.stencil)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,
a,c,d,f,g){var e=b.editor.graph;if("xml"==c)b.hideDialog(),b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var h=b.getFileData(!0,null,null,null,null,!0),k=e.getGraphBounds(),m=Math.floor(k.width*f/e.view.scale),l=Math.floor(k.height*f/e.view.scale);h.length<=MAX_REQUEST_SIZE&&m*l<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,
"format="+c+"&base64="+(a||"0")+(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+m+"&h="+l+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
@ -6486,7 +6486,7 @@ null==mxSettings.settings.customLibraries&&(mxSettings.settings.customLibraries=
!0),null==mxSettings.settings.gridColor&&(mxSettings.settings.gridColor=mxGraphView.prototype.gridColor),null==mxSettings.settings.autosave&&(mxSettings.settings.autosave=!0),null!=mxSettings.settings.scratchpadSeen&&delete mxSettings.settings.scratchpadSeen)},clear:function(){isLocalStorage&&localStorage.removeItem(mxSettings.key)}};("undefined"==typeof mxLoadSettings||mxLoadSettings)&&mxSettings.load();App=function(a,f,d){EditorUi.call(this,a,f,null!=d?d:"1"==urlParams.lightbox);mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,d,f){var c=null;try{c=window.open(a)}catch(n){}null==c||void 0===c?this.showDialog((new PopupDialog(this,a,d,f)).container,320,140,!0,!0):null!=d&&d()});this.updateDocumentTitle();this.updateUi();a=document.createElement("canvas");this.canvasSupported=!(!a.getContext||!a.getContext("2d"));window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});
this.isOffline()||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(c){null!=window.console&&console.log("Plugin Error:",c,App.DrawPlugins[a])}window.Draw.loadPlugin=mxUtils.bind(this,function(a){a(this)})}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";
App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL="https://js.live.net/v7.2/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";
App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="https://unpkg.com/dropbox@2.5.7/dist/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL="https://js.live.net/v7.2/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";
App.FOOTER_PLUGIN_URL="https://www.jgraph.com/drawio-footer.js";
App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",doors:"/plugins/doors.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",update:"/plugins/update.js",trees:"/plugins/trees/trees.js","import":"/plugins/import.js",
replay:"/plugins/replay.js",anon:"/plugins/anonymize.js"};App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var f=document.cookie.split(";"),d=0;d<f.length;d++){var c=mxUtils.trim(f[d]);if("MODE="==c.substring(0,5)){a=c.substring(5);break}}null!=a&&isLocalStorage&&(f=new Date,f.setYear(f.getFullYear()-1),document.cookie="MODE=; expires="+f.toUTCString(),localStorage.setItem(".mode",a))}return a};

View file

@ -162,9 +162,9 @@ App.MODE_TRELLO = 'trello';
App.DROPBOX_APPKEY = 'libwls2fa9szdji';
/**
* Sets the delay for autosave in milliseconds. Default is 2000.
* Sets URL to load the Dropbox SDK from
*/
App.DROPBOX_URL = 'https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js';
App.DROPBOX_URL = 'https://unpkg.com/dropbox@2.5.7/dist/Dropbox-sdk.min.js';
/**
* Sets the delay for autosave in milliseconds. Default is 2000.

View file

@ -2821,18 +2821,26 @@
*/
EditorUi.prototype.addChromelessToolbarItems = function(addButton)
{
editoUiAddChromelessToolbarItems.apply(this, arguments);
if (this.isExportToCanvas())
{
this.exportDialog = null;
var exportButton = addButton(mxUtils.bind(this, function(evt)
{
var clickHandler = mxUtils.bind(this, function()
{
mxEvent.removeListener(this.editor.graph.container, 'click', clickHandler);
if (this.exportDialog != null)
{
this.exportDialog.parentNode.removeChild(this.exportDialog);
this.exportDialog = null;
}
});
if (this.exportDialog != null)
{
this.exportDialog.parentNode.removeChild(this.exportDialog);
this.exportDialog = null;
clickHandler.apply(this);
}
else
{
@ -2873,13 +2881,6 @@
});
spinner.spin(this.exportDialog);
var clickHandler = mxUtils.bind(this, function()
{
mxEvent.removeListener(this.editor.graph.container, 'click', clickHandler);
this.exportDialog.parentNode.removeChild(this.exportDialog);
this.exportDialog = null;
});
this.exportToCanvas(mxUtils.bind(this, function(canvas)
{
spinner.stop();
@ -2919,6 +2920,8 @@
mxEvent.consume(evt);
}), Editor.cameraLargeImage, mxResources.get('export'));
}
editoUiAddChromelessToolbarItems.apply(this, arguments);
};
@ -8523,6 +8526,22 @@
return;
}
else if (data.action == 'loadFile' && this.loadFile)
{
if (data.type == 'T')
{
if (this.trello == null)
{
this.addListener('clientLoaded', function() {
this.loadFile(data.file, true);
});
}
else
{
this.loadFile(data.file, true);
}
}
}
else if (data.action == 'load')
{
autosave = data.autosave == 1;

View file

@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+y.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.4.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.4.3",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||

View file

@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+y.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.4.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.4.3",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||

142
war/js/viewer.min.js vendored
View file

@ -2709,48 +2709,48 @@ EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,n){if(window.Blob&&navigator
b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),q=0;q<f;++q){for(var k=1024*q,g=Math.min(k+1024,d),m=Array(g-k),l=0;k<g;++l,++k)m[l]=
c[k].charCodeAt(0);e[q]=new Uint8Array(m)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,g){g=null!=g?g:!1;var c="vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,
d,e);else b==App.MODE_DEVICE?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(x){this.handleError(x)}}))}catch(D){this.handleError(D)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,c,null,null,4<n?3:4,a,d,e);this.showDialog(b.container,380,4<n?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||
11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):(c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){b.apply(this,arguments);if(this.isExportToCanvas()){this.exportDialog=
null;var c=a(mxUtils.bind(this,function(a){if(null!=this.exportDialog)this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null;else{this.exportDialog=document.createElement("div");var b=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=
"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=b.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=b.zIndex;var d=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});d.spin(this.exportDialog);var f=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",f);this.exportDialog.parentNode.removeChild(this.exportDialog);this.exportDialog=null});this.exportToCanvas(mxUtils.bind(this,function(a){d.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");
a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);f.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",f);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,g){var c=!mxClient.IS_IOS||!navigator.standalone,f=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,
function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,c,d)}catch(u){this.handleError(u)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=
f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,c,d)}catch(u){this.handleError(u)}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,c,null,null,4<f?3:4,e,g,n);this.showDialog(a.container,380,4<f?390:270,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,d,e,n,g){};EditorUi.prototype.pickFolder=
function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,g,q,k,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,q,k,null,d);e&&this.editor.graph.addSvgShadow(f);var h=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,
null,null,null,d,m));var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),
this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+
":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,
mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled",
"disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+
"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");
f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();g.style.padding=
mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width="22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,g,m,q,k){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=g&&0<g.length&&f.push("edit="+encodeURIComponent(g)),m&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=q?d="#U"+encodeURIComponent(q):(c=this.getCurrentFile(),k||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?
this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,g,m,q,k,l,t,r){var c=this.getBasenames(),f={};
""!=g&&g!=mxConstants.NONE&&(f.highlight=g);"auto"!==e&&(f.target=e);l||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(f.zoom=d/100);d=[];q&&(d.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),f.resize=!0);k&&d.push("layers");0<d.length&&(l&&d.push("lightbox"),f.toolbar=d.join(" "));null!=t&&0<t.length&&(f.edit=t);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,
null,null,!q);b='<div class="mxgraph" style="'+(m?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';c=0<c.length?"s="+c.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";r(b,'<script type="text/javascript" src="'+(0<c.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+c:"https://www.draw.io/embed2.js?"+c)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+
'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(p);mxUtils.br(h);h.appendChild(k);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));h.appendChild(p);var g=this.getCurrentFile();null==d&&null!=g&&g.constructor==window.DriveFile&&(p=
document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),h.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(g.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(h);var m=this.addLinkSection(c),l=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,
":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";c.appendChild(r);var B=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,A=A=this.addCheckbox(c,mxResources.get("allPages"),h,!h),y=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),F=this.addEditButton(c,C),z=F.getEditInput();
z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&C.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,l.checked,r.value,m.getTarget(),m.getColor(),B.checked,A.checked,y.checked,C.checked,F.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};
EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,g,m){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",
p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");
n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));
this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,r=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",c.appendChild(l),mxUtils.write(c,mxResources.get("height")+":"),r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="50px",
r.style.marginLeft="6px",r.style.marginBottom="10px",r.value=e+"px",c.appendChild(r),mxUtils.br(c);var v=this.addLinkSection(c,m);d=null!=this.pages&&1<this.pages.length;var A=null;if(null==h||h.constructor!=window.DriveFile||b)A=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var y=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,y),F=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=F.style.marginLeft;z.style.marginBottom="16px";
z.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(z.removeAttribute("disabled"),F.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"));F.checked&&y.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){g(v.getTarget(),v.getColor(),null==A?!0:A.checked,y.checked,C.getLink(),z.checked,null!=l?l.value:null,null!=
r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=l?(l.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";
c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,g,m,q,k){q=null!=q?q:!0;var c=document.createElement("div");c.style.whiteSpace=
"nowrap";var f=this.editor.graph,h="jpeg"==k?170:280,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(p);mxUtils.write(c,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+
":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);mxUtils.br(c);var r=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=k),v=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight=
"8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");m&&(c.appendChild(C),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(v,"change",function(){v.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(C.setAttribute("checked","checked"),C.defaultChecked=!0);var F=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop=
"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),h+=26);var G=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),q,null,null,"jpeg"!=k),J=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=k);K.style.marginLeft="24px";K.style.marginBottom="16px";J||(K.style.visibility=
"hidden");mxEvent.addListener(G,"change",function(){G.checked&&J?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});q&&J||K.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=l.value;this.lastExportZoom=n.value;g(n.value,r.checked,!v.checked,F.checked,G.checked,z.checked,l.value,C.checked,!K.checked)}),null,d,e);this.showDialog(a.container,320,h,!0,!0);n.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var p=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,
d),l=this.addCheckbox(c,mxResources.get("lightbox"),!0),r=this.addEditButton(c,l),B=r.getEditInput(),A=1<f.model.getChildCount(f.model.getRoot()),y=this.addCheckbox(c,mxResources.get("layers"),A,!A);y.style.marginLeft=B.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(l,"change",function(){l.checked?(A&&y.removeAttribute("disabled"),B.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"));B.checked&&l.checked?
r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(p.checked,n.checked,m.checked,l.checked,r.getLink(),y.checked)}),null,mxResources.get("embed"),g);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,g,m,q,k){function c(c){var b=" ",h="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):(c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=
null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign=
"center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);
this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";
a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),
Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,n,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,n,g){var c=!mxClient.IS_IOS||!navigator.standalone,f=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=
d("_blank"==c?null:a,c==App.MODE_DEVICE||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,c,d)}catch(u){this.handleError(u)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),
a,g,!0,c,d)}catch(u){this.handleError(u)}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,c,null,null,4<f?3:4,e,g,n);this.showDialog(a.container,380,4<f?390:270,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,d,e,n,g){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=
function(a,b,d,e,n,g,q,k,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,q,k,null,d);e&&this.editor.graph.addSvgShadow(f);var h=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,m));var c='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+
mxUtils.getXml(a);this.isLocalFileSave()||c.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",c,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,p,this.thumbImageCache)):p(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,g){g=null!=g?g:!0;var c=
document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),mxUtils.write(a,b),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=
App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,
function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":
f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){g.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");
d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&
(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",g=null,g=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();g.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";g.style.marginLeft="4px";g.style.height="22px";g.style.width=
"22px";g.style.position="relative";g.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";g.className="geColorBtn";a.appendChild(g);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,g,m,q,k){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),
null!=g&&0<g.length&&f.push("edit="+encodeURIComponent(g)),m&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=q?d="#U"+encodeURIComponent(q):(c=this.getCurrentFile(),k||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):
(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,g,m,q,k,l,t,r){var c=this.getBasenames(),f={};""!=g&&g!=mxConstants.NONE&&(f.highlight=g);"auto"!==e&&(f.target=e);l||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;
d=parseInt(d);isNaN(d)||100==d||(f.zoom=d/100);d=[];q&&(d.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),f.resize=!0);k&&d.push("layers");0<d.length&&(l&&d.push("lightbox"),f.toolbar=d.join(" "));null!=t&&0<t.length&&(f.edit=t);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!q);b='<div class="mxgraph" style="'+(m?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+
mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';c=0<c.length?"s="+c.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";r(b,'<script type="text/javascript" src="'+(0<c.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+c:"https://www.draw.io/embed2.js?"+c)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");
c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name",
"type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");h.appendChild(f);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(p);mxUtils.br(h);h.appendChild(k);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));h.appendChild(p);var g=this.getCurrentFile();null==d&&null!=g&&g.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href",
"javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),h.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(g.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(h);var m=this.addLinkSection(c),l=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";
r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";c.appendChild(r);var B=this.addCheckbox(c,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,A=A=this.addCheckbox(c,mxResources.get("allPages"),h,!h),y=this.addCheckbox(c,mxResources.get("layers"),!0),C=this.addCheckbox(c,mxResources.get("lightbox"),!0),F=this.addEditButton(c,C),z=F.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?z.removeAttribute("disabled"):
z.setAttribute("disabled","disabled");z.checked&&C.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,l.checked,r.value,m.getTarget(),m.getColor(),B.checked,A.checked,y.checked,C.checked,F.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,g,m){var c=document.createElement("div");c.style.whiteSpace=
"nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var h=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=h&&h.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(h.getId())}));n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));
p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var l=null,r=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),l=document.createElement("input"),
l.setAttribute("type","text"),l.style.marginRight="16px",l.style.width="50px",l.style.marginLeft="6px",l.style.marginRight="16px",l.style.marginBottom="10px",l.value="100%",c.appendChild(l),mxUtils.write(c,mxResources.get("height")+":"),r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="50px",r.style.marginLeft="6px",r.style.marginBottom="10px",r.value=e+"px",c.appendChild(r),mxUtils.br(c);var v=this.addLinkSection(c,m);d=null!=this.pages&&1<this.pages.length;var A=null;
if(null==h||h.constructor!=window.DriveFile||b)A=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var y=this.addCheckbox(c,mxResources.get("lightbox"),!0),C=this.addEditButton(c,y),F=C.getEditInput(),z=this.addCheckbox(c,mxResources.get("layers"),!0);z.style.marginLeft=F.style.marginLeft;z.style.marginBottom="16px";z.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(z.removeAttribute("disabled"),F.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),F.setAttribute("disabled",
"disabled"));F.checked&&y.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){g(v.getTarget(),v.getColor(),null==A?!0:A.checked,y.checked,C.getLink(),z.checked,null!=l?l.value:null,null!=r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,246+a,!0,!0);null!=l?(l.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",
!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var h=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&
(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!h.checked,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,g,m,q,k){q=null!=q?q:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph,h="jpeg"==k?170:280,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(p);
mxUtils.write(c,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);
mxUtils.br(c);var r=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=k),v=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight="8px";C.style.marginLeft="24px";C.setAttribute("disabled","disabled");C.setAttribute("type","checkbox");m&&(c.appendChild(C),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),h+=26,mxEvent.addListener(v,
"change",function(){v.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(C.setAttribute("checked","checked"),C.defaultChecked=!0);var F=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),z=document.createElement("input");z.style.marginTop="16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(c.appendChild(z),mxUtils.write(c,mxResources.get("embedImages")),
mxUtils.br(c),h+=26);var G=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),q,null,null,"jpeg"!=k),J=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(c,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=k);K.style.marginLeft="24px";K.style.marginBottom="16px";J||(K.style.visibility="hidden");mxEvent.addListener(G,"change",function(){G.checked&&J?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});q&&J||K.setAttribute("disabled","disabled");a=new CustomDialog(this,
c,mxUtils.bind(this,function(){this.lastExportBorder=l.value;this.lastExportZoom=n.value;g(n.value,r.checked,!v.checked,F.checked,G.checked,z.checked,l.value,C.checked,!K.checked)}),null,d,e);this.showDialog(a.container,320,h,!0,!0);n.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;
if(null!=b){var h=document.createElement("h3");mxUtils.write(h,b);h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(h)}var p=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,d),l=this.addCheckbox(c,mxResources.get("lightbox"),!0),r=this.addEditButton(c,l),B=r.getEditInput(),A=1<f.model.getChildCount(f.model.getRoot()),y=this.addCheckbox(c,mxResources.get("layers"),A,
!A);y.style.marginLeft=B.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(l,"change",function(){l.checked?(A&&y.removeAttribute("disabled"),B.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"));B.checked&&l.checked?r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(p.checked,n.checked,m.checked,l.checked,
r.getLink(),y.checked)}),null,mxResources.get("embed"),g);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,g,m,q,k){function c(c){var b=" ",h="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(g?"&edit=_blank":"")+(m?"&layers=1":"")+"');}})(this);\"",h+="cursor:pointer;");a&&(h+="max-width:100%;");var k="";d&&(k=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');q('<img src="'+c+'"'+k+(""!=h?' style="'+h+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){k({message:mxResources.get("unknownError")})}),
null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var h="";d&&(h="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+h+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?c("data:image/png;base64,"+p.getText()):k({message:mxResources.get("unknownError")})}))}else k({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(a,b,d,e,g,m,q){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var h=0;h<f.length;h++){var p=f[h].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[h].getAttribute("target")&&f[h].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",l="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
@ -2859,35 +2859,35 @@ this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.g
("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);l=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=
this.getFileData(null,null,!0,null,null,null,k),l.format=g.format;else if("html"==g.format)p=this.editor.getGraphXml(),l.data=this.getHtml(p,this.editor.graph),l.xml=mxUtils.getXml(p),l.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),
"xmlsvg"==g.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);m.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));m.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}m.postMessage(JSON.stringify(l),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
"12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{m.postMessage(JSON.stringify({error:"unknownMessage",
data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{a(g,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var z=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=z();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=z();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,
"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||m.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var m=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?
"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),
mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight=
"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),
null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,m="auto",k="auto",l=40,r=40,D=0,x=this.editor.graph;x.getGraphBounds();for(var u=function(){x.setSelectionCells(W);x.scrollCellToVisible(x.getSelectionCell())},B=x.getFreeInsertPoint(),A=B.x,y=B.y,B=y,C=null,F="auto",z=[],G=null,J=null,K=0;K<b.length&&
"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var L=mxUtils.trim(a.substring(1,P)),M=mxUtils.trim(a.substring(P+1));"label"==L?C=x.sanitizeHtml(M):"style"==L?e=M:"identity"==L&&0<M.length&&"-"!=M?g=M:"width"==L?m=M:"height"==L?k=M:"ignore"==L?J=M.split(","):"connect"==L?z.push(JSON.parse(M)):"link"==L?G=M:"padding"==L?D=parseFloat(M):
"edgespacing"==L?l=parseFloat(M):"nodespacing"==L?r=parseFloat(M):"layout"==L&&(F=M)}}}var R=this.editor.csvToArray(b[K]);a=null;if(null!=g)for(var H=0;H<R.length;H++)if(g==R[H]){a=H;break}null==C&&(C="%"+R[0]+"%");if(null!=z)for(var I=0;I<z.length;I++)null==d[z[I].to]&&(d[z[I].to]={});x.model.beginUpdate();try{for(H=K+1;H<b.length;H++){var X=this.editor.csvToArray(b[H]);if(X.length==R.length){var E=null,U=null!=a?X[a]:null;null!=U&&(E=x.model.getCell(U));null==E&&(E=new mxCell(C,new mxGeometry(A,
B,0,0),e||"whiteSpace=wrap;html=1;"),E.vertex=!0,E.id=U);for(var Q=0;Q<X.length;Q++)x.setAttributeForCell(E,R[Q],X[Q]);x.setAttributeForCell(E,"placeholders","1");E.style=x.replacePlaceholders(E,E.style);for(I=0;I<z.length;I++)d[z[I].to][E.getAttribute(z[I].to)]=E;null!=G&&"link"!=G&&(x.setLinkForCell(E,E.getAttribute(G)),x.setAttributeForCell(E,G,null));var V=this.editor.graph.getPreferredSizeForCell(E);E.geometry.width="auto"==m?V.width+D:parseFloat(m);E.geometry.height="auto"==k?V.height+D:parseFloat(k);
B+=E.geometry.height+r;c.push(x.addCell(E))}}null==e&&x.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var N=c.slice(),W=c.slice(),I=0;I<z.length;I++)for(var S=z[I],H=0;H<c.length;H++){var E=c[H],T=E.getAttribute(S.from);if(null!=T){x.setAttributeForCell(E,S.from,null);for(var ha=T.split(","),Q=0;Q<ha.length;Q++){var Y=d[S.to][ha[Q]];null!=Y&&(W.push(x.insertEdge(null,null,S.label||"",S.invert?Y:E,S.invert?E:Y,S.style||x.createCurrentEdgeStyle())),mxUtils.remove(S.invert?E:Y,N))}}}if(null!=
J)for(H=0;H<c.length;H++)for(E=c[H],Q=0;Q<J.length;Q++)x.setAttributeForCell(E,mxUtils.trim(J[Q]),null);var Z=new mxParallelEdgeLayout(x);Z.spacing=l;var ia=function(){Z.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==k&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==F){var aa=new mxCircleLayout(x);aa.resetEdges=!1;var ma=aa.isVertexIgnored;
aa.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){aa.execute(x.getDefaultParent());ia()},!0,u);u=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&W.length==2*c.length-1&&1==N.length){x.view.validate();var ba=new mxCompactTreeLayout(x,"horizontaltree"==F);ba.levelDistance=r;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(x.getDefaultParent(),0<N.length?N[0]:null)},!0,u);u=null}else if("horizontalflow"==
F||"verticalflow"==F||"auto"==F&&1==N.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),W);x.moveCells(W,A,y)},!0,u);u=null}else if("organic"==F||"auto"==F&&W.length>c.length){x.view.validate();var ca=new mxFastOrganicLayout(x);ca.forceConstant=3*r;ca.resetEdges=!1;var qa=ca.isVertexIgnored;ca.isVertexIgnored=
function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};Z=new mxParallelEdgeLayout(x);Z.spacing=l;this.executeLayout(function(){ca.execute(x.getDefaultParent());ia()},!0,u);u=null}this.hideDialog()}finally{x.model.endUpdate()}null!=u&&u()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&
(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,
b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-
2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&
null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*
(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;
null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&
"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());
this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);
this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=
document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,
"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+
'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}m.postMessage(JSON.stringify(l),"*")}return}if("loadFile"==g.action&&this.loadFile)"T"==g.type&&(null==this.trello?this.addListener("clientLoaded",function(){this.loadFile(g.file,!0)}):this.loadFile(g.file,!0));else if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=
g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):
null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{a(g,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var z=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=z();d&&null==b&&(b=mxUtils.bind(this,
function(a,b){var d=z();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",
b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||m.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}));var m=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=
document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,
function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));
b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=
new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,m="auto",k="auto",l=40,r=40,D=0,x=this.editor.graph;x.getGraphBounds();for(var u=function(){x.setSelectionCells(W);x.scrollCellToVisible(x.getSelectionCell())},
B=x.getFreeInsertPoint(),A=B.x,y=B.y,B=y,C=null,F="auto",z=[],G=null,J=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var L=mxUtils.trim(a.substring(1,P)),M=mxUtils.trim(a.substring(P+1));"label"==L?C=x.sanitizeHtml(M):"style"==L?e=M:"identity"==L&&0<M.length&&"-"!=M?g=M:"width"==L?m=M:"height"==L?k=M:"ignore"==L?
J=M.split(","):"connect"==L?z.push(JSON.parse(M)):"link"==L?G=M:"padding"==L?D=parseFloat(M):"edgespacing"==L?l=parseFloat(M):"nodespacing"==L?r=parseFloat(M):"layout"==L&&(F=M)}}}var R=this.editor.csvToArray(b[K]);a=null;if(null!=g)for(var H=0;H<R.length;H++)if(g==R[H]){a=H;break}null==C&&(C="%"+R[0]+"%");if(null!=z)for(var I=0;I<z.length;I++)null==d[z[I].to]&&(d[z[I].to]={});x.model.beginUpdate();try{for(H=K+1;H<b.length;H++){var X=this.editor.csvToArray(b[H]);if(X.length==R.length){var E=null,
U=null!=a?X[a]:null;null!=U&&(E=x.model.getCell(U));null==E&&(E=new mxCell(C,new mxGeometry(A,B,0,0),e||"whiteSpace=wrap;html=1;"),E.vertex=!0,E.id=U);for(var Q=0;Q<X.length;Q++)x.setAttributeForCell(E,R[Q],X[Q]);x.setAttributeForCell(E,"placeholders","1");E.style=x.replacePlaceholders(E,E.style);for(I=0;I<z.length;I++)d[z[I].to][E.getAttribute(z[I].to)]=E;null!=G&&"link"!=G&&(x.setLinkForCell(E,E.getAttribute(G)),x.setAttributeForCell(E,G,null));var V=this.editor.graph.getPreferredSizeForCell(E);
E.geometry.width="auto"==m?V.width+D:parseFloat(m);E.geometry.height="auto"==k?V.height+D:parseFloat(k);B+=E.geometry.height+r;c.push(x.addCell(E))}}null==e&&x.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var N=c.slice(),W=c.slice(),I=0;I<z.length;I++)for(var S=z[I],H=0;H<c.length;H++){var E=c[H],T=E.getAttribute(S.from);if(null!=T){x.setAttributeForCell(E,S.from,null);for(var ha=T.split(","),Q=0;Q<ha.length;Q++){var Y=d[S.to][ha[Q]];null!=Y&&(W.push(x.insertEdge(null,null,S.label||
"",S.invert?Y:E,S.invert?E:Y,S.style||x.createCurrentEdgeStyle())),mxUtils.remove(S.invert?E:Y,N))}}}if(null!=J)for(H=0;H<c.length;H++)for(E=c[H],Q=0;Q<J.length;Q++)x.setAttributeForCell(E,mxUtils.trim(J[Q]),null);var Z=new mxParallelEdgeLayout(x);Z.spacing=l;var ia=function(){Z.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==k&&(b.height=Math.round(x.snap(b.height)))}};
if("circle"==F){var aa=new mxCircleLayout(x);aa.resetEdges=!1;var ma=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ma.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){aa.execute(x.getDefaultParent());ia()},!0,u);u=null}else if("horizontaltree"==F||"verticaltree"==F||"auto"==F&&W.length==2*c.length-1&&1==N.length){x.view.validate();var ba=new mxCompactTreeLayout(x,"horizontaltree"==F);ba.levelDistance=r;ba.edgeRouting=!1;ba.resetEdges=!1;this.executeLayout(function(){ba.execute(x.getDefaultParent(),
0<N.length?N[0]:null)},!0,u);u=null}else if("horizontalflow"==F||"verticalflow"==F||"auto"==F&&1==N.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==F?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),W);x.moveCells(W,A,y)},!0,u);u=null}else if("organic"==F||"auto"==F&&W.length>c.length){x.view.validate();var ca=new mxFastOrganicLayout(x);ca.forceConstant=3*
r;ca.resetEdges=!1;var qa=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return qa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};Z=new mxParallelEdgeLayout(x);Z.spacing=l;this.executeLayout(function(){ca.execute(x.getDefaultParent());ia()},!0,u);u=null}this.hideDialog()}finally{x.model.endUpdate()}null!=u&&u()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;
for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var h=
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=h.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();
this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var r=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),d=null!=b&&b.isEditable()||
"1"==urlParams.embed&&this.editor.graph.isEnabled();this.actions.get("pageSetup").setEnabled(d);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(d);this.actions.get("editData").setEnabled(d);this.actions.get("shadowVisible").setEnabled(d);this.actions.get("connectionArrows").setEnabled(d);this.actions.get("connectionPoints").setEnabled(d);this.actions.get("copyStyle").setEnabled(d&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(d&&
!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(d);this.actions.get("createRevision").setEnabled(d);this.actions.get("moveToFolder").setEnabled(null!=b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=