13.9.7 release

This commit is contained in:
David Benson [draw.io] 2020-11-12 06:58:09 +00:00
parent 565ea2d4b3
commit b5eba64f89
18 changed files with 923 additions and 906 deletions

View file

@ -1,3 +1,11 @@
12-NOV-2020: 13.9.7
- Allows null in init load message
11-NOV-2020: 13.9.6
- Uses GitHub for help and faq
11-NOV-2020: 13.9.5
- Fixes license check in Confluence Cloud

View file

@ -1 +1 @@
13.9.5
13.9.7

View file

@ -9457,7 +9457,7 @@ DrawioFile.prototype.updateFile=function(a,c,e,b){null!=e&&e()||(this.ui.getCurr
DrawioFile.prototype.mergeFile=function(a,c,e,b){var g=!0;try{this.stats.fileMerged++;var f=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),m=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=m&&0<m.length){this.shadowPages=m;this.backupPatch=this.isModified()?this.ui.diffPages(f,this.ui.pages):null;var n=[this.ui.diffPages(null!=b?b:f,this.shadowPages)];if(!this.ignorePatches(n)){var d=this.ui.patchPages(f,
n[0]);b={};var k=this.ui.getHashValueForPages(d,b),f={},l=this.ui.getHashValueForPages(this.shadowPages,f);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",n,"checksum",l==k,k);if(null!=k&&k!=l){var p=this.compressReportData(this.getAnonymizedXmlForPages(m)),u=this.compressReportData(this.getAnonymizedXmlForPages(d)),t=this.ui.hashValue(a.getCurrentEtag()),q=this.ui.hashValue(this.getCurrentEtag());this.checksumError(e,n,"Shadow Details: "+JSON.stringify(b)+
"\nChecksum: "+k+"\nCurrent: "+l+"\nCurrent Details: "+JSON.stringify(f)+"\nFrom: "+t+"\nTo: "+q+"\n\nFile Data:\n"+p+"\nPatched Shadow:\n"+u,null,"mergeFile");return}this.patch(n,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw g=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
null!=e&&e(x);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var v=this.getCurrentUser(),y=null!=v?v.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,x)}}catch(B){}}};
null!=e&&e(x);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var v=this.getCurrentUser(),y=null!=v?v.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,x)}}catch(A){}}};
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),e=c.document.createElement("mxfile");if(null!=a)for(var b=0;b<a.length;b++){var g=c.encode(new mxGraphModel(a[b].root));"1"!=urlParams.dev&&(g=this.ui.anonymizeNode(g,!0));g.setAttribute("id",a[b].getId());a[b].viewState&&this.ui.editor.graph.saveViewState(a[b].viewState,g,!0);e.appendChild(g)}return mxUtils.getPrettyXml(e)};
DrawioFile.prototype.compressReportData=function(a,c,e){c=null!=c?c:1E4;null!=e&&null!=a&&a.length>e?a=a.substring(0,e)+"[...]":null!=a&&a.length>c&&(a=Graph.compress(a)+"\n");return a};
DrawioFile.prototype.checksumError=function(a,c,e,b,g){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var f=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
@ -9493,7 +9493,7 @@ null!=e&&(c=mxResources.get("lastSaved",[e]))}null!=c&&60<c.length&&(c=c.substri
null!=c&&0<c.length?mxEvent.addListener(c[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!=this.ui.mode&&this.isEditable()?"save":"saveAs").funct()})):(c=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="overflow:hidden;">'+c+" ("+mxUtils.htmlEntities(a.message)+")</div>"));EditorUi.enableDrafts&&(null==this.getMode()||EditorUi.isElectronApp)&&(null!=this.saveDraftThread&&window.clearTimeout(this.saveDraftThread),
this.saveDraftThread=window.setTimeout(mxUtils.bind(this,function(){this.saveDraft()}),0))}};
DrawioFile.prototype.addConflictStatus=function(a,c){this.invalidChecksum&&null==c&&(c=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=c&&""!=c?" ("+mxUtils.htmlEntities(c)+")":""));this.ui.spinner.stop();this.clearAutosave();var e=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=e&&0<e.length?mxEvent.addListener(e[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&&
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://desk.draw.io/support/solutions/articles/16000087947" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://www.diagrams.net/doc/faq/synchronize" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
DrawioFile.prototype.showRefreshDialog=function(a,c,e){null==e&&(e=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,c)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,c)}),e),this.ui.showError(mxResources.get("error")+" ("+e+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,
c)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,c)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))};
DrawioFile.prototype.showCopyDialog=function(a,c,e){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,c)}),null,mxResources.get("overwrite"),e,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)};
@ -9538,8 +9538,8 @@ RemoteLibrary.prototype.saveAs=function(a,c,e){};RemoteLibrary.prototype.updateF
var StorageDialog=function(a,c,e){function b(b,k,f,g,q,v){function l(){mxEvent.addListener(p,"click",null!=v?v:function(){f!=App.MODE_GOOGLE||a.isDriveDomain()?f==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,!0);c()})):f==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,!0);c()})):
(a.setMode(f,!0),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}++m>e&&(mxUtils.br(n),m=0);var p=document.createElement("a");p.style.overflow="hidden";p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.marginTop="8px";p.style.marginBottom="0px";p.style.padding="8px 10px 8px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace=
"nowrap";p.setAttribute("title",k);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.overflow="hidden";t.style.position="absolute";t.style.bottom="8px";t.style.left="0px";t.style.right="0px";mxUtils.write(t,k);p.appendChild(t);if(null!=b){var u=document.createElement("img");u.setAttribute("src",b);u.setAttribute("border","0");u.setAttribute("align","absmiddle");u.style.width="60px";u.style.height="60px";u.style.paddingBottom=
"6px";p.appendChild(u)}else t.style.paddingTop="5px",t.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(t.style.paddingTop="0px",t.style.marginTop="-2px");if(null!=q)for(b=0;b<q.length;b++)mxUtils.br(t),mxUtils.write(t,q[b]);if(null!=g&&null==a[g]){u.style.visibility="hidden";mxUtils.setOpacity(t,10);var C=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,
hwaccel:!1,top:"40%",zIndex:2E9});C.spin(p);var A=window.setTimeout(function(){null==a[g]&&(C.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,e){null!=a[g]&&e.getProperty("client")==a[g]&&(window.clearTimeout(A),mxUtils.setOpacity(t,100),u.style.visibility="",C.stop(),l(),"drive"==g&&null!=d.parentNode&&d.parentNode.removeChild(d))}))}else l();n.appendChild(p)}e=null!=e?e:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace=
"6px";p.appendChild(u)}else t.style.paddingTop="5px",t.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(t.style.paddingTop="0px",t.style.marginTop="-2px");if(null!=q)for(b=0;b<q.length;b++)mxUtils.br(t),mxUtils.write(t,q[b]);if(null!=g&&null==a[g]){u.style.visibility="hidden";mxUtils.setOpacity(t,10);var B=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,
hwaccel:!1,top:"40%",zIndex:2E9});B.spin(p);var C=window.setTimeout(function(){null==a[g]&&(B.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,e){null!=a[g]&&e.getProperty("client")==a[g]&&(window.clearTimeout(C),mxUtils.setOpacity(t,100),u.style.visibility="",B.stop(),l(),"drive"==g&&null!=d.parentNode&&d.parentNode.removeChild(d))}))}else l();n.appendChild(p)}e=null!=e?e:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace=
"nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var f=document.createElement("div");f.style.border="1px solid #d3d3d3";f.style.borderWidth="1px 0px 1px 0px";f.style.padding="10px 0px 20px 0px";mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");var m=0,n=document.createElement("div");n.style.paddingTop="2px";f.appendChild(n);var d=document.createElement("p"),k=document.createElement("p");k.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";
mxUtils.write(k,mxResources.get("saveDiagramsTo")+":");g.appendChild(k);g.appendChild(f);m=0;"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");b(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||
b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&b(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=a.gitHub&&b(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=a.gitLab&&b(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");f=document.createElement("span");f.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";
@ -9565,22 +9565,22 @@ encodeURIComponent(d.value);a.openLink(b)}catch(t){a.handleError({message:t.mess
c.length&&(p=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent(m)+"&url="+encodeURIComponent(d.value);a.openLink(b)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),l=document.createElement("img"),l.setAttribute("src",Editor.tweetImage),l.setAttribute("width","18"),l.setAttribute("height","18"),l.setAttribute("border","0"),l.style.marginBottom="5px",p.appendChild(l),p.setAttribute("title",mxResources.get("twitter")+
" ("+a.formatFileSize(7168)+" max)"),p.style.verticalAlign="bottom",p.style.paddingTop="4px",p.style.minWidth="46px",p.className="geBtn",f.appendChild(p))}l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.appendChild(l);p=mxUtils.button(mxResources.get("copy"),function(){d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?d.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});
5E5>c.length?mxClient.IS_SF||null!=document.documentMode?l.className="geBtn gePrimaryBtn":(f.appendChild(p),p.className="geBtn gePrimaryBtn",l.className="geBtn"):(f.appendChild(k),l.className="geBtn",k.className="geBtn gePrimaryBtn");b.appendChild(f);this.container=b};EmbedDialog.showPreviewOption=!0;
var GoogleSitesDialog=function(a,c){function e(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(C.checked&&""!=u.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(u.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<A.length&&(b+="&s="+A);""!=t.value&&"0"!=t.value&&(b+="&border="+t.value);""!=p.value&&(b+="&height="+p.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(z.checked?"1":"0");
b+="&resize="+(B.checked?"1":"0");b+="&x0="+Number(l.value);b+="&y0="+d;g.mathEnabled&&(b+="&math=1");x.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));k.value=b}else D.constructor==DriveFile||D.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?b+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(b+=D.getHash().substring(1),b=D.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
var GoogleSitesDialog=function(a,c){function e(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(B.checked&&""!=u.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(u.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<C.length&&(b+="&s="+C);""!=t.value&&"0"!=t.value&&(b+="&border="+t.value);""!=p.value&&(b+="&height="+p.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(z.checked?"1":"0");
b+="&resize="+(A.checked?"1":"0");b+="&x0="+Number(l.value);b+="&y0="+d;g.mathEnabled&&(b+="&math=1");x.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));k.value=b}else D.constructor==DriveFile||D.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?b+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(b+=D.getHash().substring(1),b=D.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
a&&(b+="&title="+encodeURIComponent(a)),""!=p.value&&(a=parseInt(p.value)+parseInt(l.value),b+="&height="+a),k.value=b):k.value=""}var b=document.createElement("div"),g=a.editor.graph,f=g.getGraphBounds(),m=g.view.scale,n=Math.floor(f.x/m-g.view.translate.x),d=Math.floor(f.y/m-g.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var k=document.createElement("input");k.setAttribute("type","text");k.style.marginBottom="8px";k.style.marginTop="2px";k.style.width="410px";
b.appendChild(k);mxUtils.br(b);this.init=function(){k.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null)};mxUtils.write(b,mxResources.get("top")+":");var l=document.createElement("input");l.setAttribute("type","text");l.setAttribute("size","4");l.style.marginRight="16px";l.style.marginLeft="4px";l.value=n;b.appendChild(l);mxUtils.write(b,mxResources.get("height")+":");var p=document.createElement("input");p.setAttribute("type",
"text");p.setAttribute("size","4");p.style.marginLeft="4px";p.value=Math.ceil(f.height/m);b.appendChild(p);mxUtils.br(b);f=document.createElement("hr");f.setAttribute("size","1");f.style.marginBottom="16px";f.style.marginTop="16px";b.appendChild(f);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","28");u.style.marginBottom="8px";u.style.marginTop="2px";u.style.width="410px";u.value=c||"";
b.appendChild(u);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");t.setAttribute("size","3");t.style.marginBottom="8px";t.style.marginLeft="4px";t.value="0";b.appendChild(t);mxUtils.br(b);var q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";b.appendChild(q);mxUtils.write(b,mxResources.get("pan")+" ");var v=document.createElement("input");
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";b.appendChild(v);mxUtils.write(b,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);b.appendChild(y);mxUtils.write(b,mxResources.get("edit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";b.appendChild(x);mxUtils.write(b,
mxResources.get("asNew")+" ");mxUtils.br(b);var B=document.createElement("input");B.setAttribute("type","checkbox");B.setAttribute("checked","checked");B.defaultChecked=!0;B.style.marginLeft="16px";b.appendChild(B);mxUtils.write(b,mxResources.get("resize")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";b.appendChild(z);mxUtils.write(b,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft=
"8px";b.appendChild(C);mxUtils.write(b,mxResources.get("embed")+" ");var A=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(q,"change",e);mxEvent.addListener(v,"change",e);mxEvent.addListener(B,"change",e);mxEvent.addListener(z,"change",e);mxEvent.addListener(y,"change",e);mxEvent.addListener(x,"change",e);mxEvent.addListener(C,"change",e);mxEvent.addListener(p,"change",e);mxEvent.addListener(l,"change",e);mxEvent.addListener(t,"change",e);mxEvent.addListener(u,"change",e);e();
mxResources.get("asNew")+" ");mxUtils.br(b);var A=document.createElement("input");A.setAttribute("type","checkbox");A.setAttribute("checked","checked");A.defaultChecked=!0;A.style.marginLeft="16px";b.appendChild(A);mxUtils.write(b,mxResources.get("resize")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";b.appendChild(z);mxUtils.write(b,mxResources.get("fit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft=
"8px";b.appendChild(B);mxUtils.write(b,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(q,"change",e);mxEvent.addListener(v,"change",e);mxEvent.addListener(A,"change",e);mxEvent.addListener(z,"change",e);mxEvent.addListener(y,"change",e);mxEvent.addListener(x,"change",e);mxEvent.addListener(B,"change",e);mxEvent.addListener(p,"change",e);mxEvent.addListener(l,"change",e);mxEvent.addListener(t,"change",e);mxEvent.addListener(u,"change",e);e();
mxEvent.addListener(k,"click",function(){k.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";m=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});m.className="geBtn gePrimaryBtn";f.appendChild(m);b.appendChild(f);this.container=b},CreateGraphDialog=function(a,c,e){var b=document.createElement("div");b.style.textAlign=
"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);b.appendChild(c);var f=new Graph(c);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var m="curved=1;";f.cellRenderer.installCellOverlayListeners=
function(a,d,b){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(b.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(b){d.fireEvent(new mxEventObject("pointerdown","event",b,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(b.node,"touchstart",function(b){d.fireEvent(new mxEventObject("pointerdown","event",b,"state",a))})};f.getAllConnectionConstraints=function(){return null};f.connectionHandler.marker.highlight.keepOnTop=
!1;f.connectionHandler.createEdgeState=function(a){a=f.createEdge(null,null,null,null,null,m);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var n=f.getDefaultParent(),d=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,e){f.connectionHandler.reset();f.clearSelection();var c=f.getCellGeometry(a),k;p(function(){k=f.insertVertex(n,null,"Entry",c.x,c.y,80,30,"rounded=1;");d(k);f.view.refresh(k);
f.insertEdge(n,null,"",a,k,m)},function(){f.scrollCellToVisible(k)})});b.addListener("pointerdown",function(a,d){var b=d.getProperty("event"),e=d.getProperty("state");f.popupMenuHandler.hideMenu();f.stopEditing(!1);var c=mxUtils.convertPoint(f.container,mxEvent.getClientX(b),mxEvent.getClientY(b));f.connectionHandler.start(e,c.x,c.y);f.isMouseDown=!0;f.isMouseTrigger=mxEvent.isMouseEvent(b);mxEvent.consume(b)});f.addCellOverlay(a,b)});f.getModel().beginUpdate();var k;try{k=f.insertVertex(n,null,"Start",
0,0,80,30,"ellipse"),d(k)}finally{f.getModel().endUpdate()}var l;"horizontalTree"==e?(l=new mxCompactTreeLayout(f),l.edgeRouting=!1,l.levelDistance=30,m="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==e?(l=new mxCompactTreeLayout(f,!1),l.edgeRouting=!1,l.levelDistance=30,m="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==e?(l=new mxRadialTreeLayout(f,!1),l.edgeRouting=!1,l.levelDistance=80):"verticalFlow"==e?l=new mxHierarchicalLayout(f,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
e?l=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==e?(l=new mxFastOrganicLayout(f,!1),l.forceConstant=80):"circle"==e&&(l=new mxCircleLayout(f));if(null!=l){var p=function(a,d){f.getModel().beginUpdate();try{null!=a&&a(),l.execute(f.getDefaultParent(),k)}catch(B){throw B;}finally{var b=new mxMorphing(f);b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=d&&d()}));b.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
e?l=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==e?(l=new mxFastOrganicLayout(f,!1),l.forceConstant=80):"circle"==e&&(l=new mxCircleLayout(f));if(null!=l){var p=function(a,d){f.getModel().beginUpdate();try{null!=a&&a(),l.execute(f.getDefaultParent(),k)}catch(A){throw A;}finally{var b=new mxMorphing(f);b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=d&&d()}));b.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
function(a,d,b,e,c){u.apply(this,arguments);p()};f.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);p()};f.connectionHandler.addListener(mxEvent.CONNECT,function(){p()})}var t=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(f.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});t.className="geBtn";a.editor.cancelFirst&&b.appendChild(t);var q=mxUtils.button(mxResources.get("insert"),function(d){f.clearCellOverlays();
var b=f.getModel().getChildren(f.getDefaultParent());d=mxEvent.isAltDown(d)?a.editor.graph.getFreeInsertPoint():a.editor.graph.getCenterInsertPoint(f.getBoundingBoxFromGeometry(b,!0));b=a.editor.graph.importCells(b,d.x,d.y);d=a.editor.graph.view;var e=d.getBounds(b);e.x-=d.translate.x;e.y-=d.translate.y;a.editor.graph.scrollRectToVisible(e);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(f.destroy(),c.parentNode.removeChild(c));a.hideDialog()});b.appendChild(q);q.className="geBtn gePrimaryBtn";
a.editor.cancelFirst||b.appendChild(t)};this.container=b};
@ -9614,12 +9614,12 @@ mxUtils.write(d,mxResources.get("diagram"));"plantUml"!=e&&n.appendChild(d);d=do
"plantUmlTxt");mxUtils.write(l,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==e&&(n.appendChild(d),n.appendChild(k),n.appendChild(l));var p=g();m.value=p;c.appendChild(m);this.init=function(){m.focus()};Graph.fileSupport&&(m.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),m.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=
a.dataTransfer.files[0];var d=new FileReader;d.onload=function(a){m.value=a.target.result};d.readAsText(a)}},!1));c.appendChild(n);mxEvent.addListener(n,"change",function(){var a=g();if(0==m.value.length||m.value==p)p=a,m.value=p});a.isOffline()||"mermaid"!=e&&"plantUml"!=e||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("mermaid"==e?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),d.className="geBtn",c.appendChild(d));d=mxUtils.button(mxResources.get("close"),
function(){m.value==p?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});d.className="geBtn";a.editor.cancelFirst&&c.appendChild(d);k=mxUtils.button(mxResources.get("insert"),function(d){a.hideDialog();b(m.value,n.value,d)});c.appendChild(k);k.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(d);this.container=c},NewDialog=function(a,c,e,b,g,f,m,n,d,k,l,p,u,t,q,v,y){function x(){var a=!0;if(null!=ja)for(;H<ja.length&&(a||0!=mxUtils.mod(H,30));){var d=
ja[H++],d=C(d.url,d.libs,d.title,d.tooltip?d.tooltip:d.title,d.select,d.imgUrl,d.info,d.onClick,d.preview,d.noImg,d.clibs);a&&d.click();a=!1}}function B(){if(X)e||a.hideDialog(),t(X,da,G.value);else if(b)e||a.hideDialog(),b(Y,G.value,fa,aa);else{var d=G.value;null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,Y,null!=aa&&0<aa.length?aa:null,null,function(){a.hideDialog()},null,b,null,null!=ga&&0<ga.length?ga:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}
function z(a,b,e,c,k,l,f){null!=V&&(V.style.backgroundColor="transparent",V.style.border="1px solid transparent");I.removeAttribute("disabled");Y=b;aa=e;ga=l;V=a;X=c;fa=f;da=k;V.style.backgroundColor=n;V.style.border=d}function C(d,b,e,c,k,l,f,p,g,t,u){var q=document.createElement("div");q.className="geTemplate";q.style.height=R+"px";q.style.width=P+"px";"dark"==uiTheme&&(q.style.filter="invert(100%)");null!=e?q.setAttribute("title",mxResources.get(e,null,e)):null!=c&&0<c.length&&q.setAttribute("title",
c);if(null!=l)q.style.backgroundImage="url("+l+")",q.style.backgroundSize="contain",q.style.backgroundPosition="center center",q.style.backgroundRepeat="no-repeat",mxEvent.addListener(q,"click",function(a){z(q,null,null,d,f,u)}),mxEvent.addListener(q,"dblclick",function(a){B()});else if(!t&&null!=d&&0<d.length){c=g||TEMPLATE_PATH+"/"+d.substring(0,d.length-4)+".png";q.style.backgroundImage="url("+c+")";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";null!=e&&(q.innerHTML=
ja[H++],d=B(d.url,d.libs,d.title,d.tooltip?d.tooltip:d.title,d.select,d.imgUrl,d.info,d.onClick,d.preview,d.noImg,d.clibs);a&&d.click();a=!1}}function A(){if(X)e||a.hideDialog(),t(X,da,G.value);else if(b)e||a.hideDialog(),b(Y,G.value,fa,aa);else{var d=G.value;null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,Y,null!=aa&&0<aa.length?aa:null,null,function(){a.hideDialog()},null,b,null,null!=ga&&0<ga.length?ga:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}
function z(a,b,e,c,k,l,f){null!=V&&(V.style.backgroundColor="transparent",V.style.border="1px solid transparent");I.removeAttribute("disabled");Y=b;aa=e;ga=l;V=a;X=c;fa=f;da=k;V.style.backgroundColor=n;V.style.border=d}function B(d,b,e,c,k,l,f,p,g,t,u){var q=document.createElement("div");q.className="geTemplate";q.style.height=R+"px";q.style.width=P+"px";"dark"==uiTheme&&(q.style.filter="invert(100%)");null!=e?q.setAttribute("title",mxResources.get(e,null,e)):null!=c&&0<c.length&&q.setAttribute("title",
c);if(null!=l)q.style.backgroundImage="url("+l+")",q.style.backgroundSize="contain",q.style.backgroundPosition="center center",q.style.backgroundRepeat="no-repeat",mxEvent.addListener(q,"click",function(a){z(q,null,null,d,f,u)}),mxEvent.addListener(q,"dblclick",function(a){A()});else if(!t&&null!=d&&0<d.length){c=g||TEMPLATE_PATH+"/"+d.substring(0,d.length-4)+".png";q.style.backgroundImage="url("+c+")";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";null!=e&&(q.innerHTML=
'<table width="100%" height="100%" style="line-height:1.3em;'+("dark"==uiTheme?"":"background:rgba(255,255,255,0.85);")+'border:inherit;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:rgba(255,255,255,0.85);overflow:hidden;text-overflow:ellipsis;max-width:'+(R-34)+'px;">'+mxUtils.htmlEntities(mxResources.get(e,null,e))+"</span></td></tr></table>");var m=!1;mxEvent.addListener(q,"click",function(e){I.setAttribute("disabled",
"disabled");q.style.backgroundColor="transparent";q.style.border="1px solid transparent";var c=d,c=/^https?:\/\//.test(c)&&!a.editor.isCorsEnabledForUrl(c)?PROXY_URL+"?url="+encodeURIComponent(c):TEMPLATE_PATH+"/"+c;J.spin(O);mxUtils.get(c,mxUtils.bind(this,function(a){J.stop();200<=a.getStatus()&&299>=a.getStatus()&&(z(q,a.getText(),b,null,null,u,c),m&&B())}))});mxEvent.addListener(q,"dblclick",function(a){m=!0})}else q.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:#ffffff;overflow:hidden;text-overflow:ellipsis;max-width:'+
(R-34)+'px;">'+mxUtils.htmlEntities(mxResources.get(e,null,e))+"</span></td></tr></table>",k&&z(q),null!=p?mxEvent.addListener(q,"click",p):(mxEvent.addListener(q,"click",function(a){z(q,null,null,d,f)}),mxEvent.addListener(q,"dblclick",function(a){B()}));O.appendChild(q);return q}function A(){ha&&(ha=!1,mxEvent.addListener(O,"scroll",function(a){O.scrollTop+O.clientHeight>=O.scrollHeight&&(x(),mxEvent.consume(a))}));var a=null;if(0<ba){var d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";
"disabled");q.style.backgroundColor="transparent";q.style.border="1px solid transparent";var c=d,c=/^https?:\/\//.test(c)&&!a.editor.isCorsEnabledForUrl(c)?PROXY_URL+"?url="+encodeURIComponent(c):TEMPLATE_PATH+"/"+c;J.spin(O);mxUtils.get(c,mxUtils.bind(this,function(a){J.stop();200<=a.getStatus()&&299>=a.getStatus()&&(z(q,a.getText(),b,null,null,u,c),m&&A())}))});mxEvent.addListener(q,"dblclick",function(a){m=!0})}else q.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:#ffffff;overflow:hidden;text-overflow:ellipsis;max-width:'+
(R-34)+'px;">'+mxUtils.htmlEntities(mxResources.get(e,null,e))+"</span></td></tr></table>",k&&z(q),null!=p?mxEvent.addListener(q,"click",p):(mxEvent.addListener(q,"click",function(a){z(q,null,null,d,f)}),mxEvent.addListener(q,"dblclick",function(a){A()}));O.appendChild(q);return q}function C(){ha&&(ha=!1,mxEvent.addListener(O,"scroll",function(a){O.scrollTop+O.clientHeight>=O.scrollHeight&&(x(),mxEvent.consume(a))}));var a=null;if(0<ba){var d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";
mxUtils.write(d,mxResources.get("custom"));W.appendChild(d);for(var b in S){var c=document.createElement("div"),d=b,e=S[b];18<d.length&&(d=d.substring(0,18)+"&hellip;");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";c.setAttribute("title",d+" ("+e.length+")");mxUtils.write(c,c.getAttribute("title"));null!=k&&(c.style.padding=k);W.appendChild(c);(function(d,b){mxEvent.addListener(c,"click",function(){a!=
b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=m,O.scrollTop=0,O.innerHTML="",H=0,ja=S[d],M=null,x())})})(b,c)}d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(d,"draw.io");W.appendChild(d)}for(b in ca)c=document.createElement("div"),d=mxResources.get(b),e=ca[b],null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1)),18<d.length&&(d=d.substring(0,18)+"&hellip;"),c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;",
c.setAttribute("title",d+" ("+e.length+")"),mxUtils.write(c,c.getAttribute("title")),null!=k&&(c.style.padding=k),W.appendChild(c),null==a&&0<e.length&&(a=c,a.style.backgroundColor=m,ja=e),function(d,b){mxEvent.addListener(c,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=m,O.scrollTop=0,O.innerHTML="",H=0,ja=ca[d],M=null,x())})}(b,c);x()}e=null!=e?e:!0;g=null!=g?g:!1;m=null!=m?m:"#ebf2f9";n=null!=n?n:"dark"==uiTheme?"#a2a2a2":"#e6eff8";d=null!=d?d:"dark"==uiTheme?
@ -9627,30 +9627,30 @@ c.setAttribute("title",d+" ("+e.length+")"),mxUtils.write(c,c.getAttribute("titl
a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&e&&F.appendChild(E);e&&mxUtils.write(F,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
mxResources.get("filename"))+":");E=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?E=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?E=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?E=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?E=a.gitHub.extension:a.mode==App.MODE_GITLAB&&null!=a.gitLab?E=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(E=a.trello.extension);var G=document.createElement("input");G.setAttribute("value",a.defaultFilename+
E);G.style.marginLeft="10px";G.style.width=c?"144px":"244px";this.init=function(){e&&(G.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?G.select():document.execCommand("selectAll",!1,null))};e&&(F.appendChild(G),null!=a.editor.diagramFileTypes&&(E=FilenameDialog.createFileTypes(a,G,a.editor.diagramFileTypes),E.style.marginLeft="6px",E.style.width=c?"80px":"180px",F.appendChild(E)),null!=a.editor.fileExtensions&&(E=FilenameDialog.createTypeHint(a,G,a.editor.fileExtensions),
E.style.marginTop="12px",F.appendChild(E)));var F=!1,H=0,J=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),I=mxUtils.button(v||mxResources.get("create"),function(){I.setAttribute("disabled","disabled");B();I.removeAttribute("disabled")});I.className="geBtn gePrimaryBtn";if(p||u){var K=[],M=null,N=null,U=null,L=function(a){I.setAttribute("disabled","disabled");for(var d=0;d<K.length;d++)K[d].className=d==a?"geBtn gePrimaryBtn":
"geBtn"},F=!0;v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";D.appendChild(v);E=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){W.style.display="";O.style.left="160px";L(0);O.scrollTop=0;O.innerHTML="";H=0;M!=ja&&(ja=M,ca=N,ba=U,W.innerHTML="",A(),M=null)});K.push(E);v.appendChild(E);var T=function(a){W.style.display="none";O.style.left="30px";L(a?-1:1);null==M&&(M=ja);O.scrollTop=0;O.innerHTML="";J.spin(O);var d=function(a,d,b){H=0;J.stop();
ja=a;b=b||{};var c=0,e;for(e in b)c+=b[e].length;if(d)O.innerHTML=d;else if(0==a.length&&0==c)O.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(O.innerHTML="",0<c){W.style.display="";O.style.left="160px";W.innerHTML="";ba=0;ca={"draw.io":a};for(e in b)ca[e]=b[e];A()}else x()};a?u(Z.value,d):p(d)};p&&(E=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){T()}),v.appendChild(E),K.push(E));if(u){E=document.createElement("span");E.style.marginLeft=
E.style.marginTop="12px",F.appendChild(E)));var F=!1,H=0,J=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),I=mxUtils.button(v||mxResources.get("create"),function(){I.setAttribute("disabled","disabled");A();I.removeAttribute("disabled")});I.className="geBtn gePrimaryBtn";if(p||u){var K=[],M=null,N=null,U=null,L=function(a){I.setAttribute("disabled","disabled");for(var d=0;d<K.length;d++)K[d].className=d==a?"geBtn gePrimaryBtn":
"geBtn"},F=!0;v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";D.appendChild(v);E=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){W.style.display="";O.style.left="160px";L(0);O.scrollTop=0;O.innerHTML="";H=0;M!=ja&&(ja=M,ca=N,ba=U,W.innerHTML="",C(),M=null)});K.push(E);v.appendChild(E);var T=function(a){W.style.display="none";O.style.left="30px";L(a?-1:1);null==M&&(M=ja);O.scrollTop=0;O.innerHTML="";J.spin(O);var d=function(a,d,b){H=0;J.stop();
ja=a;b=b||{};var c=0,e;for(e in b)c+=b[e].length;if(d)O.innerHTML=d;else if(0==a.length&&0==c)O.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(O.innerHTML="",0<c){W.style.display="";O.style.left="160px";W.innerHTML="";ba=0;ca={"draw.io":a};for(e in b)ca[e]=b[e];C()}else x()};a?u(Z.value,d):p(d)};p&&(E=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){T()}),v.appendChild(E),K.push(E));if(u){E=document.createElement("span");E.style.marginLeft=
"10px";E.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");v.appendChild(E);var Z=document.createElement("input");Z.style.marginRight="10px";Z.style.marginLeft="10px";Z.style.width="220px";mxEvent.addListener(Z,"keypress",function(a){13==a.keyCode&&T(!0)});v.appendChild(Z);E=mxUtils.button(mxResources.get("search"),function(){T(!0)});E.className="geBtn";v.appendChild(E)}L(0)}var aa=null,ga=null,Y=null,V=null,X=null,fa=null,da=null,O=document.createElement("div");O.style.border="1px solid #d3d3d3";
O.style.position="absolute";O.style.left="160px";O.style.right="34px";v=(e?72:40)+(F?30:0);O.style.top=v+"px";O.style.bottom="68px";O.style.margin="6px 0 0 -1px";O.style.padding="6px";O.style.overflow="auto";var W=document.createElement("div");W.style.cssText="position:absolute;left:30px;width:128px;top:"+v+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var R=140,P=140,ca={},S={},ba=0,ha=!0;ca.basic=[{title:"blankDiagram",select:!0}];var ja=ca.basic;if(!c){var Q=function(){mxUtils.get(ea,
function(a){if(!ka){ka=!0;a=a.getXml().documentElement.firstChild;for(var d={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var b=a.getAttribute("name"),c=a.getElementsByTagName("add"),e=[],k=0;k<c.length;k++)e.push(encodeURIComponent(mxUtils.getTextContent(c[k])));null!=b&&0<e.length&&(d[b]=e.join(";"))}else b=a.getAttribute("url"),null!=b&&(c=a.getAttribute("section"),null==c&&(c=b.indexOf("/"),c=b.substring(0,c)),b=ca[c],null==b&&(b=[],ca[c]=b),c=a.getAttribute("clibs"),
null!=d[c]&&(c=d[c]),b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:c}));a=a.nextSibling}J.stop();A()}})};D.appendChild(W);D.appendChild(O);var ka=!1,ea=l;/^https?:\/\//.test(ea)&&!a.editor.isCorsEnabledForUrl(ea)&&(ea=PROXY_URL+"?url="+encodeURIComponent(ea));J.spin(O);null!=y?y(function(a,d){S=a;U=ba=d;Q()},Q):Q();N=ca}mxEvent.addListener(G,"keypress",function(d){a.dialog.container.firstChild==
D&&13==d.keyCode&&B()});l=document.createElement("div");l.style.marginTop=c?"4px":"16px";l.style.textAlign="right";l.style.position="absolute";l.style.left="40px";l.style.bottom="24px";l.style.right="40px";c||a.isOffline()||!e||null!=b||g||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",l.appendChild(y));y=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});y.className=
null!=d[c]&&(c=d[c]),b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:c}));a=a.nextSibling}J.stop();C()}})};D.appendChild(W);D.appendChild(O);var ka=!1,ea=l;/^https?:\/\//.test(ea)&&!a.editor.isCorsEnabledForUrl(ea)&&(ea=PROXY_URL+"?url="+encodeURIComponent(ea));J.spin(O);null!=y?y(function(a,d){S=a;U=ba=d;Q()},Q):Q();N=ca}mxEvent.addListener(G,"keypress",function(d){a.dialog.container.firstChild==
D&&13==d.keyCode&&A()});l=document.createElement("div");l.style.marginTop=c?"4px":"16px";l.style.textAlign="right";l.style.position="absolute";l.style.left="40px";l.style.bottom="24px";l.style.right="40px";c||a.isOffline()||!e||null!=b||g||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",l.appendChild(y));y=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});y.className=
"geBtn";!a.editor.cancelFirst||g&&null==f||l.appendChild(y);c||"1"==urlParams.embed||g||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var d=new FilenameDialog(a,"",mxResources.get("create"),function(d){null!=d&&0<d.length&&(d=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(G.value)+"&create="+encodeURIComponent(d)),null==a.getCurrentFile()?window.location.href=d:window.openWindow(d))},mxResources.get("url"));a.showDialog(d.container,300,80,!0,!0);d.init()}),
c.className="geBtn",l.appendChild(c));Graph.fileSupport&&q&&(q=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var d=document.createElement("input");d.setAttribute("multiple","multiple");d.setAttribute("type","file");mxEvent.addListener(d,"change",function(b){a.openFiles(d.files,!0);d.value=""});d.style.display="none";document.body.appendChild(d);a.newDlgFileInputElt=d}a.newDlgFileInputElt.click()}),q.className="geBtn",l.appendChild(q));l.appendChild(I);a.editor.cancelFirst||
null!=b||g&&null==f||l.appendChild(y);D.appendChild(l);this.container=D},CreateDialog=function(a,c,e,b,g,f,m,n,d,k,l,p,u,t,q,v,y){function x(d,b,e,k){function l(){mxEvent.addListener(f,"click",function(){var d=e;if(m){var b=C.value,k=b.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var d=null!=d?d:F.value,l="";d==App.MODE_GOOGLE?l=a.drive.extension:d==App.MODE_GITHUB?l=a.gitHub.extension:d==App.MODE_GITLAB?l=a.gitLab.extension:d==App.MODE_TRELLO?l=a.trello.extension:d==App.MODE_DROPBOX?l=a.dropbox.extension:
d==App.MODE_ONEDRIVE?l=a.oneDrive.extension:d==App.MODE_DEVICE&&(l=".drawio");0<=k&&(b=b.substring(0,k));C.value=b+l}}B(e)})}var f=document.createElement("a");f.style.overflow="hidden";var g=document.createElement("img");g.src=d;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding=
null!=b||g&&null==f||l.appendChild(y);D.appendChild(l);this.container=D},CreateDialog=function(a,c,e,b,g,f,m,n,d,k,l,p,u,t,q,v,y){function x(d,b,e,k){function l(){mxEvent.addListener(f,"click",function(){var d=e;if(m){var b=B.value,k=b.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var d=null!=d?d:F.value,l="";d==App.MODE_GOOGLE?l=a.drive.extension:d==App.MODE_GITHUB?l=a.gitHub.extension:d==App.MODE_GITLAB?l=a.gitLab.extension:d==App.MODE_TRELLO?l=a.trello.extension:d==App.MODE_DROPBOX?l=a.dropbox.extension:
d==App.MODE_ONEDRIVE?l=a.oneDrive.extension:d==App.MODE_DEVICE&&(l=".drawio");0<=k&&(b=b.substring(0,k));B.value=b+l}}A(e)})}var f=document.createElement("a");f.style.overflow="hidden";var g=document.createElement("img");g.src=d;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding=
"8px 8px 10px 8px";f.style.whiteSpace="nowrap";f.appendChild(g);mxClient.IS_QUIRKS&&(f.style.cssFloat="left",f.style.zoom="1");f.style.color="gray";f.style.fontSize="11px";var t=document.createElement("div");f.appendChild(t);mxUtils.write(t,b);if(null!=k&&null==a[k]){g.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(f);var q=window.setTimeout(function(){null==
a[k]&&(u.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(q),mxUtils.setOpacity(t,100),g.style.visibility="",u.stop(),l())}))}else l();A.appendChild(f);++D==p&&(mxUtils.br(A),D=0)}function B(d){var b=C.value;if(null==d||null!=b&&0<b.length)y&&a.hideDialog(),e(b,d,C)}m=null!=m?m:!0;n=null!=n?n:!0;p=null!=p?p:4;y=null!=y?y:!0;f=document.createElement("div");f.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(f);var z=
document.createElement("h2");mxUtils.write(z,g||mxResources.get("create"));z.style.marginTop="0px";z.style.marginBottom="24px";f.appendChild(z);mxUtils.write(f,mxResources.get("filename")+":");var C=document.createElement("input");C.setAttribute("value",c);C.style.width="200px";C.style.marginLeft="10px";C.style.marginBottom="20px";C.style.maxWidth="70%";this.init=function(){C.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?C.select():document.execCommand("selectAll",
!1,null)};f.appendChild(C);null!=v&&(null!=a.editor.diagramFileTypes&&(g=FilenameDialog.createFileTypes(a,C,a.editor.diagramFileTypes),g.style.marginLeft="6px",g.style.width="80px",f.appendChild(g)),f.appendChild(FilenameDialog.createTypeHint(a,C,v)));null==u||null==t||"image/"!=t.substring(0,6)||"image/svg"==t.substring(0,9)&&!mxClient.IS_SVG||(C.style.width="160px",v=document.createElement("img"),u=q?u:btoa(unescape(encodeURIComponent(u))),v.setAttribute("src","data:"+t+";base64,"+u),v.style.position=
"absolute",v.style.top="70px",v.style.right="100px",v.style.maxWidth="120px",v.style.maxHeight="80px",mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)"),f.appendChild(v),d&&Editor.popupsAllowed&&(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(){B("_blank")})));mxUtils.br(f);var A=document.createElement("div");A.style.textAlign="center";var D=0;A.style.marginTop="6px";f.appendChild(A);var F=document.createElement("select");F.style.marginLeft="10px";a.isOfflineApp()||
a[k]&&(u.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(q),mxUtils.setOpacity(t,100),g.style.visibility="",u.stop(),l())}))}else l();C.appendChild(f);++D==p&&(mxUtils.br(C),D=0)}function A(d){var b=B.value;if(null==d||null!=b&&0<b.length)y&&a.hideDialog(),e(b,d,B)}m=null!=m?m:!0;n=null!=n?n:!0;p=null!=p?p:4;y=null!=y?y:!0;f=document.createElement("div");f.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(f);var z=
document.createElement("h2");mxUtils.write(z,g||mxResources.get("create"));z.style.marginTop="0px";z.style.marginBottom="24px";f.appendChild(z);mxUtils.write(f,mxResources.get("filename")+":");var B=document.createElement("input");B.setAttribute("value",c);B.style.width="200px";B.style.marginLeft="10px";B.style.marginBottom="20px";B.style.maxWidth="70%";this.init=function(){B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?B.select():document.execCommand("selectAll",
!1,null)};f.appendChild(B);null!=v&&(null!=a.editor.diagramFileTypes&&(g=FilenameDialog.createFileTypes(a,B,a.editor.diagramFileTypes),g.style.marginLeft="6px",g.style.width="80px",f.appendChild(g)),f.appendChild(FilenameDialog.createTypeHint(a,B,v)));null==u||null==t||"image/"!=t.substring(0,6)||"image/svg"==t.substring(0,9)&&!mxClient.IS_SVG||(B.style.width="160px",v=document.createElement("img"),u=q?u:btoa(unescape(encodeURIComponent(u))),v.setAttribute("src","data:"+t+";base64,"+u),v.style.position=
"absolute",v.style.top="70px",v.style.right="100px",v.style.maxWidth="120px",v.style.maxHeight="80px",mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)"),f.appendChild(v),d&&Editor.popupsAllowed&&(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(){A("_blank")})));mxUtils.br(f);var C=document.createElement("div");C.style.textAlign="center";var D=0;C.style.marginTop="6px";f.appendChild(C);var F=document.createElement("select");F.style.marginLeft="10px";a.isOfflineApp()||
a.isOffline()||("function"===typeof window.DriveClient&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(t,mxResources.get("googleDrive")),F.appendChild(t),x(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(t,mxResources.get("oneDrive")),F.appendChild(t),a.mode==App.MODE_ONEDRIVE&&
t.setAttribute("selected","selected"),x(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(t,mxResources.get("dropbox")),F.appendChild(t),a.mode==App.MODE_DROPBOX&&t.setAttribute("selected","selected"),x(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(t=document.createElement("option"),
t.setAttribute("value",App.MODE_GITHUB),mxUtils.write(t,mxResources.get("github")),F.appendChild(t),x(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_GITLAB),mxUtils.write(t,mxResources.get("gitlab")),F.appendChild(t),x(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(t=document.createElement("option"),t.setAttribute("value",
App.MODE_TRELLO),mxUtils.write(t,mxResources.get("trello")),F.appendChild(t),x(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(t=document.createElement("option"),t.setAttribute("value",App.MODE_DEVICE),mxUtils.write(t,mxResources.get("device")),F.appendChild(t),a.mode!=App.MODE_DEVICE&&n||t.setAttribute("selected","selected"),l&&x(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),
App.MODE_DEVICE));n&&isLocalStorage&&"0"!=urlParams.browser&&(n=document.createElement("option"),n.setAttribute("value",App.MODE_BROWSER),mxUtils.write(n,mxResources.get("browser")),F.appendChild(n),a.mode==App.MODE_BROWSER&&n.setAttribute("selected","selected"),x(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=k&&(l=mxUtils.button(mxResources.get("help"),function(){a.openLink(k)}),
l.className="geBtn",n.appendChild(l));l=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});l.className="geBtn";a.editor.cancelFirst&&n.appendChild(l);null==b&&(t=mxUtils.button(mxResources.get("decideLater"),function(){B(null)}),t.className="geBtn",n.appendChild(t));d&&Editor.popupsAllowed&&(d=mxUtils.button(mxResources.get("openInNewWindow"),function(){B("_blank")}),d.className="geBtn",n.appendChild(d));
CreateDialog.showDownloadButton&&(d=mxUtils.button(mxResources.get("download"),function(){B("download")}),d.className="geBtn",n.appendChild(d));a.editor.cancelFirst||n.appendChild(l);mxEvent.addListener(C,"keypress",function(d){13==d.keyCode?B(App.MODE_DEVICE):27==d.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(n);this.container=f};CreateDialog.showDownloadButton=!0;
l.className="geBtn",n.appendChild(l));l=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});l.className="geBtn";a.editor.cancelFirst&&n.appendChild(l);null==b&&(t=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),t.className="geBtn",n.appendChild(t));d&&Editor.popupsAllowed&&(d=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),d.className="geBtn",n.appendChild(d));
CreateDialog.showDownloadButton&&(d=mxUtils.button(mxResources.get("download"),function(){A("download")}),d.className="geBtn",n.appendChild(d));a.editor.cancelFirst||n.appendChild(l);mxEvent.addListener(B,"keypress",function(d){13==d.keyCode?A(App.MODE_DEVICE):27==d.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(n);this.container=f};CreateDialog.showDownloadButton=!0;
var PopupDialog=function(a,c,e,b,g){g=null!=g?g:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var m=mxUtils.button(mxResources.get("openInThisWindow"),function(){g&&a.hideDialog();null!=b&&b()});m.className="geBtn";m.style.marginBottom="8px";m.style.width="280px";f.appendChild(m);mxUtils.br(f);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){g&&a.hideDialog();null!=e&&e();a.openLink(c,
null,!0)});n.className="geBtn gePrimaryBtn";n.style.width=m.style.width;f.appendChild(n);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,c,e,b,g,f){f=null!=f?f:!0;var m=a.editor.graph,n=document.createElement("div");mxUtils.write(n,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor=
"default";mxClient.IS_VML||(c.style.paddingRight="20px");var d=document.createElement("input");d.setAttribute("value",e);d.setAttribute("type","text");d.setAttribute("spellcheck","false");d.setAttribute("autocorrect","off");d.setAttribute("autocomplete","off");d.setAttribute("autocapitalize","off");d.style.marginTop="6px";d.style.width=(Graph.fileSupport?460:340)+(mxClient.IS_QUIRKS?20:-20)+"px";d.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";d.style.backgroundRepeat="no-repeat";
@ -9671,9 +9671,9 @@ n.appendChild(d);n.appendChild(k);mxUtils.br(n);n.appendChild(p);g=!1;for(k=0;k<
q.setAttribute("selected","selected");q.setAttribute("value","pageNotFound");u.appendChild(q);mxEvent.addListener(u,"change",function(){null==q.parentNode||q.selected||q.parentNode.removeChild(q)})}n.appendChild(u)}else d.setAttribute("value",c),n.appendChild(d),n.appendChild(k);m.appendChild(n);var v=mxUtils.button(e,function(){a.hideDialog();b(p.checked?"pageNotFound"!==u.value?u.value:c:d.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=
function(){p.checked?u.focus():(d.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?d.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(u,"focus",function(){l.removeAttribute("checked");p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(d,"focus",function(){p.removeAttribute("checked");l.setAttribute("checked","checked");l.checked=!0});if(Graph.fileSupport){var b=m.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=
c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(d.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),l.setAttribute("checked",
"checked"),l.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var y=document.createElement("div");y.style.marginTop="20px";y.style.textAlign="center";e=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000080137")});e.style.verticalAlign="middle";e.className="geBtn";y.appendChild(e);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(e.style.display="none");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
e.style.verticalAlign="middle";e.className="geBtn";a.editor.cancelFirst&&y.appendChild(e);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||null!=a.docs[0].mimeType&&"application/vnd.jgraph."==a.docs[0].mimeType.substring(0,23)?b="https://www.draw.io/#G"+a.docs[0].id:"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+
a.docs[0].id);d.value=b;d.focus()}else LinkDialog.selectedDocs=null;d.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&f(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var d=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),
"checked"),l.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var y=document.createElement("div");y.style.marginTop="20px";y.style.textAlign="center";e=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/doc/faq/custom-links")});e.style.verticalAlign="middle";e.className="geBtn";y.appendChild(e);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(e.style.display="none");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.style.verticalAlign=
"middle";e.className="geBtn";a.editor.cancelFirst&&y.appendChild(e);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||null!=a.docs[0].mimeType&&"application/vnd.jgraph."==a.docs[0].mimeType.substring(0,23)?b="https://www.draw.io/#G"+a.docs[0].id:"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);
d.value=b;d.focus()}else LinkDialog.selectedDocs=null;d.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&f(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var d=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),
b=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),c=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0),d=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(d).addView(b).addView(c).addView(google.picker.ViewId.RECENTLY_PICKED);a.linkPicker=d.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});
"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&f(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){d.value=a[0].link;d.focus()}})});null!=a.oneDrive&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){d.value=b.value[0].webUrl;d.focus()})});null!=a.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=
a){a=a.split("/");var b=a[0],c=a[1],e=a[2];a=a.slice(3,a.length).join("/");d.value="https://github.com/"+b+"/"+c+"/blob/"+e+"/"+a;d.focus()}})});null!=a.gitLab&&f(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),function(){a.gitLab.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],e=a[2];a=a.slice(3,a.length).join("/");d.value=DRAWIO_GITLAB_URL+"/"+b+"/"+c+"/blob/"+e+"/"+a;d.focus()}})});mxEvent.addListener(d,"keypress",function(c){13==c.keyCode&&(a.hideDialog(),b(p.checked?
@ -9686,10 +9686,10 @@ mxUtils.write(f,mxResources.get("feedback"));g.appendChild(f);var l=document.cre
e.appendChild(f));g.appendChild(e);this.container=g};FeedbackDialog.maxAttachmentSize=1E6;
var RevisionDialog=function(a,c,e){var b=document.createElement("div"),g=document.createElement("h3");g.style.marginTop="0px";mxUtils.write(g,mxResources.get("revisionHistory"));b.appendChild(g);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";b.appendChild(f);var m=document.createElement("div");m.style.position="absolute";m.style.border="1px solid lightGray";m.style.left="199px";m.style.width="470px";m.style.height=
"376px";m.style.overflow="hidden";mxEvent.disableContextMenu(m);b.appendChild(m);var n=new Graph(m);n.setTooltips(!1);n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;var d=0,k=null,l=0,p=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=k&&null!=k[l]?k[l].getAttribute("name"):"pagenumber"==a?l+1:"pagecount"==a?null!=k?k.length:1:p.apply(this,arguments)};n.getLinkForCell=
function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(d,b){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var u=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),t=a.getCurrentFile(),q=null,v=null,y=null,x=null,B=mxUtils.button("",function(){null!=y&&n.zoomIn()});B.className="geSprite geSprite-zoomin";
B.setAttribute("title",mxResources.get("zoomIn"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var z=mxUtils.button("",function(){null!=y&&n.zoomOut()});z.className="geSprite geSprite-zoomout";z.setAttribute("title",mxResources.get("zoomOut"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var C=mxUtils.button("",function(){null!=y&&
(n.maxFitScale=8,n.fit(8),n.center())});C.className="geSprite geSprite-fit";C.setAttribute("title",mxResources.get("fit"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var A=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});A.className="geSprite geSprite-actualsize";A.setAttribute("title",mxResources.get("actualSize"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled",
"disabled");mxUtils.setOpacity(A,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var d=mxUtils.getXml(y.documentElement),b=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml"):(d=
function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(d,b){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var u=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),t=a.getCurrentFile(),q=null,v=null,y=null,x=null,A=mxUtils.button("",function(){null!=y&&n.zoomIn()});A.className="geSprite geSprite-zoomin";
A.setAttribute("title",mxResources.get("zoomIn"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var z=mxUtils.button("",function(){null!=y&&n.zoomOut()});z.className="geSprite geSprite-zoomout";z.setAttribute("title",mxResources.get("zoomOut"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var B=mxUtils.button("",function(){null!=y&&
(n.maxFitScale=8,n.fit(8),n.center())});B.className="geSprite geSprite-fit";B.setAttribute("title",mxResources.get("fit"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var C=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled",
"disabled");mxUtils.setOpacity(C,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var d=mxUtils.getXml(y.documentElement),b=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml"):(d=
"undefined"===typeof pako?"&xml="+encodeURIComponent(d):"&data="+encodeURIComponent(Graph.compress(d)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+d)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=x&&a.confirm(mxResources.get("areYouSure"),function(){null!=e?e(x):a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(d){a.spinner.stop();
a.replaceFileData(x);a.hideDialog()},function(d){a.spinner.stop();a.editor.setStatus("");a.handleError(d,null!=d?mxResources.get("errorSavingFile"):null)})})});E.className="geBtn";E.setAttribute("disabled","disabled");var G=document.createElement("select");G.setAttribute("disabled","disabled");G.style.maxWidth="80px";G.style.position="relative";G.style.top="-2px";G.style.verticalAlign="bottom";G.style.marginRight="6px";G.style.display="none";var H=null;mxEvent.addListener(G,"change",function(a){null!=
H&&(H(a),mxEvent.consume(a))});var J=mxUtils.button(mxResources.get("edit"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),a.openLink(a.getUrl(),null,!0))});J.className="geBtn";J.setAttribute("disabled","disabled");null!=e&&(J.style.display="none");var I=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl(G.selectedIndex))});I.className="geBtn gePrimaryBtn";I.setAttribute("disabled",
@ -9697,33 +9697,33 @@ H&&(H(a),mxEvent.consume(a))});var J=mxUtils.button(mxResources.get("edit"),func
"1px solid lightGray";N.style.borderCollapse="collapse";N.style.borderSpacing="0px";N.style.width="100%";var U=document.createElement("tbody"),L=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(d=mxUtils.indexOf(a.pages,a.currentPage));for(var T=c.length-1;0<=T;T--){var Z=function(b){var e=new Date(b.modifiedDate),f=null;if(0<=e.getTime()){var p=function(c){u.stop();var p=mxUtils.parseXml(c),g=a.editor.extractGraphModel(p.documentElement,!0);if(null!=g){var q=function(a){null!=a&&(a=
K(Editor.parseDiagramNode(a)));return a},K=function(a){var d=a.getAttribute("background");if(null==d||""==d||d==mxConstants.NONE)d="#ffffff";m.style.backgroundColor=d;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return a};G.style.display="none";G.innerHTML="";y=p;x=c;k=parseSelectFunction=null;l=0;if("mxfile"==g.nodeName){p=g.getElementsByTagName("diagram");k=[];for(c=0;c<p.length;c++)k.push(p[c]);l=Math.min(d,k.length-1);0<k.length&&q(k[l]);if(1<k.length)for(G.removeAttribute("disabled"),
G.style.display="",c=0;c<k.length;c++)p=document.createElement("option"),mxUtils.write(p,k[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),p.setAttribute("value",c),c==l&&p.setAttribute("selected","selected"),G.appendChild(p);H=function(){try{var b=parseInt(G.value);l=d=b;q(k[b])}catch(ca){G.value=d,a.handleError(ca)}}}else K(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");D.innerHTML="";mxUtils.write(D,(null!=c?c+" ":"")+e.toLocaleDateString()+" "+
e.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));B.removeAttribute("disabled");z.removeAttribute("disabled");C.removeAttribute("disabled");A.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),F.removeAttribute("disabled"),I.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(B,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(A,60)}else G.style.display="none",G.innerHTML=
e.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));A.removeAttribute("disabled");z.removeAttribute("disabled");B.removeAttribute("disabled");C.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),F.removeAttribute("disabled"),I.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(A,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(B,60);mxUtils.setOpacity(C,60)}else G.style.display="none",G.innerHTML=
"",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},f=document.createElement("tr");f.style.borderBottom="1px solid lightGray";f.style.fontSize="12px";f.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):e.toDateString()===L?mxUtils.write(g,e.toLocaleTimeString()):mxUtils.write(g,e.toLocaleDateString()+" "+e.toLocaleTimeString());f.appendChild(g);f.setAttribute("title",
e.toLocaleDateString()+" "+e.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(f,"click",function(a){v!=b&&(u.stop(),null!=q&&(q.style.backgroundColor=""),v=b,q=f,q.style.backgroundColor="#ebf2f9",x=y=null,D.removeAttribute("title"),D.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),m.style.backgroundColor="#ffffff",n.getModel().clear(),E.setAttribute("disabled",
"disabled"),F.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),mxUtils.setOpacity(B,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(A,20),u.spin(m),b.getXml(function(a){if(v==b)try{p(a)}catch(O){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
"disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),mxUtils.setOpacity(A,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(C,20),u.spin(m),b.getXml(function(a){if(v==b)try{p(a)}catch(O){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
": "+O.message)}},function(a){u.stop();G.style.display="none";G.innerHTML="";D.innerHTML="";mxUtils.write(D,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(f,"dblclick",function(a){I.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);U.appendChild(f)}return f}(c[T]);null!=Z&&T==c.length-1&&(M=Z)}N.appendChild(U);f.appendChild(N)}else null==t||null==a.drive&&t.constructor==window.DriveFile||
null==a.dropbox&&t.constructor==window.DropboxFile?(m.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(m.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";K.appendChild(G);K.appendChild(B);K.appendChild(z);K.appendChild(A);K.appendChild(C);a.editor.cancelFirst?(g.appendChild(f),g.appendChild(F),
null==a.dropbox&&t.constructor==window.DropboxFile?(m.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(m.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";K.appendChild(G);K.appendChild(A);K.appendChild(z);K.appendChild(C);K.appendChild(B);a.editor.cancelFirst?(g.appendChild(f),g.appendChild(F),
g.appendChild(J),g.appendChild(E),g.appendChild(I)):(g.appendChild(F),g.appendChild(J),g.appendChild(E),g.appendChild(I),g.appendChild(f));b.appendChild(g);b.appendChild(K);b.appendChild(D);this.container=b},DraftDialog=function(a,c,e,b,g,f,m,n,d){var k=document.createElement("div"),l=document.createElement("div");l.style.marginTop="0px";l.style.whiteSpace="nowrap";l.style.overflow="auto";l.style.lineHeight="normal";mxUtils.write(l,c);k.appendChild(l);var p=document.createElement("select"),u=mxUtils.bind(this,
function(){B=mxUtils.parseXml(d[p.value].data);z=a.editor.extractGraphModel(B.documentElement,!0);C=0;this.init()});if(null!=d){p.style.marginLeft="4px";for(c=0;c<d.length;c++){var t=document.createElement("option");t.setAttribute("value",c);var q=new Date(d[c].created),v=new Date(d[c].modified);mxUtils.write(t,q.toLocaleDateString()+" "+q.toLocaleTimeString()+" - "+(q.toDateString(),v.toDateString(),v.toLocaleDateString())+" "+v.toLocaleTimeString());p.appendChild(t)}l.appendChild(p);mxEvent.addListener(p,
"change",u)}null==e&&(e=d[0].data);var y=document.createElement("div");y.style.position="absolute";y.style.border="1px solid lightGray";y.style.marginTop="10px";y.style.left="40px";y.style.right="40px";y.style.top="46px";y.style.bottom="74px";y.style.overflow="hidden";mxEvent.disableContextMenu(y);k.appendChild(y);var x=new Graph(y);x.setEnabled(!1);x.setPanning(!0);x.panningHandler.ignoreCell=!0;x.panningHandler.useLeftButtonForPanning=!0;x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;var B=
mxUtils.parseXml(e),z=a.editor.extractGraphModel(B.documentElement,!0),C=0,A=null,D=x.getGlobalVariable;x.getGlobalVariable=function(a){return"page"==a&&null!=A&&null!=A[C]?A[C].getAttribute("name"):"pagenumber"==a?C+1:"pagecount"==a?null!=A?A.length:1:D.apply(this,arguments)};x.getLinkForCell=function(){return null};e=mxUtils.button("",function(){x.zoomIn()});e.className="geSprite geSprite-zoomin";e.setAttribute("title",mxResources.get("zoomIn"));e.style.outline="none";e.style.border="none";e.style.margin=
function(){A=mxUtils.parseXml(d[p.value].data);z=a.editor.extractGraphModel(A.documentElement,!0);B=0;this.init()});if(null!=d){p.style.marginLeft="4px";for(c=0;c<d.length;c++){var t=document.createElement("option");t.setAttribute("value",c);var q=new Date(d[c].created),v=new Date(d[c].modified);mxUtils.write(t,q.toLocaleDateString()+" "+q.toLocaleTimeString()+" - "+(q.toDateString(),v.toDateString(),v.toLocaleDateString())+" "+v.toLocaleTimeString());p.appendChild(t)}l.appendChild(p);mxEvent.addListener(p,
"change",u)}null==e&&(e=d[0].data);var y=document.createElement("div");y.style.position="absolute";y.style.border="1px solid lightGray";y.style.marginTop="10px";y.style.left="40px";y.style.right="40px";y.style.top="46px";y.style.bottom="74px";y.style.overflow="hidden";mxEvent.disableContextMenu(y);k.appendChild(y);var x=new Graph(y);x.setEnabled(!1);x.setPanning(!0);x.panningHandler.ignoreCell=!0;x.panningHandler.useLeftButtonForPanning=!0;x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;var A=
mxUtils.parseXml(e),z=a.editor.extractGraphModel(A.documentElement,!0),B=0,C=null,D=x.getGlobalVariable;x.getGlobalVariable=function(a){return"page"==a&&null!=C&&null!=C[B]?C[B].getAttribute("name"):"pagenumber"==a?B+1:"pagecount"==a?null!=C?C.length:1:D.apply(this,arguments)};x.getLinkForCell=function(){return null};e=mxUtils.button("",function(){x.zoomIn()});e.className="geSprite geSprite-zoomin";e.setAttribute("title",mxResources.get("zoomIn"));e.style.outline="none";e.style.border="none";e.style.margin=
"2px";mxUtils.setOpacity(e,60);l=mxUtils.button("",function(){x.zoomOut()});l.className="geSprite geSprite-zoomout";l.setAttribute("title",mxResources.get("zoomOut"));l.style.outline="none";l.style.border="none";l.style.margin="2px";mxUtils.setOpacity(l,60);c=mxUtils.button("",function(){x.maxFitScale=8;x.fit(8);x.center()});c.className="geSprite geSprite-fit";c.setAttribute("title",mxResources.get("fit"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);
t=mxUtils.button("",function(){x.zoomActual();x.center()});t.className="geSprite geSprite-actualsize";t.setAttribute("title",mxResources.get("actualSize"));t.style.outline="none";t.style.border="none";t.style.margin="2px";mxUtils.setOpacity(t,60);m=mxUtils.button(m||mxResources.get("discard"),function(){g.apply(this,[p.value,mxUtils.bind(this,function(){null!=p.parentNode&&(p.options[p.selectedIndex].parentNode.removeChild(p.options[p.selectedIndex]),0<p.options.length?(p.value=p.options[0].value,
u()):a.hideDialog(!0))})])});m.className="geBtn";var F=document.createElement("select");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";f=mxUtils.button(f||mxResources.get("edit"),function(){b.apply(this,[p.value])});f.className="geBtn gePrimaryBtn";q=document.createElement("div");q.style.position="absolute";q.style.bottom="30px";q.style.right="40px";q.style.textAlign="right";v=document.createElement("div");
v.className="geToolbarContainer";v.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var d=a.getAttribute("background");if(null==d||""==d||d==mxConstants.NONE)d="dark"==uiTheme?"transparent":"#ffffff";y.style.backgroundColor=d;(new mxCodec(a.ownerDocument)).decode(a,x.getModel());x.maxFitScale=1;x.fit(8);x.center()}return a}function d(d){null!=d&&(d=a(Editor.parseDiagramNode(d)));
return d}mxEvent.addListener(F,"change",function(a){C=parseInt(F.value);d(A[C]);mxEvent.consume(a)});if("mxfile"==z.nodeName){var b=z.getElementsByTagName("diagram");A=[];for(var c=0;c<b.length;c++)A.push(b[c]);0<A.length&&d(A[C]);F.innerHTML="";if(1<A.length)for(F.style.display="",c=0;c<A.length;c++)b=document.createElement("option"),mxUtils.write(b,A[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),b.setAttribute("value",c),c==C&&b.setAttribute("selected","selected"),F.appendChild(b);
return d}mxEvent.addListener(F,"change",function(a){B=parseInt(F.value);d(C[B]);mxEvent.consume(a)});if("mxfile"==z.nodeName){var b=z.getElementsByTagName("diagram");C=[];for(var c=0;c<b.length;c++)C.push(b[c]);0<C.length&&d(C[B]);F.innerHTML="";if(1<C.length)for(F.style.display="",c=0;c<C.length;c++)b=document.createElement("option"),mxUtils.write(b,C[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),b.setAttribute("value",c),c==B&&b.setAttribute("selected","selected"),F.appendChild(b);
else F.style.display="none"}else a(z)};v.appendChild(F);v.appendChild(e);v.appendChild(l);v.appendChild(t);v.appendChild(c);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.className="geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(q.appendChild(e),null!=n&&q.appendChild(n),q.appendChild(m),q.appendChild(f)):(q.appendChild(f),q.appendChild(m),null!=n&&q.appendChild(n),q.appendChild(e));k.appendChild(q);
k.appendChild(v);this.container=k},FindWindow=function(a,c,e,b,g){function f(a,d,b){if("object"===typeof d.value&&null!=d.value.attributes){d=d.value.attributes;for(var c=0;c<d.length;c++)if("label"!=d[c].nodeName){var e=mxUtils.trim(d[c].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&e.substring(0,b.length)===b||null!=a&&a.test(e))return!0}}return!1}function m(b){var c=d.model.getDescendants(d.model.getRoot()),e=t.value.toLowerCase(),g=q.checked?new RegExp(e):null,
u=null;k!=e&&(k=e,l=null,p=!1);var z=null==l;if(0<e.length){if(p){p=!1;for(var n,v=0;v<a.pages.length;v++)if(a.currentPage==a.pages[v]){n=v;break}b=(n+1)%a.pages.length;l=null;do p=!1,c=a.pages[b],d=a.createTemporaryGraph(d.getStylesheet()),a.updatePageRoot(c),d.model.setRoot(c.root),b=(b+1)%a.pages.length;while(!m(!0)&&b!=n);l&&(l=null,a.selectPage(c));p=!1;d=a.editor.graph;return m(!0)}for(v=0;v<c.length;v++){n=d.view.getState(c[v]);if(null!=n&&null!=n.cell.value&&(z||null==u)&&(d.model.isVertex(n.cell)||
d.model.isEdge(n.cell))&&(d.isHtmlLabel(n.cell)?(x.innerHTML=d.sanitizeHtml(d.getLabel(n.cell)),label=mxUtils.extractTextWithWhitespace([x])):label=d.getLabel(n.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==g&&(label.substring(0,e.length)===e||f(g,n.cell,e))||null!=g&&(g.test(label)||f(g,n.cell,e))))if(z){u=n;break}else null==u&&(u=n);z=z||n==l}}if(null!=u){if(v==c.length&&y.checked)return l=null,p=!0,m(!0);l=u;d.scrollCellToVisible(l.cell);d.isEnabled()?
d.setSelectionCell(l.cell):d.highlightCell(l.cell)}else{if(!b&&y.checked)return p=!0,m(!0);d.isEnabled()&&d.clearSelection()}return 0==e.length||null!=u}var n=a.actions.get("find"),d=a.editor.graph,k=null,l=null,p=!1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var t=document.createElement("input");t.setAttribute("placeholder",mxResources.get("find"));t.setAttribute("type","text");t.style.marginTop="4px";t.style.marginBottom=
"6px";t.style.width="200px";t.style.fontSize="12px";t.style.borderRadius="4px";t.style.padding="6px";u.appendChild(t);mxUtils.br(u);var q=document.createElement("input");q.setAttribute("id","geFindWinRegExChck");q.setAttribute("type","checkbox");q.style.marginRight="4px";u.appendChild(q);var v=document.createElement("label");v.setAttribute("for","geFindWinRegExChck");u.appendChild(v);mxUtils.write(v,mxResources.get("regularExpression"));u.appendChild(v);v=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");
"6px";t.style.width="200px";t.style.fontSize="12px";t.style.borderRadius="4px";t.style.padding="6px";u.appendChild(t);mxUtils.br(u);var q=document.createElement("input");q.setAttribute("id","geFindWinRegExChck");q.setAttribute("type","checkbox");q.style.marginRight="4px";u.appendChild(q);var v=document.createElement("label");v.setAttribute("for","geFindWinRegExChck");u.appendChild(v);mxUtils.write(v,mxResources.get("regularExpression"));u.appendChild(v);v=a.menus.createHelpLink("https://www.diagrams.net/doc/faq/find-shapes");
v.style.position="relative";v.style.marginLeft="6px";v.style.top="-1px";u.appendChild(v);mxUtils.br(u);var y=document.createElement("input");y.setAttribute("id","geFindWinAllPagesChck");y.setAttribute("type","checkbox");y.style.marginRight="4px";u.appendChild(y);v=document.createElement("label");v.setAttribute("for","geFindWinAllPagesChck");u.appendChild(v);mxUtils.write(v,mxResources.get("allPages"));u.appendChild(v);var x=document.createElement("div");mxUtils.br(u);v=mxUtils.button(mxResources.get("reset"),
function(){t.value="";t.style.backgroundColor="";k=l=null;p=!1;t.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.style.marginLeft=(b-20-156)/2+"px";v.className="geBtn";u.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{t.style.backgroundColor=m()?"":"#ffcfcf"}catch(z){a.handleError(z)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";u.appendChild(v);
mxEvent.addListener(t,"keyup",function(a){if(91==a.keyCode||93==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(k!=t.value.toLowerCase()||13==a.keyCode)try{t.style.backgroundColor=m()?"":"#ffcfcf"}catch(C){t.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(u,"keydown",function(d){70==d.keyCode&&a.keyHandler.isControlDown(d)&&!mxEvent.isShiftDown(d)&&(n.funct(),mxEvent.consume(d))});this.window=new mxWindow(mxResources.get("find"),u,c,e,b,g,!0,!0);this.window.destroyOnClose=
mxEvent.addListener(t,"keyup",function(a){if(91==a.keyCode||93==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(k!=t.value.toLowerCase()||13==a.keyCode)try{t.style.backgroundColor=m()?"":"#ffcfcf"}catch(B){t.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(u,"keydown",function(d){70==d.keyCode&&a.keyHandler.isControlDown(d)&&!mxEvent.isShiftDown(d)&&(n.funct(),mxEvent.consume(d))});this.window=new mxWindow(mxResources.get("find"),u,c,e,b,g,!0,!0);this.window.destroyOnClose=
!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null),null!=a.pages&&1<a.pages.length?y.removeAttribute("disabled"):(y.checked=!1,y.setAttribute("disabled","disabled"))):d.container.focus()}));this.window.setLocation=function(a,
d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var B=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,
"resize",B);this.destroy=function(){mxEvent.removeListener(window,"resize",B);this.window.destroy()}},FreehandWindow=function(a,c,e,b,g){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var m=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});m.setAttribute("title",mxResources.get("startDrawing"));m.style.marginTop="8px";m.style.marginRight=
d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var A=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,
"resize",A);this.destroy=function(){mxEvent.removeListener(window,"resize",A);this.window.destroy()}},FreehandWindow=function(a,c,e,b,g){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var m=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});m.setAttribute("title",mxResources.get("startDrawing"));m.style.marginTop="8px";m.style.marginRight=
"4px";m.style.width="160px";m.style.overflow="hidden";m.style.textOverflow="ellipsis";m.style.textAlign="center";m.className="geBtn gePrimaryBtn";a.appendChild(m);var n=m.cloneNode(!1);mxUtils.write(n,mxResources.get("stopDrawing"));n.setAttribute("title",mxResources.get("stopDrawing"));n.style.marginTop="4px";mxEvent.addListener(n,"click",function(){f.freehand.stopDrawing()});a.appendChild(n);this.window=new mxWindow(mxResources.get("freehand"),a,c,e,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
this.window.setResizable(!1);this.window.setClosable(!0);f.addListener("freehandStateChanged",mxUtils.bind(this,function(){n.className="geBtn"+(f.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){f.freehand.isDrawing()&&f.freehand.stopDrawing()}));this.window.setLocation=function(a,d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;
a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var d=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,"resize",d);this.destroy=function(){mxEvent.removeListener(window,"resize",d);this.window.destroy()}},
@ -9747,55 +9747,55 @@ var u=null,t=[],q=document.createElement("div");q.style.position="relative";q.st
"12px");var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)f=document.createElement("span"),f.style.paddingRight="20px",f.appendChild(v),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),v.checked=!0,v.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){mxEvent.getSource(a)!=v&&(v.checked=!v.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(f.style.position="relative",f.style.top="-6px"),e.appendChild(f);f=mxUtils.button(mxResources.get("cancel"),
function(){a.hideDialog()});f.className="geBtn";d=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var d=[],b=0;b<t.length;b++){var c=t[b].apply(this,arguments);null!=c&&d.push(c)}a.sidebar.showEntries(d.join(";"),v.checked,!0)});d.className="geBtn gePrimaryBtn"}else{var y=document.createElement("table"),f=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";d=document.createElement("tr");y.style.width="100%";c=document.createElement("td");var g=document.createElement("td"),
m=document.createElement("td"),x=mxUtils.bind(this,function(d,b,c){var e=document.createElement("input");e.type="checkbox";y.appendChild(e);e.checked=a.sidebar.isEntryVisible(c);var k=document.createElement("span");mxUtils.write(k,b);b=document.createElement("div");b.style.display="block";b.appendChild(e);b.appendChild(k);mxEvent.addListener(k,"click",function(a){e.checked=!e.checked;mxEvent.consume(a)});d.appendChild(b);return function(){return e.checked?c:null}});d.appendChild(c);d.appendChild(g);
d.appendChild(m);f.appendChild(d);y.appendChild(f);for(var t=[],B=0,f=0;f<e.length;f++)for(d=0;d<e[f].entries.length;d++)B++;for(var z=[c,g,m],C=0,f=0;f<e.length;f++)(function(a){for(var d=0;d<a.entries.length;d++){var b=a.entries[d];t.push(x(z[Math.floor(C/(B/3))],b.title,b.id));C++}})(e[f]);b.appendChild(y);e=document.createElement("div");e.style.marginTop="18px";e.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=
d.appendChild(m);f.appendChild(d);y.appendChild(f);for(var t=[],A=0,f=0;f<e.length;f++)for(d=0;d<e[f].entries.length;d++)A++;for(var z=[c,g,m],B=0,f=0;f<e.length;f++)(function(a){for(var d=0;d<a.entries.length;d++){var b=a.entries[d];t.push(x(z[Math.floor(B/(A/3))],b.title,b.id));B++}})(e[f]);b.appendChild(y);e=document.createElement("div");e.style.marginTop="18px";e.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=
!0,e.appendChild(v),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),e.appendChild(f),mxEvent.addListener(f,"click",function(a){v.checked=!v.checked;mxEvent.consume(a)}));b.appendChild(e);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";d=mxUtils.button(mxResources.get("apply"),function(){for(var d=["search"],b=0;b<t.length;b++){var c=t[b].apply(this,arguments);null!=c&&d.push(c)}a.sidebar.showEntries(0<d.length?
d.join(";"):"",v.checked);a.hideDialog()});d.className="geBtn gePrimaryBtn";e=document.createElement("div");e.style.marginTop="26px";e.style.textAlign="right"}a.editor.cancelFirst?(e.appendChild(f),e.appendChild(d)):(e.appendChild(d),e.appendChild(f));b.appendChild(e);this.container=b},PluginsDialog=function(a,c,e){function b(){if(0==m.length)f.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{f.innerHTML="";for(var d=0;d<m.length;d++){var c=document.createElement("span");c.style.whiteSpace=
"nowrap";var k=document.createElement("span");k.className="geSprite geSprite-delete";k.style.position="relative";k.style.cursor="pointer";k.style.top="5px";k.style.marginRight="4px";k.style.display="inline-block";c.appendChild(k);mxUtils.write(c,m[d]);f.appendChild(c);mxUtils.br(f);mxEvent.addListener(k,"click",function(d){return function(){a.confirm(mxResources.get("delete")+' "'+m[d]+'"?',function(){null!=e&&e(m[d]);m.splice(d,1);b()})}}(d))}}}var g=document.createElement("div"),f=document.createElement("div");
f.style.height="120px";f.style.overflow="auto";var m=mxSettings.getPlugins().slice();g.appendChild(f);b();var n=mxUtils.button(mxResources.get("add")+"...",null!=c?function(){c(function(a){a&&0>mxUtils.indexOf(m,a)&&m.push(a);b()})}:function(){var d=document.createElement("div"),c=document.createElement("span");c.style.marginTop="6px";mxUtils.write(c,mxResources.get("builtinPlugins")+": ");d.appendChild(c);var e=document.createElement("select");e.style.width="150px";for(c=0;c<App.publicPlugin.length;c++){var k=
document.createElement("option");mxUtils.write(k,App.publicPlugin[c]);k.value=App.publicPlugin[c];e.appendChild(k)}d.appendChild(e);mxUtils.br(d);mxUtils.br(d);c=mxUtils.button(mxResources.get("custom")+"...",function(){var d=new FilenameDialog(a,"",mxResources.get("add"),function(d){a.hideDialog();if(null!=d&&0<d.length){d=d.split(";");for(var c=0;c<d.length;c++){var e=d[c],k=App.pluginRegistry[e];null!=k&&(e=k);0<e.length&&0>mxUtils.indexOf(m,e)&&m.push(e)}b()}},mxResources.get("enterValue")+" ("+
mxResources.get("url")+")");a.showDialog(d.container,300,80,!0,!0);d.init()});c.className="geBtn";d=new CustomDialog(a,d,mxUtils.bind(this,function(){var a=App.pluginRegistry[e.value];0>mxUtils.indexOf(m,a)&&(m.push(a),b())}),null,null,null,c);a.showDialog(d.container,300,80,!0,!0)});n.className="geBtn";var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";var k=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(m);mxSettings.save();a.hideDialog();
a.alert(mxResources.get("restartForChangeRequired"))});k.className="geBtn gePrimaryBtn";var l=document.createElement("div");l.style.marginTop="14px";l.style.textAlign="right";var p=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000056430")});p.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(p.style.display="none");l.appendChild(p);a.editor.cancelFirst?(l.appendChild(d),l.appendChild(n),l.appendChild(k)):(l.appendChild(n),l.appendChild(k),
l.appendChild(d));g.appendChild(l);this.container=g},CropImageDialog=function(a,c,e){function b(a){null!=m&&m.destroy();m=a?new Croppie(f,{viewport:{width:150,height:150,type:"circle"},enableExif:!0,showZoomer:!1,enableResize:!1,enableOrientation:!0}):new Croppie(f,{viewport:{width:150,height:150,type:"square"},enableExif:!0,showZoomer:!1,enableResize:!0,enableOrientation:!0});m.bind({url:c})}var g=document.createElement("div"),f=document.createElement("div");f.style.width="300px";f.style.height=
"300px";g.appendChild(f);var m=null;this.init=function(){b()};var n=document.createElement("input");n.setAttribute("type","checkbox");n.setAttribute("id","croppieCircle");n.style.margin="5px";g.appendChild(n);var d=document.createElement("label");d.setAttribute("for","croppieCircle");mxUtils.write(d,mxResources.get("circle"));g.appendChild(d);var k,l,p,u,d=document.createElement("div");k=document.createElement("button");l=document.createElement("button");d.appendChild(k);d.appendChild(l);p=document.createElement("i");
u=document.createElement("i");k.appendChild(p);l.appendChild(u);d.className="cr-rotate-controls";d.style["float"]="right";d.style.position="inherit";k.className="cr-rotate-l";l.className="cr-rotate-r";g.appendChild(d);k.addEventListener("click",function(){m.rotate(-90)});l.addEventListener("click",function(){m.rotate(90)});mxEvent.addListener(n,"change",function(){b(this.checked)});n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";d=mxUtils.button(mxResources.get("apply"),
function(){m.result({type:"base64",size:"original"}).then(function(d){e(d);a.hideDialog()})});d.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.marginTop="20px";k.style.textAlign="right";a.editor.cancelFirst?(k.appendChild(n),k.appendChild(d)):(k.appendChild(d),k.appendChild(n));g.appendChild(k);this.container=g},EditGeometryDialog=function(a,c){var e=a.editor.graph,b=1==c.length?e.getCellGeometry(c[0]):null,g=document.createElement("div"),f=document.createElement("table"),
m=document.createElement("tbody"),n=document.createElement("tr"),d=document.createElement("td"),k=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(d,mxResources.get("relative")+":");var l=document.createElement("input");l.setAttribute("type","checkbox");null!=b&&b.relative&&(l.setAttribute("checked","checked"),l.defaultChecked=!0);this.init=function(){l.focus()};k.appendChild(l);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");
k=document.createElement("td");mxUtils.write(d,mxResources.get("left")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=b?b.x:"";k.appendChild(p);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("top")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=b?b.y:
"";k.appendChild(u);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("dx")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=b&&null!=b.offset?b.offset.x:"";k.appendChild(t);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");
mxUtils.write(d,mxResources.get("dy")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=b&&null!=b.offset?b.offset.y:"";k.appendChild(q);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("width")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=b?b.width:"";
k.appendChild(v);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("height")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=b?b.height:"";k.appendChild(y);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,
mxResources.get("rotation")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.width="100px";x.value=1==c.length?mxUtils.getValue(e.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";k.appendChild(x);n.appendChild(d);n.appendChild(k);m.appendChild(n);f.appendChild(m);g.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e.getModel().beginUpdate();
try{for(var d=0;d<c.length;d++){var b=e.getCellGeometry(c[d]);null!=b&&(b=b.clone(),e.isCellMovable(c[d])&&(b.relative=l.checked,0<mxUtils.trim(p.value).length&&(b.x=Number(p.value)),0<mxUtils.trim(u.value).length&&(b.y=Number(u.value)),0<mxUtils.trim(t.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.x=Number(t.value)),0<mxUtils.trim(q.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.y=Number(q.value))),e.isCellResizable(c[d])&&(0<mxUtils.trim(v.value).length&&(b.width=
Number(v.value)),0<mxUtils.trim(y.value).length&&(b.height=Number(y.value))),e.getModel().setGeometry(c[d],b));0<mxUtils.trim(x.value).length&&e.setCellStyles(mxConstants.STYLE_ROTATION,Number(x.value),[c[d]])}}finally{e.getModel().endUpdate()}});B.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&B.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(b),f.appendChild(B)):(f.appendChild(B),
f.appendChild(b));g.appendChild(f);this.container=g},LibraryDialog=function(a,c,e,b,g,f){function m(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=t;)a=a.parentNode;var d=null;if(null!=a)for(var b=t.firstChild,d=0;null!=b&&b!=a;)b=b.nextSibling,d++;return d}function n(d,b,c,e,k,f,p,g,u){try{if(a.spinner.stop(),null==b||"image/"==b.substring(0,6))if(null==d&&null!=p||null==v[d]){var K=function(){H.innerHTML="";H.style.cursor="pointer";H.style.whiteSpace="nowrap";H.style.textOverflow=
"ellipsis";mxUtils.write(H,null!=E.title&&0<E.title.length?E.title:mxResources.get("untitled"));H.style.color=null==E.title||0==E.title.length?"#d0d0d0":""};t.style.backgroundImage="";q.style.display="none";var M=k,A=f;if(k>a.maxImageSize||f>a.maxImageSize){var x=Math.min(1,Math.min(a.maxImageSize/Math.max(1,k)),a.maxImageSize/Math.max(1,f));k*=x;f*=x}M>A?(A=Math.round(100*A/M),M=100):(M=Math.round(100*M/A),A=100);var N=document.createElement("div");N.setAttribute("draggable","true");N.style.display=
mxClient.IS_QUIRKS?"inline":"inline-block";N.style.position="relative";N.style.cursor="move";mxUtils.setPrefixedStyle(N.style,"transition","transform .1s ease-in-out");if(null!=d){var D=document.createElement("img");D.setAttribute("src",z.convert(d));D.style.width=M+"px";D.style.height=A+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-A)/2)+"px";D.style.paddingLeft=Math.floor((100-M)/2)+"px";N.appendChild(D)}else if(null!=p){var F=a.stringToCells(Graph.decompress(p.xml));0<F.length&&
(a.sidebar.createThumb(F,100,100,N,null,!0,!1),N.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",N.firstChild.style.cursor="")}var I=document.createElement("img");I.setAttribute("src",Editor.closeImage);I.setAttribute("border","0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.position="absolute";I.style.marginLeft="-12px";I.style.zIndex="1";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});
(function(a,d,b){mxEvent.addListener(I,"click",function(c){v[d]=null;for(var e=0;e<l.length;e++)if(null!=l[e].data&&l[e].data==d||null!=l[e].xml&&null!=b&&l[e].xml==b.xml){l.splice(e,1);break}N.parentNode.removeChild(a);0==l.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(c)});mxEvent.addListener(I,"dblclick",function(a){mxEvent.consume(a)})})(N,d,p);N.appendChild(I);N.style.marginBottom="30px";var H=document.createElement("div");H.style.position=
"absolute";H.style.boxSizing="border-box";H.style.bottom="-18px";H.style.left="10px";H.style.right="10px";H.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var E=null;null!=d?(E={data:d,w:k,h:f,title:u},null!=g&&(E.aspect=g),v[d]=D,l.push(E)):null!=p&&(p.aspect="fixed",l.push(p),E=p);mxEvent.addListener(H,"keydown",function(a){13==a.keyCode&&null!=B&&(B(),B=null,mxEvent.consume(a))});K();N.appendChild(H);mxEvent.addListener(H,"mousedown",
function(a){"true"!=H.getAttribute("contentEditable")&&mxEvent.consume(a)});F=function(d){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,E.title||"",mxResources.get("ok"),function(a){null!=a&&(E.title=a,K())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(d)}else if("true"!=H.getAttribute("contentEditable")){null!=B&&(B(),B=null);if(null==E.title||0==E.title.length)H.innerHTML=
"";H.style.textOverflow="";H.style.whiteSpace="";H.style.cursor="text";H.style.color="";H.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(H.style,"user-select","text");H.focus();document.execCommand("selectAll",!1,null);B=function(){H.removeAttribute("contentEditable");H.style.cursor="pointer";E.title=H.innerHTML;K()};mxEvent.consume(d)}};mxEvent.addListener(H,"click",F);mxEvent.addListener(N,"dblclick",F);t.appendChild(N);mxEvent.addListener(N,"dragstart",function(a){null==d&&null!=
p&&(I.style.visibility="hidden",H.style.visibility="hidden");mxClient.IS_FF&&null!=p.xml&&a.dataTransfer.setData("Text",p.xml);y=m(a);mxClient.IS_GC&&(N.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(N.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(N,30);I.style.visibility="";H.style.visibility=""},0)});mxEvent.addListener(N,"dragend",function(a){"hidden"==I.style.visibility&&(I.style.visibility="",H.style.visibility="");y=null;mxUtils.setOpacity(N,100);mxUtils.setPrefixedStyle(N.style,
"transform",null)})}else C||(C=!0,a.handleError({message:mxResources.get("fileExists")}));else{k=!1;try{if(M=mxUtils.parseXml(d),"mxlibrary"==M.documentElement.nodeName){A=JSON.parse(mxUtils.getTextContent(M.documentElement));if(null!=A&&0<A.length)for(var G=0;G<A.length;G++)null!=A[G].xml?n(null,null,0,0,0,0,A[G]):n(A[G].data,null,0,0,A[G].w,A[G].h,null,"fixed",A[G].title);k=!0}else if("mxfile"==M.documentElement.nodeName){for(var J=M.documentElement.getElementsByTagName("diagram"),G=0;G<J.length;G++){var A=
mxUtils.getTextContent(J[G]),F=a.stringToCells(Graph.decompress(A)),W=a.editor.graph.getBoundingBoxFromGeometry(F);n(null,null,0,0,0,0,{xml:A,w:W.width,h:W.height})}k=!0}}catch(R){}k||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(R){}return null}function d(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function k(d){d.stopPropagation();d.preventDefault();C=!1;x=m(d);if(null!=y)null!=x&&x<t.children.length?(l.splice(x>
y?x-1:x,0,l.splice(y,1)[0]),t.insertBefore(t.children[y],t.children[x])):(l.push(l.splice(y,1)[0]),t.appendChild(t.children[y]));else if(0<d.dataTransfer.files.length)a.importFiles(d.dataTransfer.files,0,0,a.maxImageSize,A(d));else if(0<=mxUtils.indexOf(d.dataTransfer.types,"text/uri-list")){var b=decodeURIComponent(d.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(b)||/(\.png)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b)||/(\.svg)($|\?)/i.test(b))&&a.loadImage(b,function(a){n(b,null,0,
0,a.width,a.height);t.scrollTop=t.scrollHeight})}d.stopPropagation();d.preventDefault()}var l=[];e=document.createElement("div");e.style.height="100%";var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.height="40px";e.appendChild(p);mxUtils.write(p,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var u=document.createElement("input");u.setAttribute("value",c);u.style.marginRight="20px";u.style.marginLeft="10px";u.style.width="500px";null==g||g.isRenamable()||
u.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};p.appendChild(u);var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle="solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat=
"no-repeat";0==l.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var q=document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));e.appendChild(q);var v={},y=null,x=null,B=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=B&&(B(),B=null,mxEvent.consume(a))};
mxEvent.addListener(t,"mousedown",c);mxEvent.addListener(t,"pointerdown",c);mxEvent.addListener(t,"touchstart",c);var z=new mxUrlConverter,C=!1;if(null!=b)for(c=0;c<b.length;c++)p=b[c],n(p.data,null,0,0,p.w,p.h,p,p.aspect,p.title);mxEvent.addListener(t,"dragleave",function(a){q.style.cursor="";for(var d=mxEvent.getSource(a);null!=d;){if(d==t||d==q){a.stopPropagation();a.preventDefault();break}d=d.parentNode}});var A=function(d){return function(b,c,e,k,l,f,p,g,u){null!=u&&(/(\.v(dx|sdx?))($|\?)/i.test(u.name)||
/(\.vs(x|sx?))($|\?)/i.test(u.name))?a.importVisio(u,mxUtils.bind(this,function(a){n(a,c,e,k,l,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," "))})):null!=u&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(b,u.name)?a.parseFile(u,mxUtils.bind(this,function(b){4==b.readyState&&(a.spinner.stop(),200<=b.status&&299>=b.status&&(n(b.responseText,c,e,k,l,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=
t.scrollHeight))})):(n(b,c,e,k,l,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",d);mxEvent.addListener(t,"drop",k);mxEvent.addListener(q,"dragover",d);mxEvent.addListener(q,"drop",k);e.appendChild(t);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className=
"geBtn";a.editor.cancelFirst&&b.appendChild(c);"draw.io"!=a.getServiceName()||null==g||g.constructor!=DriveLibrary&&g.constructor!=GitHubLibrary||(p=mxUtils.button(mxResources.get("link"),function(){a.spinner.spin(document.body,mxResources.get("loading"))&&g.getPublicUrl(function(d){a.spinner.stop();if(null!=d){var b=a.getSearch("create title mode url drive splash state clibs ui".split(" ")),b=b+((0==b.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(d));d=new EmbedDialog(a,window.location.protocol+
"//"+window.location.host+"/"+b,null,null,null,null,"Check out the library I made using @drawio");a.showDialog(d.container,440,240,!0);d.init()}else g.constructor==DriveLibrary?a.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){a.drive.showPermissions(g.getId())}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):a.handleError({message:mxResources.get("diagramIsNotPublic")})})}),p.className="geBtn",b.appendChild(p));
p=mxUtils.button(mxResources.get("export"),function(){var d=a.createLibraryDataFromImages(l),b=u.value;/(\.xml)$/i.test(b)||(b+=".xml");a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml",null,null,!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml&xml="+encodeURIComponent(d))).simulate(document,"_blank")});p.setAttribute("id","btnDownload");p.className="geBtn";b.appendChild(p);if(Graph.fileSupport){if(null==a.libDlgFileInputElt){var D=document.createElement("input");
D.setAttribute("multiple","multiple");D.setAttribute("type","file");mxEvent.addListener(D,"change",function(d){C=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,b,c,e,k,l,f,p,g){null!=D.files&&(A(d)(a,b,c,e,k,l,f,p,g),D.type="",D.type="file",D.value="")});t.scrollTop=t.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt=D}p=mxUtils.button(mxResources.get("import"),function(){null!=B&&(B(),B=null);a.libDlgFileInputElt.click()});p.setAttribute("id","btnAddImage");
p.className="geBtn";b.appendChild(p)}p=mxUtils.button(mxResources.get("addImages"),function(){null!=B&&(B(),B=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,d,b){C=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var c=a.indexOf(",");0<c&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))}n(a,null,0,0,d,b);t.scrollTop=t.scrollHeight}})});p.setAttribute("id","btnAddImageUrl");p.className="geBtn";b.appendChild(p);this.saveBtnClickHandler=function(d,b,c,e){a.saveLibrary(d,b,c,
e)};p=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=B&&(B(),B=null);this.saveBtnClickHandler(u.value,l,g,f)}));p.setAttribute("id","btnSave");p.className="geBtn gePrimaryBtn";b.appendChild(p);a.editor.cancelFirst||b.appendChild(c);e.appendChild(b);this.container=e},EditShapeDialog=function(a,c,e,b,g){b=null!=b?b:300;g=null!=g?g:120;var f,m,n=document.createElement("table"),d=document.createElement("tbody");n.style.cellPadding="4px";f=document.createElement("tr");m=document.createElement("td");
m.setAttribute("colspan","2");m.style.fontSize="10pt";mxUtils.write(m,e);f.appendChild(m);d.appendChild(f);f=document.createElement("tr");m=document.createElement("td");var k=document.createElement("textarea");k.style.outline="none";k.style.resize="none";k.style.width=b-200+"px";k.style.height=g+"px";this.textarea=k;this.init=function(){k.focus();k.scrollTop=0};m.appendChild(k);f.appendChild(m);m=document.createElement("td");e=document.createElement("div");e.style.position="relative";e.style.border=
"1px solid gray";e.style.top="6px";e.style.width="200px";e.style.height=g+4+"px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);m.appendChild(e);var l=new Graph(e);l.setEnabled(!1);var p=a.editor.graph.cloneCell(c);l.addCells([p]);e=l.view.getState(p);var u="";null!=e.shape&&null!=e.shape.stencil&&(u=mxUtils.getPrettyXml(e.shape.stencil.desc));mxUtils.write(k,u||"");e=l.getGraphBounds();g=Math.min(160/e.width,(g-40)/e.height);l.view.scaleAndTranslate(g,20/g-e.x,
20/g-e.y);f.appendChild(m);d.appendChild(f);f=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan","2");m.style.paddingTop="2px";m.style.whiteSpace="nowrap";m.setAttribute("align","right");a.isOffline()||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),g.className="geBtn",m.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&
m.appendChild(g);var t=function(d,b,c){var e=k.value,l=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(l.documentElement),l=l.documentElement.getElementsByTagName("parsererror");if(null!=l&&0<l.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),l=!d.model.contains(b),!c||l||e!=u){e=Graph.compress(e);d.getModel().beginUpdate();try{if(l){var f=a.editor.graph.getFreeInsertPoint();b.geometry.x=f.x;b.geometry.y=f.y;d.addCell(b)}d.setCellStyles(mxConstants.STYLE_SHAPE,
"stencil("+e+")",[b])}catch(C){throw C;}finally{d.getModel().endUpdate()}l&&(d.setSelectionCell(b),d.scrollCellToVisible(b))}};e=mxUtils.button(mxResources.get("preview"),function(){t(l,p,!1)});e.className="geBtn";m.appendChild(e);e=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,c,!0)});e.className="geBtn gePrimaryBtn";m.appendChild(e);a.editor.cancelFirst||m.appendChild(g);f.appendChild(m);d.appendChild(f);n.appendChild(d);this.container=n},CustomDialog=function(a,c,e,b,g,f,
a.alert(mxResources.get("restartForChangeRequired"))});k.className="geBtn gePrimaryBtn";var l=document.createElement("div");l.style.marginTop="14px";l.style.textAlign="right";var p=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/doc/faq/plugins")});p.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(p.style.display="none");l.appendChild(p);a.editor.cancelFirst?(l.appendChild(d),l.appendChild(n),l.appendChild(k)):(l.appendChild(n),l.appendChild(k),l.appendChild(d));
g.appendChild(l);this.container=g},CropImageDialog=function(a,c,e){function b(a){null!=m&&m.destroy();m=a?new Croppie(f,{viewport:{width:150,height:150,type:"circle"},enableExif:!0,showZoomer:!1,enableResize:!1,enableOrientation:!0}):new Croppie(f,{viewport:{width:150,height:150,type:"square"},enableExif:!0,showZoomer:!1,enableResize:!0,enableOrientation:!0});m.bind({url:c})}var g=document.createElement("div"),f=document.createElement("div");f.style.width="300px";f.style.height="300px";g.appendChild(f);
var m=null;this.init=function(){b()};var n=document.createElement("input");n.setAttribute("type","checkbox");n.setAttribute("id","croppieCircle");n.style.margin="5px";g.appendChild(n);var d=document.createElement("label");d.setAttribute("for","croppieCircle");mxUtils.write(d,mxResources.get("circle"));g.appendChild(d);var k,l,p,u,d=document.createElement("div");k=document.createElement("button");l=document.createElement("button");d.appendChild(k);d.appendChild(l);p=document.createElement("i");u=document.createElement("i");
k.appendChild(p);l.appendChild(u);d.className="cr-rotate-controls";d.style["float"]="right";d.style.position="inherit";k.className="cr-rotate-l";l.className="cr-rotate-r";g.appendChild(d);k.addEventListener("click",function(){m.rotate(-90)});l.addEventListener("click",function(){m.rotate(90)});mxEvent.addListener(n,"change",function(){b(this.checked)});n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";d=mxUtils.button(mxResources.get("apply"),function(){m.result({type:"base64",
size:"original"}).then(function(d){e(d);a.hideDialog()})});d.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.marginTop="20px";k.style.textAlign="right";a.editor.cancelFirst?(k.appendChild(n),k.appendChild(d)):(k.appendChild(d),k.appendChild(n));g.appendChild(k);this.container=g},EditGeometryDialog=function(a,c){var e=a.editor.graph,b=1==c.length?e.getCellGeometry(c[0]):null,g=document.createElement("div"),f=document.createElement("table"),m=document.createElement("tbody"),n=
document.createElement("tr"),d=document.createElement("td"),k=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(d,mxResources.get("relative")+":");var l=document.createElement("input");l.setAttribute("type","checkbox");null!=b&&b.relative&&(l.setAttribute("checked","checked"),l.defaultChecked=!0);this.init=function(){l.focus()};k.appendChild(l);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");
mxUtils.write(d,mxResources.get("left")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=b?b.x:"";k.appendChild(p);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("top")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=b?b.y:"";k.appendChild(u);n.appendChild(d);
n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("dx")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=b&&null!=b.offset?b.offset.x:"";k.appendChild(t);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("dy")+
":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=b&&null!=b.offset?b.offset.y:"";k.appendChild(q);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("width")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=b?b.width:"";k.appendChild(v);n.appendChild(d);n.appendChild(k);
m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("height")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=b?b.height:"";k.appendChild(y);n.appendChild(d);n.appendChild(k);m.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("rotation")+":");var x=document.createElement("input");
x.setAttribute("type","text");x.style.width="100px";x.value=1==c.length?mxUtils.getValue(e.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";k.appendChild(x);n.appendChild(d);n.appendChild(k);m.appendChild(n);f.appendChild(m);g.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e.getModel().beginUpdate();try{for(var d=0;d<c.length;d++){var b=e.getCellGeometry(c[d]);null!=
b&&(b=b.clone(),e.isCellMovable(c[d])&&(b.relative=l.checked,0<mxUtils.trim(p.value).length&&(b.x=Number(p.value)),0<mxUtils.trim(u.value).length&&(b.y=Number(u.value)),0<mxUtils.trim(t.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.x=Number(t.value)),0<mxUtils.trim(q.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.y=Number(q.value))),e.isCellResizable(c[d])&&(0<mxUtils.trim(v.value).length&&(b.width=Number(v.value)),0<mxUtils.trim(y.value).length&&(b.height=Number(y.value))),
e.getModel().setGeometry(c[d],b));0<mxUtils.trim(x.value).length&&e.setCellStyles(mxConstants.STYLE_ROTATION,Number(x.value),[c[d]])}}finally{e.getModel().endUpdate()}});A.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&A.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(b),f.appendChild(A)):(f.appendChild(A),f.appendChild(b));g.appendChild(f);this.container=g},LibraryDialog=function(a,
c,e,b,g,f){function m(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=t;)a=a.parentNode;var d=null;if(null!=a)for(var b=t.firstChild,d=0;null!=b&&b!=a;)b=b.nextSibling,d++;return d}function n(d,b,c,e,k,f,p,g,u){try{if(a.spinner.stop(),null==b||"image/"==b.substring(0,6))if(null==d&&null!=p||null==v[d]){var K=function(){H.innerHTML="";H.style.cursor="pointer";H.style.whiteSpace="nowrap";H.style.textOverflow="ellipsis";mxUtils.write(H,null!=E.title&&0<E.title.length?E.title:
mxResources.get("untitled"));H.style.color=null==E.title||0==E.title.length?"#d0d0d0":""};t.style.backgroundImage="";q.style.display="none";var M=k,x=f;if(k>a.maxImageSize||f>a.maxImageSize){var C=Math.min(1,Math.min(a.maxImageSize/Math.max(1,k)),a.maxImageSize/Math.max(1,f));k*=C;f*=C}M>x?(x=Math.round(100*x/M),M=100):(M=Math.round(100*M/x),x=100);var N=document.createElement("div");N.setAttribute("draggable","true");N.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";N.style.position="relative";
N.style.cursor="move";mxUtils.setPrefixedStyle(N.style,"transition","transform .1s ease-in-out");if(null!=d){var D=document.createElement("img");D.setAttribute("src",z.convert(d));D.style.width=M+"px";D.style.height=x+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-x)/2)+"px";D.style.paddingLeft=Math.floor((100-M)/2)+"px";N.appendChild(D)}else if(null!=p){var F=a.stringToCells(Graph.decompress(p.xml));0<F.length&&(a.sidebar.createThumb(F,100,100,N,null,!0,!1),N.firstChild.style.display=
mxClient.IS_QUIRKS?"inline":"inline-block",N.firstChild.style.cursor="")}var I=document.createElement("img");I.setAttribute("src",Editor.closeImage);I.setAttribute("border","0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.position="absolute";I.style.marginLeft="-12px";I.style.zIndex="1";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});(function(a,d,b){mxEvent.addListener(I,"click",function(c){v[d]=
null;for(var e=0;e<l.length;e++)if(null!=l[e].data&&l[e].data==d||null!=l[e].xml&&null!=b&&l[e].xml==b.xml){l.splice(e,1);break}N.parentNode.removeChild(a);0==l.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(c)});mxEvent.addListener(I,"dblclick",function(a){mxEvent.consume(a)})})(N,d,p);N.appendChild(I);N.style.marginBottom="30px";var H=document.createElement("div");H.style.position="absolute";H.style.boxSizing="border-box";H.style.bottom=
"-18px";H.style.left="10px";H.style.right="10px";H.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var E=null;null!=d?(E={data:d,w:k,h:f,title:u},null!=g&&(E.aspect=g),v[d]=D,l.push(E)):null!=p&&(p.aspect="fixed",l.push(p),E=p);mxEvent.addListener(H,"keydown",function(a){13==a.keyCode&&null!=A&&(A(),A=null,mxEvent.consume(a))});K();N.appendChild(H);mxEvent.addListener(H,"mousedown",function(a){"true"!=H.getAttribute("contentEditable")&&
mxEvent.consume(a)});F=function(d){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,E.title||"",mxResources.get("ok"),function(a){null!=a&&(E.title=a,K())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(d)}else if("true"!=H.getAttribute("contentEditable")){null!=A&&(A(),A=null);if(null==E.title||0==E.title.length)H.innerHTML="";H.style.textOverflow="";H.style.whiteSpace=
"";H.style.cursor="text";H.style.color="";H.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(H.style,"user-select","text");H.focus();document.execCommand("selectAll",!1,null);A=function(){H.removeAttribute("contentEditable");H.style.cursor="pointer";E.title=H.innerHTML;K()};mxEvent.consume(d)}};mxEvent.addListener(H,"click",F);mxEvent.addListener(N,"dblclick",F);t.appendChild(N);mxEvent.addListener(N,"dragstart",function(a){null==d&&null!=p&&(I.style.visibility="hidden",H.style.visibility=
"hidden");mxClient.IS_FF&&null!=p.xml&&a.dataTransfer.setData("Text",p.xml);y=m(a);mxClient.IS_GC&&(N.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(N.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(N,30);I.style.visibility="";H.style.visibility=""},0)});mxEvent.addListener(N,"dragend",function(a){"hidden"==I.style.visibility&&(I.style.visibility="",H.style.visibility="");y=null;mxUtils.setOpacity(N,100);mxUtils.setPrefixedStyle(N.style,"transform",null)})}else B||
(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{k=!1;try{if(M=mxUtils.parseXml(d),"mxlibrary"==M.documentElement.nodeName){x=JSON.parse(mxUtils.getTextContent(M.documentElement));if(null!=x&&0<x.length)for(var G=0;G<x.length;G++)null!=x[G].xml?n(null,null,0,0,0,0,x[G]):n(x[G].data,null,0,0,x[G].w,x[G].h,null,"fixed",x[G].title);k=!0}else if("mxfile"==M.documentElement.nodeName){for(var J=M.documentElement.getElementsByTagName("diagram"),G=0;G<J.length;G++){var x=mxUtils.getTextContent(J[G]),
F=a.stringToCells(Graph.decompress(x)),W=a.editor.graph.getBoundingBoxFromGeometry(F);n(null,null,0,0,0,0,{xml:x,w:W.width,h:W.height})}k=!0}}catch(R){}k||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(R){}return null}function d(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function k(d){d.stopPropagation();d.preventDefault();B=!1;x=m(d);if(null!=y)null!=x&&x<t.children.length?(l.splice(x>y?x-1:x,0,l.splice(y,1)[0]),
t.insertBefore(t.children[y],t.children[x])):(l.push(l.splice(y,1)[0]),t.appendChild(t.children[y]));else if(0<d.dataTransfer.files.length)a.importFiles(d.dataTransfer.files,0,0,a.maxImageSize,C(d));else if(0<=mxUtils.indexOf(d.dataTransfer.types,"text/uri-list")){var b=decodeURIComponent(d.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(b)||/(\.png)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b)||/(\.svg)($|\?)/i.test(b))&&a.loadImage(b,function(a){n(b,null,0,0,a.width,a.height);t.scrollTop=
t.scrollHeight})}d.stopPropagation();d.preventDefault()}var l=[];e=document.createElement("div");e.style.height="100%";var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.height="40px";e.appendChild(p);mxUtils.write(p,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var u=document.createElement("input");u.setAttribute("value",c);u.style.marginRight="20px";u.style.marginLeft="10px";u.style.width="500px";null==g||g.isRenamable()||u.setAttribute("disabled",
"true");this.init=function(){if(null==g||g.isRenamable())u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};p.appendChild(u);var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle="solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==
l.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var q=document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));e.appendChild(q);var v={},y=null,x=null,A=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=A&&(A(),A=null,mxEvent.consume(a))};mxEvent.addListener(t,
"mousedown",c);mxEvent.addListener(t,"pointerdown",c);mxEvent.addListener(t,"touchstart",c);var z=new mxUrlConverter,B=!1;if(null!=b)for(c=0;c<b.length;c++)p=b[c],n(p.data,null,0,0,p.w,p.h,p,p.aspect,p.title);mxEvent.addListener(t,"dragleave",function(a){q.style.cursor="";for(var d=mxEvent.getSource(a);null!=d;){if(d==t||d==q){a.stopPropagation();a.preventDefault();break}d=d.parentNode}});var C=function(d){return function(b,c,e,k,l,f,p,g,u){null!=u&&(/(\.v(dx|sdx?))($|\?)/i.test(u.name)||/(\.vs(x|sx?))($|\?)/i.test(u.name))?
a.importVisio(u,mxUtils.bind(this,function(a){n(a,c,e,k,l,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," "))})):null!=u&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(b,u.name)?a.parseFile(u,mxUtils.bind(this,function(b){4==b.readyState&&(a.spinner.stop(),200<=b.status&&299>=b.status&&(n(b.responseText,c,e,k,l,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(n(b,c,
e,k,l,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",d);mxEvent.addListener(t,"drop",k);mxEvent.addListener(q,"dragover",d);mxEvent.addListener(q,"drop",k);e.appendChild(t);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&
b.appendChild(c);"draw.io"!=a.getServiceName()||null==g||g.constructor!=DriveLibrary&&g.constructor!=GitHubLibrary||(p=mxUtils.button(mxResources.get("link"),function(){a.spinner.spin(document.body,mxResources.get("loading"))&&g.getPublicUrl(function(d){a.spinner.stop();if(null!=d){var b=a.getSearch("create title mode url drive splash state clibs ui".split(" ")),b=b+((0==b.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(d));d=new EmbedDialog(a,window.location.protocol+"//"+window.location.host+
"/"+b,null,null,null,null,"Check out the library I made using @drawio");a.showDialog(d.container,440,240,!0);d.init()}else g.constructor==DriveLibrary?a.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){a.drive.showPermissions(g.getId())}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):a.handleError({message:mxResources.get("diagramIsNotPublic")})})}),p.className="geBtn",b.appendChild(p));p=mxUtils.button(mxResources.get("export"),
function(){var d=a.createLibraryDataFromImages(l),b=u.value;/(\.xml)$/i.test(b)||(b+=".xml");a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml",null,null,!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml&xml="+encodeURIComponent(d))).simulate(document,"_blank")});p.setAttribute("id","btnDownload");p.className="geBtn";b.appendChild(p);if(Graph.fileSupport){if(null==a.libDlgFileInputElt){var D=document.createElement("input");D.setAttribute("multiple","multiple");
D.setAttribute("type","file");mxEvent.addListener(D,"change",function(d){B=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,b,c,e,k,l,f,p,g){null!=D.files&&(C(d)(a,b,c,e,k,l,f,p,g),D.type="",D.type="file",D.value="")});t.scrollTop=t.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt=D}p=mxUtils.button(mxResources.get("import"),function(){null!=A&&(A(),A=null);a.libDlgFileInputElt.click()});p.setAttribute("id","btnAddImage");p.className="geBtn";b.appendChild(p)}p=
mxUtils.button(mxResources.get("addImages"),function(){null!=A&&(A(),A=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,d,b){B=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var c=a.indexOf(",");0<c&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))}n(a,null,0,0,d,b);t.scrollTop=t.scrollHeight}})});p.setAttribute("id","btnAddImageUrl");p.className="geBtn";b.appendChild(p);this.saveBtnClickHandler=function(d,b,c,e){a.saveLibrary(d,b,c,e)};p=mxUtils.button(mxResources.get("save"),
mxUtils.bind(this,function(){null!=A&&(A(),A=null);this.saveBtnClickHandler(u.value,l,g,f)}));p.setAttribute("id","btnSave");p.className="geBtn gePrimaryBtn";b.appendChild(p);a.editor.cancelFirst||b.appendChild(c);e.appendChild(b);this.container=e},EditShapeDialog=function(a,c,e,b,g){b=null!=b?b:300;g=null!=g?g:120;var f,m,n=document.createElement("table"),d=document.createElement("tbody");n.style.cellPadding="4px";f=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan",
"2");m.style.fontSize="10pt";mxUtils.write(m,e);f.appendChild(m);d.appendChild(f);f=document.createElement("tr");m=document.createElement("td");var k=document.createElement("textarea");k.style.outline="none";k.style.resize="none";k.style.width=b-200+"px";k.style.height=g+"px";this.textarea=k;this.init=function(){k.focus();k.scrollTop=0};m.appendChild(k);f.appendChild(m);m=document.createElement("td");e=document.createElement("div");e.style.position="relative";e.style.border="1px solid gray";e.style.top=
"6px";e.style.width="200px";e.style.height=g+4+"px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);m.appendChild(e);var l=new Graph(e);l.setEnabled(!1);var p=a.editor.graph.cloneCell(c);l.addCells([p]);e=l.view.getState(p);var u="";null!=e.shape&&null!=e.shape.stencil&&(u=mxUtils.getPrettyXml(e.shape.stencil.desc));mxUtils.write(k,u||"");e=l.getGraphBounds();g=Math.min(160/e.width,(g-40)/e.height);l.view.scaleAndTranslate(g,20/g-e.x,20/g-e.y);f.appendChild(m);
d.appendChild(f);f=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan","2");m.style.paddingTop="2px";m.style.whiteSpace="nowrap";m.setAttribute("align","right");a.isOffline()||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/doc/faq/shape-complex-create-edit")}),g.className="geBtn",m.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&m.appendChild(g);
var t=function(d,b,c){var e=k.value,l=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(l.documentElement),l=l.documentElement.getElementsByTagName("parsererror");if(null!=l&&0<l.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),l=!d.model.contains(b),!c||l||e!=u){e=Graph.compress(e);d.getModel().beginUpdate();try{if(l){var f=a.editor.graph.getFreeInsertPoint();b.geometry.x=f.x;b.geometry.y=f.y;d.addCell(b)}d.setCellStyles(mxConstants.STYLE_SHAPE,
"stencil("+e+")",[b])}catch(B){throw B;}finally{d.getModel().endUpdate()}l&&(d.setSelectionCell(b),d.scrollCellToVisible(b))}};e=mxUtils.button(mxResources.get("preview"),function(){t(l,p,!1)});e.className="geBtn";m.appendChild(e);e=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,c,!0)});e.className="geBtn gePrimaryBtn";m.appendChild(e);a.editor.cancelFirst||m.appendChild(g);f.appendChild(m);d.appendChild(f);n.appendChild(d);this.container=n},CustomDialog=function(a,c,e,b,g,f,
m,n,d,k){var l=document.createElement("div");l.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=m&&c.appendChild(m);a.isOffline()||null==f||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),m.className="geBtn",c.appendChild(m));d=mxUtils.button(d||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b()});d.className="geBtn";n&&(d.style.display="none");a.editor.cancelFirst&&c.appendChild(d);g=mxUtils.button(g||mxResources.get("ok"),
mxUtils.bind(this,function(){k||a.hideDialog(null,null,this.container);if(null!=e){var d=e();if("string"===typeof d){a.showError(mxResources.get("error"),d);return}}k&&a.hideDialog(null,null,this.container)}));c.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(d);l.appendChild(c);this.cancelBtn=d;this.okButton=g;this.container=l},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+
mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+
@ -9803,30 +9803,30 @@ mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTe
mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">&#x1F6C8; '+
mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg";
var a=window.innerWidth,e=window.innerHeight,b=987,g=712;.9*a<b&&(b=Math.max(.9*a,600),c.style.width=b+"px");.9*e<g&&(g=Math.max(.9*e,300),c.style.height=g+"px");this.width=b;this.height=g;this.container=c};
TemplatesDialog.prototype.init=function(a,c,e,b,g,f,m,n,d,k){function l(){null!=E&&(E.style.fontWeight="normal",E.style.textDecoration="none",E=null)}function p(a,d,b,c,e,k,l){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";A.querySelector(".geTempDlgRadioBtn[data-id="+c+"]").className="geTempDlgRadioBtn "+(l?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");A.querySelector("."+d).src="/images/"+b+"-sel.svg";A.querySelector("."+e).src="/images/"+
k+".svg";return!0}function u(a){function d(a){aa.removeChild(c);A.removeChild(b);aa.scrollTop=k}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var b=document.createElement("div");b.className="geTempDlgDialogMask";A.appendChild(b);var c=document.createElement("div");c.className="geTempDlgDiagramPreviewBox";var e=document.createElement("img");e.src=a;c.appendChild(e);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
TemplatesDialog.prototype.init=function(a,c,e,b,g,f,m,n,d,k){function l(){null!=E&&(E.style.fontWeight="normal",E.style.textDecoration="none",E=null)}function p(a,d,b,c,e,k,l){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";C.querySelector(".geTempDlgRadioBtn[data-id="+c+"]").className="geTempDlgRadioBtn "+(l?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");C.querySelector("."+d).src="/images/"+b+"-sel.svg";C.querySelector("."+e).src="/images/"+
k+".svg";return!0}function u(a){function d(a){aa.removeChild(c);C.removeChild(b);aa.scrollTop=k}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var b=document.createElement("div");b.className="geTempDlgDialogMask";C.appendChild(b);var c=document.createElement("div");c.className="geTempDlgDiagramPreviewBox";var e=document.createElement("img");e.src=a;c.appendChild(e);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
a.setAttribute("title",mxResources.get("close"));c.appendChild(a);var k=aa.scrollTop;mxEvent.addListener(a,"click",d);mxEvent.addListener(b,"click",d);aa.appendChild(c);aa.scrollTop=0;c.style.lineHeight=c.clientHeight+"px"}function t(a,d,b){if(null!=G){for(var c=G.className.split(" "),e=0;e<c.length;e++)if(-1<c[e].indexOf("Active")){c.splice(e,1);break}G.className=c.join(" ")}null!=a?(G=a,G.className+=" "+d,H=b,X.className="geTempDlgCreateBtn"):(H=G=null,X.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
function q(b){if(null!=H){var e=H;H=null;X.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";e.isExternal?(1==b?k(e.url,e,"nameInput.value"):d(e.url,e,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+e.url,mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()&&(c(d.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function v(a){a=a?"":"none";for(var d=A.querySelectorAll(".geTempDlgLinkToDiagram"),b=0;b<d.length;b++)d[b].style.display=
function q(b){if(null!=H){var e=H;H=null;X.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";e.isExternal?(1==b?k(e.url,e,"nameInput.value"):d(e.url,e,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+e.url,mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()&&(c(d.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function v(a){a=a?"":"none";for(var d=C.querySelectorAll(".geTempDlgLinkToDiagram"),b=0;b<d.length;b++)d[b].style.display=
a}function y(a,d,b){function c(){X.innerHTML=d?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));v(!d)}L.innerHTML="";t();M=a;var e=null;if(b){e=document.createElement("table");e.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),l=document.createElement("th");l.style.width="50%";l.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(l);l=document.createElement("th");l.style.width="25%";l.innerHTML=
mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));k.appendChild(l);l=document.createElement("th");l.style.width="25%";l.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));k.appendChild(l);e.appendChild(k);L.appendChild(e)}for(k=0;k<a.length;k++){a[k].isExternal=!d;var f=a[k].url,l=mxUtils.htmlEntities(a[k].title),p=a[k].tooltip||a[k].title,g=a[k].imgUrl,m=mxUtils.htmlEntities(a[k].changedBy||""),n=mxUtils.htmlEntities(a[k].lastModifiedOn||
"");g||(g=TEMPLATE_PATH+"/"+f.substring(0,f.length-4)+".png");f=b?50:15;null!=l&&l.length>f&&(l=l.substring(0,f)+"&hellip;");if(b){var z=document.createElement("tr"),g=document.createElement("td"),K=document.createElement("img");K.src="/images/icon-search.svg";K.className="geTempDlgDiagramListPreviewBtn";K.setAttribute("title",mxResources.get("preview"));g.appendChild(K);p=document.createElement("span");p.className="geTempDlgDiagramTitle";p.innerHTML=l;g.appendChild(p);z.appendChild(g);g=document.createElement("td");
g.innerHTML=m;z.appendChild(g);g=document.createElement("td");g.innerHTML=n;z.appendChild(g);e.appendChild(z);null==G&&(c(),t(z,"geTempDlgDiagramsListGridActive",a[k]));(function(a,d){mxEvent.addListener(z,"click",function(){G!=d&&(c(),t(d,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(z,"dblclick",q);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],z)}else{var C=document.createElement("div");C.className="geTempDlgDiagramTile";C.setAttribute("title",p);null==G&&(c(),t(C,"geTempDlgDiagramTileActive",
a[k]));m=document.createElement("div");m.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var A=document.createElement("img");A.style.display="none";(function(a,d){A.onload=function(){d.className="geTempDlgDiagramTileImg";a.style.display=""};A.onerror=function(){d.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(A,m);A.src=g;m.appendChild(A);C.appendChild(m);m=document.createElement("div");m.className="geTempDlgDiagramTileLbl";m.innerHTML=null!=l?l:"";C.appendChild(m);
K=document.createElement("img");K.src="/images/icon-search.svg";K.className="geTempDlgDiagramPreviewBtn";K.setAttribute("title",mxResources.get("preview"));C.appendChild(K);(function(a,d){mxEvent.addListener(C,"click",function(){G!=d&&(c(),t(d,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(C,"dblclick",q);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],C);L.appendChild(C)}}}function x(a,d){V.innerHTML="";t();for(var b=!d&&5<a.length?5:a.length,c=0;c<b;c++){var e=a[c];e.isCategory=!0;
g.innerHTML=m;z.appendChild(g);g=document.createElement("td");g.innerHTML=n;z.appendChild(g);e.appendChild(z);null==G&&(c(),t(z,"geTempDlgDiagramsListGridActive",a[k]));(function(a,d){mxEvent.addListener(z,"click",function(){G!=d&&(c(),t(d,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(z,"dblclick",q);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],z)}else{var B=document.createElement("div");B.className="geTempDlgDiagramTile";B.setAttribute("title",p);null==G&&(c(),t(B,"geTempDlgDiagramTileActive",
a[k]));m=document.createElement("div");m.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var x=document.createElement("img");x.style.display="none";(function(a,d){x.onload=function(){d.className="geTempDlgDiagramTileImg";a.style.display=""};x.onerror=function(){d.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(x,m);x.src=g;m.appendChild(x);B.appendChild(m);m=document.createElement("div");m.className="geTempDlgDiagramTileLbl";m.innerHTML=null!=l?l:"";B.appendChild(m);
K=document.createElement("img");K.src="/images/icon-search.svg";K.className="geTempDlgDiagramPreviewBtn";K.setAttribute("title",mxResources.get("preview"));B.appendChild(K);(function(a,d){mxEvent.addListener(B,"click",function(){G!=d&&(c(),t(d,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(B,"dblclick",q);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],B);L.appendChild(B)}}}function x(a,d){V.innerHTML="";t();for(var b=!d&&5<a.length?5:a.length,c=0;c<b;c++){var e=a[c];e.isCategory=!0;
var k=document.createElement("div"),l=mxResources.get(e.title);null==l&&(l=e.title.substring(0,1).toUpperCase()+e.title.substring(1));k.className="geTempDlgNewDiagramCatItem";k.setAttribute("title",l);l=mxUtils.htmlEntities(l);15<l.length&&(l=l.substring(0,15)+"&hellip;");null==G&&(X.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),t(k,"geTempDlgNewDiagramCatItemActive",e));var f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemImg";var p=document.createElement("img");
p.src=NEW_DIAGRAM_CATS_PATH+"/"+e.img;f.appendChild(p);k.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=l;k.appendChild(f);V.appendChild(k);(function(a,d){mxEvent.addListener(k,"click",function(){G!=d&&(X.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),t(d,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",q)})(e,k)}U.style.display=5>a.length?"none":""}function B(a){var d=A.querySelector(".geTemplatesList"),
p.src=NEW_DIAGRAM_CATS_PATH+"/"+e.img;f.appendChild(p);k.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=l;k.appendChild(f);V.appendChild(k);(function(a,d){mxEvent.addListener(k,"click",function(){G!=d&&(X.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),t(d,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",q)})(e,k)}U.style.display=5>a.length?"none":""}function A(a){var d=C.querySelector(".geTemplatesList"),
b;for(b in a){var c=document.createElement("div"),e=mxResources.get(b),k=a[b];null==e&&(e=b.substring(0,1).toUpperCase()+b.substring(1));c.className="geTemplateCatLink";c.setAttribute("title",e+" ("+k.length+")");e=mxUtils.htmlEntities(e);15<e.length&&(e=e.substring(0,15)+"&hellip;");c.innerHTML=e+" ("+k.length+")";d.appendChild(c);(function(d,b,e){mxEvent.addListener(c,"click",function(){E!=e&&(null!=E?(E.style.fontWeight="normal",E.style.textDecoration="none"):(Y.style.display="none",ga.style.minHeight=
"100%"),E=e,E.style.fontWeight="bold",E.style.textDecoration="underline",aa.scrollTop=0,D&&(F=!0),T.innerHTML=b,Z.style.display="none",y(a[d],!0))})})(b,e,c)}}function z(a){m&&(aa.scrollTop=0,L.innerHTML="",fa.spin(L),F=!1,D=!0,T.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,m(ca,a?null:f))}function C(a){l();aa.scrollTop=0;L.innerHTML="";fa.spin(L);F=!1;D=!0;S=null;T.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
' "'+mxUtils.htmlEntities(a)+'"';n(a,ca,I?null:f);N=a}b=null!=b?b:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var A=this.container,D=!1,F=!1,E=null,G=null,H=null,J=!1,I=!0,K=!1,M=[],N,U=A.querySelector(".geTempDlgShowAllBtn"),L=A.querySelector(".geTempDlgDiagramsTiles"),T=A.querySelector(".geTempDlgDiagramsListTitle"),Z=A.querySelector(".geTempDlgDiagramsListBtns"),aa=A.querySelector(".geTempDlgContent"),ga=A.querySelector(".geTempDlgDiagramsList"),Y=A.querySelector(".geTempDlgNewDiagramCat"),
V=A.querySelector(".geTempDlgNewDiagramCatList"),X=A.querySelector(".geTempDlgCreateBtn"),fa=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(A.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){l();Y.style.display="";ga.style.minHeight="calc(100% - 280px)";z(I)});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){p(this,"geTempDlgAllDiagramsBtnImg",
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(I=!0,null==N?z(I):C(N))});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){p(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(I=!1,null==N?z(I):C(N))});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){p(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
"tiles",!1)&&(K=!0,y(M,!1,K))});mxEvent.addListener(A.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){p(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,y(M,!1,K))});mxEvent.addListener(U,"click",function(){J?(Y.style.height="280px",V.style.height="190px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),x(R)):(Y.style.height="440px",V.style.height="355px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
"100%"),E=e,E.style.fontWeight="bold",E.style.textDecoration="underline",aa.scrollTop=0,D&&(F=!0),T.innerHTML=b,Z.style.display="none",y(a[d],!0))})})(b,e,c)}}function z(a){m&&(aa.scrollTop=0,L.innerHTML="",fa.spin(L),F=!1,D=!0,T.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,m(ca,a?null:f))}function B(a){l();aa.scrollTop=0;L.innerHTML="";fa.spin(L);F=!1;D=!0;S=null;T.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
' "'+mxUtils.htmlEntities(a)+'"';n(a,ca,I?null:f);N=a}b=null!=b?b:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var C=this.container,D=!1,F=!1,E=null,G=null,H=null,J=!1,I=!0,K=!1,M=[],N,U=C.querySelector(".geTempDlgShowAllBtn"),L=C.querySelector(".geTempDlgDiagramsTiles"),T=C.querySelector(".geTempDlgDiagramsListTitle"),Z=C.querySelector(".geTempDlgDiagramsListBtns"),aa=C.querySelector(".geTempDlgContent"),ga=C.querySelector(".geTempDlgDiagramsList"),Y=C.querySelector(".geTempDlgNewDiagramCat"),
V=C.querySelector(".geTempDlgNewDiagramCatList"),X=C.querySelector(".geTempDlgCreateBtn"),fa=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(C.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){l();Y.style.display="";ga.style.minHeight="calc(100% - 280px)";z(I)});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){p(this,"geTempDlgAllDiagramsBtnImg",
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(I=!0,null==N?z(I):B(N))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){p(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(I=!1,null==N?z(I):B(N))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){p(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
"tiles",!1)&&(K=!0,y(M,!1,K))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){p(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,y(M,!1,K))});mxEvent.addListener(U,"click",function(){J?(Y.style.height="280px",V.style.height="190px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),x(R)):(Y.style.height="440px",V.style.height="355px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
null,"- Show less")),x(R,!0));J=!J});var da=!1,O=!1,W={},R=[],P=1;mxUtils.get(b,function(a){if(!da){da=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var d=a.getAttribute("url");if(null!=d){var b=d.indexOf("/"),d=d.substring(0,b),b=W[d];null==b&&(P++,b=[],W[d]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=
a.nextSibling}B(W)}});mxUtils.get(g,function(a){if(!O){O=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&R.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;x(R)}});var ca=function(a,d){Z.style.display="";fa.stop();D=!1;F?F=!1:d?L.innerHTML=d:0==a.length?L.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
y(a,!1,K)};z(I);var S=null;n&&mxEvent.addListener(A.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var d=this;null!=S&&clearTimeout(S);13==a.keyCode?C(d.value):S=setTimeout(function(){C(d.value)},500)});mxEvent.addListener(X,"click",q);mxEvent.addListener(A.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){q(!0)});mxEvent.addListener(A.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=e&&e();a.hideDialog(!0)})};
a.nextSibling}A(W)}});mxUtils.get(g,function(a){if(!O){O=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&R.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;x(R)}});var ca=function(a,d){Z.style.display="";fa.stop();D=!1;F?F=!1:d?L.innerHTML=d:0==a.length?L.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
y(a,!1,K)};z(I);var S=null;n&&mxEvent.addListener(C.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var d=this;null!=S&&clearTimeout(S);13==a.keyCode?B(d.value):S=setTimeout(function(){B(d.value)},500)});mxEvent.addListener(X,"click",q);mxEvent.addListener(C.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){q(!0)});mxEvent.addListener(C.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=e&&e();a.hideDialog(!0)})};
var BtnDialog=function(a,c,e,b){var g=document.createElement("div");g.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding="0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("done"));var m="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";c==a.drive?(m=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
(m=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(m=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(m=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(m=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg"):c==a.trello&&(m=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[m],"You are now authorized in {1}"));
e=mxUtils.button(e,b);e.insertBefore(n,e.firstChild);e.style.marginTop="6px";e.className="geBigButton";e.style.fontSize="18px";e.style.padding="14px";g.appendChild(f);g.appendChild(a);g.appendChild(e);this.container=g},FontDialog=function(a,c,e,b,g){function f(a){this.style.border="";13==a.keyCode&&B.click()}var m,n,d,k=document.createElement("table"),l=document.createElement("tbody");k.style.marginTop="8px";m=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace=
e=mxUtils.button(e,b);e.insertBefore(n,e.firstChild);e.style.marginTop="6px";e.className="geBigButton";e.style.fontSize="18px";e.style.padding="14px";g.appendChild(f);g.appendChild(a);g.appendChild(e);this.container=g},FontDialog=function(a,c,e,b,g){function f(a){this.style.border="";13==a.keyCode&&A.click()}var m,n,d,k=document.createElement("table"),l=document.createElement("tbody");k.style.marginTop="8px";m=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace=
"nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","sysfonts");p.setAttribute("type","radio");p.setAttribute("name","current-fontdialog");p.setAttribute("id","fontdialog-sysfonts");n.appendChild(p);d=document.createElement("label");d.setAttribute("for","fontdialog-sysfonts");mxUtils.write(d,mxResources.get("sysFonts",null,"System Fonts"));n.appendChild(d);m.appendChild(n);l.appendChild(m);
m=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");m.appendChild(n);var u=document.createElement("input");"s"==b&&u.setAttribute("value",c);u.style.marginLeft="4px";u.style.width="250px";u.className="dlg_fontName_s";n=document.createElement("td");n.appendChild(u);m.appendChild(n);l.appendChild(m);m=document.createElement("tr");
n=document.createElement("td");n.colSpan=2;n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","googlefonts");t.setAttribute("type","radio");t.setAttribute("name","current-fontdialog");t.setAttribute("id","fontdialog-googlefonts");n.appendChild(t);d=document.createElement("label");d.setAttribute("for","fontdialog-googlefonts");mxUtils.write(d,mxResources.get("googleFonts",
@ -9835,9 +9835,9 @@ m.appendChild(n);var q=document.createElement("input");"g"==b&&q.setAttribute("v
"webfonts");v.setAttribute("type","radio");v.setAttribute("name","current-fontdialog");v.setAttribute("id","fontdialog-webfonts");n.appendChild(v);d=document.createElement("label");d.setAttribute("for","fontdialog-webfonts");mxUtils.write(d,mxResources.get("webfonts",null,"Web Fonts"));n.appendChild(d);m.appendChild(n);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";
mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");m.appendChild(n);var y=document.createElement("input");"w"==b&&y.setAttribute("value",c);y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontName_w";n=document.createElement("td");n.appendChild(y);m.appendChild(n);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontUrl",
null,"Font URL")+":");m.appendChild(n);var x=document.createElement("input");x.setAttribute("value",e||"");x.style.marginLeft="4px";x.style.width="250px";x.className="dlg_fontUrl";n=document.createElement("td");n.appendChild(x);m.appendChild(n);l.appendChild(m);this.init=function(){var a=u;"g"==b?a=q:"w"==b&&(a=y);a.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?a.select():document.execCommand("selectAll",!1,null)};m=document.createElement("tr");n=document.createElement("td");
n.colSpan=2;n.style.paddingTop="20px";n.style.whiteSpace="nowrap";n.setAttribute("align","right");a.isOffline()||(c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}),c.className="geBtn",n.appendChild(c));c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();g()});c.className="geBtn";a.editor.cancelFirst&&n.appendChild(c);var B=mxUtils.button(mxResources.get("apply"),function(){var d,b,c;p.checked?(d=u.value,c="s"):t.checked?
(d=q.value,b=Editor.GOOGLE_FONTS+encodeURIComponent(d).replace(/%20/g,"+"),c="g"):v.checked&&(d=y.value,b=x.value,c="w");var e;e=b;var l=c,f=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null==d||0==d.length?(k.querySelector(".dlg_fontName_"+l).style.border="1px solid red",e=!1):"w"!=l||f.test(e)?e=!0:(k.querySelector(".dlg_fontUrl").style.border="1px solid red",e=!1);e&&(g(d,b,c),a.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",
f);mxEvent.addListener(q,"keypress",f);mxEvent.addListener(y,"keypress",f);mxEvent.addListener(x,"keypress",f);mxEvent.addListener(u,"focus",function(){p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(q,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(y,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});mxEvent.addListener(x,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});n.appendChild(B);a.editor.cancelFirst||
n.colSpan=2;n.style.paddingTop="20px";n.style.whiteSpace="nowrap";n.setAttribute("align","right");a.isOffline()||(c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}),c.className="geBtn",n.appendChild(c));c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();g()});c.className="geBtn";a.editor.cancelFirst&&n.appendChild(c);var A=mxUtils.button(mxResources.get("apply"),function(){var d,b,c;p.checked?(d=u.value,c="s"):t.checked?
(d=q.value,b=Editor.GOOGLE_FONTS+encodeURIComponent(d).replace(/%20/g,"+"),c="g"):v.checked&&(d=y.value,b=x.value,c="w");var e;e=b;var l=c,f=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null==d||0==d.length?(k.querySelector(".dlg_fontName_"+l).style.border="1px solid red",e=!1):"w"!=l||f.test(e)?e=!0:(k.querySelector(".dlg_fontUrl").style.border="1px solid red",e=!1);e&&(g(d,b,c),a.hideDialog())});A.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",
f);mxEvent.addListener(q,"keypress",f);mxEvent.addListener(y,"keypress",f);mxEvent.addListener(x,"keypress",f);mxEvent.addListener(u,"focus",function(){p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(q,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(y,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});mxEvent.addListener(x,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});n.appendChild(A);a.editor.cancelFirst||
n.appendChild(c);m.appendChild(n);l.appendChild(m);k.appendChild(l);this.container=k};
function AspectDialog(a,c,e,b,g){this.aspect={pageId:c||a.pages[0].getId(),layerIds:e||[]};c=document.createElement("div");var f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("pages"));c.appendChild(f);e=document.createElement("div");e.className="geAspectDlgList";c.appendChild(e);f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("layers"));c.appendChild(f);f=document.createElement("div");f.className="geAspectDlgList";
c.appendChild(f);this.pagesContainer=e;this.layersContainer=f;this.ui=a;e=document.createElement("div");e.style.marginTop="16px";e.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});f.className="geBtn";a.editor.cancelFirst&&e.appendChild(f);var m=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();b({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));e.appendChild(m);m.className="geBtn gePrimaryBtn";
@ -9958,8 +9958,8 @@ function(a){c--;b+="@import url("+d+");";e()}))):b+=this.cachedGoogleFonts[d]:b+
if(null!=d){var b=a.getElementsByTagName("defs"),c=a.ownerDocument;0==b.length?(b=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"defs"):c.createElement("defs"),null!=a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)):b=b[0];c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,d);b.appendChild(c)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||
this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(a,d,b){var c=mxClient.IS_FF?8192:16384;return Math.min(b,Math.min(c/a,c/d))};Editor.prototype.exportToCanvas=function(a,d,b,c,e,k,l,f,p,g,u,t,q,m,n,z){try{k=null!=k?k:!0;l=null!=l?l:!0;t=null!=t?t:this.graph;q=null!=q?q:0;var v=p?null:t.background;v==mxConstants.NONE&&(v=null);null==v&&(v=c);null==v&&0==p&&(v=z?this.graph.defaultPageBackgroundColor:"#ffffff");this.convertImages(t.getSvg(null,null,q,m,null,l,null,null,null,g,null,
z),mxUtils.bind(this,function(b){try{var c=new Image;c.onload=mxUtils.bind(this,function(){try{var l=function(){mxClient.IS_SF?window.setTimeout(function(){m.drawImage(c,0,0);a(p)},0):(m.drawImage(c,0,0),a(p))},p=document.createElement("canvas"),g=parseInt(b.getAttribute("width")),u=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=d&&(f=k?Math.min(1,Math.min(3*d/(4*u),d/g)):d/g);f=this.getMaxCanvasScale(g,u,f);g=Math.ceil(f*g);u=Math.ceil(f*u);p.setAttribute("width",g);p.setAttribute("height",
u);var m=p.getContext("2d");null!=v&&(m.beginPath(),m.rect(0,0,g,u),m.fillStyle=v,m.fill());1!=f&&m.scale(f,f);if(n){var z=t.view,C=z.scale;z.scale=1;var A=btoa(unescape(encodeURIComponent(z.createSvgGrid(z.gridColor))));z.scale=C;var A="data:image/svg+xml;base64,"+A,x=t.gridSize*z.gridSteps*f,y=t.getGraphBounds(),D=z.translate.x*C,K=z.translate.y*C,M=D+(y.x-D)/C-q,B=K+(y.y-K)/C-q,I=new Image;I.onload=function(){try{for(var a=-Math.round(x-mxUtils.mod((D-M)*f,x)),d=-Math.round(x-mxUtils.mod((K-B)*
f,x));a<g;a+=x)for(var b=d;b<u;b+=x)m.drawImage(I,a/f,b/f);l()}catch(ta){null!=e&&e(ta)}};I.onerror=function(a){null!=e&&e(a)};I.src=A}else l()}catch(oa){null!=e&&e(oa)}});c.onerror=function(a){null!=e&&e(a)};g&&this.graph.addSvgShadow(b);this.graph.mathEnabled&&this.addMathCss(b);var l=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(b,this.resolvedFontCss),c.src=Editor.createSvgDataUri(mxUtils.getXml(b))}catch(ba){null!=e&&e(ba)}});this.embedExtFonts(mxUtils.bind(this,
u);var m=p.getContext("2d");null!=v&&(m.beginPath(),m.rect(0,0,g,u),m.fillStyle=v,m.fill());1!=f&&m.scale(f,f);if(n){var z=t.view,B=z.scale;z.scale=1;var x=btoa(unescape(encodeURIComponent(z.createSvgGrid(z.gridColor))));z.scale=B;var x="data:image/svg+xml;base64,"+x,C=t.gridSize*z.gridSteps*f,y=t.getGraphBounds(),D=z.translate.x*B,K=z.translate.y*B,M=D+(y.x-D)/B-q,A=K+(y.y-K)/B-q,I=new Image;I.onload=function(){try{for(var a=-Math.round(C-mxUtils.mod((D-M)*f,C)),d=-Math.round(C-mxUtils.mod((K-A)*
f,C));a<g;a+=C)for(var b=d;b<u;b+=C)m.drawImage(I,a/f,b/f);l()}catch(ta){null!=e&&e(ta)}};I.onerror=function(a){null!=e&&e(a)};I.src=x}else l()}catch(oa){null!=e&&e(oa)}});c.onerror=function(a){null!=e&&e(a)};g&&this.graph.addSvgShadow(b);this.graph.mathEnabled&&this.addMathCss(b);var l=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(b,this.resolvedFontCss),c.src=Editor.createSvgDataUri(mxUtils.getXml(b))}catch(ba){null!=e&&e(ba)}});this.embedExtFonts(mxUtils.bind(this,
function(a){try{null!=a&&this.addFontCss(b,a),this.loadFonts(l)}catch(ha){null!=e&&e(ha)}}))}catch(ba){null!=e&&e(ba)}}),b,u)}catch(P){null!=e&&e(P)}};Editor.crcTable=[];for(var g=0;256>g;g++)for(var f=g,m=0;8>m;m++)f=1==(f&1)?3988292384^f>>>1:f>>>1,Editor.crcTable[g]=f;Editor.updateCRC=function(a,d,b,c){for(var e=0;e<c;e++)a=Editor.crcTable[(a^d.charCodeAt(b+e))&255]^a>>>8;return a};Editor.crc32=function(a){for(var d=-1,b=0;b<a.length;b++)d=d>>>8^Editor.crcTable[(d^a.charCodeAt(b))&255];return(d^
-1)>>>0};Editor.writeGraphModelToPng=function(a,d,b,c,e){function k(a,d){var b=p;p+=d;return a.substring(b,p)}function l(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(k(a,4),"IHDR"!=k(a,4))null!=
e&&e();else{k(a,17);e=a.substring(0,p);do{var g=l(a);if("IDAT"==k(a,4)){e=a.substring(0,p-8);"pHYs"==d&&"dpi"==b?(b=Math.round(c/.0254),b=f(b)+f(b)+String.fromCharCode(1)):b=b+String.fromCharCode(0)+("zTXt"==d?String.fromCharCode(0):"")+c;c=4294967295;c=Editor.updateCRC(c,d,0,4);c=Editor.updateCRC(c,b,0,b.length);e+=f(b.length)+d+b+f(c^4294967295);e+=a.substring(p-8,a.length);break}e+=a.substring(p-8,p-4+g);k(a,g);k(a,4)}while(g);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,
@ -9968,7 +9968,7 @@ function(a,d){var b=null;null!=a.editor.graph.getModel().getParent(d)?b=d.getId(
this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile();return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var p=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=p.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var d=this.editorUi,b=d.editor.graph,c=this.createOption(mxResources.get("shadow"),
function(){return b.shadowVisible},function(a){var c=new ChangePageSetup(d);c.ignoreColor=!0;c.ignoreImage=!0;c.shadowVisible=a;b.model.execute(c)},{install:function(a){this.listener=function(){a(b.shadowVisible)};d.addListener("shadowVisibleChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});Editor.shadowOptionEnabled||(c.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(c,60));a.appendChild(c)}return a};var u=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=u.apply(this,arguments);var d=this.editorUi,b=d.editor.graph;if(b.isEnabled()){var c=d.getCurrentFile();if(null!=c&&c.isAutosaveOptional()){var e=this.createOption(mxResources.get("autosave"),function(){return d.editor.autosave},function(a){d.editor.setAutosave(a);d.editor.autosave&&c.isModified()&&c.fileChanged()},{install:function(a){this.listener=function(){a(d.editor.autosave)};d.editor.addListener("autosaveChanged",this.listener)},destroy:function(){d.editor.removeListener(this.listener)}});
a.appendChild(e)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){e=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){d.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};d.addListener("mathEnabledChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});e.style.paddingTop="5px";a.appendChild(e);var k=d.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");
a.appendChild(e)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){e=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){d.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};d.addListener("mathEnabledChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});e.style.paddingTop="5px";a.appendChild(e);var k=d.menus.createHelpLink("https://www.diagrams.net/doc/faq/math-typesetting");
k.style.position="relative";k.style.marginLeft="6px";k.style.top="2px";e.appendChild(k)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},
@ -10001,15 +10001,15 @@ function e(d,b,c){var e=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(d,!0);b.styl
function(k){this.editorUi.pickColor(d,function(d){e.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(e);return btn}function l(a,d,b,e,k,l,f){null!=d&&(d=d.split(","),q.push({name:a,values:d,type:b,defVal:e,countProperty:k,parentRow:l,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(u,function(d){for(var p=l,u=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==
a)p=p.nextSibling,u++;else break;var t={type:b,parentRow:l,index:u,isDeletable:!0,defVal:e,countProperty:k},u=g(a,"",t,0==u%2,f);c(a,e,t);p.parentNode.insertBefore(u,p.nextSibling);mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,d,b,c,e,k,l){if(0<e){var f=Array(e);d=null!=d?d.split(","):[];for(var p=0;p<e;p++)f[p]=null!=d[p]?d[p]:null!=c?c:"";q.push({name:a,values:f,type:b,defVal:c,parentRow:k,flipBkg:l,size:e})}return document.createElement("div")}
function p(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function g(d,b,g,t,q){var m=g.dispName,n=g.type,z=document.createElement("tr");z.className="gePropRow"+(q?"Dark":"")+(t?"Alt":"")+" gePropNonHeaderRow";z.setAttribute("data-pName",d);z.setAttribute("data-pValue",b);t=!1;null!=g.index&&(z.setAttribute("data-index",g.index),m=(null!=m?m:"")+"["+g.index+"]",t=!0);var v=document.createElement("td");
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(m,null,m));t&&(v.style.textAlign="right");z.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==n)v.appendChild(k(d,b,g));else if("bool"==n||"boolean"==n)v.appendChild(p(d,b,g));else if("enum"==n){var C=g.enumList;for(q=0;q<C.length;q++)if(m=C[q],m.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(m.dispName,null,m.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(u,function(){var k=
document.createElement("select");e(v,k);for(var l=0;l<C.length;l++){var f=C[l],p=document.createElement("option");p.value=mxUtils.htmlEntities(f.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(p)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);c(d,a,g)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==n?v.appendChild(l(d,b,g.subType,g.subDefVal,g.countProperty,
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(m,null,m));t&&(v.style.textAlign="right");z.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==n)v.appendChild(k(d,b,g));else if("bool"==n||"boolean"==n)v.appendChild(p(d,b,g));else if("enum"==n){var B=g.enumList;for(q=0;q<B.length;q++)if(m=B[q],m.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(m.dispName,null,m.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(u,function(){var k=
document.createElement("select");e(v,k);for(var l=0;l<B.length;l++){var f=B[l],p=document.createElement("option");p.value=mxUtils.htmlEntities(f.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(p)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);c(d,a,g)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==n?v.appendChild(l(d,b,g.subType,g.subDefVal,g.countProperty,
z,q)):"staticArr"==n?v.appendChild(f(d,b,g.subType,g.subDefVal,g.size,z,q)):(v.innerHTML=b,mxEvent.addListener(v,"click",mxUtils.bind(u,function(){function k(){var a=l.value,a=0==a.length&&"string"!=n?0:a;g.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",n="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=g.min&&a<g.min?a=g.min:null!=g.max&&a>g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==n?parseInt(a):a)+"");c(d,a,g)}var l=document.createElement("input");e(v,l,!0);l.value=b;l.className=
"gePropEditor";"int"!=n&&"float"!=n||g.allowAuto||(l.type="number",l.step="int"==n?"1":"any",null!=g.min&&(l.min=parseFloat(g.min)),null!=g.max&&(l.max=parseFloat(g.max)));a.appendChild(l);mxEvent.addListener(l,"keypress",function(a){13==a.keyCode&&k()});l.focus();mxEvent.addListener(l,"blur",function(){k()})})));g.isDeletable&&(q=mxUtils.button("-",mxUtils.bind(u,function(a){c(d,"",g,g.index);mxEvent.consume(a)})),q.style.height="16px",q.style.width="25px",q.style["float"]="right",q.className="geColorBtn",
v.appendChild(q));z.appendChild(v);return z}var u=this,t=this.editorUi.editor.graph,q=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.className="geProperties";m.style.whiteSpace="nowrap";m.style.width="100%";var n=document.createElement("tr");n.className="gePropHeader";var z=document.createElement("th");z.className="gePropHeaderCell";var v=document.createElement("img");v.src=Sidebar.prototype.expandedImage;z.appendChild(v);mxUtils.write(z,mxResources.get("property"));
n.style.cursor="pointer";var C=function(){var d=m.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(la){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(n,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;
C()});n.appendChild(z);z=document.createElement("th");z.className="gePropHeaderCell";z.innerHTML=mxResources.get("value");n.appendChild(z);m.appendChild(n);var A=!1,x=!1,y;for(y in d)if(n=d[y],"function"!=typeof n.isVisible||n.isVisible(b,this)){var D=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=n.getDefaultValue?n.getDefaultValue(b,this):n.defVal;if("separator"==n.type)x=!x;else{if("staticArr"==n.type)n.size=parseInt(b.style[n.sizeProperty]||d[n.sizeProperty].defVal)||0;else if(null!=
n.dependentProps){for(var K=n.dependentProps,B=[],I=[],z=0;z<K.length;z++){var F=b.style[K[z]];I.push(d[K[z]].subDefVal);B.push(null!=F?F.split(","):[])}n.dependentPropsDefVal=I;n.dependentPropsVals=B}m.appendChild(g(y,D,n,A,x));A=!A}}for(z=0;z<q.length;z++)for(n=q[z],d=n.parentRow,b=0;b<n.values.length;b++)y=g(n.name,n.values[b],{type:n.type,parentRow:n.parentRow,isDeletable:n.isDeletable,index:b,defVal:n.defVal,countProperty:n.countProperty,size:n.size},0==b%2,n.flipBkg),d.parentNode.insertBefore(y,
d.nextSibling),d=y;a.appendChild(m);C();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var b=this.editorUi,c=b.editor.graph,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.paddingLeft="24px";e.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(e);
n.style.cursor="pointer";var B=function(){var d=m.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(la){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(n,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;
B()});n.appendChild(z);z=document.createElement("th");z.className="gePropHeaderCell";z.innerHTML=mxResources.get("value");n.appendChild(z);m.appendChild(n);var x=!1,C=!1,y;for(y in d)if(n=d[y],"function"!=typeof n.isVisible||n.isVisible(b,this)){var D=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=n.getDefaultValue?n.getDefaultValue(b,this):n.defVal;if("separator"==n.type)C=!C;else{if("staticArr"==n.type)n.size=parseInt(b.style[n.sizeProperty]||d[n.sizeProperty].defVal)||0;else if(null!=
n.dependentProps){for(var K=n.dependentProps,A=[],I=[],z=0;z<K.length;z++){var F=b.style[K[z]];I.push(d[K[z]].subDefVal);A.push(null!=F?F.split(","):[])}n.dependentPropsDefVal=I;n.dependentPropsVals=A}m.appendChild(g(y,D,n,x,C));x=!x}}for(z=0;z<q.length;z++)for(n=q[z],d=n.parentRow,b=0;b<n.values.length;b++)y=g(n.name,n.values[b],{type:n.type,parentRow:n.parentRow,isDeletable:n.isDeletable,index:b,defVal:n.defVal,countProperty:n.countProperty,size:n.size},0==b%2,n.flipBkg),d.parentNode.insertBefore(y,
d.nextSibling),d=y;a.appendChild(m);B();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var b=this.editorUi,c=b.editor.graph,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.paddingLeft="24px";e.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(e);
var k="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" "),l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.position="relative";l.style.textAlign="center";for(var f=[],p=0;p<this.defaultColorSchemes.length;p++){var g=document.createElement("div");g.style.display="inline-block";g.style.width="6px";g.style.height="6px";g.style.marginLeft="4px";g.style.marginRight=
"3px";g.style.borderRadius="3px";g.style.cursor="pointer";g.style.background="transparent";g.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(a){mxEvent.addListener(g,"click",mxUtils.bind(this,function(){u(a)}))})(p);f.push(g);l.appendChild(g)}var u=mxUtils.bind(this,function(a){null!=this.format.currentScheme&&(f[this.format.currentScheme].style.background="transparent");this.format.currentScheme=a;t(this.defaultColorSchemes[this.format.currentScheme]);f[this.format.currentScheme].style.background=
"#84d7ff"}),t=mxUtils.bind(this,function(a){var d=mxUtils.bind(this,function(a){var d=mxUtils.button("",function(d){c.getModel().beginUpdate();try{for(var e=c.getSelectionCells(),l=0;l<e.length;l++){for(var f=c.getModel().getStyle(e[l]),p=0;p<k.length;p++)f=mxUtils.removeStylename(f,k[p]);var g=c.getModel().isVertex(e[l])?b.initialDefaultVertexStyle:b.initialdefaultEdgeStyle;null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(g,mxConstants.STYLE_GRADIENTCOLOR,
@ -10032,12 +10032,12 @@ d.altKey=a.altKey,d.shiftKey=a.shiftKey,d.metaKey=a.metaKey,d.button=a.button,d.
d?this.getPointForEvent(d):b.apply(this,arguments)};var c=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var d=this.graph.getCellStyle(a);if(null!=d){if("rack"==d.childLayout){var b=new mxStackLayout(this.graph,!1);b.gridSize=null!=d.rackUnitSize?parseFloat(d.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;b.marginLeft=d.marginLeft||0;b.marginRight=d.marginRight||0;b.marginTop=d.marginTop||0;b.marginBottom=d.marginBottom||0;b.allowGaps=d.allowGaps||
0;b.horizontal="1"==mxUtils.getValue(d,"horizontalRack","0");b.resizeParent=!1;b.fill=!0;return b}if("undefined"!==typeof mxTableLayout&&"tableLayout"==d.childLayout)return b=new mxTableLayout(this.graph),b.rows=d.tableRows||2,b.columns=d.tableColumns||2,b.colPercentages=d.colPercentages,b.rowPercentages=d.rowPercentages,b.equalColumns="1"==mxUtils.getValue(d,"equalColumns",b.colPercentages?"0":"1"),b.equalRows="1"==mxUtils.getValue(d,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(d,
"resizeParent","1"),b.border=d.tableBorder||b.border,b.marginLeft=d.marginLeft||0,b.marginRight=d.marginRight||0,b.marginTop=d.marginTop||0,b.marginBottom=d.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(d,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(d,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=d.colWidths||"100",b.rowHeights=d.rowHeights||"50",b}return c.apply(this,arguments)};this.updateGlobalUrlVariables()};var y=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=
function(a){return Graph.processFontStyle(y.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(a,d,b,c,e,k,l,f,p,g,u){x.apply(this,arguments);Graph.processFontAttributes(u)};var B=mxText.prototype.redraw;mxText.prototype.redraw=function(){B.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.getCustomFonts=function(){var a=this.extFonts,a=null!=a?a.slice():[],d;
function(a){return Graph.processFontStyle(y.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(a,d,b,c,e,k,l,f,p,g,u){x.apply(this,arguments);Graph.processFontAttributes(u)};var A=mxText.prototype.redraw;mxText.prototype.redraw=function(){A.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.getCustomFonts=function(){var a=this.extFonts,a=null!=a?a.slice():[],d;
for(d in Graph.customFontElements){var b=Graph.customFontElements[d];a.push({name:b.name,url:b.url})}return a};Graph.prototype.setFont=function(a,d){Graph.addFont(a,d);document.execCommand("fontname",!1,a);if(null!=d){var b=this.cellEditor.textarea.getElementsByTagName("font");d=Graph.getFontUrl(a,d);for(var c=0;c<b.length;c++)b[c].getAttribute("face")==a&&b[c].getAttribute("data-font-src")!=d&&b[c].setAttribute("data-font-src",d)}};var z=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=
function(){return z.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=a)for(var d in a)this.globalVars[d]=a[d]}catch(N){null!=window.console&&console.log("Error in vars URL parameter: "+N)}};Graph.prototype.getExportVariables=function(){return null!=
this.globalVars?mxUtils.clone(this.globalVars):{}};var C=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=C.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,k,l,f,p,g,u,t){var q=null;t||null==this.themes||"darkTheme"!=this.defaultThemeName||(q=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var m=A.apply(this,arguments),n=this.getCustomFonts();if(u&&0<n.length){var z=m.ownerDocument,v=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"style"):z.createElement("style");null!=z.setAttributeNS?v.setAttributeNS("type","text/css"):v.setAttribute("type",
"text/css");for(var C="",x="",y=0;y<n.length;y++){var D=n[y].name,B=n[y].url;Graph.isCssFontUrl(B)?C+="@import url("+B+");\n":x+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+B+'");\n}\n'}v.appendChild(z.createTextNode(C+x));m.getElementsByTagName("defs")[0].appendChild(v)}null!=q&&(this.stylesheet=q,this.refresh());return m};var D=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=D.apply(this,arguments);if(this.mathEnabled){var d=a.drawText;a.drawText=
this.globalVars?mxUtils.clone(this.globalVars):{}};var B=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=B.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
var C=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,k,l,f,p,g,u,t){var q=null;t||null==this.themes||"darkTheme"!=this.defaultThemeName||(q=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var m=C.apply(this,arguments),n=this.getCustomFonts();if(u&&0<n.length){var z=m.ownerDocument,v=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"style"):z.createElement("style");null!=z.setAttributeNS?v.setAttributeNS("type","text/css"):v.setAttribute("type",
"text/css");for(var B="",x="",y=0;y<n.length;y++){var D=n[y].name,A=n[y].url;Graph.isCssFontUrl(A)?B+="@import url("+A+");\n":x+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+A+'");\n}\n'}v.appendChild(z.createTextNode(B+x));m.getElementsByTagName("defs")[0].appendChild(v)}null!=q&&(this.stylesheet=q,this.refresh());return m};var D=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=D.apply(this,arguments);if(this.mathEnabled){var d=a.drawText;a.drawText=
function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&(mxUtils.isNode(a.text.value)||a.text.dialect==mxConstants.DIALECT_STRICTHTML)){var c=a.text.getContentNode();if(null!=c){c=c.cloneNode(!0);if(c.getElementsByTagNameNS)for(var e=c.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<e.length;)e[0].parentNode.removeChild(e[0]);null!=c.innerHTML&&(e=a.text.value,a.text.value=c.innerHTML,d.apply(this,arguments),a.text.value=e)}}else d.apply(this,arguments)}}return a};
var F=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){F.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==
this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};var E=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){E.apply(this,arguments);
@ -10066,30 +10066,30 @@ mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.x
[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var d=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?d="mxgraph.er":"sysML"==a.substring(0,5)&&(d="mxgraph.sysml"));return d};var G=mxMarker.createMarker;mxMarker.createMarker=function(a,d,b,c,e,k,l,f,p,g){if(null!=b&&null==mxMarker.markers[b]){var u=this.getPackageForType(b);null!=u&&mxStencilRegistry.getStencil(u)}return G.apply(this,arguments)};PrintDialog.prototype.create=function(a,d){function b(){m.value=Math.max(1,
Math.min(f,Math.max(parseInt(m.value),parseInt(q.value))));q.value=Math.max(1,Math.min(f,Math.min(parseInt(m.value),parseInt(q.value))))}function c(d){function b(d,b,k){var l=d.useCssTransforms,f=d.currentTranslate,g=d.currentScale,p=d.view.translate,u=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var t=d.getGraphBounds(),q=0,m=0,n=K.get(),z=1/d.pageScale,A=C.checked;if(A)var z=parseInt(E.value),
x=parseInt(J.value),z=Math.min(n.height*x/(t.height/d.view.scale),n.width*z/(t.width/d.view.scale));else z=parseInt(v.value)/(100*d.pageScale),isNaN(z)&&(c=1/d.pageScale,v.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*c);n.height=Math.ceil(n.height*c);z*=c;!A&&d.pageVisible?(t=d.getPageLayout(),q-=t.x*n.width,m-=t.y*n.height):A=!0;if(null==b){b=PrintDialog.createPrintPreview(d,z,n,0,q,m,A);b.pageSelector=!1;b.mathEnabled=!1;q=a.getCurrentFile();null!=q&&(b.title=q.getTitle());
Math.min(f,Math.max(parseInt(m.value),parseInt(q.value))));q.value=Math.max(1,Math.min(f,Math.min(parseInt(m.value),parseInt(q.value))))}function c(d){function b(d,b,k){var l=d.useCssTransforms,f=d.currentTranslate,g=d.currentScale,p=d.view.translate,u=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var t=d.getGraphBounds(),q=0,m=0,n=K.get(),z=1/d.pageScale,x=B.checked;if(x)var z=parseInt(E.value),
C=parseInt(J.value),z=Math.min(n.height*C/(t.height/d.view.scale),n.width*z/(t.width/d.view.scale));else z=parseInt(v.value)/(100*d.pageScale),isNaN(z)&&(c=1/d.pageScale,v.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*c);n.height=Math.ceil(n.height*c);z*=c;!x&&d.pageVisible?(t=d.getPageLayout(),q-=t.x*n.width,m-=t.y*n.height):x=!0;if(null==b){b=PrintDialog.createPrintPreview(d,z,n,0,q,m,x);b.pageSelector=!1;b.mathEnabled=!1;q=a.getCurrentFile();null!=q&&(b.title=q.getTitle());
var y=b.writeHead;b.writeHead=function(b){y.apply(this,arguments);if(mxClient.IS_GC||mxClient.IS_SF)b.writeln('<style type="text/css">'),b.writeln("div.MathJax_SVG_Display { position: static; }"),b.writeln("</style>");mxClient.IS_GC&&(b.writeln('<style type="text/css">'),b.writeln("@media print {"),b.writeln("span.MathJax_SVG svg { shape-rendering: crispEdges; }"),b.writeln("}"),b.writeln("</style>"));null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"));
for(var c=d.getCustomFonts(),e=0;e<c.length;e++){var k=c[e].name,l=c[e].url;Graph.isCssFontUrl(l)?b.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(l)+'" charset="UTF-8" type="text/css">'):(b.writeln('<style type="text/css">'),b.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(k)+'";\nsrc: url("'+mxUtils.htmlEntities(l)+'");\n}'),b.writeln("</style>"))}};if("undefined"!==typeof MathJax){var D=b.renderPage;b.renderPage=function(d,b,c,e,k,l){var f=mxClient.NO_FO;mxClient.NO_FO=
this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var g=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:g.className="geDisableMathJax";return g}}q=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(q=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=q&&(e.stylesheet=q,e.refresh())}else{n=d.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor=
n;b.autoOrigin=A;b.appendGraph(d,z,q,m,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q<k.length;q++)m=k[q].name,A=k[q].url,Graph.isCssFontUrl(A)?b.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(A)+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(m)+'";\nsrc: url("'+mxUtils.htmlEntities(A)+'");\n}'),b.wnd.document.writeln("</style>"))}l&&(d.useCssTransforms=
l,d.currentTranslate=f,d.currentScale=g,d.view.translate=p,d.view.scale=u);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var l=q.value,f=m.value,g=!u.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,u.checked,l,f,C.checked,E.value,J.value,parseInt(v.value)/100,parseInt(M.value)/100,K.get());else{g&&(g=l==p&&f==p);if(!g&&null!=
a.pages&&a.pages.length){var n=0,g=a.pages.length-1;u.checked||(n=parseInt(l)-1,g=parseInt(f)-1);for(var z=n;z<=g;z++){var A=a.pages[z],l=A==a.currentPage?e:null;if(null==l){var l=a.createTemporaryGraph(e.stylesheet),f=!0,n=!1,x=null,y=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(f=A.viewState.pageVisible,n=A.viewState.mathEnabled,x=A.viewState.background,y=A.viewState.backgroundImage,l.extFonts=A.viewState.extFonts);l.background=x;l.backgroundImage=null!=y?new mxImage(y.src,
y.width,y.height):null;l.pageVisible=f;l.mathEnabled=n;var D=l.getGlobalVariable;l.getGlobalVariable=function(d){return"page"==d?A.getName():"pagenumber"==d?z+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(l.container);a.updatePageRoot(A);l.model.setRoot(A.root)}t=b(l,t,z!=g);l!=e&&l.container.parentNode.removeChild(l.container)}}else t=b(e);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(g=t.wnd.document,
n;b.autoOrigin=x;b.appendGraph(d,z,q,m,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q<k.length;q++)m=k[q].name,x=k[q].url,Graph.isCssFontUrl(x)?b.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(x)+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(m)+'";\nsrc: url("'+mxUtils.htmlEntities(x)+'");\n}'),b.wnd.document.writeln("</style>"))}l&&(d.useCssTransforms=
l,d.currentTranslate=f,d.currentScale=g,d.view.translate=p,d.view.scale=u);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var l=q.value,f=m.value,g=!u.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,u.checked,l,f,B.checked,E.value,J.value,parseInt(v.value)/100,parseInt(M.value)/100,K.get());else{g&&(g=l==p&&f==p);if(!g&&null!=
a.pages&&a.pages.length){var n=0,g=a.pages.length-1;u.checked||(n=parseInt(l)-1,g=parseInt(f)-1);for(var z=n;z<=g;z++){var x=a.pages[z],l=x==a.currentPage?e:null;if(null==l){var l=a.createTemporaryGraph(e.stylesheet),f=!0,n=!1,C=null,y=null;null==x.viewState&&null==x.root&&a.updatePageRoot(x);null!=x.viewState&&(f=x.viewState.pageVisible,n=x.viewState.mathEnabled,C=x.viewState.background,y=x.viewState.backgroundImage,l.extFonts=x.viewState.extFonts);l.background=C;l.backgroundImage=null!=y?new mxImage(y.src,
y.width,y.height):null;l.pageVisible=f;l.mathEnabled=n;var D=l.getGlobalVariable;l.getGlobalVariable=function(d){return"page"==d?x.getName():"pagenumber"==d?z+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(l.container);a.updatePageRoot(x);l.model.setRoot(x.root)}t=b(l,t,z!=g);l!=e&&l.container.parentNode.removeChild(l.container)}}else t=b(e);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(g=t.wnd.document,
d&&(t.wnd.IMMEDIATE_PRINT=!0),g.writeln('<script type="text/javascript" src="'+DRAWIO_BASE_URL+'/js/math-print.js">\x3c/script>')),t.closeDocument(),!t.mathEnabled&&d&&PrintDialog.printPreview(t));null!=k&&(e.stylesheet=k,e.refresh())}}var e=a.editor.graph,k=document.createElement("div"),l=document.createElement("h3");l.style.width="100%";l.style.textAlign="center";l.style.marginTop="0px";mxUtils.write(l,d||mxResources.get("print"));k.appendChild(l);var f=1,p=1,g=document.createElement("div");g.style.cssText=
"border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");g.appendChild(u);l=document.createElement("span");mxUtils.write(l,mxResources.get("printAllPages"));g.appendChild(l);mxUtils.br(g);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");g.appendChild(t);
l=document.createElement("span");mxUtils.write(l,mxResources.get("pages")+":");g.appendChild(l);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","1");q.setAttribute("type","number");q.setAttribute("min","1");q.style.width="50px";g.appendChild(q);l=document.createElement("span");mxUtils.write(l,mxResources.get("to"));g.appendChild(l);var m=q.cloneNode(!0);g.appendChild(m);mxEvent.addListener(q,"focus",function(){t.checked=!0});mxEvent.addListener(m,
"focus",function(){t.checked=!0});mxEvent.addListener(q,"change",b);mxEvent.addListener(m,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(l=0;l<a.pages.length;l++)if(a.currentPage==a.pages[l]){p=l+1;q.value=p;m.value=p;break}q.setAttribute("max",f);m.setAttribute("max",f);a.isPagesEnabled()?1<f&&(k.appendChild(g),t.checked=!0):t.checked=!0;var n=document.createElement("div");n.style.marginBottom="10px";var z=document.createElement("input");z.style.marginRight="8px";z.setAttribute("value",
"adjust");z.setAttribute("type","radio");z.setAttribute("name","printZoom");n.appendChild(z);l=document.createElement("span");mxUtils.write(l,mxResources.get("adjustTo"));n.appendChild(l);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";n.appendChild(v);mxEvent.addListener(v,"focus",function(){z.checked=!0});k.appendChild(n);var g=g.cloneNode(!1),C=z.cloneNode(!0);C.setAttribute("value","fit");z.setAttribute("checked",
"checked");l=document.createElement("div");l.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";l.appendChild(C);g.appendChild(l);n=document.createElement("table");n.style.display="inline-block";var A=document.createElement("tbody"),x=document.createElement("tr"),y=x.cloneNode(!0),D=document.createElement("td"),B=D.cloneNode(!0),I=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";F.style.textAlign="right";mxUtils.write(D,
mxResources.get("fitTo"));var E=document.createElement("input");E.style.cssText="margin:0 8px 0 8px;";E.setAttribute("value","1");E.setAttribute("min","1");E.setAttribute("type","number");E.style.width="40px";B.appendChild(E);l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsAcross"));I.appendChild(l);mxUtils.write(F,mxResources.get("fitToBy"));var J=E.cloneNode(!0);H.appendChild(J);mxEvent.addListener(E,"focus",function(){C.checked=!0});mxEvent.addListener(J,"focus",function(){C.checked=
!0});l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsDown"));G.appendChild(l);x.appendChild(D);x.appendChild(B);x.appendChild(I);y.appendChild(F);y.appendChild(H);y.appendChild(G);A.appendChild(x);A.appendChild(y);n.appendChild(A);g.appendChild(n);k.appendChild(g);g=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));g.appendChild(l);l=document.createElement("div");
"adjust");z.setAttribute("type","radio");z.setAttribute("name","printZoom");n.appendChild(z);l=document.createElement("span");mxUtils.write(l,mxResources.get("adjustTo"));n.appendChild(l);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";n.appendChild(v);mxEvent.addListener(v,"focus",function(){z.checked=!0});k.appendChild(n);var g=g.cloneNode(!1),B=z.cloneNode(!0);B.setAttribute("value","fit");z.setAttribute("checked",
"checked");l=document.createElement("div");l.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";l.appendChild(B);g.appendChild(l);n=document.createElement("table");n.style.display="inline-block";var x=document.createElement("tbody"),C=document.createElement("tr"),y=C.cloneNode(!0),D=document.createElement("td"),A=D.cloneNode(!0),I=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";F.style.textAlign="right";mxUtils.write(D,
mxResources.get("fitTo"));var E=document.createElement("input");E.style.cssText="margin:0 8px 0 8px;";E.setAttribute("value","1");E.setAttribute("min","1");E.setAttribute("type","number");E.style.width="40px";A.appendChild(E);l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsAcross"));I.appendChild(l);mxUtils.write(F,mxResources.get("fitToBy"));var J=E.cloneNode(!0);H.appendChild(J);mxEvent.addListener(E,"focus",function(){B.checked=!0});mxEvent.addListener(J,"focus",function(){B.checked=
!0});l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsDown"));G.appendChild(l);C.appendChild(D);C.appendChild(A);C.appendChild(I);y.appendChild(F);y.appendChild(H);y.appendChild(G);x.appendChild(C);x.appendChild(y);n.appendChild(x);g.appendChild(n);k.appendChild(g);g=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));g.appendChild(l);l=document.createElement("div");
l.style.marginBottom="12px";var K=PageSetupDialog.addPageFormatPanel(l,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(l);l=document.createElement("span");mxUtils.write(l,mxResources.get("pageScale"));g.appendChild(l);var M=document.createElement("input");M.style.cssText="margin:0 8px 0 8px;";M.setAttribute("value","100 %");M.style.width="60px";g.appendChild(M);k.appendChild(g);l=document.createElement("div");l.style.cssText="text-align:right;margin:48px 0 0 0;";
g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);a.isOffline()||(n=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),n.className="geBtn",l.appendChild(n));PrintDialog.previewEnabled&&(n=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),n.className="geBtn",l.appendChild(n));n=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);a.isOffline()||(n=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://www.diagrams.net/doc/faq/print-diagram")}),n.className="geBtn",l.appendChild(n));PrintDialog.previewEnabled&&(n=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),n.className="geBtn",l.appendChild(n));n=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
"print":"ok"),function(){a.hideDialog();c(!0)});n.className="geBtn gePrimaryBtn";l.appendChild(n);a.editor.cancelFirst||l.appendChild(g);k.appendChild(l);this.container=k};var H=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(H.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var J=document.createElement("canvas"),I=new Image;I.onload=function(){try{J.getContext("2d").drawImage(I,0,0);var a=J.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(M){}};I.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(K){}})();
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.9.5";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.9.7";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;
EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},
gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(a,b,c,e,f,g,q){g=null!=g?g:0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";if(EditorUi.enableLogging&&"1"!=urlParams.dev)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&
@ -10113,11 +10113,11 @@ a.keyCode)return function(){0<d&&f.selectPage(f.pages[0])};if(39==a.keyCode)retu
e>b&&(d=a.substring(b,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(a),g=this.editor.extractGraphModel(f.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),d=null!=g?mxUtils.getXml(g):""}catch(q){}return d};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var d=a.indexOf('<meta charset="utf-8">');0<=d&&(a=a.slice(0,d)+'<meta charset="utf-8"/>'+a.slice(d+23-1,a.length));
a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a){d=this.editor.graph;d.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,c=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<c.length||1==c.length&&c[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?
this.pages:[];for(var e=c.length-1;0<=e;e--){var f=this.updatePageRoot(new DiagramPage(c[e]));null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[e+1]));d.model.execute(new ChangePage(this,f,0==e?f:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),d.model.execute(new ChangePage(this,this.currentPage,
this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,f,g,q,m,n,x,B){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;n=null!=n?n:!0;var d,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":k=d=e;if(null==a)return"";var l=a;if("mxfile"!=
l.nodeName.toLowerCase()){if(B){var p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());p.appendChild(a)}else{p=Graph.zapGremlins(mxUtils.getXml(a));l=Graph.compress(p);if(Graph.decompress(l)!=p)return p;p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());mxUtils.setTextContent(p,l)}l=a.ownerDocument.createElement("mxfile");l.appendChild(p)}x?(l=l.cloneNode(!0),l.removeAttribute("modified"),l.removeAttribute("host"),l.removeAttribute("agent"),l.removeAttribute("etag"),
this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,f,g,q,m,n,x,A){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;n=null!=n?n:!0;var d,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":k=d=e;if(null==a)return"";var l=a;if("mxfile"!=
l.nodeName.toLowerCase()){if(A){var p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());p.appendChild(a)}else{p=Graph.zapGremlins(mxUtils.getXml(a));l=Graph.compress(p);if(Graph.decompress(l)!=p)return p;p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());mxUtils.setTextContent(p,l)}l=a.ownerDocument.createElement("mxfile");l.appendChild(p)}x?(l=l.cloneNode(!0),l.removeAttribute("modified"),l.removeAttribute("host"),l.removeAttribute("agent"),l.removeAttribute("etag"),
l.removeAttribute("userAgent"),l.removeAttribute("version"),l.removeAttribute("editor"),l.removeAttribute("type")):(l.removeAttribute("userAgent"),l.removeAttribute("version"),l.removeAttribute("editor"),l.removeAttribute("pages"),l.removeAttribute("type"),mxClient.IS_CHROMEAPP?l.setAttribute("host","Chrome"):EditorUi.isElectronApp?l.setAttribute("host","Electron"):l.setAttribute("host",window.location.hostname),l.setAttribute("modified",(new Date).toISOString()),l.setAttribute("agent",navigator.appVersion),
l.setAttribute("version",EditorUi.VERSION),l.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&l.setAttribute("type",a),1<l.getElementsByTagName("diagram").length&&null!=this.pages&&l.setAttribute("pages",this.pages.length));B=B?mxUtils.getPrettyXml(l):mxUtils.getXml(l);if(!g&&!f&&(q||null!=c&&/(\.html)$/i.test(c.getTitle())))B=this.getHtml2(mxUtils.getXml(l),b,null!=c?c.getTitle():null,d,k);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&
c.getMode()!=App.MODE_BROWSER||(e=null),B=this.getEmbeddedSvg(B,b,e,null,m,n,k);return B};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):
l.setAttribute("version",EditorUi.VERSION),l.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&l.setAttribute("type",a),1<l.getElementsByTagName("diagram").length&&null!=this.pages&&l.setAttribute("pages",this.pages.length));A=A?mxUtils.getPrettyXml(l):mxUtils.getXml(l);if(!g&&!f&&(q||null!=c&&/(\.html)$/i.test(c.getTitle())))A=this.getHtml2(mxUtils.getXml(l),b,null!=c?c.getTitle():null,d,k);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&
c.getMode()!=App.MODE_BROWSER||(e=null),A=this.getEmbeddedSvg(A,b,e,null,m,n,k);return A};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):
null==b||c?a=a.cloneNode(!0):(a=a.cloneNode(!1),mxUtils.setTextContent(a,Graph.compressNode(b)));d.appendChild(a)},EditorUi.removeChildNodes(this.currentPage.node),mxUtils.setTextContent(this.currentPage.node,Graph.compressNode(d)),d=this.fileNode.cloneNode(!1),b)a(this.currentPage.node);else for(b=0;b<this.pages.length;b++){if(this.currentPage!=this.pages[b]&&this.pages[b].needsUpdate){var e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root));this.editor.graph.saveViewState(this.pages[b].viewState,
e);EditorUi.removeChildNodes(this.pages[b].node);mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(e));delete this.pages[b].needsUpdate}a(this.pages[b].node)}return d};EditorUi.prototype.anonymizeString=function(a,b){for(var d=[],c=0;c<a.length;c++){var e=a.charAt(c);0<=EditorUi.ignoredAnonymizedChars.indexOf(e)?d.push(e):isNaN(parseInt(e))?e.toLowerCase()!=e?d.push(String.fromCharCode(65+Math.round(25*Math.random()))):e.toUpperCase()!=e?d.push(String.fromCharCode(97+Math.round(25*Math.random()))):
/\s/.test(e)?d.push(" "):d.push("?"):d.push(b?"0":Math.round(9*Math.random()))}return d.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var d=0;d<a[EditorUi.DIFF_INSERT].length;d++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][d].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][d].data=mxUtils.getXml(b)}catch(t){a[EditorUi.DIFF_INSERT][d].data=
@ -10136,9 +10136,9 @@ mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==f?'<script type="tex
null;var d=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(d)throw Error(mxResources.get("notADiagramFile")+" ("+d+")");d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a&&"mxfile"==a.nodeName&&(d=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name"))){var b=null;this.fileNode=a;this.pages=[];for(var c=0;c<d.length;c++)null==d[c].getAttribute("id")&&d[c].setAttribute("id",c),a=new DiagramPage(d[c]),
null==a.getName()&&a.setName(mxResources.get("pageWithNumber",[c+1])),this.pages.push(a),null!=urlParams["page-id"]&&a.getId()==urlParams["page-id"]&&(b=a);this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",
[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=urlParams["layer-ids"])try{var e=urlParams["layer-ids"].split(" ");a={};for(c=0;c<e.length;c++)a[e[c]]=!0;for(var f=this.editor.graph.getModel(),g=f.getChildren(f.root),c=0;c<g.length;c++){var m=g[c];f.setVisible(m,a[m.id]||!1)}}catch(y){}};EditorUi.prototype.getBaseFilename=function(a){var d=this.getCurrentFile(),d=null!=d&&null!=d.getTitle()?d.getTitle():
this.defaultFilename;if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,f,g,m,n,y,x,B){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),
this.defaultFilename;if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,f,g,m,n,y,x,A){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),
k=d+"."+a;if("xml"==a){var l='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,e,f,null,null,null,b);this.saveData(k,a,l,"text/xml")}else if("html"==a)l=this.getHtml2(this.getFileData(!0),this.editor.graph,d),this.saveData(k,a,l,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=d+".png":"jpeg"==a&&(k=d+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(d,b){try{var c=this.editor.graph.pageVisible;
null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(d,a,e,b,m,f,n,y,x,B);this.editor.graph.pageVisible=c;return k}catch(M){this.handleError(M)}}));else{var p=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var q=this.editor.graph.background;if(m||q==mxConstants.NONE)q=
null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(d,a,e,b,m,f,n,y,x,A);this.editor.graph.pageVisible=c;return k}catch(M){this.handleError(M)}}));else{var p=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var q=this.editor.graph.background;if(m||q==mxConstants.NONE)q=
null;var u=this.editor.graph.getSvg(q,null,null,null,null,e);c&&this.editor.graph.addSvgShadow(u);this.editor.convertImages(u,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();t('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=d+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),e)}}catch(H){this.handleError(H)}};EditorUi.prototype.createDownloadRequest=
function(a,b,c,e,f,g,m,n,y,x){var d=this.editor.graph,k=d.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var l="",p="";if(k.width*k.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};x=x?"1":"0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(x="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){l="&from="+g;break}g=d.background;"png"!=b&&"pdf"!=b||!f?f||
null!=g&&g!=mxConstants.NONE||(g="#ffffff"):g=mxConstants.NONE;f={globalVars:d.getExportVariables()};y&&(f.grid={size:d.gridSize,steps:d.view.gridSteps,color:d.view.gridColor});Graph.translateDiagram&&(f.diagramLanguage=Graph.diagramLanguage);return new mxXmlRequest(EXPORT_URL,"format="+b+l+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+x+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=m?"&scale="+
@ -10146,7 +10146,7 @@ m:"")+(null!=n?"&border="+n:""))};EditorUi.prototype.setMode=function(a,b){this.
mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,l=null,f=mxUtils.bind(this,function(){var d=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){d===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+
" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(l);l=window.setTimeout(f,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();f()}));g();f()}null!=b&&b()});null!=a.url&&0<a.url.length?this.editor.loadUrl(a.url,mxUtils.bind(this,function(a){e(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)})):e("")};EditorUi.prototype.updateDiagram=function(a){function d(a){var d=new mxCellOverlay(a.image||e.warningImage,
a.tooltip,a.align,a.valign,a.offset);d.addListener(mxEvent.CLICK,function(d,b){c.alert(a.tooltip)});return d}var b=null,c=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var e=this.editor.graph,f=e.getModel();f.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var m=f.getCell(a.getAttribute("id"));if(null!=m){try{var n=a.getAttribute("value");if(null!=n){var x=mxUtils.parseXml(n).documentElement;
if(null!=x)if("1"==x.getAttribute("replace-value"))f.setValue(m,x);else for(var B=x.attributes,z=0;z<B.length;z++)e.setAttributeForCell(m,B[z].nodeName,0<B[z].nodeValue.length?B[z].nodeValue:null)}}catch(J){null!=window.console&&console.log("Error in value for "+m.id+": "+J)}try{var C=a.getAttribute("style");null!=C&&e.model.setStyle(m,C)}catch(J){null!=window.console&&console.log("Error in style for "+m.id+": "+J)}try{var A=a.getAttribute("icon");if(null!=A){var D=0<A.length?JSON.parse(A):null;null!=
if(null!=x)if("1"==x.getAttribute("replace-value"))f.setValue(m,x);else for(var A=x.attributes,z=0;z<A.length;z++)e.setAttributeForCell(m,A[z].nodeName,0<A[z].nodeValue.length?A[z].nodeValue:null)}}catch(J){null!=window.console&&console.log("Error in value for "+m.id+": "+J)}try{var B=a.getAttribute("style");null!=B&&e.model.setStyle(m,B)}catch(J){null!=window.console&&console.log("Error in style for "+m.id+": "+J)}try{var C=a.getAttribute("icon");if(null!=C){var D=0<C.length?JSON.parse(C):null;null!=
D&&D.append||e.removeCellOverlays(m);null!=D&&e.addCellOverlay(m,d(D))}}catch(J){null!=window.console&&console.log("Error in icon for "+m.id+": "+J)}try{var F=a.getAttribute("geometry");if(null!=F){var F=JSON.parse(F),E=e.getCellGeometry(m);if(null!=E){E=E.clone();for(key in F){var G=parseFloat(F[key]);"dx"==key?E.x+=G:"dy"==key?E.y+=G:"dw"==key?E.width+=G:"dh"==key?E.height+=G:E[key]=parseFloat(F[key])}e.model.setGeometry(m,E)}}}catch(J){null!=window.console&&console.log("Error in icon for "+m.id+
": "+J)}}}else if("model"==a.nodeName){for(var H=a.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=H.nextSibling;null!=H&&(new mxCodec(a.firstChild)).decode(H,f)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(e.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))e.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):
1);a=a.nextSibling}}finally{f.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var d=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,c="",e=d.lastIndexOf(".");0<=e&&(c=d.substring(e),d=d.substring(0,e));if(b)var k=new Date,e=k.getFullYear(),f=k.getMonth()+1,g=k.getDate(),m=k.getHours(),n=k.getMinutes(),k=k.getSeconds(),d=d+(" "+(e+"-"+f+"-"+g+"-"+m+"-"+n+"-"+k));return d=mxResources.get("copyOf",[d])+c};
@ -10165,13 +10165,13 @@ EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if
this.libraryLoaded(a,c,d.documentElement.getAttribute("title"),b)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c,e){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var k=
null,f=mxUtils.bind(this,function(b,d){0==b.length&&a.isEditable()?(null==k&&(k=document.createElement("div"),k.className="geDropTarget",mxUtils.write(k,mxResources.get("dragElementsHere"))),d.appendChild(k)):this.addLibraryEntries(b,d)});null!=this.sidebar&&null!=b&&this.sidebar.addEntries(b);c=null!=c&&0<c.length?c:a.getTitle();var l=this.sidebar.addPalette(a.getHash(),c,null!=e?e:!0,mxUtils.bind(this,function(a){f(b,a)}));this.repositionLibrary(d);var g=l.parentNode.previousSibling;e=g.getAttribute("title");
null!=e&&0<e.length&&".scratchpad"!=a.title&&g.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+e);var p=document.createElement("div");p.style.position="absolute";p.style.right="0px";p.style.top="0px";p.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");g.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title",mxResources.get("close"));m.setAttribute("valign","absmiddle");
m.setAttribute("border","0");m.style.cursor="pointer";m.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)p.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var d=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):d();mxEvent.consume(b)}}));if(a.isEditable()){var C=this.editor.graph,A=null,
D=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),l,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A),A=m.cloneNode(!1),A.setAttribute("src",Editor.spinImage),A.setAttribute("title",mxResources.get("saving")),A.style.cursor="default",A.style.marginRight="2px",A.style.marginTop="-2px",p.insertBefore(A,p.firstChild),g.style.paddingRight=18*p.childNodes.length+"px",this.saveLibrary(a.getTitle(),
b,a,a.getMode(),!0,!0,function(){null!=A&&null!=A.parentNode&&(A.parentNode.removeChild(A),g.style.paddingRight=18*p.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),p.insertBefore(n,p.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(g.style.paddingRight=18*p.childNodes.length+
"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(d)})),g.style.paddingRight=18*p.childNodes.length+"px")}),E=mxUtils.bind(this,function(a,d,c,e){a=C.cloneCells(mxUtils.sortCells(C.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var g=C.getCellGeometry(a[f]);null!=g&&g.translate(-d.x,-d.y)}l.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&
(a.title=e);b.push(a);F(c);null!=k&&null!=k.parentNode&&0<b.length&&(k.parentNode.removeChild(k),k=null)}),G=mxUtils.bind(this,function(a){if(C.isSelectionEmpty())C.getRubberband().isActive()?(C.getRubberband().execute(a),C.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=C.getSelectionCells(),d=C.view.getBounds(b),c=C.view.scale;d.x/=c;d.y/=c;d.width/=c;d.height/=c;d.x-=C.view.translate.x;d.y-=C.view.translate.y;
E(b,d)}mxEvent.consume(a)});mxEvent.addGestureListeners(l,function(){},mxUtils.bind(this,function(a){C.isMouseDown&&null!=C.panningManager&&null!=C.graphHandler.first&&(C.graphHandler.suspend(),null!=C.graphHandler.hint&&(C.graphHandler.hint.style.visibility="hidden"),l.style.backgroundColor="#f1f3f4",l.style.cursor="copy",C.panningManager.stop(),C.autoScroll=!1,mxEvent.consume(a))}),mxUtils.bind(this,function(a){C.isMouseDown&&null!=C.panningManager&&null!=C.graphHandler&&(l.style.backgroundColor=
"",l.style.cursor="default",this.sidebar.showTooltips=!0,C.panningManager.stop(),C.graphHandler.reset(),C.isMouseDown=!1,C.autoScroll=!0,G(a),mxEvent.consume(a))}));mxEvent.addListener(l,"mouseleave",mxUtils.bind(this,function(a){C.isMouseDown&&null!=C.graphHandler.first&&(C.graphHandler.resume(),null!=C.graphHandler.hint&&(C.graphHandler.hint.style.visibility="visible"),l.style.backgroundColor="",l.style.cursor="",C.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(l,"dragover",mxUtils.bind(this,
m.setAttribute("border","0");m.style.cursor="pointer";m.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)p.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var d=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):d();mxEvent.consume(b)}}));if(a.isEditable()){var B=this.editor.graph,C=null,
D=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),l,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=C&&null!=C.parentNode&&C.parentNode.removeChild(C),C=m.cloneNode(!1),C.setAttribute("src",Editor.spinImage),C.setAttribute("title",mxResources.get("saving")),C.style.cursor="default",C.style.marginRight="2px",C.style.marginTop="-2px",p.insertBefore(C,p.firstChild),g.style.paddingRight=18*p.childNodes.length+"px",this.saveLibrary(a.getTitle(),
b,a,a.getMode(),!0,!0,function(){null!=C&&null!=C.parentNode&&(C.parentNode.removeChild(C),g.style.paddingRight=18*p.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),p.insertBefore(n,p.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(g.style.paddingRight=18*p.childNodes.length+
"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(d)})),g.style.paddingRight=18*p.childNodes.length+"px")}),E=mxUtils.bind(this,function(a,d,c,e){a=B.cloneCells(mxUtils.sortCells(B.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var g=B.getCellGeometry(a[f]);null!=g&&g.translate(-d.x,-d.y)}l.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&
(a.title=e);b.push(a);F(c);null!=k&&null!=k.parentNode&&0<b.length&&(k.parentNode.removeChild(k),k=null)}),G=mxUtils.bind(this,function(a){if(B.isSelectionEmpty())B.getRubberband().isActive()?(B.getRubberband().execute(a),B.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=B.getSelectionCells(),d=B.view.getBounds(b),c=B.view.scale;d.x/=c;d.y/=c;d.width/=c;d.height/=c;d.x-=B.view.translate.x;d.y-=B.view.translate.y;
E(b,d)}mxEvent.consume(a)});mxEvent.addGestureListeners(l,function(){},mxUtils.bind(this,function(a){B.isMouseDown&&null!=B.panningManager&&null!=B.graphHandler.first&&(B.graphHandler.suspend(),null!=B.graphHandler.hint&&(B.graphHandler.hint.style.visibility="hidden"),l.style.backgroundColor="#f1f3f4",l.style.cursor="copy",B.panningManager.stop(),B.autoScroll=!1,mxEvent.consume(a))}),mxUtils.bind(this,function(a){B.isMouseDown&&null!=B.panningManager&&null!=B.graphHandler&&(l.style.backgroundColor=
"",l.style.cursor="default",this.sidebar.showTooltips=!0,B.panningManager.stop(),B.graphHandler.reset(),B.isMouseDown=!1,B.autoScroll=!0,G(a),mxEvent.consume(a))}));mxEvent.addListener(l,"mouseleave",mxUtils.bind(this,function(a){B.isMouseDown&&null!=B.graphHandler.first&&(B.graphHandler.resume(),null!=B.graphHandler.hint&&(B.graphHandler.hint.style.visibility="visible"),l.style.backgroundColor="",l.style.cursor="",B.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(l,"dragover",mxUtils.bind(this,
function(a){l.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";l.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(l,"drop",mxUtils.bind(this,function(a){l.style.cursor="";l.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,e,g,p,m,n,q,t){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+
this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,p,m),d)],d[0].vertex=!0,E(d,new mxRectangle(0,0,p,m),a,mxEvent.isAltDown(a)?null:n.substring(0,n.lastIndexOf(".")).replace(/_/g," ")),null!=k&&null!=k.parentNode&&0<b.length&&(k.parentNode.removeChild(k),k=null);else{var z=!1,u=mxUtils.bind(this,function(d,c){if(null!=d&&"application/pdf"==c){var e=Editor.extractGraphModelFromPdf(d);null!=e&&0<e.length&&(d=e)}if(null!=d)if(e=mxUtils.parseXml(d),"mxlibrary"==e.documentElement.nodeName)try{var g=
JSON.parse(mxUtils.getTextContent(e.documentElement));f(g,l);b=b.concat(g);F(a);this.spinner.stop();z=!0}catch(R){}else if("mxfile"==e.documentElement.nodeName)try{for(var p=e.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var m=this.stringToCells(Editor.getDiagramNodeXml(p[g])),n=this.editor.graph.getBoundingBoxFromGeometry(m);E(m,new mxRectangle(0,0,n.width,n.height),a)}z=!0}catch(R){null!=window.console&&console.log("error in drop handler:",R)}z||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
@ -10186,7 +10186,7 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM
480:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a,b){a=null!=a?a:mxUtils.bind(this,function(a,b){if(!b){var d=new ChangePageSetup(this,null,a);d.ignoreColor=!0;this.editor.graph.model.execute(d)}});var d=new BackgroundImageDialog(this,a,b);this.showDialog(d.container,360,200,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,e,f){a=new LibraryDialog(this,a,b,c,e,f);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,
function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var e=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=e.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&b.refresh()}));return b};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow=
"hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#DF6C0C";b.style.fontWeight="bold";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));
a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,e,f,g,m){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},k=null!=a&&null!=a.error?a.error:a;if(null!=a&&null!=a.stack&&null!=a.message)try{m?null!=window.console&&console.error("EditorUi.handleError:",a):EditorUi.logError("Caught: "+(""==a.message&&null!=a.name)?a.name:a.message,a.filename,a.lineNumber,a.columnNumber,a,"INFO")}catch(A){}if(null!=k||null!=b){m=mxUtils.htmlEntities(mxResources.get("unknownError"));
a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,e,f,g,m){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},k=null!=a&&null!=a.error?a.error:a;if(null!=a&&null!=a.stack&&null!=a.message)try{m?null!=window.console&&console.error("EditorUi.handleError:",a):EditorUi.logError("Caught: "+(""==a.message&&null!=a.name)?a.name:a.message,a.filename,a.lineNumber,a.columnNumber,a,"INFO")}catch(C){}if(null!=k||null!=b){m=mxUtils.htmlEntities(mxResources.get("unknownError"));
var l=mxResources.get("ok"),p=null;b=null!=b?b:mxResources.get("error");if(null!=k){null!=k.retry&&(l=mxResources.get("cancel"),p=function(){d();k.retry()});if(404==k.code||404==k.status||403==k.code){m=403==k.code?null!=k.message?mxUtils.htmlEntities(k.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=f?f:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":""));var n=
null!=f?null:null!=g?g:window.location.hash;if(null!=n&&("#G"==n.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==n.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==k.code||404==k.status)){n="#U"==n.substring(0,2)?n.substring(45,n.lastIndexOf("%26ex")):n.substring(2);this.showError(b,m,mxResources.get("openInNewWindow"),
mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+n);this.handleError(a,b,c,e,f)}),p,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){e.innerHTML="";for(var a=0;a<b.length;a++){var d=document.createElement("option");mxUtils.write(d,b[a].displayName);d.value=a;e.appendChild(d);d=document.createElement("option");d.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(d,"<"+b[a].email+">");d.setAttribute("disabled","disabled");e.appendChild(d)}d=
@ -10204,9 +10204,9 @@ EditorUi.prototype.saveCanvas=function(a,b,c,e,f){var d="jpeg"==c?"jpg":c;e=this
EditorUi.prototype.showTextDialog=function(a,b){var d=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));d.textarea.style.width="600px";d.textarea.style.height="380px";this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,f,g){"text/xml"!=c||/(\.drawio)$/i.test(b)||/(\.xml)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.html)$/i.test(b)||(b=b+"."+(null!=g?g:"drawio"));if(window.Blob&&
navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==c||"image/"!=c.substring(0,6)?this.showTextDialog(b+":",a):this.openInNewWindow(a,c,e);else{var d=document.createElement("a");g=(null==navigator.userAgent||
0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof d.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var k=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);g=65==(k?parseInt(k[2],10):!1)?!1:g}if(g||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));g?d.download=b:d.setAttribute("target","_blank");document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},2E4),d.click(),d.parentNode.removeChild(d)}catch(y){}}else this.createEchoRequest(a,
b,c,e,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,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):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),f=Array(e),k=0;k<e;++k){for(var g=1024*k,m=Math.min(g+1024,c),n=Array(m-g),B=0;g<m;++B,++g)n[B]=
b,c,e,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,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):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),f=Array(e),k=0;k<e;++k){for(var g=1024*k,m=Math.min(g+1024,c),n=Array(m-g),A=0;g<m;++A,++g)n[A]=
d[g].charCodeAt(0);f[k]=new Uint8Array(n)}return new Blob(f,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,f,g,m,n){g=null!=g?g:!1;m=null!=m?m:"vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(g);isLocalStorage&&f++;var d=4>=f?2:6<f?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,d){try{if("_blank"==d)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,e);else if(null!=c&&"text/html"==c.substring(0,9)){var f=new EmbedDialog(this,a);this.showDialog(f.container,
440,240,!0,!0);f.init()}else{var k=window.open("about:blank");null==k?mxUtils.popup(a,!0):(k.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"</pre>"),k.document.close())}else d==App.MODE_DEVICE||"download"==d?this.doSaveLocalFile(a,b,c,e,null,n):null!=b&&0<b.length&&this.pickFolder(d,mxUtils.bind(this,function(f){try{this.exportFile(a,b,c,e,d,f)}catch(D){this.handleError(D)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
440,240,!0,!0);f.init()}else{var k=window.open("about:blank");null==k?mxUtils.popup(a,!0):(k.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"</pre>"),k.document.close())}else d==App.MODE_DEVICE||"download"==d?this.doSaveLocalFile(a,b,c,e,null,n):null!=b&&0<b.length&&this.pickFolder(d,mxUtils.bind(this,function(f){try{this.exportFile(a,b,c,e,d,f)}catch(D){this.handleError(D)}}))}catch(C){this.handleError(C)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
!1,g,m,null,1<f,d,a,c,e);g=this.isServices(f)?f>d?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!=b||mxClient.IS_SVG?"image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):(a=c?a:btoa(unescape(encodeURIComponent(a))),d.document.write('<html><img style="max-width:100%;" src="data:'+b+";base64,"+a+'"/></html>')):d.document.write("<html><pre>"+
mxUtils.htmlEntities(a,!1)+"</pre></html>"),d.document.close())};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var d=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 c=d.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";
@ -10214,9 +10214,9 @@ mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=c.left+"px
function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var d=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",d);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,
function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,null,null,null,null,null,null,Editor.defaultBorder);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,e,f){this.isLocalFileSave()?this.saveLocalFile(c,a,e,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,f,b,d)}),c,f,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,f,g,m){m=null!=m?m:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);isLocalStorage&&d++;var k=4>=d?2:6<d?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||"download"==
d||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"download"==d||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,d,c)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,d,c)}catch(A){this.handleError(A)}else this.handleError({message:mxResources.get("errorSavingFile")})}),
d||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"download"==d||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,d,c)}catch(C){this.handleError(C)}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,d,c)}catch(C){this.handleError(C)}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,m,null,1<d,k,e,g,f);d=this.isServices(d)?4<d?390:270:160;this.showDialog(a.container,380,d,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,f,g){};EditorUi.prototype.pickFolder=function(a,
b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,f,g,m,n,y,x,B){if(this.spinner.spin(document.body,mxResources.get("export")))try{var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;var k=b?null:this.editor.graph.background;k==mxConstants.NONE&&(k=null);null==k&&0==b&&(k=B?this.editor.graph.defaultPageBackgroundColor:"#ffffff");var l=this.editor.graph.getSvg(k,a,m,n,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null,null,!0,B);e&&this.editor.graph.addSvgShadow(l);var p=this.getBaseFilename()+
b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,f,g,m,n,y,x,A){if(this.spinner.spin(document.body,mxResources.get("export")))try{var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;var k=b?null:this.editor.graph.background;k==mxConstants.NONE&&(k=null);null==k&&0==b&&(k=A?this.editor.graph.defaultPageBackgroundColor:"#ffffff");var l=this.editor.graph.getSvg(k,a,m,n,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null,null,!0,A);e&&this.editor.graph.addSvgShadow(l);var p=this.getBaseFilename()+
".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,y,null,null,null,!1));var b='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(p,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,
function(){mxUtils.popup(b)}))});this.editor.addFontCss(l);this.editor.graph.mathEnabled&&this.editor.addMathCss(l);g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(l,q,this.thumbImageCache)):q(l)}catch(E){this.handleError(E)}};EditorUi.prototype.addRadiobox=function(a,b,c,e,f,g,m){return this.addCheckbox(a,c,e,f,g,m,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,e,f,g,m,n){g=null!=g?g:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop=
"16px";d.setAttribute("type",m?"radio":"checkbox");m="geCheckbox-"+Editor.guid();d.id=m;null!=n&&d.setAttribute("name",n);c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");g&&(a.appendChild(d),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",m),a.appendChild(c),f||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a,b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";
@ -10228,14 +10228,14 @@ mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("sele
"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return c.value},focus:function(){c.focus()}}};EditorUi.prototype.createUrlParameters=function(a,b,c,e,f,g,m){m=null!=m?m:[];e&&("1"==urlParams.dev&&m.push("lightbox=1"),"auto"!=a&&m.push("target="+
a),null!=b&&b!=mxConstants.NONE&&m.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&m.push("edit="+encodeURIComponent(f)),g&&m.push("layers=1"),this.editor.graph.foldingEnabled&&m.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&m.push("page-id="+this.currentPage.getId());return m};EditorUi.prototype.createLink=function(a,b,c,e,f,g,m,n,y){y=null!=y?y:this.createUrlParameters(a,b,c,e,f,g);a=this.getCurrentFile();b=!0;null!=m?c=
"#U"+encodeURIComponent(m):(a=this.getCurrentFile(),n||null==a||a.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+a.getHash(),b=!1));b&&null!=a&&null!=a.getTitle()&&a.getTitle()!=this.defaultFilename&&y.push("title="+encodeURIComponent(a.getTitle()));return(e&&"1"!=urlParams.dev?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?
EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<y.length?"?"+y.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,f,g,m,n,y,x,B){this.getBasenames();var d={};""!=f&&f!=mxConstants.NONE&&(d.highlight=f);"auto"!==e&&(d.target=e);y||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];m&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),
d.resize=!0);n&&c.push("layers");0<c.length&&(y&&c.push("lightbox"),d.toolbar=c.join(" "));null!=x&&0<x.length&&(d.edit=x);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!m);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";B(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":
EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<y.length?"?"+y.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,f,g,m,n,y,x,A){this.getBasenames();var d={};""!=f&&f!=mxConstants.NONE&&(d.highlight=f);"auto"!==e&&(d.target=e);y||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];m&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),
d.resize=!0);n&&c.push("layers");0<c.length&&(y&&c.push("lightbox"),d.toolbar=c.join(" "));null!=x&&0<x.length&&(d.edit=x);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!m);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";A(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":
EditorUi.lightboxHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.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";d.appendChild(f);var k=
document.createElement("div");k.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");f=l.cloneNode(!0);f.setAttribute("value","copy");k.appendChild(f);var g=document.createElement("span");mxUtils.write(g,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(g);
mxUtils.br(k);k.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("publicDiagramUrl"));k.appendChild(g);var m=this.getCurrentFile();null==c&&null!=m&&m.constructor==window.DriveFile&&(g=document.createElement("a"),g.style.paddingLeft="12px",g.style.color="gray",g.style.cursor="pointer",mxUtils.write(g,mxResources.get("share")),k.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked",
"checked");null==c&&l.setAttribute("disabled","disabled");d.appendChild(k);var p=this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var C=document.createElement("input");C.setAttribute("type","text");C.style.marginRight="16px";C.style.width="60px";C.style.marginLeft="4px";C.style.marginRight="12px";C.value="100%";d.appendChild(C);var A=this.addCheckbox(d,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(d,mxResources.get("allPages"),
"checked");null==c&&l.setAttribute("disabled","disabled");d.appendChild(k);var p=this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");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%";d.appendChild(B);var C=this.addCheckbox(d,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(d,mxResources.get("allPages"),
k,!k),F=this.addCheckbox(d,mxResources.get("layers"),!0),E=this.addCheckbox(d,mxResources.get("lightbox"),!0),G=this.addEditButton(d,E),H=G.getEditInput();H.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled");H.checked&&E.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(l.checked?c:null,n.checked,
C.value,p.getTarget(),p.getColor(),A.checked,D.checked,F.checked,E.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,g,m){m=document.createElement("div");m.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,a||mxResources.get("link"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(d);var k=this.getCurrentFile(),d="https://desk.draw.io/support/solutions/articles/16000051941";
B.value,p.getTarget(),p.getColor(),C.checked,D.checked,F.checked,E.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,g,m){m=document.createElement("div");m.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,a||mxResources.get("link"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(d);var k=this.getCurrentFile(),d="https://desk.draw.io/support/solutions/articles/16000051941";
a=0;if(null!=k&&k.constructor==window.DriveFile&&!b){a=80;var d="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var p=document.createElement("div");p.style.whiteSpace="normal";mxUtils.write(p,mxResources.get("linkAccountRequired"));l.appendChild(p);p=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));
p.style.marginTop="12px";p.className="geBtn";l.appendChild(p);m.appendChild(l);p=document.createElement("a");p.style.paddingLeft="12px";p.style.color="gray";p.style.fontSize="11px";p.style.cursor="pointer";mxUtils.write(p,mxResources.get("check"));l.appendChild(p);mxEvent.addListener(p,"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!=e)a+=30,mxUtils.write(m,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%",m.appendChild(n),mxUtils.write(m,mxResources.get("height")+":"),
@ -10252,8 +10252,8 @@ t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.
N=this.addCheckbox(d,M&&"svg"!=n?mxResources.get("allPages"):"",M,!M,null,"jpeg"!=n);N.style.marginLeft="24px";N.style.marginBottom="16px";M&&"svg"!=n?l+=26:N.style.display="none";mxEvent.addListener(K,"change",function(){K.checked&&M?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled")});m&&M||N.setAttribute("disabled","disabled");var U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginRight="10px";U.className="geBtn";a=document.createElement("option");
a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));U.appendChild(a);"svg"==n&&(mxUtils.write(d,mxResources.get("links")+":"),d.appendChild(U),mxUtils.br(d),mxUtils.br(d),l+=26);c=new CustomDialog(this,d,
mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=q.value;f(q.value,u.checked,!E.checked,H.checked,K.checked,J.checked,t.value,G.checked,!N.checked,U.value,null!=I?I.checked:null,null!=v?v.checked:null)}),null,c,e);this.showDialog(c.container,340,l,!0,!0,null,null,null,null,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,
c,e,f){var d=document.createElement("div");d.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var l=document.createElement("h3");mxUtils.write(l,b);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(l)}var g=this.addCheckbox(d,mxResources.get("fit"),!0),m=this.addCheckbox(d,mxResources.get("shadow"),k.shadowVisible&&e,!e),p=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),u=this.addEditButton(d,n),A=u.getEditInput(),
D=1<k.model.getChildCount(k.model.getRoot()),F=this.addCheckbox(d,mxResources.get("layers"),D,!D);F.style.marginLeft=A.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(D&&F.removeAttribute("disabled"),A.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"));A.checked&&n.checked?u.getEditSelect().removeAttribute("disabled"):u.getEditSelect().setAttribute("disabled","disabled")});
c,e,f){var d=document.createElement("div");d.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var l=document.createElement("h3");mxUtils.write(l,b);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(l)}var g=this.addCheckbox(d,mxResources.get("fit"),!0),m=this.addCheckbox(d,mxResources.get("shadow"),k.shadowVisible&&e,!e),p=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),u=this.addEditButton(d,n),C=u.getEditInput(),
D=1<k.model.getChildCount(k.model.getRoot()),F=this.addCheckbox(d,mxResources.get("layers"),D,!D);F.style.marginLeft=C.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(D&&F.removeAttribute("disabled"),C.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"));C.checked&&n.checked?u.getEditSelect().removeAttribute("disabled"):u.getEditSelect().setAttribute("disabled","disabled")});
b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(g.checked,m.checked,p.checked,n.checked,u.getLink(),F.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,f,g,m,n){function d(b){var d=" ",p="";e&&(d=" 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('"+
EditorUi.lightboxHost+"/?client=1"+(null!=l?"&page="+l:"")+(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");var n="";c&&(n=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');m('<img src="'+b+'"'+n+(""!=p?' style="'+p+'"':"")+d+"/>")}var k=this.editor.graph.getGraphBounds(),l=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=
this.createImageDataUri(a,b,"png");d(a)}),null,null,null,mxUtils.bind(this,function(a){n({message:mxResources.get("unknownError")})}),null,!0,c?2:1,null,b,null,null,Editor.defaultBorder);else if(b=this.getFileData(!0),k.width*k.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var p="";c&&(p="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+p+"&xml="+encodeURIComponent(b));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&
@ -10265,19 +10265,19 @@ Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxR
a;else if("mxfile"==a.nodeName){var c=a.getElementsByTagName("diagram");if(0<c.length){var d=c[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?d.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=d&&(a=Editor.parseDiagramNode(d))}c=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(t){}finally{this.editor.graph=c}return a};EditorUi.prototype.getPngFileProperties=function(a){var b=1,d=0;if(null!=
a){if(a.hasAttribute("scale")){var c=parseFloat(a.getAttribute("scale"));!isNaN(c)&&0<c&&(b=c)}a.hasAttribute("border")&&(c=parseInt(a.getAttribute("border")),!isNaN(c)&&0<c&&(d=c))}return{scale:b,border:d}};EditorUi.prototype.getEmbeddedPng=function(a,b,c,e,f){try{var d=this.editor.graph,k=null!=d.themes&&"darkTheme"==d.defaultThemeName,l=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,
!0),d),l=c;else if(k||null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,m=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(m.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(c){try{null==l&&(l=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var e=c.toDataURL("image/png"),e=Editor.writeGraphModelToPng(e,
"tEXt","mxfile",encodeURIComponent(l));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(C){null!=b&&b(C)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,e,null,d.shadowVisible,null,d,f)}catch(B){null!=b&&b(B)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,f,g,m,n){n=null!=n?n:!0;m=b.background;m==mxConstants.NONE&&(m=null);g=b.getSvg(m,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&
"tEXt","mxfile",encodeURIComponent(l));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(B){null!=b&&b(B)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,e,null,d.shadowVisible,null,d,f)}catch(A){null!=b&&b(A)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,f,g,m,n){n=null!=n?n:!0;m=b.background;m==mxConstants.NONE&&(m=null);g=b.getSvg(m,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&
g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=f)this.embedFonts(g,mxUtils.bind(this,function(a){n?this.editor.convertImages(a,mxUtils.bind(this,function(a){f((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))})):f((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(g)};EditorUi.prototype.embedFonts=function(a,b){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(a,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(d){try{null!=d&&this.editor.addFontCss(a,d),b(a)}catch(p){b(a)}}))}catch(l){b(a)}}))};
EditorUi.prototype.exportImage=function(a,b,c,e,f,g,m,n,y,x,B,z){y=null!=y?y:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,n):null,y,null==this.pages||0==this.pages.length,B)}catch(D){this.handleError(D)}}),null,this.thumbImageCache,
null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,g,m,x,z)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.importXml=function(a,b,c,e,f){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var k=this.editor.graph;if(null!=a&&0<a.length){k.model.beginUpdate();try{var l=mxUtils.parseXml(a);a={};var g=this.editor.extractGraphModel(l.documentElement,
EditorUi.prototype.exportImage=function(a,b,c,e,f,g,m,n,y,x,A,z){y=null!=y?y:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,n):null,y,null==this.pages||0==this.pages.length,A)}catch(D){this.handleError(D)}}),null,this.thumbImageCache,
null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,g,m,x,z)}catch(C){this.spinner.stop(),this.handleError(C)}}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.importXml=function(a,b,c,e,f){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var k=this.editor.graph;if(null!=a&&0<a.length){k.model.beginUpdate();try{var l=mxUtils.parseXml(a);a={};var g=this.editor.extractGraphModel(l.documentElement,
null!=this.pages);if(null!=g&&"mxfile"==g.nodeName&&null!=this.pages){var m=g.getElementsByTagName("diagram");if(1==m.length)g=Editor.parseDiagramNode(m[0]),null!=this.currentPage&&(a[m[0].getAttribute("id")]=this.currentPage.getId());else if(1<m.length){var l=[],n=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(a[m[0].getAttribute("id")]=this.pages[0].getId(),g=Editor.parseDiagramNode(m[0]),e=!1,n=1);for(;n<m.length;n++){var p=m[n].getAttribute("id");m[n].removeAttribute("id");
var u=this.updatePageRoot(new DiagramPage(m[n]));a[p]=m[n].getAttribute("id");var A=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[A+1]));k.model.execute(new ChangePage(this,u,u,A,!0));l.push(u)}this.updatePageLinks(a,l)}}if(null!=g&&"mxGraphModel"===g.nodeName&&(d=k.importGraphModel(g,b,c,e),null!=d))for(n=0;n<d.length;n++)this.updatePageLinksForCell(a,d[n])}finally{k.model.endUpdate()}}}catch(D){if(f)throw D;this.handleError(D)}return d};EditorUi.prototype.updatePageLinks=
var u=this.updatePageRoot(new DiagramPage(m[n]));a[p]=m[n].getAttribute("id");var C=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,u,u,C,!0));l.push(u)}this.updatePageLinks(a,l)}}if(null!=g&&"mxGraphModel"===g.nodeName&&(d=k.importGraphModel(g,b,c,e),null!=d))for(n=0;n<d.length;n++)this.updatePageLinksForCell(a,d[n])}finally{k.model.endUpdate()}}}catch(D){if(f)throw D;this.handleError(D)}return d};EditorUi.prototype.updatePageLinks=
function(a,b){for(var d=0;d<b.length;d++)this.updatePageLinksForCell(a,b[d].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var d=document.createElement("div"),c=this.editor.graph,e=c.getLinkForCell(b);null!=e&&c.setLinkForCell(b,this.updatePageLink(a,e));if(c.isHtmlLabel(b)){d.innerHTML=c.sanitizeHtml(c.getLabel(b));for(var f=d.getElementsByTagName("a"),k=!1,g=0;g<f.length;g++)e=f[g].getAttribute("href"),null!=e&&(f[g].setAttribute("href",this.updatePageLink(a,e)),k=!0);k&&c.labelChanged(b,
d.innerHTML)}for(g=0;g<c.model.getChildCount(b);g++)this.updatePageLinksForCell(a,c.model.getChildAt(b,g))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var d=a[b.substring(b.indexOf(",")+1)];b=null!=d?"data:page/id,"+d:null}else if("data:action/json,"==b.substring(0,17))try{var c=JSON.parse(b.substring(17));if(null!=c.actions){for(var e=0;e<c.actions.length;e++){var f=c.actions[e];null!=f.open&&"data:page/id,"==f.open.substring(0,13)&&(d=a[f.open.substring(f.open.indexOf(",")+
1)],null!=d?f.open="data:page/id,"+d:delete f.open)}b="data:action/json,"+JSON.stringify(c)}}catch(q){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,e){e=null!=e?e:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var d=this.isRemoteVisioFormat(e);try{var f="UNKNOWN-VISIO",
k=e.lastIndexOf(".");if(0<=k&&k<e.length)f=e.substring(k+1).toUpperCase();else{var g=e.lastIndexOf("/");0<=g&&g<e.length&&(e=e.substring(g+1))}EditorUi.logEvent({category:f+"-MS-IMPORT-FILE",action:"filename_"+e,label:d?"remote":"local"})}catch(B){}if(d)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{d=new FormData;d.append("file1",a,e);var l=new XMLHttpRequest;l.open("POST",VSD_CONVERT_URL);
l.responseType="blob";this.addRemoteServiceSecurityCheck(l);l.onreadystatechange=mxUtils.bind(this,function(){if(4==l.readyState)if(200<=l.status&&299>=l.status)try{var a=l.response;if("text/xml"==a.type){var d=new FileReader;d.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(A){c({message:mxResources.get("errorLoadingFile")})}});d.readAsText(a)}else this.doImportVisio(a,b,c,e)}catch(C){c(C)}else try{""==l.responseType||"text"==l.responseType?c({message:l.responseText}):(d=new FileReader,
d.onload=function(){c({message:JSON.parse(d.result).Message})},d.readAsText(l.response))}catch(C){c({})}});l.send(d)}else try{this.doImportVisio(a,b,c,e)}catch(B){c(B)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
k=e.lastIndexOf(".");if(0<=k&&k<e.length)f=e.substring(k+1).toUpperCase();else{var g=e.lastIndexOf("/");0<=g&&g<e.length&&(e=e.substring(g+1))}EditorUi.logEvent({category:f+"-MS-IMPORT-FILE",action:"filename_"+e,label:d?"remote":"local"})}catch(A){}if(d)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{d=new FormData;d.append("file1",a,e);var l=new XMLHttpRequest;l.open("POST",VSD_CONVERT_URL);
l.responseType="blob";this.addRemoteServiceSecurityCheck(l);l.onreadystatechange=mxUtils.bind(this,function(){if(4==l.readyState)if(200<=l.status&&299>=l.status)try{var a=l.response;if("text/xml"==a.type){var d=new FileReader;d.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(C){c({message:mxResources.get("errorLoadingFile")})}});d.readAsText(a)}else this.doImportVisio(a,b,c,e)}catch(B){c(B)}else try{""==l.responseType||"text"==l.responseType?c({message:l.responseText}):(d=new FileReader,
d.onload=function(){c({message:JSON.parse(d.result).Message})},d.readAsText(l.response))}catch(B){c({})}});l.send(d)}else try{this.doImportVisio(a,b,c,e)}catch(A){c(A)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(u){c(u)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||
this.handleError({message:mxResources.get("unknownError")})}catch(k){this.handleError(k)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",
action:"size_"+a.length}),EditorUi.debug("convertLucidChart",a)}catch(u){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(u){null!=window.console&&console.error(u),c(u)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generateMermaidImage=
@ -10298,18 +10298,18 @@ this.importFileInputElt){var d=document.createElement("input");d.setAttribute("t
"F",a,b)});window.openBrowserFile=mxUtils.bind(this,function(a,b,d){StorageFile.getFileContent(this,a,b,d)});window.deleteBrowserFile=mxUtils.bind(this,function(a,b,d){StorageFile.deleteFile(this,a,b,d)});if(!b){var c=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var d=new Blob([a],{type:"application/octet-stream"});
this.importVisio(d,mxUtils.bind(this,function(a){this.importXml(a,0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=c;f.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};
EditorUi.prototype.importZipFile=function(a,b,c){var d=this,e=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(e){if(0==Object.keys(e.files).length)c();else{var f=0,k,g=!1;e.forEach(function(a,d){var e=d.name.toLowerCase();"diagram/diagram.xml"==e?(g=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==e.indexOf("versions/")&&(e=parseInt(e.substr(9)),e>f&&(f=e,k=d))});0<f?k.async("string").then(function(e){!d.isOffline()&&
(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):g||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,g,m,n,y,x,B){x=null!=x?x:!0;var d=!1,k=null,
l=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,m)):b=this.importXml(a,c,e,x);null!=n&&n(b)});"image"==b.substring(0,5)?(y=!1,"image/png"==b.substring(0,9)&&(b=B?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,e,x),y=!0)),y||(b=this.editor.graph,B=a.indexOf(";"),0<B&&(a=a.substring(0,B)+a.substring(a.indexOf(",",B+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),k=[b.insertVertex(null,
(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):g||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,g,m,n,y,x,A){x=null!=x?x:!0;var d=!1,k=null,
l=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,m)):b=this.importXml(a,c,e,x);null!=n&&n(b)});"image"==b.substring(0,5)?(y=!1,"image/png"==b.substring(0,9)&&(b=A?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,e,x),y=!0)),y||(b=this.editor.graph,A=a.indexOf(";"),0<A&&(a=a.substring(0,A)+a.substring(a.indexOf(",",A+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),k=[b.insertVertex(null,
null,"",c,e,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,l)):null!=y&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(d=!0,this.importVisio(y,l)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(d=!0,this.parseFile(null!=y?y:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==
a.readyState&&(200<=a.status&&299>=a.status?l(a.responseText):null!=n&&n(null))}),m)):0==a.indexOf("PK")&&null!=y?(d=!0,this.importZipFile(y,l,mxUtils.bind(this,function(){k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);n(k)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==n||n(k);return k};EditorUi.prototype.importFiles=function(a,b,c,e,f,g,m,n,y,x,B,z){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;
var d=null!=b&&null!=c,k=!0;b=null!=b?b:0;c=null!=c?c:0;var l=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=B||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){l=!0;break}var u=mxUtils.bind(this,function(){var l=this.editor.graph,p=l.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,f,k,g,l,m){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,
l,m,d,z)}catch(da){return this.handleError(da),null}});g=null!=g?g:mxUtils.bind(this,function(a){l.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,C=q,u=[],t=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--C){this.spinner.stop();if(null!=n)n(u);else{var d=[];l.getModel().beginUpdate();try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{l.getModel().endUpdate()}}g(d)}}),v=0;v<q;v++)mxUtils.bind(this,function(d){var g=
a[d];if(null!=g){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,q=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(q+1)))),C=mxUtils.parseXml(u),u=C.getElementsByTagName("svg");if(0<u.length){var u=u[0],v=z?null:u.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?t(d,mxUtils.bind(this,function(){try{if(n.substring(0,q+1),null!=C){var a=C.getElementsByTagName("svg");if(0<a.length){var k=a[0],m=k.getAttribute("width"),z=k.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN,u=k.getAttribute("viewBox");if(null==u||0==u.length)k.setAttribute("viewBox","0 0 "+m+" "+z);else if(isNaN(m)||
isNaN(z)){var t=u.split(" ");3<t.length&&(m=parseFloat(t[2]),z=parseFloat(t[3]))}n=Editor.createSvgDataUri(mxUtils.getXml(k));var v=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,z)),A=f(n,g.type,b+d*p,c+d*p,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(z*v)),g.name);if(isNaN(m)||isNaN(z)){var x=new Image;x.onload=mxUtils.bind(this,function(){m=Math.max(1,x.width);z=Math.max(1,x.height);A[0].geometry.width=m;A[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+m+" "+z);n=Editor.createSvgDataUri(mxUtils.getXml(k));
var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));l.setCellStyles("image",n,[A[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(k))}return A}}}catch(ka){}return null})):t(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*p,c+d*p,0,0,g.name)}))}else t(d,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==g.type){var A=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var D=new Image;D.src=a.target.result;t(d,mxUtils.bind(this,
function(){return f(A,"text/xml",b+d*p,c+d*p,D.width,D.height,g.name)}));u=!0}}u||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(l){this.resizeImage(l,a.target.result,mxUtils.bind(this,function(a,l,m){t(d,mxUtils.bind(this,
function(){if(null!=a&&a.length<x){var n=k&&this.isResampleImageSize(g.size,B)?Math.min(1,Math.min(e/l,e/m)):1;return f(a,g.type,b+d*p,c+d*p,Math.round(l*n),Math.round(m*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,e,B,g.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else n=a.target.result,f(n,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||
a.readyState&&(200<=a.status&&299>=a.status?l(a.responseText):null!=n&&n(null))}),m)):0==a.indexOf("PK")&&null!=y?(d=!0,this.importZipFile(y,l,mxUtils.bind(this,function(){k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);n(k)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==n||n(k);return k};EditorUi.prototype.importFiles=function(a,b,c,e,f,g,m,n,y,x,A,z){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;
var d=null!=b&&null!=c,k=!0;b=null!=b?b:0;c=null!=c?c:0;var l=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=A||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){l=!0;break}var u=mxUtils.bind(this,function(){var l=this.editor.graph,p=l.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,f,k,g,l,m){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,
l,m,d,z)}catch(da){return this.handleError(da),null}});g=null!=g?g:mxUtils.bind(this,function(a){l.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,B=q,u=[],t=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--B){this.spinner.stop();if(null!=n)n(u);else{var d=[];l.getModel().beginUpdate();try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{l.getModel().endUpdate()}}g(d)}}),v=0;v<q;v++)mxUtils.bind(this,function(d){var g=
a[d];if(null!=g){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,q=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(q+1)))),B=mxUtils.parseXml(u),u=B.getElementsByTagName("svg");if(0<u.length){var u=u[0],v=z?null:u.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?t(d,mxUtils.bind(this,function(){try{if(n.substring(0,q+1),null!=B){var a=B.getElementsByTagName("svg");if(0<a.length){var k=a[0],m=k.getAttribute("width"),z=k.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN,u=k.getAttribute("viewBox");if(null==u||0==u.length)k.setAttribute("viewBox","0 0 "+m+" "+z);else if(isNaN(m)||
isNaN(z)){var t=u.split(" ");3<t.length&&(m=parseFloat(t[2]),z=parseFloat(t[3]))}n=Editor.createSvgDataUri(mxUtils.getXml(k));var v=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,z)),C=f(n,g.type,b+d*p,c+d*p,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(z*v)),g.name);if(isNaN(m)||isNaN(z)){var x=new Image;x.onload=mxUtils.bind(this,function(){m=Math.max(1,x.width);z=Math.max(1,x.height);C[0].geometry.width=m;C[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+m+" "+z);n=Editor.createSvgDataUri(mxUtils.getXml(k));
var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));l.setCellStyles("image",n,[C[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(k))}return C}}}catch(ka){}return null})):t(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*p,c+d*p,0,0,g.name)}))}else t(d,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==g.type){var C=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var D=new Image;D.src=a.target.result;t(d,mxUtils.bind(this,
function(){return f(C,"text/xml",b+d*p,c+d*p,D.width,D.height,g.name)}));u=!0}}u||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(l){this.resizeImage(l,a.target.result,mxUtils.bind(this,function(a,l,m){t(d,mxUtils.bind(this,
function(){if(null!=a&&a.length<x){var n=k&&this.isResampleImageSize(g.size,A)?Math.min(1,Math.min(e/l,e/m)):1;return f(a,g.type,b+d*p,c+d*p,Math.round(l*n),Math.round(m*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,e,A,g.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else n=a.target.result,f(n,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||
/(\.vs(x|sx?))($|\?)/i.test(g.name)?f(null,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g):"image"==g.type.substring(0,5)||"application/pdf"==g.type?n.readAsDataURL(g):n.readAsText(g)}})(v)});if(l){l=[];for(q=0;q<a.length;q++)l.push(a[q]);a=l;this.confirmImageResize(function(a){k=a;u()},y)}else u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?
mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(a,b){b=null!=b?b:this.resampleThreshold;return a>b};EditorUi.prototype.resizeImage=function(a,
@ -10331,7 +10331,7 @@ mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getD
"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));"undefined"!==typeof window.mxSettings&&(x=this.editor.graph.view,x.setUnit(mxSettings.getUnit()),x.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==
document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,x.unit),this.refresh());if("1"==urlParams.styledev){x=document.getElementById("geFooter");null!=x&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility=
"hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),x.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),d=this.editor.graph.getModel().getStyle(d);this.styleInput.value=d||
"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var B=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:B.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),
"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var A=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:A.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),
z=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=z&&(z.parentNode.removeChild(z),z=null);if(b.isEnabled()){var d=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),
c=b.view.translate,e=b.view.scale,f=d.x/e-c.x,g=d.y/e-c.y;if(0<a.dataTransfer.files.length)mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)?this.openFiles(a.dataTransfer.files,!0):(mxEvent.isAltDown(a)&&(g=f=null),this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a)));else{mxEvent.isAltDown(a)&&(g=f=0);var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):
null,d=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=d)b.setSelectionCells(this.importXml(d,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),d=document.createElement("div");d.innerHTML=b.sanitizeHtml(l);var m=null,c=d.getElementsByTagName("img");null!=c&&1==c.length?(l=c[0].getAttribute("src"),null==l&&(l=c[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(m=!0)):(c=d.getElementsByTagName("a"),null!=
@ -10355,8 +10355,8 @@ f=!0;g=d.getElementsByTagName("style");if(null!=g)for(;0<g.length;)g[0].parentNo
g==d.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(d,g),f=!1));k=k&&null!=d.firstChild?d.firstChild.nextSibling:d.firstChild;null!=k&&null==k.nextSibling&&k.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==k.nodeName&&(g=k.getAttribute("src"),null!=g&&(mxUtils.setTextContent(d,g),f=!1));f&&Graph.removePasteFormatting(d)}else g=a.clipboardData.getData("text/plain"),null!=g&&0<g.length&&(d=document.createElement("div"),mxUtils.setTextContent(d,g))}k=d.getElementsByTagName("span");
if(null!=k&&0<k.length&&"application/vnd.lucid.chart.objects"===k[0].getAttribute("data-lucid-type"))c=k[0].getAttribute("data-lucid-content"),null!=c&&0<c.length&&(this.convertLucidChart(c,mxUtils.bind(this,function(a){var b=this.editor.graph;b.lastPasteXml==a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var d=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,d,d));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a));
else{f=f?d.innerHTML:mxUtils.trim(null==d.innerText?mxUtils.getTextContent(d):d.innerText);g=!1;try{var l=f.lastIndexOf("%3E");0<=l&&l<f.length-3&&(f=f.substring(0,l+3))}catch(D){}try{var k=d.getElementsByTagName("span"),m=null!=k&&0<k.length?mxUtils.trim(decodeURIComponent(k[0].textContent)):decodeURIComponent(f);this.isCompatibleString(m)&&(g=!0,f=m)}catch(D){}try{var n=this.editor.graph;if(null!=f&&0<f.length){n.lastPasteXml==f?n.pasteCounter++:(n.lastPasteXml=f,n.pasteCounter=0);var p=n.pasteCounter*
n.gridSize;if(g||this.isCompatibleString(f))n.setSelectionCells(this.importXml(f,p,p));else if(e&&1==n.getSelectionCount()){var C=n.getStartEditingCell(n.getSelectionCell(),a);/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(f)&&"image"==n.getCurrentCellStyle(C)[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_IMAGE,f,[C]):(n.labelChanged(C,f),Graph.isLink(f)&&n.setLinkForCell(C,f));n.setSelectionCell(C)}else{var A=n.getInsertPoint();n.isMouseInsertPoint()&&(p=0,n.lastPasteXml==f&&0<n.pasteCounter&&
n.pasteCounter--);n.setSelectionCells(this.insertTextAt(f,A.x+p,A.y+p,!0))}n.isSelectionEmpty()||(n.scrollCellToVisible(n.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(n.view.getState(n.getSelectionCell())));try{mxEvent.consume(a)}catch(D){}}else c||(n.lastPasteXml=null,n.pasteCounter=0)}catch(D){this.handleError(D)}}}b.innerHTML="&nbsp;"};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave",
n.gridSize;if(g||this.isCompatibleString(f))n.setSelectionCells(this.importXml(f,p,p));else if(e&&1==n.getSelectionCount()){var B=n.getStartEditingCell(n.getSelectionCell(),a);/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(f)&&"image"==n.getCurrentCellStyle(B)[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_IMAGE,f,[B]):(n.labelChanged(B,f),Graph.isLink(f)&&n.setLinkForCell(B,f));n.setSelectionCell(B)}else{var C=n.getInsertPoint();n.isMouseInsertPoint()&&(p=0,n.lastPasteXml==f&&0<n.pasteCounter&&
n.pasteCounter--);n.setSelectionCells(this.insertTextAt(f,C.x+p,C.y+p,!0))}n.isSelectionEmpty()||(n.scrollCellToVisible(n.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(n.view.getState(n.getSelectionCell())));try{mxEvent.consume(a)}catch(D){}}else c||(n.lastPasteXml=null,n.pasteCounter=0)}catch(D){this.handleError(D)}}}b.innerHTML="&nbsp;"};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave",
function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||
"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types,
"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(c.types,"text/html")?c.getData("text/html"):null,null!=d&&0<d.length?(c=document.createElement("div"),c.innerHTML=this.editor.graph.sanitizeHtml(d),c=c.getElementsByTagName("img"),0<c.length&&(d=c[0].getAttribute("src"))):0<=mxUtils.indexOf(c.types,"text/plain")&&(d=c.getData("text/plain"))),null!=d&&("data:image/png;base64,"==d.substring(0,22)?(d=this.extractGraphModelFromPng(d),null!=d&&0<d.length&&this.openLocalFile(d,
@ -10396,26 +10396,26 @@ null!=k.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=k.noExitBtn);
this.buttonContainer.appendChild(n),this.embedFilenameSpan=n);try{k.libs&&this.sidebar.showEntries(k.libs)}catch(O){}k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):null!=k.descriptor?k.descriptor:k.xml}else{if("merge"==k.action){var X=this.getCurrentFile();null!=X&&(n=l(k.xml),null!=n&&""!=n&&X.mergeFile(new LocalFile(this,n),function(){g.postMessage(JSON.stringify({event:"merge",message:k}),"*")},function(a){g.postMessage(JSON.stringify({event:"merge",message:k,error:a}),"*")}))}else"remoteInvokeReady"==
k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k,f.origin):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}catch(O){this.handleError(O)}}var fa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),da=mxUtils.bind(this,function(f,k){d=!0;try{a(f,
k)}catch(P){this.handleError(P)}d=!1;null!=urlParams.modified&&this.editor.setStatus("");e=fa();c&&null==b&&(b=mxUtils.bind(this,function(a,b){var c=fa();if(c!=e&&!d){var f=this.createLoadMessage("autosave");f.xml=c;(window.opener||window.parent).postMessage(JSON.stringify(f),"*")}e=c}),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));if("1"==urlParams.returnbounds||"json"==urlParams.proto){var l=this.createLoadMessage("load");l.xml=f;g.postMessage(JSON.stringify(l),"*")}});"object"===typeof k?this.loadDescriptor(k,mxUtils.bind(this,
function(a){da(fa(),f)}),mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))})):null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(l="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+1)),function(a){da(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&
this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&da(a.responseText,f)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,mxUtils.bind(this,function(a){da(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(k=l(k),da(k,f))}}));var g=window.opener||window.parent,f="json"==urlParams.proto?
JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*");if("json"==urlParams.proto){var m=this.editor.graph.openLink;this.editor.graph.openLink=function(a,b,d){m.apply(this,arguments);g.postMessage(JSON.stringify({event:"openLink",href:a,target:b,allowOpener:d}),"*")}}};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":"0px";
a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";var c=b;if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var e="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(b,e);b.setAttribute("title",e);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));a.appendChild(b)}}else mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",
mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b),
c=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),c="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,c),b.setAttribute("title",c),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),c=b);c.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=
function(a,b){for(var d=this.editor.graph,c=d.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](d);if(null!=a[e].config)for(var g in a[e].config)f[g]=a[e].config[g];this.executeLayout(function(){f.execute(d.getDefaultParent(),0==c.length?null:c)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var g={},k=null,m=null,n=null,B=null,z=null,C=null,A=null,D=null,F=null,E="",G="auto",H="auto",J=null,I=null,K=40,M=40,
N=100,U=0,L=this.editor.graph;L.getGraphBounds();for(var T=function(){null!=b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))},Z=L.getFreeInsertPoint(),aa=Z.x,ga=Z.y,Z=ga,Y=null,V="auto",F=null,X=[],fa=null,da=null,O=0;O<c.length&&"#"==c[O].charAt(0);){a=c[O];for(O++;O<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[O].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[O].substring(1)),O++;if("#"!=a.charAt(1)){var W=a.indexOf(":");if(0<W){var R=mxUtils.trim(a.substring(1,
W)),P=mxUtils.trim(a.substring(W+1));"label"==R?Y=L.sanitizeHtml(P):"labelname"==R&&0<P.length&&"-"!=P?z=P:"labels"==R&&0<P.length&&"-"!=P?C=JSON.parse(P):"style"==R?m=P:"parentstyle"==R?A=P:"stylename"==R&&0<P.length&&"-"!=P?B=P:"styles"==R&&0<P.length&&"-"!=P?n=JSON.parse(P):"vars"==R&&0<P.length&&"-"!=P?k=JSON.parse(P):"identity"==R&&0<P.length&&"-"!=P?D=P:"parent"==R&&0<P.length&&"-"!=P?F=P:"namespace"==R&&0<P.length&&"-"!=P?E=P:"width"==R?G=P:"height"==R?H=P:"left"==R&&0<P.length?J=P:"top"==
R&&0<P.length?I=P:"ignore"==R?da=P.split(","):"connect"==R?X.push(JSON.parse(P)):"link"==R?fa=P:"padding"==R?U=parseFloat(P):"edgespacing"==R?K=parseFloat(P):"nodespacing"==R?M=parseFloat(P):"levelspacing"==R?N=parseFloat(P):"layout"==R&&(V=P)}}}if(null==c[O])throw Error(mxResources.get("invalidOrMissingFile"));for(var ca=this.editor.csvToArray(c[O]),R=W=null,P=[],S=0;S<ca.length;S++)D==ca[S]&&(W=S),F==ca[S]&&(R=S),P.push(mxUtils.trim(ca[S]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,
""));null==Y&&(Y="%"+P[0]+"%");if(null!=X)for(var ba=0;ba<X.length;ba++)null==g[X[ba].to]&&(g[X[ba].to]={});D=[];for(S=O+1;S<c.length;S++){var ha=this.editor.csvToArray(c[S]);if(null==ha){var ja=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(ja+" ("+S+"):\n"+mxResources.get("containsValidationErrors"));}0<ha.length&&D.push(ha)}L.model.beginUpdate();try{for(S=0;S<D.length;S++){var ha=D[S],Q=null,ka=null!=W?E+ha[W]:null;null!=ka&&(Q=L.model.getCell(ka));var c=null!=Q,ea=new mxCell(Y,new mxGeometry(aa,
Z,0,0),m||"whiteSpace=wrap;html=1;");ea.vertex=!0;ea.id=ka;for(var ia=0;ia<ha.length;ia++)L.setAttributeForCell(ea,P[ia],ha[ia]);if(null!=z&&null!=C){var ua=C[ea.getAttribute(z)];null!=ua&&L.labelChanged(ea,ua)}if(null!=B&&null!=n){var va=n[ea.getAttribute(B)];null!=va&&(ea.style=va)}L.setAttributeForCell(ea,"placeholders","1");ea.style=L.replacePlaceholders(ea,ea.style,k);c&&(L.model.setGeometry(Q,ea.geometry),L.model.setStyle(Q,ea.style),0>mxUtils.indexOf(e,Q)&&e.push(Q));Q=ea;if(!c)for(ba=0;ba<
X.length;ba++)g[X[ba].to][Q.getAttribute(X[ba].to)]=Q;null!=fa&&"link"!=fa&&(L.setLinkForCell(Q,Q.getAttribute(fa)),L.setAttributeForCell(Q,fa,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[Q]));var wa=this.editor.graph.getPreferredSizeForCell(Q);Q.vertex&&(null!=J&&null!=Q.getAttribute(J)&&(Q.geometry.x=aa+parseFloat(Q.getAttribute(J))),null!=I&&null!=Q.getAttribute(I)&&(Q.geometry.y=ga+parseFloat(Q.getAttribute(I))),"@"==G.charAt(0)&&null!=Q.getAttribute(G.substring(1))?Q.geometry.width=
parseFloat(Q.getAttribute(G.substring(1))):Q.geometry.width="auto"==G?wa.width+U:parseFloat(G),"@"==H.charAt(0)&&null!=Q.getAttribute(H.substring(1))?Q.geometry.height=parseFloat(Q.getAttribute(H.substring(1))):Q.geometry.height="auto"==H?wa.height+U:parseFloat(H),Z+=Q.geometry.height+M);c?(null==f[ka]&&(f[ka]=[]),f[ka].push(Q)):(F=null!=R?L.model.getCell(E+ha[R]):null,d.push(Q),null!=F?(F.style=L.replacePlaceholders(F,A,k),L.addCell(Q,F)):e.push(L.addCell(Q)))}for(var na=e.slice(),la=e.slice(),ba=
0;ba<X.length;ba++)for(var xa=X[ba],S=0;S<d.length;S++){var Q=d[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(L.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),e=0;e<d.length;e++){var f=g[c.to][d[e]];if(null!=f){var l=c.label;null!=c.fromlabel&&(l=(b.getAttribute(c.fromlabel)||"")+(l||""));null!=c.tolabel&&(l=(l||"")+(f.getAttribute(c.tolabel)||""));var m="target"==c.placeholders==!c.invert?f:a,m=null!=c.style?L.replacePlaceholders(m,c.style,k):
L.createCurrentEdgeStyle(),l=L.insertEdge(null,null,l||"",c.invert?f:a,c.invert?a:f,m);if(null!=c.labels)for(m=0;m<c.labels.length;m++){var n=c.labels[m],p=new mxCell(n.label||m,new mxGeometry(null!=n.x?n.x:0,null!=n.y?n.y:0,0,0),"resizable=0;html=1;");p.vertex=!0;p.connectable=!1;p.geometry.relative=!0;if(null!=n.dx||null!=n.dy)p.geometry.offset=new mxPoint(null!=n.dx?n.dx:0,null!=n.dy?n.dy:0);l.insert(p)}la.push(l);mxUtils.remove(c.invert?a:f,na)}}});ya(Q,Q,xa);if(null!=f[Q.id])for(ia=0;ia<f[Q.id].length;ia++)ya(Q,
f[Q.id][ia],xa)}if(null!=da)for(S=0;S<d.length;S++)for(Q=d[S],ia=0;ia<da.length;ia++)L.setAttributeForCell(Q,mxUtils.trim(da[ia]),null);if(0<e.length){var ra=new mxParallelEdgeLayout(L);ra.spacing=K;ra.checkOverlap=!0;var oa=function(){0<ra.spacing&&ra.execute(L.getDefaultParent());for(var a=0;a<e.length;a++){var b=L.getCellGeometry(e[a]);b.x=Math.round(L.snap(b.x));b.y=Math.round(L.snap(b.y));"auto"==G&&(b.width=Math.round(L.snap(b.width)));"auto"==H&&(b.height=Math.round(L.snap(b.height)))}};if("["==
V.charAt(0)){var za=T;L.view.validate();this.executeLayoutList(JSON.parse(V),function(){oa();za()});T=null}else if("circle"==V){var pa=new mxCircleLayout(L);pa.disableEdgeStyle=!1;pa.resetEdges=!1;var ta=pa.isVertexIgnored;pa.isVertexIgnored=function(a){return ta.apply(this,arguments)||0>mxUtils.indexOf(e,a)};this.executeLayout(function(){pa.execute(L.getDefaultParent());oa()},!0,T);T=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&la.length==2*e.length-1&&1==na.length){L.view.validate();
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));if("1"==urlParams.returnbounds||"json"==urlParams.proto){var l=this.createLoadMessage("load");l.xml=f;g.postMessage(JSON.stringify(l),"*")}});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==
k.substring(0,34)?(l="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+1)),function(a){da(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,
13)&&da(a.responseText,f)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,mxUtils.bind(this,function(a){da(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):null==k||"object"!==typeof k||null==k.format||null==k.data&&null==k.url?(k=l(k),da(k,f)):this.loadDescriptor(k,mxUtils.bind(this,function(a){da(fa(),f)}),mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}}));var g=window.opener||window.parent,f="json"==
urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*");if("json"==urlParams.proto){var m=this.editor.graph.openLink;this.editor.graph.openLink=function(a,b,d){m.apply(this,arguments);g.postMessage(JSON.stringify({event:"openLink",href:a,target:b,allowOpener:d}),"*")}}};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";var c=b;if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var e="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(b,e);b.setAttribute("title",e);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));a.appendChild(b)}}else mxUtils.write(b,mxResources.get("save")),
b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
a.appendChild(b),c=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),c="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,c),b.setAttribute("title",c),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),c=b);c.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};
EditorUi.prototype.executeLayoutList=function(a,b){for(var d=this.editor.graph,c=d.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](d);if(null!=a[e].config)for(var g in a[e].config)f[g]=a[e].config[g];this.executeLayout(function(){f.execute(d.getDefaultParent(),0==c.length?null:c)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var g={},k=null,m=null,n=null,A=null,z=null,B=null,C=null,D=null,F=null,E="",G="auto",
H="auto",J=null,I=null,K=40,M=40,N=100,U=0,L=this.editor.graph;L.getGraphBounds();for(var T=function(){null!=b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))},Z=L.getFreeInsertPoint(),aa=Z.x,ga=Z.y,Z=ga,Y=null,V="auto",F=null,X=[],fa=null,da=null,O=0;O<c.length&&"#"==c[O].charAt(0);){a=c[O];for(O++;O<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[O].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[O].substring(1)),O++;if("#"!=a.charAt(1)){var W=a.indexOf(":");if(0<
W){var R=mxUtils.trim(a.substring(1,W)),P=mxUtils.trim(a.substring(W+1));"label"==R?Y=L.sanitizeHtml(P):"labelname"==R&&0<P.length&&"-"!=P?z=P:"labels"==R&&0<P.length&&"-"!=P?B=JSON.parse(P):"style"==R?m=P:"parentstyle"==R?C=P:"stylename"==R&&0<P.length&&"-"!=P?A=P:"styles"==R&&0<P.length&&"-"!=P?n=JSON.parse(P):"vars"==R&&0<P.length&&"-"!=P?k=JSON.parse(P):"identity"==R&&0<P.length&&"-"!=P?D=P:"parent"==R&&0<P.length&&"-"!=P?F=P:"namespace"==R&&0<P.length&&"-"!=P?E=P:"width"==R?G=P:"height"==R?H=
P:"left"==R&&0<P.length?J=P:"top"==R&&0<P.length?I=P:"ignore"==R?da=P.split(","):"connect"==R?X.push(JSON.parse(P)):"link"==R?fa=P:"padding"==R?U=parseFloat(P):"edgespacing"==R?K=parseFloat(P):"nodespacing"==R?M=parseFloat(P):"levelspacing"==R?N=parseFloat(P):"layout"==R&&(V=P)}}}if(null==c[O])throw Error(mxResources.get("invalidOrMissingFile"));for(var ca=this.editor.csvToArray(c[O]),R=W=null,P=[],S=0;S<ca.length;S++)D==ca[S]&&(W=S),F==ca[S]&&(R=S),P.push(mxUtils.trim(ca[S]).replace(/[^a-z0-9]+/ig,
"_").replace(/^\d+/,"").replace(/_+$/,""));null==Y&&(Y="%"+P[0]+"%");if(null!=X)for(var ba=0;ba<X.length;ba++)null==g[X[ba].to]&&(g[X[ba].to]={});D=[];for(S=O+1;S<c.length;S++){var ha=this.editor.csvToArray(c[S]);if(null==ha){var ja=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(ja+" ("+S+"):\n"+mxResources.get("containsValidationErrors"));}0<ha.length&&D.push(ha)}L.model.beginUpdate();try{for(S=0;S<D.length;S++){var ha=D[S],Q=null,ka=null!=W?E+ha[W]:null;null!=ka&&(Q=L.model.getCell(ka));
var c=null!=Q,ea=new mxCell(Y,new mxGeometry(aa,Z,0,0),m||"whiteSpace=wrap;html=1;");ea.vertex=!0;ea.id=ka;for(var ia=0;ia<ha.length;ia++)L.setAttributeForCell(ea,P[ia],ha[ia]);if(null!=z&&null!=B){var ua=B[ea.getAttribute(z)];null!=ua&&L.labelChanged(ea,ua)}if(null!=A&&null!=n){var va=n[ea.getAttribute(A)];null!=va&&(ea.style=va)}L.setAttributeForCell(ea,"placeholders","1");ea.style=L.replacePlaceholders(ea,ea.style,k);c&&(L.model.setGeometry(Q,ea.geometry),L.model.setStyle(Q,ea.style),0>mxUtils.indexOf(e,
Q)&&e.push(Q));Q=ea;if(!c)for(ba=0;ba<X.length;ba++)g[X[ba].to][Q.getAttribute(X[ba].to)]=Q;null!=fa&&"link"!=fa&&(L.setLinkForCell(Q,Q.getAttribute(fa)),L.setAttributeForCell(Q,fa,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[Q]));var wa=this.editor.graph.getPreferredSizeForCell(Q);Q.vertex&&(null!=J&&null!=Q.getAttribute(J)&&(Q.geometry.x=aa+parseFloat(Q.getAttribute(J))),null!=I&&null!=Q.getAttribute(I)&&(Q.geometry.y=ga+parseFloat(Q.getAttribute(I))),"@"==G.charAt(0)&&null!=Q.getAttribute(G.substring(1))?
Q.geometry.width=parseFloat(Q.getAttribute(G.substring(1))):Q.geometry.width="auto"==G?wa.width+U:parseFloat(G),"@"==H.charAt(0)&&null!=Q.getAttribute(H.substring(1))?Q.geometry.height=parseFloat(Q.getAttribute(H.substring(1))):Q.geometry.height="auto"==H?wa.height+U:parseFloat(H),Z+=Q.geometry.height+M);c?(null==f[ka]&&(f[ka]=[]),f[ka].push(Q)):(F=null!=R?L.model.getCell(E+ha[R]):null,d.push(Q),null!=F?(F.style=L.replacePlaceholders(F,C,k),L.addCell(Q,F)):e.push(L.addCell(Q)))}for(var na=e.slice(),
la=e.slice(),ba=0;ba<X.length;ba++)for(var xa=X[ba],S=0;S<d.length;S++){var Q=d[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(L.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),e=0;e<d.length;e++){var f=g[c.to][d[e]];if(null!=f){var l=c.label;null!=c.fromlabel&&(l=(b.getAttribute(c.fromlabel)||"")+(l||""));null!=c.tolabel&&(l=(l||"")+(f.getAttribute(c.tolabel)||""));var m="target"==c.placeholders==!c.invert?f:a,m=null!=c.style?L.replacePlaceholders(m,
c.style,k):L.createCurrentEdgeStyle(),l=L.insertEdge(null,null,l||"",c.invert?f:a,c.invert?a:f,m);if(null!=c.labels)for(m=0;m<c.labels.length;m++){var n=c.labels[m],p=new mxCell(n.label||m,new mxGeometry(null!=n.x?n.x:0,null!=n.y?n.y:0,0,0),"resizable=0;html=1;");p.vertex=!0;p.connectable=!1;p.geometry.relative=!0;if(null!=n.dx||null!=n.dy)p.geometry.offset=new mxPoint(null!=n.dx?n.dx:0,null!=n.dy?n.dy:0);l.insert(p)}la.push(l);mxUtils.remove(c.invert?a:f,na)}}});ya(Q,Q,xa);if(null!=f[Q.id])for(ia=
0;ia<f[Q.id].length;ia++)ya(Q,f[Q.id][ia],xa)}if(null!=da)for(S=0;S<d.length;S++)for(Q=d[S],ia=0;ia<da.length;ia++)L.setAttributeForCell(Q,mxUtils.trim(da[ia]),null);if(0<e.length){var ra=new mxParallelEdgeLayout(L);ra.spacing=K;ra.checkOverlap=!0;var oa=function(){0<ra.spacing&&ra.execute(L.getDefaultParent());for(var a=0;a<e.length;a++){var b=L.getCellGeometry(e[a]);b.x=Math.round(L.snap(b.x));b.y=Math.round(L.snap(b.y));"auto"==G&&(b.width=Math.round(L.snap(b.width)));"auto"==H&&(b.height=Math.round(L.snap(b.height)))}};
if("["==V.charAt(0)){var za=T;L.view.validate();this.executeLayoutList(JSON.parse(V),function(){oa();za()});T=null}else if("circle"==V){var pa=new mxCircleLayout(L);pa.disableEdgeStyle=!1;pa.resetEdges=!1;var ta=pa.isVertexIgnored;pa.isVertexIgnored=function(a){return ta.apply(this,arguments)||0>mxUtils.indexOf(e,a)};this.executeLayout(function(){pa.execute(L.getDefaultParent());oa()},!0,T);T=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&la.length==2*e.length-1&&1==na.length){L.view.validate();
var sa=new mxCompactTreeLayout(L,"horizontaltree"==V);sa.levelDistance=M;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(L.getDefaultParent(),0<na.length?na[0]:null)},!0,T);T=null}else if("horizontalflow"==V||"verticalflow"==V||"auto"==V&&1==na.length){L.view.validate();var qa=new mxHierarchicalLayout(L,"horizontalflow"==V?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);qa.intraCellSpacing=M;qa.parallelEdgeSpacing=K;qa.interRankCellSpacing=N;qa.disableEdgeStyle=
!1;this.executeLayout(function(){qa.execute(L.getDefaultParent(),la);L.moveCells(la,aa,ga)},!0,T);T=null}else if("organic"==V||"auto"==V&&la.length>e.length){L.view.validate();var ma=new mxFastOrganicLayout(L);ma.forceConstant=3*M;ma.disableEdgeStyle=!1;ma.resetEdges=!1;var Aa=ma.isVertexIgnored;ma.isVertexIgnored=function(a){return Aa.apply(this,arguments)||0>mxUtils.indexOf(e,a)};this.executeLayout(function(){ma.execute(L.getDefaultParent());oa()},!0,T);T=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=
T&&T()}}catch(Ba){this.handleError(Ba)}};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(" "),
@ -10438,7 +10438,7 @@ this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle")
return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';
var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var m=g[a];if("R"==m.substring(0,1)){var n=JSON.parse(decodeURIComponent(m.substring(1)));f[n[0]]={id:n[0],title:n[1],downloadUrl:n[2]}}}}catch(x){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";if(0==a.length)e.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&
(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},mxUtils.bind(this,function(a){e.innerHTML="";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,
function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));
function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));
for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};
EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];if(null==c)throw Error("No callback for "+(null!=b?b.callbackId:"null"));a.error?c.error&&c.error(a.error.errResp):
c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,e,f){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(g);d&&e.apply(this,arguments)}),l=mxUtils.bind(this,function(){window.clearTimeout(g);d&&f.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;
@ -10456,32 +10456,32 @@ function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};
null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();
return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language",
"da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(a,b,c,e,f,g,m,n){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(a,b,c,e,f,g,m,n)};EditorUi.prototype.loadFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(a)};EditorUi.prototype.createSvgDataUri=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(a)};EditorUi.prototype.embedCssFonts=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");
return this.editor.embedCssFonts(a,b)};EditorUi.prototype.embedExtFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(a)};EditorUi.prototype.exportToCanvas=function(a,b,c,e,f,g,m,n,y,x,B,z,C,A,D,F){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(a,b,c,e,f,g,m,n,y,x,B,z,C,A,D,F)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
return this.editor.embedCssFonts(a,b)};EditorUi.prototype.embedExtFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(a)};EditorUi.prototype.exportToCanvas=function(a,b,c,e,f,g,m,n,y,x,A,z,B,C,D,F){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(a,b,c,e,f,g,m,n,y,x,A,z,B,C,D,F)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(a,b,c,e)};EditorUi.prototype.convertImageToDataUri=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(a,b)};EditorUi.prototype.base64Encode=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(a)};EditorUi.prototype.updateCRC=
function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(a,b,c,e)};EditorUi.prototype.crc32=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(a)};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,e,f){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(a,b,c,e,f)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=
urlParams.forceMigration)return null;for(var a=[],b=0;b<localStorage.length;b++){var c=localStorage.key(b),e=localStorage.getItem(c);if(0<c.length&&(".scratchpad"==c||"."!=c.charAt(0))&&0<e.length){var f="<mxfile "===e.substring(0,8)||"<?xml"===e.substring(0,5)||"\x3c!--[if IE]>"===e.substring(0,12),e="<mxlibrary>"===e.substring(0,11);(f||e)&&a.push(c)}}return a};EditorUi.prototype.getLocalStorageFile=function(a){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;
var b=localStorage.getItem(a);return{title:a,data:b,isLib:"<mxlibrary>"===b.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
var CommentsWindow=function(a,c,e,b,g,f){function m(){for(var a=B.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==B&&b++;z.style.display=0==b?"block":"none"}function n(a,b,c,d){function e(){b.removeChild(k);b.removeChild(l);g.style.display="block";f.style.display="block"}v={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
var CommentsWindow=function(a,c,e,b,g,f){function m(){for(var a=A.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==A&&b++;z.style.display=0==b?"block":"none"}function n(a,b,c,d){function e(){b.removeChild(k);b.removeChild(l);g.style.display="block";f.style.display="block"}v={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
"geCommentEditTxtArea";k.style.minHeight=f.offsetHeight+"px";k.value=a.content;b.insertBefore(k,f);var l=document.createElement("div");l.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),m()):e();v=null});n.className="geCommentEditBtn";l.appendChild(n);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=k.value;mxUtils.write(f,a.content);e();c(a);v=null});mxEvent.addListener(k,"keydown",mxUtils.bind(this,
function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";l.appendChild(p);b.insertBefore(l,f);g.style.display="none";f.style.display="none";k.focus()}function d(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function k(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function l(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,g){function C(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});E.appendChild(e);d&&(e.style.display="none")}function A(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=x;a(b);return{pdiv:d,replies:c}}function I(c,d,e,g,m){function z(){k(v);b.addReply(t,function(a){t.id=a;b.replies.push(t);p(v);e&&e()},function(b){q();l(v);a.handleError(b,null,
null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},g,m)}function q(){n(t,v,function(a){z()},!0)}var C=A().pdiv,t=a.newComment(c,a.getCurrentUser());t.pCommentId=b.id;null==b.replies&&(b.replies=[]);var v=u(t,b.replies,C,f+1);d?q():z()}if(g||!b.isResolved){z.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",b.id);x.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(x.style.backgroundColor="ghostWhite");
[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function k(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function l(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,g){function B(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});E.appendChild(e);d&&(e.style.display="none")}function C(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=x;a(b);return{pdiv:d,replies:c}}function I(c,d,e,g,m){function z(){k(v);b.addReply(t,function(a){t.id=a;b.replies.push(t);p(v);e&&e()},function(b){q();l(v);a.handleError(b,null,
null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},g,m)}function q(){n(t,v,function(a){z()},!0)}var B=C().pdiv,t=a.newComment(c,a.getCurrentUser());t.pCommentId=b.id;null==b.replies&&(b.replies=[]);var v=u(t,b.replies,B,f+1);d?q():z()}if(g||!b.isResolved){z.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",b.id);x.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(x.style.backgroundColor="ghostWhite");
var y=document.createElement("div");y.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=b.user.pictureUrl||Editor.userImage;y.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";y.appendChild(F);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,b.user.displayName||"");F.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",b.id);d(b,
K);F.appendChild(K);x.appendChild(y);y=document.createElement("div");y.className="geCommentTxt";mxUtils.write(y,b.content||"");x.appendChild(y);b.isLocked&&(x.style.opacity="0.5");y=document.createElement("div");y.className="geCommentActions";var E=document.createElement("ul");E.className="geCommentActionsList";y.appendChild(E);t||b.isLocked||0!=f&&!q||C(mxResources.get("reply"),function(){I("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||t||b.isLocked||(C(mxResources.get("edit"),
function(){function c(){n(b,x,function(){k(x);b.editComment(b.content,function(){p(x)},function(b){l(x);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),C(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){k(x);b.deleteComment(function(a){if(!0===a){a=x.querySelector(".geCommentTxt");a.innerHTML="";mxUtils.write(a,mxResources.get("msgDeleted"));var d=x.querySelectorAll(".geCommentAction");for(a=
0;a<d.length;a++)d[a].parentNode.removeChild(d[a]);p(x);x.style.opacity="0.5"}else{d=A(b).replies;for(a=0;a<d.length;a++)B.removeChild(d[a]);for(a=0;a<c.length;a++)if(c[a]==b){c.splice(a,1);break}z.style.display=0==B.getElementsByTagName("div").length?"block":"none"}},function(b){l(x);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));t||b.isLocked||0!=f||C(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=
a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=A(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"),l=0;l<k.length;l++)k[l]!=c.parentNode&&(k[l].style.display=d);D||(e[g].style.display="none")}m()}b.isResolved?I(mxResources.get("reOpened")+": ",!0,c,!1,
!0):I(mxResources.get("markedAsResolved"),!1,c,!0)});x.appendChild(y);null!=e?B.insertBefore(x,e.nextSibling):B.appendChild(x);for(e=0;null!=b.replies&&e<b.replies.length;e++)y=b.replies[e],y.isResolved=b.isResolved,u(y,b.replies,null,f+1,g);null!=v&&(v.comment.id==b.id?(g=b.content,b.content=v.comment.content,n(b,x,v.saveCallback,v.deleteOnCancel),b.content=g):null==v.comment.id&&v.comment.pCommentId==b.id&&(B.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel)));return x}}var t=
!a.canComment(),q=a.canReplyToReplies(),v=null,y=document.createElement("div");y.className="geCommentsWin";y.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var x=EditorUi.compactUi?"26px":"30px",B=document.createElement("div");B.className="geCommentsList";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;B.style.bottom=parseInt(x)+7+"px";y.appendChild(B);var z=document.createElement("span");z.style.cssText="display:none;padding-top:10px;text-align:center;";
mxUtils.write(z,mxResources.get("noCommentsFound"));var C=document.createElement("div");C.className="geToolbarContainer geCommentsToolbar";C.style.height=x;C.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";C.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(C.style.filter="none");x=document.createElement("a");x.className="geButton";mxClient.IS_QUIRKS&&(x.style.filter="none");if(!t){var A=x.cloneNode();A.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';
A.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(A,"click",function(b){function c(){n(d,e,function(b){k(e);a.addComment(b,function(a){b.id=a;F.push(b);p(e)},function(b){l(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var d=a.newComment("",a.getCurrentUser()),e=u(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});C.appendChild(A)}A=x.cloneNode();A.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';
A.setAttribute("title",mxResources.get("showResolved"));var D=!1;"dark"==uiTheme&&(A.style.filter="invert(100%)");mxEvent.addListener(A,"click",function(a){this.className=(D=!D)?"geButton geCheckedBtn":"geButton";E();a.preventDefault();mxEvent.consume(a)});C.appendChild(A);a.commentsRefreshNeeded()&&(A=x.cloneNode(),A.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',A.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(A.style.filter="invert(100%)"),
mxEvent.addListener(A,"click",function(a){E();a.preventDefault();mxEvent.consume(a)}),C.appendChild(A));a.commentsSaveNeeded()&&(x=x.cloneNode(),x.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',x.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&(x.style.filter="invert(100%)"),mxEvent.addListener(x,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),C.appendChild(x));y.appendChild(C);var F=[],E=mxUtils.bind(this,function(){this.hasError=
!1;if(null!=v)try{v.div=v.div.cloneNode(!0);var b=v.div.querySelector(".geCommentEditTxtArea"),c=v.div.querySelector(".geCommentEditBtns");v.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(I){a.handleError(I)}B.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";q=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=
a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});B.innerHTML="";B.appendChild(z);z.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),u(F[a],F,null,0,D);null!=v&&null==v.comment.id&&null==v.comment.pCommentId&&(B.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel))},mxUtils.bind(this,function(a){B.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
(a&&a.message?": "+a.message:""));this.hasError=!0})):B.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});E();this.refreshComments=E;C=mxUtils.bind(this,function(){function a(b){var e=c[b.id];if(null!=e)for(d(b,e),e=0;null!=b.replies&&e<b.replies.length;e++)a(b.replies[e])}if(this.window.isVisible()){for(var b=B.querySelectorAll(".geCommentDate"),c={},e=0;e<b.length;e++){var f=b[e];c[f.getAttribute("data-commentId")]=f}for(e=0;e<F.length;e++)a(F[e])}});setInterval(C,6E4);this.refreshCommentsTime=
C;this.window=new mxWindow(mxResources.get("comments"),y,c,e,b,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,
K);F.appendChild(K);x.appendChild(y);y=document.createElement("div");y.className="geCommentTxt";mxUtils.write(y,b.content||"");x.appendChild(y);b.isLocked&&(x.style.opacity="0.5");y=document.createElement("div");y.className="geCommentActions";var E=document.createElement("ul");E.className="geCommentActionsList";y.appendChild(E);t||b.isLocked||0!=f&&!q||B(mxResources.get("reply"),function(){I("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||t||b.isLocked||(B(mxResources.get("edit"),
function(){function c(){n(b,x,function(){k(x);b.editComment(b.content,function(){p(x)},function(b){l(x);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){k(x);b.deleteComment(function(a){if(!0===a){a=x.querySelector(".geCommentTxt");a.innerHTML="";mxUtils.write(a,mxResources.get("msgDeleted"));var d=x.querySelectorAll(".geCommentAction");for(a=
0;a<d.length;a++)d[a].parentNode.removeChild(d[a]);p(x);x.style.opacity="0.5"}else{d=C(b).replies;for(a=0;a<d.length;a++)A.removeChild(d[a]);for(a=0;a<c.length;a++)if(c[a]==b){c.splice(a,1);break}z.style.display=0==A.getElementsByTagName("div").length?"block":"none"}},function(b){l(x);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));t||b.isLocked||0!=f||B(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=
a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=C(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"),l=0;l<k.length;l++)k[l]!=c.parentNode&&(k[l].style.display=d);D||(e[g].style.display="none")}m()}b.isResolved?I(mxResources.get("reOpened")+": ",!0,c,!1,
!0):I(mxResources.get("markedAsResolved"),!1,c,!0)});x.appendChild(y);null!=e?A.insertBefore(x,e.nextSibling):A.appendChild(x);for(e=0;null!=b.replies&&e<b.replies.length;e++)y=b.replies[e],y.isResolved=b.isResolved,u(y,b.replies,null,f+1,g);null!=v&&(v.comment.id==b.id?(g=b.content,b.content=v.comment.content,n(b,x,v.saveCallback,v.deleteOnCancel),b.content=g):null==v.comment.id&&v.comment.pCommentId==b.id&&(A.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel)));return x}}var t=
!a.canComment(),q=a.canReplyToReplies(),v=null,y=document.createElement("div");y.className="geCommentsWin";y.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var x=EditorUi.compactUi?"26px":"30px",A=document.createElement("div");A.className="geCommentsList";A.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;A.style.bottom=parseInt(x)+7+"px";y.appendChild(A);var z=document.createElement("span");z.style.cssText="display:none;padding-top:10px;text-align:center;";
mxUtils.write(z,mxResources.get("noCommentsFound"));var B=document.createElement("div");B.className="geToolbarContainer geCommentsToolbar";B.style.height=x;B.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(B.style.filter="none");x=document.createElement("a");x.className="geButton";mxClient.IS_QUIRKS&&(x.style.filter="none");if(!t){var C=x.cloneNode();C.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';
C.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(C,"click",function(b){function c(){n(d,e,function(b){k(e);a.addComment(b,function(a){b.id=a;F.push(b);p(e)},function(b){l(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var d=a.newComment("",a.getCurrentUser()),e=u(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});B.appendChild(C)}C=x.cloneNode();C.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';
C.setAttribute("title",mxResources.get("showResolved"));var D=!1;"dark"==uiTheme&&(C.style.filter="invert(100%)");mxEvent.addListener(C,"click",function(a){this.className=(D=!D)?"geButton geCheckedBtn":"geButton";E();a.preventDefault();mxEvent.consume(a)});B.appendChild(C);a.commentsRefreshNeeded()&&(C=x.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',C.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(C.style.filter="invert(100%)"),
mxEvent.addListener(C,"click",function(a){E();a.preventDefault();mxEvent.consume(a)}),B.appendChild(C));a.commentsSaveNeeded()&&(x=x.cloneNode(),x.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',x.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&(x.style.filter="invert(100%)"),mxEvent.addListener(x,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),B.appendChild(x));y.appendChild(B);var F=[],E=mxUtils.bind(this,function(){this.hasError=
!1;if(null!=v)try{v.div=v.div.cloneNode(!0);var b=v.div.querySelector(".geCommentEditTxtArea"),c=v.div.querySelector(".geCommentEditBtns");v.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(I){a.handleError(I)}A.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";q=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=
a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});A.innerHTML="";A.appendChild(z);z.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),u(F[a],F,null,0,D);null!=v&&null==v.comment.id&&null==v.comment.pCommentId&&(A.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel))},mxUtils.bind(this,function(a){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
(a&&a.message?": "+a.message:""));this.hasError=!0})):A.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});E();this.refreshComments=E;B=mxUtils.bind(this,function(){function a(b){var e=c[b.id];if(null!=e)for(d(b,e),e=0;null!=b.replies&&e<b.replies.length;e++)a(b.replies[e])}if(this.window.isVisible()){for(var b=A.querySelectorAll(".geCommentDate"),c={},e=0;e<b.length;e++){var f=b[e];c[f.getAttribute("data-commentId")]=f}for(e=0;e<F.length;e++)a(F[e])}});setInterval(B,6E4);this.refreshCommentsTime=
B;this.window=new mxWindow(mxResources.get("comments"),y,c,e,b,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,
(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var G=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",G);this.destroy=function(){mxEvent.removeListener(window,"resize",G);this.window.destroy()}},ConfirmDialog=
function(a,c,e,b,g,f,m,n,d,k,l){var p=document.createElement("div");p.style.textAlign="center";l=null!=l?l:44;var u=document.createElement("div");u.style.padding="6px";u.style.overflow="auto";u.style.maxHeight=l+"px";u.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(u.style.height="60px");mxUtils.write(u,c);p.appendChild(u);null!=k&&(u=document.createElement("div"),u.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",k),u.appendChild(c),p.appendChild(u));k=document.createElement("div");
k.style.textAlign="center";k.style.whiteSpace="nowrap";var t=document.createElement("input");t.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(t.checked)});f.className="geBtn";null!=n&&(f.innerHTML=n+"<br>"+f.innerHTML,f.style.paddingBottom="8px",f.style.paddingTop="8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&k.appendChild(f);var q=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=e&&
@ -10549,8 +10549,8 @@ DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mx
DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
DrawioFileSync.prototype.catchup=function(a,c,e,b){if(null!=a&&(null==b||!b())){var g=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==g)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=c&&c();else if(this.isValidState()){var m=this.file.getDescriptorSecret(a);if(null==m)this.reload(c,e,b);else{var n=0,d=!1,k=mxUtils.bind(this,function(){if(null==b||!b())if(f!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var l=!0,p=window.setTimeout(mxUtils.bind(this,
function(){l=!1;this.reload(c,e,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(g)+(null!=m?"&secret="+encodeURIComponent(m):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(p);if(l&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var m=null,q=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var u=
JSON.parse(g.getText());if(null!=u&&0<u.length)for(var y=0;y<u.length;y++){var x=this.stringToObject(u[y]);if(x.v>DrawioFileSync.PROTOCOL){d=!0;q=[];break}else if(x.v===DrawioFileSync.PROTOCOL&&null!=x.d)m=x.d.checksum,q.push(x.d.patch);else{d=!0;q=[];break}}}catch(B){q=[],null!=window.console&&"1"==urlParams.test&&console.log(B)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,m,a,c,e,b)):n<=this.maxCacheReadyRetries-1&&!d&&401!=g.getStatus()&&503!=g.getStatus()?(n++,this.file.stats.cacheMiss++,
window.setTimeout(k,(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,e,b))}catch(B){null!=e&&e(B)}}else null!=e&&e()}))}else null!=e&&e()});window.setTimeout(k,this.cacheReadyDelay)}}else null!=e&&e()}};DrawioFileSync.prototype.reload=function(a,c,e,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),e,b)};
JSON.parse(g.getText());if(null!=u&&0<u.length)for(var y=0;y<u.length;y++){var x=this.stringToObject(u[y]);if(x.v>DrawioFileSync.PROTOCOL){d=!0;q=[];break}else if(x.v===DrawioFileSync.PROTOCOL&&null!=x.d)m=x.d.checksum,q.push(x.d.patch);else{d=!0;q=[];break}}}catch(A){q=[],null!=window.console&&"1"==urlParams.test&&console.log(A)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,m,a,c,e,b)):n<=this.maxCacheReadyRetries-1&&!d&&401!=g.getStatus()&&503!=g.getStatus()?(n++,this.file.stats.cacheMiss++,
window.setTimeout(k,(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,e,b))}catch(A){null!=e&&e(A)}}else null!=e&&e()}))}else null!=e&&e()});window.setTimeout(k,this.cacheReadyDelay)}}else null!=e&&e()}};DrawioFileSync.prototype.reload=function(a,c,e,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),e,b)};
DrawioFileSync.prototype.merge=function(a,c,e,b,g,f){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var m=this.file.ignorePatches(a),n=this.file.getDescriptorRevisionId(e);if(!m){for(f=0;f<a.length;f++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
a[f]);var d=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",n,"etag",this.file.getDescriptorEtag(e),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==d,c);if(null!=c&&c!=d){var k=this.ui.hashValue(this.file.getCurrentRevisionId()),l=this.ui.hashValue(n);this.file.checksumError(g,a,"From: "+k+"\nTo: "+l+"\nChecksum: "+c+"\nCurrent: "+d,n,"merge");
return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),e);this.file.backupPatch=null;null!=b&&b()}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=g&&g(t);try{if(this.file.errorReportsEnabled)k=this.ui.hashValue(this.file.getCurrentRevisionId()),l=this.ui.hashValue(n),this.file.sendErrorReport("Error in merge",
@ -10627,7 +10627,7 @@ DriveClient.prototype.placeholderThumbnail="iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMA
DriveClient.prototype.sameWinAuthMode=!1;DriveClient.prototype.sameWinRedirectUrl=null;DriveClient.prototype.setUser=function(a){this.user=a;null==this.user?(this.userId=null,null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null)):this.userId=a.id;this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.setUserId=function(a){this.userId=a;null!=this.user&&this.user.id!=this.userId&&(this.user=null)};DriveClient.prototype.getUser=function(){return this.user};
DriveClient.prototype.getUsersList=function(){var a=[],c=JSON.parse(this.getPersistentToken(!0)),e=null;if(null!=c){null!=c.current&&(e=c.current.userId,a.push(c[e].user),a[0].isCurrent=!0);for(var b in c)"current"!=b&&b!=e&&a.push(c[b].user)}return a};DriveClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};
DriveClient.prototype.execute=function(a){var c=mxUtils.bind(this,function(c){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();a()}),mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.logout();this.ui.showError(mxResources.get("error"),b,mxResources.get("help"),
mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,c)};
mxUtils.bind(this,function(){this.ui.openLink("https://www.diagrams.net/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,c)};
DriveClient.prototype.executeRequest=function(a,c,e){try{var b=!0,g=null,f=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var m=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=a;null!=g&&window.clearTimeout(g);g=window.setTimeout(mxUtils.bind(this,function(){b=!1;null!=e&&e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:m})}),this.ui.timeout);var n=null,d=!1;"string"===typeof a.params?n=a.params:null!=a.params&&(n=JSON.stringify(a.params),
d=!0);var k=a.fullUrl||this.GDriveBaseUrl+a.url;d&&(k+=(0<k.indexOf("?")?"&":"?")+"alt=json");var l=new mxXmlRequest(k,n,a.method||"GET");l.setRequestHeaders=mxUtils.bind(this,function(b,c){if(null!=a.headers)for(var e in a.headers)b.setRequestHeader(e,a.headers[e]);else null!=a.contentType?b.setRequestHeader("Content-Type",a.contentType):d&&b.setRequestHeader("Content-Type","application/json");b.setRequestHeader("Authorization","Bearer "+this.token)});l.send(mxUtils.bind(this,function(d){try{if(window.clearTimeout(g),
b){var k;try{k=JSON.parse(d.getText())}catch(v){k=null}if(200<=d.getStatus()&&299>=d.getStatus())null!=c&&c(k);else{var l=null!=k&&null!=k.error?null!=k.error.data?k.error.data:k.error.errors:null,n=null!=l&&0<l.length?l[0].reason:null;null==e||null==k||null==k.error||-1!=k.error.code&&(403!=k.error.code||"domainPolicy"!=n&&"The requested mime type change is forbidden."!=k.error.message)?null!=k&&null!=k.error&&(401==k.error.code||403==k.error.code&&"rateLimitExceeded"!=n)?403==k.error.code&&this.retryAuth||
@ -10653,18 +10653,18 @@ b.substring(0,32)&&(n=b.substring(22),b=window.atob&&!mxClient.IS_SF?atob(n):Bas
new LocalFile(this.ui,b,a.title,!0):new DriveFile(this.ui,b,a))}}catch(t){if(null!=e)e(t);else throw t;}}),e,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title)||/\.pdf$/i.test(a.title),null,null,null,f)}catch(n){if(null!=e)e(n);else throw n;}};
DriveClient.prototype.saveFile=function(a,c,e,b,g,f,m,n,d){try{var k=0;a.saveLevel=1;var l=mxUtils.bind(this,function(c){if(null!=b)b(c);else throw c;try{if(!a.isConflict(c)){var d="sl_"+a.saveLevel+"-error_"+(a.getErrorMessage(c)||"unknown");null!=c&&null!=c.error&&null!=c.error.code&&(d+="-code_"+c.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?
"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:d,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(F){}}),p=mxUtils.bind(this,function(a){l(a);try{EditorUi.logError(a.message,null,null,a)}catch(D){}});if(a.isEditable()&&null!=a.desc){var u=(new Date).getTime(),t=a.desc.etag,q=a.desc.modifiedDate,v=a.desc.headRevisionId,y=
this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());f=null!=f?f:!1;var x=null,B=!1,z={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(z.mimeType))z.mimeType=this.xmlMimeType,x=a.desc,B=c=!0;else if("application/octet-stream"==z.mimeType||"1"==urlParams["override-mime"]&&z.mimeType!=this.xmlMimeType)z.mimeType=this.xmlMimeType;var C=mxUtils.bind(this,function(b,g,C){try{a.saveLevel=3;a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",
value:Editor.guid(32)}),null==a.getChannelKey()&&n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:null!=d?d:Editor.guid(32)}));C||(null!=b||f||(b=this.placeholderThumbnail,g=this.placeholderMimeType),null!=b&&null!=g&&(z.thumbnail={image:b,mimeType:g}));var A=a.getData(),D=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-u,a.saveLevel=11,null==b)l({message:mxResources.get("errorSavingFile")+": Empty response"});else{var d=(new Date(b.modifiedDate)).getTime()-
this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());f=null!=f?f:!1;var x=null,A=!1,z={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(z.mimeType))z.mimeType=this.xmlMimeType,x=a.desc,A=c=!0;else if("application/octet-stream"==z.mimeType||"1"==urlParams["override-mime"]&&z.mimeType!=this.xmlMimeType)z.mimeType=this.xmlMimeType;var B=mxUtils.bind(this,function(b,g,B){try{a.saveLevel=3;a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",
value:Editor.guid(32)}),null==a.getChannelKey()&&n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:null!=d?d:Editor.guid(32)}));B||(null!=b||f||(b=this.placeholderThumbnail,g=this.placeholderMimeType),null!=b&&null!=g&&(z.thumbnail={image:b,mimeType:g}));var C=a.getData(),D=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-u,a.saveLevel=11,null==b)l({message:mxResources.get("errorSavingFile")+": Empty response"});else{var d=(new Date(b.modifiedDate)).getTime()-
(new Date(q)).getTime();if(0>=d||t==b.etag||c&&v==b.headRevisionId){a.saveLevel=12;var f=[];0>=d&&f.push("invalid modified time");t==b.etag&&f.push("stale etag");c&&v==b.headRevisionId&&f.push("stale revision");var g=f.join(", ");l({message:mxResources.get("errorSavingFile")+": "+g},b);try{EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+v+"."+q+"-"+this.ui.hashValue(t)+"-to-"+b.headRevisionId+"."+b.modifiedDate+"-"+this.ui.hashValue(b.etag)+(0<g.length?"-errors-"+
g:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(U){}}else if(a.saveLevel=null,e(b,A),null!=x){this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+a.getHash(),action:"from_"+
g:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(U){}}else if(a.saveLevel=null,e(b,C),null!=x){this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+a.getHash(),action:"from_"+
x.id+"."+x.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(U){}}}}catch(U){p(U)}}),F=mxUtils.bind(this,function(d,e){a.saveLevel=4;try{null!=n&&(z.properties=n);var f=m||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),g=mxUtils.bind(this,function(b){a.saveLevel=5;try{var g=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&
a.desc.mimeType!=this.libraryMimeType,m=!0,n=null;try{n=window.setTimeout(mxUtils.bind(this,function(){m=!1;l({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(a.getId(),z,d,c||b||g,e,b?null:f,B),mxUtils.bind(this,function(a){window.clearTimeout(n);m&&D(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(m){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},
a.desc.mimeType!=this.libraryMimeType,m=!0,n=null;try{n=window.setTimeout(mxUtils.bind(this,function(){m=!1;l({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(a.getId(),z,d,c||b||g,e,b?null:f,A),mxUtils.bind(this,function(a){window.clearTimeout(n);m&&D(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(m){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},
mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==f)if(k<this.staleEtagMaxRetries){k++;var d=2*k*this.coolOff*(1+.1*(Math.random()-.5));window.setTimeout(q,d);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",k,"delay",d)}else{q(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+a.getHash(),action:"rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?
"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(fa){}}else"1"==urlParams.test&&c.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed","local",f,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),l(b,c)}catch(fa){p(fa)}}),mxUtils.bind(this,function(){l(b)})):l(b)}catch(V){p(V)}}}))}catch(Y){p(Y)}}),
q=mxUtils.bind(this,function(b){a.saveLevel=9;if(b||null==f)g(b);else{var c=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){c=!1;l({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(ga){}this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(e){window.clearTimeout(d);if(c){a.saveLevel=10;try{null!=e&&e.headRevisionId==v?("1"==urlParams.test&&f!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",
f,"to",e.etag,"rev",a.desc.headRevisionId,"response",[e],"file",[a]),f=e.etag,g(b)):l({error:{code:412}},e)}catch(Y){p(Y)}}}),mxUtils.bind(this,function(b){window.clearTimeout(d);c&&(a.saveLevel=11,l(b))}))}});if(y&&null==b){a.saveLevel=8;var C=new Image;C.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/C.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(C.height*a);b.getContext("2d").drawImage(C,0,0,b.width,b.height);var c=b.toDataURL(),c=
c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");z.thumbnail={image:c,mimeType:"image/png"};q(!1)}catch(ga){try{q(!1)}catch(Y){p(Y)}}});C.src="data:image/png;base64,"+d}else q(!1)}catch(T){p(T)}});if(y){var J=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){F(a,!0)}),l,this.ui.getCurrentFile()!=a?A:null,J.scale,J.border)}else F(A,!1)}catch(I){p(I)}});try{a.saveLevel=2,(f||y||a.constructor==DriveLibrary||!this.enableThumbnails||
"0"==urlParams.thumb||null!=z.mimeType&&"application/vnd.jgraph.mxfile"!=z.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(F){b=null}C(b,"image/png")}catch(F){p(F)}})))&&C(null,null,a.constructor!=DriveLibrary)}catch(A){p(A)}}else this.ui.editor.graph.reset(),l({message:mxResources.get("readOnly")})}catch(A){p(A)}};
f,"to",e.etag,"rev",a.desc.headRevisionId,"response",[e],"file",[a]),f=e.etag,g(b)):l({error:{code:412}},e)}catch(Y){p(Y)}}}),mxUtils.bind(this,function(b){window.clearTimeout(d);c&&(a.saveLevel=11,l(b))}))}});if(y&&null==b){a.saveLevel=8;var B=new Image;B.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/B.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(B.height*a);b.getContext("2d").drawImage(B,0,0,b.width,b.height);var c=b.toDataURL(),c=
c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");z.thumbnail={image:c,mimeType:"image/png"};q(!1)}catch(ga){try{q(!1)}catch(Y){p(Y)}}});B.src="data:image/png;base64,"+d}else q(!1)}catch(T){p(T)}});if(y){var J=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){F(a,!0)}),l,this.ui.getCurrentFile()!=a?C:null,J.scale,J.border)}else F(C,!1)}catch(I){p(I)}});try{a.saveLevel=2,(f||y||a.constructor==DriveLibrary||!this.enableThumbnails||
"0"==urlParams.thumb||null!=z.mimeType&&"application/vnd.jgraph.mxfile"!=z.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(F){b=null}B(b,"image/png")}catch(F){p(F)}})))&&B(null,null,a.constructor!=DriveLibrary)}catch(C){p(C)}}else this.ui.editor.graph.reset(),l({message:mxResources.get("readOnly")})}catch(C){p(C)}};
DriveClient.prototype.insertFile=function(a,c,e,b,g,f,m){f=null!=f?f:this.xmlMimeType;a={mimeType:f,title:a};null!=e&&(a.parents=[{kind:"drive#fileLink",id:e}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,m),mxUtils.bind(this,function(a){f==this.libraryMimeType?b(new DriveLibrary(this.ui,c,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,c,a))}),g)};
DriveClient.prototype.createUploadRequest=function(a,c,e,b,g,f,m){g=null!=g?g:!1;var n={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=f&&(n["If-Match"]=f);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:n,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+
"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=e?g?e:!window.btoa||mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(e):Graph.base64EncodeUnicode(e):"")+"\r\n---------314159265358979323846--"};b||(a.fullUrl+="&newRevision=false");m&&(a.fullUrl+="&pinned=true");return a};
@ -10807,18 +10807,18 @@ GitHubClient.prototype.saveFile=function(a,c,e,b,g){var f=a.meta.org,m=a.meta.re
b)}),e,this.ui.getCurrentFile()!=a?a.getData():null,b.scale,b.border)}else k(a.meta.sha,Base64.encode(a.getData()))});b?this.getSha(f,m,d,n,mxUtils.bind(this,function(b){a.meta.sha=b;l()}),e):l()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
GitHubClient.prototype.showGitHubDialog=function(a,c){var e=null,b=null,g=null,f=null,m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="hidden";m.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(n);var d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.border="1px solid lightgray";d.style.boxSizing=
"border-box";d.style.padding="4px";d.style.overflow="auto";d.style.lineHeight="1.2em";d.style.height="274px";m.appendChild(d);var k=document.createElement("div");k.style.textOverflow="ellipsis";k.style.boxSizing="border-box";k.style.overflow="hidden";k.style.padding="4px";k.style.width="100%";var l=new CustomDialog(this.ui,m,mxUtils.bind(this,function(){c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+f)}));this.ui.showDialog(l.container,420,360,!0,!0);a&&l.okButton.parentNode.removeChild(l.okButton);var p=
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;B()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,B()):this.ui.hideDialog()}),null,{})}),q=null,v=null,y=mxUtils.bind(this,function(m){null==
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;A()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,A()):this.ui.hideDialog()}),null,{})}),q=null,v=null,y=mxUtils.bind(this,function(m){null==
m&&(d.innerHTML="",m=1);var n=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+b+"/contents/"+f+"?ref="+encodeURIComponent(g)+"&per_page=100&page="+m,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));l.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var z=mxUtils.bind(this,
function(){y(m+1)});mxEvent.addListener(q,"click",z);this.executeRequest(n,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==m&&(u(),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var z=!0,q=0;l=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,function(m,n){if(l==
("dir"==m.type)){var C=k.cloneNode();C.style.backgroundColor=z?"dark"==uiTheme?"#000000":"#eeeeee":"";z=!z;var t=document.createElement("img");t.src=IMAGE_PATH+"/"+("dir"==m.type?"folder.png":"file.png");t.setAttribute("align","absmiddle");t.style.marginRight="4px";t.style.marginTop="-4px";t.width=20;C.appendChild(t);C.appendChild(p(m.name+("dir"==m.type?"/":""),mxUtils.bind(this,function(){"dir"==m.type?(f=m.path,y()):a&&"file"==m.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+
m.path))})));d.appendChild(C);q++}})(n[m],m)});l(!0);a&&l(!1)}}),t,!0)}),x=mxUtils.bind(this,function(a,c){null==a&&(d.innerHTML="",a=1);var m=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+b+"/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor=
"pointer";mxUtils.write(q,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(q,"click",n);this.executeRequest(m,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;B()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else if(1==b.length&&c)g=b[0].name,f="",y();else{for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a,b){var c=
k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=a.name;f="";y()})));d.appendChild(c)})(b[e],e);100==b.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&n()},mxEvent.addListener(d,"scroll",v))}}),t)}),B=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled",
"disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&mxEvent.removeListener(d,"scroll",v);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var m=mxUtils.bind(this,function(){B(a+1)});mxEvent.addListener(q,"click",m);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(d,
function(){y(m+1)});mxEvent.addListener(q,"click",z);this.executeRequest(n,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==m&&(u(),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var z=!0,q=0;l=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,function(m,n){if(l==
("dir"==m.type)){var B=k.cloneNode();B.style.backgroundColor=z?"dark"==uiTheme?"#000000":"#eeeeee":"";z=!z;var t=document.createElement("img");t.src=IMAGE_PATH+"/"+("dir"==m.type?"folder.png":"file.png");t.setAttribute("align","absmiddle");t.style.marginRight="4px";t.style.marginTop="-4px";t.width=20;B.appendChild(t);B.appendChild(p(m.name+("dir"==m.type?"/":""),mxUtils.bind(this,function(){"dir"==m.type?(f=m.path,y()):a&&"file"==m.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+
m.path))})));d.appendChild(B);q++}})(n[m],m)});l(!0);a&&l(!1)}}),t,!0)}),x=mxUtils.bind(this,function(a,c){null==a&&(d.innerHTML="",a=1);var m=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+b+"/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor=
"pointer";mxUtils.write(q,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(q,"click",n);this.executeRequest(m,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else if(1==b.length&&c)g=b[0].name,f="",y();else{for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a,b){var c=
k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=a.name;f="";y()})));d.appendChild(c)})(b[e],e);100==b.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&n()},mxEvent.addListener(d,"scroll",v))}}),t)}),A=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled",
"disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&mxEvent.removeListener(d,"scroll",v);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var m=mxUtils.bind(this,function(){A(a+1)});mxEvent.addListener(q,"click",m);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(d,
mxResources.get("noFiles"));else{1==a&&(d.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var c=a.split("/");if(1<c.length){a=c[0];var k=c[1];3>c.length?(e=a,b=k,f=g=null,x()):this.ui.spinner.spin(d,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+k+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();
e=a.meta.org;b=a.meta.repo;g=decodeURIComponent(a.meta.ref);f="";y()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d),mxUtils.br(d));for(var l=0;l<c.length;l++)mxUtils.bind(this,function(a,c){var g=k.cloneNode();g.style.backgroundColor=
0==c%2?"dark"==uiTheme?"#000000":"#eeeeee":"";g.appendChild(p(a.full_name,mxUtils.bind(this,function(){e=a.owner.login;b=a.name;f="";x(null,!0)})));d.appendChild(g)})(c[l],l)}100==c.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&m()},mxEvent.addListener(d,"scroll",v))}),t)});B()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,e){DrawioFile.call(this,a,c);this.meta=e;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
0==c%2?"dark"==uiTheme?"#000000":"#eeeeee":"";g.appendChild(p(a.full_name,mxUtils.bind(this,function(){e=a.owner.login;b=a.name;f="";x(null,!0)})));d.appendChild(g)})(c[l],l)}100==c.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&m()},mxEvent.addListener(d,"scroll",v))}),t)});A()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,e){DrawioFile.call(this,a,c);this.meta=e;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
TrelloFile.prototype.save=function(a,c,e){this.doSave(this.getTitle(),c,e)};TrelloFile.prototype.saveAs=function(a,c,e){this.doSave(a,c,e)};TrelloFile.prototype.doSave=function(a,c,e){var b=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=b;this.saveFile(a,!1,c,e)}),e])};
TrelloFile.prototype.saveFile=function(a,c,e,b){this.isEditable()?this.savingFile?null!=b&&(this.saveNeededCounter++,b({code:App.ERROR_BUSY})):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.getTitle()==a?this.ui.trello.saveFile(this,mxUtils.bind(this,function(g){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=g;this.contentChanged();null!=e&&e();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,e,b))}),mxUtils.bind(this,
function(a){this.savingFile=!1;null!=b&&b(a)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(g){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(f){this.savingFile=!1;null!=e&&e();this.ui.fileLoaded(f);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,e,b))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,g)}))):null!=e&&e()};TrelloLibrary=function(a,c,e){TrelloFile.call(this,a,c,e)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,c,e){this.saveFile(a,!1,c,e)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";
@ -10864,20 +10864,20 @@ this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){k(a.meta.last_commit_id,b)}
GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)};
GitLabClient.prototype.showGitLabDialog=function(a,c){var e=null,b=null,g=null,f=null,m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="hidden";m.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(n);var d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.border="1px solid lightgray";d.style.boxSizing=
"border-box";d.style.padding="4px";d.style.overflow="auto";d.style.lineHeight="1.2em";d.style.height="274px";m.appendChild(d);var k=document.createElement("div");k.style.textOverflow="ellipsis";k.style.boxSizing="border-box";k.style.overflow="hidden";k.style.padding="4px";k.style.width="100%";var l=new CustomDialog(this.ui,m,mxUtils.bind(this,function(){c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+f)}));this.ui.showDialog(l.container,420,360,!0,!0);a&&l.okButton.parentNode.removeChild(l.okButton);var p=
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;B()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,B()):this.ui.hideDialog()}))}),q=null,v=null,y=mxUtils.bind(this,function(m){null==
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;A()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,A()):this.ui.hideDialog()}))}),q=null,v=null,y=mxUtils.bind(this,function(m){null==
m&&(d.innerHTML="",m=1);var n=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(e+"/"+b)+"/repository/tree?path="+f+"&ref="+g+"&per_page=100&page="+m,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));l.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");
var z=mxUtils.bind(this,function(){y(m+1)});mxEvent.addListener(q,"click",z);this.executeRequest(n,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==m&&(u(!g),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var C=!0,t=0;l=mxUtils.bind(this,function(m){for(var l=0;l<n.length;l++)mxUtils.bind(this,
function(l){if(m==("tree"==l.type)){var n=k.cloneNode();n.style.backgroundColor=C?"dark"==uiTheme?"#000000":"#eeeeee":"";C=!C;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(p(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,y()):a&&"blob"==l.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+g+
var z=mxUtils.bind(this,function(){y(m+1)});mxEvent.addListener(q,"click",z);this.executeRequest(n,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==m&&(u(!g),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var B=!0,t=0;l=mxUtils.bind(this,function(m){for(var l=0;l<n.length;l++)mxUtils.bind(this,
function(l){if(m==("tree"==l.type)){var n=k.cloneNode();n.style.backgroundColor=B?"dark"==uiTheme?"#000000":"#eeeeee":"";B=!B;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(p(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,y()):a&&"blob"==l.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+g+
"/"+l.path))})));d.appendChild(n);t++}})(n[l])});l(!0);a&&l(!1);100==t&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&z()},mxEvent.addListener(d,"scroll",v))}}),t,!0)}),x=mxUtils.bind(this,function(a,c){null==a&&(d.innerHTML="",a=1);var m=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(e+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&
(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(q,"click",n);this.executeRequest(m,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;B()}),"4px")));b=JSON.parse(b.getText());if(null==
(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(q,"click",n);this.executeRequest(m,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==
b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else if(1==b.length&&c)g=b[0].name,f="",y();else{for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a,b){var c=k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=encodeURIComponent(a.name);f="";y()})));d.appendChild(c)})(b[e],e);100==b.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&n()},mxEvent.addListener(d,"scroll",
v))}}),t)});l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));var B=mxUtils.bind(this,function(a){this.ui.spinner.stop();null==a&&(d.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){B(a+1)});mxEvent.addListener(q,
v))}}),t)});l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));var A=mxUtils.bind(this,function(a){this.ui.spinner.stop();null==a&&(d.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){A(a+1)});mxEvent.addListener(q,
"click",c);var m=mxUtils.bind(this,function(a){this.ui.spinner.spin(d,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),t)}),l=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(d,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();
b(a,JSON.parse(c.getText()))}),t)});m(mxUtils.bind(this,function(m){var n=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+a,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=m&&0!=m.length){1==a&&(d.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",
mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(e=a[0],b=a[1],g=f=null,2<a.length?(g=encodeURIComponent(a.slice(2,a.length).join("/")),y()):x(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d),mxUtils.br(d));for(var z=0;z<n.length;z++)mxUtils.bind(this,function(a,c){var g=k.cloneNode();g.style.backgroundColor=
0==c%2?"dark"==uiTheme?"#000000":"#eeeeee":"";g.appendChild(p(a.name_with_namespace,mxUtils.bind(this,function(){e=a.owner.username;b=a.path;f="";x(null,!0)})));d.appendChild(g)})(n[z],z);for(z=0;z<m.length;z++)l(m[z],mxUtils.bind(this,function(a,c){for(var g=0;g<c.length;g++){var m=k.cloneNode();m.style.backgroundColor=0==idx%2?"dark"==uiTheme?"#000000":"#eeeeee":"";mxUtils.bind(this,function(c){m.appendChild(p(c.name_with_namespace,mxUtils.bind(this,function(){e=a.full_path;b=c.path;f="";x(null,
!0)})));d.appendChild(m)})(c[g])}}))}else mxUtils.write(d,mxResources.get("noFiles"));100==n.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&c()},mxEvent.addListener(d,"scroll",v))}),t)}))});this.token?this.user?B():this.updateUser(function(){B()},t,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){B()},t,!0)}),t)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,e,b,g,f,m){this.file=a;this.id=c;this.content=e;this.modifiedDate=b;this.createdDate=g;this.isResolved=f;this.user=m;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,e,b,g){c()};DrawioComment.prototype.editComment=function(a,c,e){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,e,b,g,f,m,n){DrawioComment.call(this,a,c,e,b,g,f,m);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,e,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),e)};
!0)})));d.appendChild(m)})(c[g])}}))}else mxUtils.write(d,mxResources.get("noFiles"));100==n.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&c()},mxEvent.addListener(d,"scroll",v))}),t)}))});this.token?this.user?A():this.updateUser(function(){A()},t,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){A()},t,!0)}),t)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,e,b,g,f,m){this.file=a;this.id=c;this.content=e;this.modifiedDate=b;this.createdDate=g;this.isResolved=f;this.user=m;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,e,b,g){c()};DrawioComment.prototype.editComment=function(a,c,e){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,e,b,g,f,m,n){DrawioComment.call(this,a,c,e,b,g,f,m);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,e,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),e)};
DriveComment.prototype.editComment=function(a,c,e){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},c,e)};
DriveComment.prototype.deleteComment=function(a,c){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,c)};App=function(a,c,e){EditorUi.call(this,a,c,null!=e?e:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var c={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=
a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!=a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};
@ -10887,8 +10887,8 @@ a.constructor==DriveFile&&null!=a.desc&&null!=this.drive&&(c.label+=(null!=this.
this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(b){null!=window.console&&console.log("Plugin Error:",b,App.DrawPlugins[a])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(a){try{a(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,
this.initializeEmbedMode())}),5E3)}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_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL=window.DRAWIO_BASE_URL+"/js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";
App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":window.DRAWIO_BASE_URL+"/js/onedrive/OneDrive.js";App.ONEDRIVE_INLINE_PICKER_URL=window.DRAWIO_BASE_URL+"/js/onedrive/mxODPicker.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date;
App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",ac148:"/plugins/cConf-1-4-8.js",ac148cmnt:"/plugins/cConf-comments.js",ac148lic:"/plugins/cConf-license.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",
update:"/plugins/update.js",trees:"/plugins/trees/trees.js","import":"/plugins/import.js",replay:"/plugins/replay.js",anon:"/plugins/anonymize.js",tr:"/plugins/trello.js",f5:"/plugins/rackF5.js",tickets:"/plugins/tickets.js",flow:"/plugins/flow.js",webcola:"/plugins/webcola/webcola.js",rnd:"/plugins/random.js",page:"/plugins/page.js",gd:"/plugins/googledrive.js",tags:"/plugins/tags.js"};App.publicPlugin="ex voice tips svgdata number sql props text anim update trees replay anon tickets flow webcola tags".split(" ");
App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",ac148:"/plugins/cConf-1-4-8.js",ac148cmnt:"/plugins/cConf-comments.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",update:"/plugins/update.js",
trees:"/plugins/trees/trees.js","import":"/plugins/import.js",replay:"/plugins/replay.js",anon:"/plugins/anonymize.js",tr:"/plugins/trello.js",f5:"/plugins/rackF5.js",tickets:"/plugins/tickets.js",flow:"/plugins/flow.js",webcola:"/plugins/webcola/webcola.js",rnd:"/plugins/random.js",page:"/plugins/page.js",gd:"/plugins/googledrive.js",tags:"/plugins/tags.js"};App.publicPlugin="ex voice tips svgdata number sql props text anim update trees replay anon tickets flow webcola tags".split(" ");
App.loadScripts=function(a,c){for(var e=a.length,b=0;b<e;b++)mxscript(a[b],function(){0==--e&&null!=c&&c()})};
App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var c=document.cookie.split(";"),e=0;e<c.length;e++){var b=mxUtils.trim(c[e]);if("MODE="==b.substring(0,5)){a=b.substring(5);break}}null!=a&&isLocalStorage&&(c=new Date,c.setYear(c.getFullYear()-1),document.cookie="MODE=; expires="+c.toUTCString(),localStorage.setItem(".mode",a))}return a};
(function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode),null==App.mode&&(App.mode=App.getStoredMode()),null!=window.mxscript&&("1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&
@ -10951,10 +10951,10 @@ App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{
App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var a=this.getCurrentFile();if(null!=a)if(a.constructor!=LocalFile||""!=a.getHash()||a.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=a.fileHandle){if(a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,c=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=c&&(a=(null!=c.getTitle()?c.getTitle():this.defaultFilename)+" - "+a);document.title!=a&&(document.title=a,a=this.editor.graph,a.invalidateDescendantsWithPlaceholders(a.model.getRoot()),a.view.validate())}};
App.prototype.getThumbnail=function(a,c){var e=!1;try{var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;c(null)}),this.timeout),f=mxUtils.bind(this,function(a){window.clearTimeout(g);b&&c(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var m=this.editor.graph,n=null!=m.themes&&"darkTheme"==m.defaultThemeName;if(n||null!=this.pages&&this.currentPage!=this.pages[0]){var d=m.getGlobalVariable,m=this.createTemporaryGraph(n?m.getDefaultStylesheet():m.getStylesheet()),k=this.pages[0];
n&&(m.defaultThemeName="default");m.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:d.apply(this,arguments)};m.getGlobalVariable=d;document.body.appendChild(m.container);m.model.setRoot(k.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(a){try{m!=this.editor.graph&&null!=m.container.parentNode&&m.container.parentNode.removeChild(m.container)}catch(A){a=null}f(a)}),a,this.thumbImageCache,"#ffffff",function(){f()},
n&&(m.defaultThemeName="default");m.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:d.apply(this,arguments)};m.getGlobalVariable=d;document.body.appendChild(m.container);m.model.setRoot(k.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(a){try{m!=this.editor.graph&&null!=m.container.parentNode&&m.container.parentNode.removeChild(m.container)}catch(C){a=null}f(a)}),a,this.thumbImageCache,"#ffffff",function(){f()},
null,null,null,null,null,null,m),e=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var l=document.createElement("canvas"),p=m.getGraphBounds(),u=a/p.width,u=Math.min(1,Math.min(3*a/(4*p.height),u)),t=Math.floor(p.x),q=Math.floor(p.y);l.setAttribute("width",Math.ceil(u*(p.width+4)));l.setAttribute("height",Math.ceil(u*(p.height+4)));var v=l.getContext("2d");v.scale(u,u);v.translate(-t,-q);var y=m.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";v.save();v.fillStyle=y;v.fillRect(t,
q,Math.ceil(p.width+4),Math.ceil(p.height+4));v.restore();var x=new mxJsCanvas(l),B=new mxAsyncCanvas(this.thumbImageCache);x.images=this.thumbImageCache.images;var z=new mxImageExport;z.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};z.drawText=function(a,b){};z.drawState(m.getView().getState(m.model.root),B);B.finish(mxUtils.bind(this,function(){try{z.drawState(m.getView().getState(m.model.root),
x),m!=this.editor.graph&&null!=m.container.parentNode&&m.container.parentNode.removeChild(m.container)}catch(C){l=null}f(l)}));e=!0}}catch(C){e=!1,null!=m&&m!=this.editor.graph&&null!=m.container.parentNode&&m.container.parentNode.removeChild(m.container)}return e};
q,Math.ceil(p.width+4),Math.ceil(p.height+4));v.restore();var x=new mxJsCanvas(l),A=new mxAsyncCanvas(this.thumbImageCache);x.images=this.thumbImageCache.images;var z=new mxImageExport;z.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};z.drawText=function(a,b){};z.drawState(m.getView().getState(m.model.root),A);A.finish(mxUtils.bind(this,function(){try{z.drawState(m.getView().getState(m.model.root),
x),m!=this.editor.graph&&null!=m.container.parentNode&&m.container.parentNode.removeChild(m.container)}catch(B){l=null}f(l)}));e=!0}}catch(B){e=!1,null!=m&&m!=this.editor.graph&&null!=m.container.parentNode&&m.container.parentNode.removeChild(m.container)}return e};
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(c,e){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var b=this.getCurrentFile();c=null!=b?b.getMode():c;c==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):c==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),
this.appIcon.style.cursor="pointer"):c==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=c==App.MODE_DEVICE?"pointer":"default")}if(e)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var g=new Date;g.setYear(g.getFullYear()+1);document.cookie="MODE="+c+"; expires="+g.toUTCString()}}catch(f){}}})();
@ -11150,7 +11150,7 @@ mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbon
mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");g.appendChild(k);var p=document.createElement("input");p.type="number";p.value=c;p.style.width="200px";p.style.boxSizing="border-box";g.appendChild(p);mxEvent.addListener(p,"change",function(){c=p.value});k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");g.appendChild(k);var q=document.createElement("input");q.type="number";
q.value=d;q.style.width="200px";q.style.boxSizing="border-box";g.appendChild(q);mxEvent.addListener(q,"change",function(){d=q.value});g=new CustomDialog(b,g,function(){null==a&&(a=2);"undefined"!==typeof mxOrgChartLayout||b.loadingOrgChart||b.isOffline(!0)?f():b.spinner.spin(document.body,mxResources.get("loading"))&&(b.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart.min.js",f):mxscript("js/extensions.min.js",f))});b.showDialog(g.container,355,125,!0,!0)},c,null,f());a.addSeparator(c);
a.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){var a=new mxParallelEdgeLayout(g);a.checkOverlap=!0;a.spacing=20;b.executeLayout(function(){a.execute(g.getDefaultParent(),g.isSelectionEmpty()?null:g.getSelectionCells())},!1)}),c);a.addSeparator(c);b.menus.addMenuItem(a,"runLayout",c,null,null,mxResources.get("apply")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(a,c){if(!mxClient.IS_CHROMEAPP&&b.isOffline())this.addMenuItems(a,["about"],c);else{var d=a.addItem("Search:",
null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),e.value="",EditorUi.logEvent({category:"SEARCH-HELP",
null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://www.google.com/search?q=site%3Adiagrams.net+inurl%3A%2Fdoc%2Ffaq%2F+"+encodeURIComponent(b)),e.value="",EditorUi.logEvent({category:"SEARCH-HELP",
action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(e.value="")}));d.firstChild.nextSibling.appendChild(e);mxEvent.addGestureListeners(e,function(a){document.activeElement!=e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(a,"- keyboardShortcuts quickStart support - forkme downloadDesktop - about".split(" "),
c)}"1"==urlParams.test&&(a.addSeparator(c),this.addSubmenu("testDevelop",a,c))})));mxResources.parse("diagramLanguage=Diagram Language");b.actions.addAction("diagramLanguage...",function(){var a=prompt("Language Code",Graph.diagramLanguage||"");null!=a&&(Graph.diagramLanguage=0<a.length?a:null,g.refresh())});"1"==urlParams.test&&(mxResources.parse("testDevelop=Develop"),mxResources.parse("showBoundingBox=Show bounding box"),mxResources.parse("createSidebarEntry=Create Sidebar Entry"),mxResources.parse("testCheckFile=Check File"),
mxResources.parse("testDiff=Diff"),mxResources.parse("testInspect=Inspect"),mxResources.parse("testShowConsole=Show Console"),mxResources.parse("testXmlImageExport=XML Image Export"),mxResources.parse("testDownloadRtModel=Export RT model"),mxResources.parse("testImportRtModel=Import RT model"),b.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!g.isSelectionEmpty()){var a=g.cloneCells(g.getSelectionCells()),c=g.getBoundingBoxFromGeometry(a),a=g.moveCells(a,-c.x,-c.y);b.showTextDialog("Create Sidebar Entry",
@ -11158,7 +11158,7 @@ mxResources.parse("testDiff=Diff"),mxResources.parse("testInspect=Inspect"),mxRe
"",a=new TextareaDialog(b,"Paste Data:",a,function(a){if(0<a.length)try{var c=function(a){function b(a){if(null==n[a]){if(n[a]=!0,null!=e[a]){for(;0<e[a].length;){var d=e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var m=d[k];if(null!=m.id&&0<m.id.length)if(null==a[m.id]){a[m.id]=m.id;var l=m.getAttribute("parent");null==l?null!=f?mxLog.debug(c+": Multiple roots: "+m.id):f=m.id:(null==e[l]&&(e[l]=
[]),e[l].push(m.id))}else g[m.id]=m.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null==f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",e)))};"<"!=a.charAt(0)&&(a=Graph.decompress(a),mxLog.debug("See console for uncompressed XML"),console.log("xml",a));var d=mxUtils.parseXml(a),
e=b.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=b.getHashValueForPages(e);mxLog.debug("Checksum: ",f)}catch(H){mxLog.debug("Error: ",H.message)}else mxLog.debug("No pages found for checksum");var g=d.getElementsByTagName("root");for(a=0;a<g.length;a++)c(g[a]);mxLog.show()}catch(H){b.handleError(H),null!=window.console&&console.error(H)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()})),b.actions.addAction("testDiff",
mxUtils.bind(this,function(){if(null!=b.pages){var a=new TextareaDialog(b,"Paste Data:","",function(a){if(0<a.length)try{console.log(JSON.stringify(b.diffPages(b.pages,b.getPagesForNode(mxUtils.parseXml(a).documentElement)),null,2))}catch(A){b.handleError(A),null!=window.console&&console.error(A)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()}else b.alert("No pages")})),b.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(b,
mxUtils.bind(this,function(){if(null!=b.pages){var a=new TextareaDialog(b,"Paste Data:","",function(a){if(0<a.length)try{console.log(JSON.stringify(b.diffPages(b.pages,b.getPagesForNode(mxUtils.parseXml(a).documentElement)),null,2))}catch(C){b.handleError(C),null!=window.console&&console.error(C)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()}else b.alert("No pages")})),b.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(b,
g.getModel())})),b.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=g.getGraphBounds(),c=g.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var f=0,k=d.save;d.save=function(){f++;k.apply(this,arguments)};var m=d.restore;d.restore=function(){f--;m.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",
a,f);l.apply(this,arguments);mxLog.debug("leaving shape",a,f)};a.drawState(g.getView().getState(g.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",f)})),b.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"createSidebarEntry showBoundingBox - testCheckFile testDiff - testInspect - testXmlImageExport - testShowConsole".split(" "),
b)}))));b.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!b.isOffline()?b.showDialog((new MoreShapesDialog(b,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):b.showDialog((new MoreShapesDialog(b,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});b.actions.put("createShape",new Action(mxResources.get("shape")+"...",function(a){g.isEnabled()&&(a=new mxCell("",new mxGeometry(0,0,120,120),b.defaultCustomShapeStyle),a.vertex=!0,a=new EditShapeDialog(b,
@ -11191,7 +11191,7 @@ mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,n
c):("download"==d&&(d=App.MODE_GOOGLE),null!=c&&0<c.length&&(d==App.MODE_GOOGLE?b.spinner.spin(document.body,mxResources.get("saving"))&&a.saveAs(c,mxUtils.bind(this,function(c){a.desc=c;a.save(!1,mxUtils.bind(this,function(){b.spinner.stop();a.setModified(!1);a.addAllSavedStatus()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),mxUtils.bind(this,function(a){b.handleError(a)})):b.createFile(c,b.getFileData(!0),null,d)))}),mxUtils.bind(this,function(){b.hideDialog()}),mxResources.get("makeCopy"),
mxResources.get("create"),null,null,!0,null,!0,null,null,null,null,b.editor.fileExtensions),b.showDialog(c.container,420,380,!0,!0),c.init()):b.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));b.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var a=b.getCurrentFile();if(a.getMode()==App.MODE_GOOGLE||a.getMode()==App.MODE_ONEDRIVE){var c=!1;if(a.getMode()==App.MODE_GOOGLE&&null!=a.desc.parents)for(var d=0;d<a.desc.parents.length;d++)if(a.desc.parents[d].isRoot){c=!0;break}b.pickFolder(a.getMode(),
mxUtils.bind(this,function(c){b.spinner.spin(document.body,mxResources.get("moving"))&&a.move(c,mxUtils.bind(this,function(a){b.spinner.stop()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));b.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+
"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&a.share()}catch(C){b.handleError(C)}}));this.put("embed",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||
"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&a.share()}catch(B){b.handleError(B)}}));this.put("embed",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||
b.isOffline()||this.addMenuItems(a,["embedIframe"],c);"1"==urlParams.embed||b.isOffline()||this.addMenuItems(a,"- googleDocs googleSlides googleSheets - microsoftOffice".split(" "),c)})));var v=function(a,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!b.isOffline())&&a.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e||"mermaid"==e){var a=new ParseDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);b.dialog.container.style.overflow="auto"}else a=new CreateGraphDialog(b,
d,e),b.showDialog(a.container,620,420,!0,!1);a.init()}),c,null,f())},y=function(a,c,d,e){var f=new mxCell(a,new mxGeometry(0,0,c,d),e);f.vertex=!0;a=g.getCenterInsertPoint(g.getBoundingBoxFromGeometry([f],!0));f.geometry.x=a.x;f.geometry.y=a.y;g.getModel().beginUpdate();try{f=g.addCell(f),g.fireEvent(new mxEventObject("cellsInserted","cells",[f]))}finally{g.getModel().endUpdate()}g.scrollCellToVisible(f);g.setSelectionCell(f);g.container.focus();g.editAfterInsert&&g.startEditing(f);window.setTimeout(function(){null!=
b.hoverIcons&&b.hoverIcons.update(g.view.getState(f))},0);return f};b.actions.put("insertText",new Action(mxResources.get("text"),function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&g.startEditingAtCell(y("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;b.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){g.isEnabled()&&
@ -11213,8 +11213,8 @@ mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c)
a;b.editor.isCorsEnabledForUrl(a)||(c=PROXY_URL+"?url="+encodeURIComponent(a));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){b.spinner.stop();try{b.loadLibrary(new UrlLibrary(this,c.getText(),a))}catch(G){b.handleError(G,mxResources.get("errorLoadingFile"))}}else b.spinner.stop(),b.handleError(null,mxResources.get("errorLoadingFile"))},function(){b.spinner.stop();b.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));b.showDialog(a.container,300,
80,!0,!0);a.init()},c));"1"==urlParams.confLib&&(a.addSeparator(c),a.addItem(mxResources.get("confluenceCloud")+"...",null,function(){b.showRemotelyStoredLibrary(mxResources.get("libraries"))},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["undo","redo","-","cut","copy"]);EditorUi.isElectronApp&&this.addMenuItems(a,["copyAsImage"]);this.addMenuItems(a,"paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));
l=b.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(b,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("comments"));else{var a=!this.commentsWindow.window.isVisible();
this.commentsWindow.window.setVisible(a);this.commentsWindow.refreshCommentsTime();a&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));b.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var l=this.get("viewPanels"),B=l.funct;l.funct=
function(a,c){B.apply(this,arguments);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(b.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(a,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(a,"scratchpad",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,
this.commentsWindow.window.setVisible(a);this.commentsWindow.refreshCommentsTime();a&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));b.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var l=this.get("viewPanels"),A=l.funct;l.funct=
function(a,c){A.apply(this,arguments);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(b.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(a,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(a,"scratchpad",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,
"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(a,["shapes","-","pageView","pageScale"]);this.addSubmenu("units",a,c);this.addMenuItems(a,"- scrollbars tooltips ruler - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(a,"shadowVisible",c);this.addMenuItems(a,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=
urlParams.embed&&(this.addSubmenu("theme",a,c),a.addSeparator(c));if("undefined"!==typeof MathJax){var d=this.addMenuItem(a,"mathematicalTypesetting",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}this.addMenuItems(a,["copyConnect","collapseExpand","-"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(a,["showStartScreen"],c);"1"!=urlParams.embed&&this.addMenuItems(a,
["autosave"],c);a.addSeparator(c);!b.isOfflineApp()&&isLocalStorage&&this.addMenuItem(a,"plugins",c);this.addMenuItems(a,["tags","-","editDiagram"],c);Graph.translateDiagram&&this.addMenuItems(a,["diagramLanguage"]);this.addMenuItems(a,["-","configuration"],c);a.addSeparator(c);"1"==urlParams.newTempDlg&&(b.actions.addAction("templates",function(){var a=new TemplatesDialog;b.showDialog(a.container,a.width,a.height,!0,!1,null,!1,!0);a.init(b,function(a){console.log(a)},null,null,null,"user",function(a,
@ -11306,8 +11306,8 @@ function(a,c){this.model.beginUpdate();try{var b=[];this.traverse(c,!0,mxUtils.b
e(a)}function c(a){var b=!1;null!=a&&(b="1"==q.getCurrentCellStyle(a).treeMoving);return b}function e(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),b="tree"==(null!=b?b.style:q.getCellStyle(a)).containerType);return b}function m(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function n(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.view.getState(b[0]),
null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function d(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=q.cloneCells([d[0],a]);q.model.setTerminal(e[0],
q.model.getTerminal(d[0],!0),!0);var f=n(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;q.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=q.view.getState(a),l=q.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-
10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=q.getOutgoingEdges(q.model.getTerminal(d[0],!0));if(null!=p){for(var v=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<p.length;t++){var u=q.model.getTerminal(p[t],!1);if(f==n(u)){var A=q.view.getState(u);u!=a&&null!=A&&(v&&b!=A.getCenterX()<k.getCenterX()||!v&&b!=A.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,A)&&(d=10+Math.max(d,(Math.min(m.x+m.width,A.x+A.width)-Math.max(m.x,A.x))/l),g=10+Math.max(g,
(Math.min(m.y+m.height,A.y+A.height)-Math.max(m.y,A.y))/l))}}v?g=0:d=0;for(t=0;t<p.length;t++)if(u=q.model.getTerminal(p[t],!1),f==n(u)&&(A=q.view.getState(u),u!=a&&null!=A&&(v&&b!=A.getCenterX()<k.getCenterX()||!v&&b!=A.getCenterY()<k.getCenterY()))){var x=[];q.traverse(A.cell,!0,function(a,b){null!=b&&x.push(b);x.push(a);return!0});q.moveCells(x,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function k(a){q.model.beginUpdate();try{var b=n(a),c=q.getIncomingEdges(a),
10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=q.getOutgoingEdges(q.model.getTerminal(d[0],!0));if(null!=p){for(var v=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<p.length;t++){var u=q.model.getTerminal(p[t],!1);if(f==n(u)){var x=q.view.getState(u);u!=a&&null!=x&&(v&&b!=x.getCenterX()<k.getCenterX()||!v&&b!=x.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,x)&&(d=10+Math.max(d,(Math.min(m.x+m.width,x.x+x.width)-Math.max(m.x,x.x))/l),g=10+Math.max(g,
(Math.min(m.y+m.height,x.y+x.height)-Math.max(m.y,x.y))/l))}}v?g=0:d=0;for(t=0;t<p.length;t++)if(u=q.model.getTerminal(p[t],!1),f==n(u)&&(x=q.view.getState(u),u!=a&&null!=x&&(v&&b!=x.getCenterX()<k.getCenterX()||!v&&b!=x.getCenterY()<k.getCenterY()))){var z=[];q.traverse(x.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});q.moveCells(z,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function k(a){q.model.beginUpdate();try{var b=n(a),c=q.getIncomingEdges(a),
d=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],d[1],!1);q.model.setTerminal(d[0],d[1],!0);q.model.setTerminal(d[0],a,!1);var e=q.model.getParent(a),f=e.geometry,g=[];q.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);q.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&
(l=0);q.moveCells(g,k,l);return q.addCells(d,e)}finally{q.model.endUpdate()}}function l(a,b){q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=n(a);0==d.length&&(d=[q.createEdge(c,null,"",null,null,q.createCurrentEdgeStyle())],e=b);var f=q.cloneCells([d[0],a]);q.model.setTerminal(f[0],a,!0);if(null==q.model.getTerminal(f[0],!1)){q.model.setTerminal(f[0],f[1],!1);var g=q.getCellStyle(f[1]).newEdgeStyle;if(null!=g)try{var k=JSON.parse(g),l;for(l in k)q.setCellStyles(l,k[l],
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&q.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(da){}}var d=q.getOutgoingEdges(a),m=c.geometry,g=[];q.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var p=q.model.getTerminal(d[k],!1);null!=p&&g.push(p)}var v=q.view.getBounds(g),t=q.view.translate,u=q.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==v?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
@ -11318,14 +11318,14 @@ var t=this,q=t.editor.graph,v=q.getModel(),y=t.menus.createPopupMenu;t.menus.cre
t.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=
[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,
c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+D");var x=q.removeCells;q.removeCells=function(b,c){c=null!=c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];q.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=q.getIncomingEdges(b[f]),
b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return x.apply(this,arguments)};t.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var B=q.duplicateCells;q.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=B.call(this,
b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return x.apply(this,arguments)};t.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var A=q.duplicateCells;q.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=A.call(this,
b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(b[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var z=q.moveCells;q.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(a(b[p])||
q.model.isEdge(b[p])&&null==q.model.getTerminal(b[p],!0)){f=q.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var v=q.getIncomingEdges(b[0]);if(0<v.length){var t=q.view.getState(q.model.getTerminal(v[0],!0));if(null!=t){var u=q.view.getState(m);null!=u&&(c=(u.getCenterX()-t.getCenterX())/q.view.scale,d=(u.getCenterY()-t.getCenterY())/q.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(p=0;p<l.length;p++)if(this.model.isEdge(l[p]))a(m)&&
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(v=q.getIncomingEdges(b[p]),0<v.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==q.getIncomingEdges(l[p]).length){n=m;if(null==n||n==q.model.getParent(b[p]))n=q.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,q.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var C=t.sidebar.dropAndConnect;
t.sidebar.dropAndConnect=function(b,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=C.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:t.actions.get("selectChildren"),84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},D=
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(v=q.getIncomingEdges(b[p]),0<v.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==q.getIncomingEdges(l[p]).length){n=m;if(null==n||n==q.model.getParent(b[p]))n=q.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,q.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var B=t.sidebar.dropAndConnect;
t.sidebar.dropAndConnect=function(b,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=B.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:t.actions.get("selectChildren"),84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},D=
t.onKeyDown;t.onKeyDown=function(b){try{if(q.isEnabled()&&!q.isEditing()&&a(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==b.which?c=mxEvent.isShiftDown(b)?k(q.getSelectionCell()):l(q.getSelectionCell()):13==b.which&&(c=d(q.getSelectionCell(),!mxEvent.isShiftDown(b))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(q.view.getState(q.getSelectionCell())),
q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var e=A[b.keyCode];null!=e&&(e.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(u(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
mxEvent.consume(b))}}catch(N){t.handleError(N)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var F=q.connectVertex;q.connectVertex=function(b,c,e,f,g,m,p){var v=q.getIncomingEdges(b);if(a(b)){var t=n(b),u=t==mxConstants.DIRECTION_EAST||t==mxConstants.DIRECTION_WEST,A=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return t==c||0==v.length?l(b,c):u==A?k(b):d(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return F.apply(this,arguments)};q.getSubtree=function(b){var d=
q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var e=C[b.keyCode];null!=e&&(e.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(u(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
mxEvent.consume(b))}}catch(N){t.handleError(N)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var F=q.connectVertex;q.connectVertex=function(b,c,e,f,g,m,p){var v=q.getIncomingEdges(b);if(a(b)){var t=n(b),u=t==mxConstants.DIRECTION_EAST||t==mxConstants.DIRECTION_WEST,x=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return t==c||0==v.length?l(b,c):u==x?k(b):d(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return F.apply(this,arguments)};q.getSubtree=function(b){var d=
[b];!c(b)&&!a(b)||m(b)||q.traverse(b,!0,function(a,b){null!=b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};var E=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){E.apply(this,arguments);(c(this.state.cell)||a(this.state.cell))&&!m(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position=
"absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;t.hoverIcons.reset();
mxEvent.consume(a)})))};var G=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(a){H.apply(this,arguments);null!=this.moveHandle&&
@ -11406,13 +11406,13 @@ l.menus.get("viewZoom");if(null!=J){this.tabContainer.style.right="70px";var I=t
"none";I.style.right="0px";I.style.bottom="0px";I.style.overflow="hidden";I.style.visibility="hidden";I.style.textAlign="center";I.style.color="#000";I.style.fontSize="12px";I.style.color="#707070";I.style.width="59px";I.style.cursor="pointer";I.style.borderTop="1px solid lightgray";I.style.borderLeft="1px solid lightgray";I.style.height=parseInt(l.tabContainerHeight)-1+"px";I.style.lineHeight=parseInt(l.tabContainerHeight)+1+"px";H.appendChild(I);J=mxUtils.bind(this,function(){I.innerHTML=Math.round(100*
l.editor.graph.view.scale)+"%"});l.editor.graph.view.addListener(mxEvent.EVENT_SCALE,J);l.editor.addListener("resetGraphView",J);l.editor.addListener("pageSelected",J);var K=l.setGraphEnabled;l.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(I.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}H.appendChild(l.tabContainer);H.appendChild(n);H.appendChild(l.diagramContainer);
k.appendChild(H);l.updateTabContainer();var M=null;g();mxEvent.addListener(window,"resize",function(){g();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit()})}}};
(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,m){var f=c.y,d=c.x,g=!1,l=!1;if(null!=this.states&&null!=b&&null!=c){var p=this,u=new mxCellState,t=this.graph.getView().scale,q=Math.max(2,this.getGuideTolerance()/2);u.x=b.x+d;u.y=b.y+f;u.width=b.width;u.height=b.height;for(var v=[],y=[],x=0;x<this.states.length;x++){var B=this.states[x];B instanceof mxCellState&&(m||!this.graph.isCellSelected(B.cell))&&((u.x>=B.x&&u.x<=B.x+B.width||B.x>=u.x&&B.x<=u.x+u.width)&&(u.y>
B.y+B.height+4||u.y+u.height+4<B.y)?v.push(B):(u.y>=B.y&&u.y<=B.y+B.height||B.y>=u.y&&B.y<=u.y+u.height)&&(u.x>B.x+B.width+4||u.x+u.width+4<B.x)&&y.push(B))}var z=0,C=0,A=B=0,D=0,F=0,E=0,G=0,H=5*t;if(1<v.length){v.push(u);v.sort(function(a,b){return a.y-b.y});var J=!1,x=u==v[0],t=u==v[v.length-1];if(!x&&!t)for(x=1;x<v.length-1;x++)if(u==v[x]){t=v[x-1];x=v[x+1];B=C=A=(x.y-t.y-t.height-u.height)/2;break}for(x=0;x<v.length-1;x++){var t=v[x],I=v[x+1],K=u==t||u==I,I=I.y-t.y-t.height,J=J|u==t;if(0==C&&
0==z)C=I,z=1;else if(Math.abs(C-I)<=(K||1==x&&J?q:0))z+=1;else if(1<z&&J){v=v.slice(0,x+1);break}else if(3<=v.length-x&&!J)z=0,B=C=0!=A?A:0,v.splice(0,0==x?1:x),x=-1;else break;0!=B||K||(C=B=I)}3==v.length&&v[1]==u&&(B=0)}if(1<y.length){y.push(u);y.sort(function(a,b){return a.x-b.x});J=!1;x=u==y[0];t=u==y[y.length-1];if(!x&&!t)for(x=1;x<y.length-1;x++)if(u==y[x]){t=y[x-1];x=y[x+1];E=F=G=(x.x-t.x-t.width-u.width)/2;break}for(x=0;x<y.length-1;x++){t=y[x];I=y[x+1];K=u==t||u==I;I=I.x-t.x-t.width;J|=u==
(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,m){var f=c.y,d=c.x,g=!1,l=!1;if(null!=this.states&&null!=b&&null!=c){var p=this,u=new mxCellState,t=this.graph.getView().scale,q=Math.max(2,this.getGuideTolerance()/2);u.x=b.x+d;u.y=b.y+f;u.width=b.width;u.height=b.height;for(var v=[],y=[],x=0;x<this.states.length;x++){var A=this.states[x];A instanceof mxCellState&&(m||!this.graph.isCellSelected(A.cell))&&((u.x>=A.x&&u.x<=A.x+A.width||A.x>=u.x&&A.x<=u.x+u.width)&&(u.y>
A.y+A.height+4||u.y+u.height+4<A.y)?v.push(A):(u.y>=A.y&&u.y<=A.y+A.height||A.y>=u.y&&A.y<=u.y+u.height)&&(u.x>A.x+A.width+4||u.x+u.width+4<A.x)&&y.push(A))}var z=0,B=0,C=A=0,D=0,F=0,E=0,G=0,H=5*t;if(1<v.length){v.push(u);v.sort(function(a,b){return a.y-b.y});var J=!1,x=u==v[0],t=u==v[v.length-1];if(!x&&!t)for(x=1;x<v.length-1;x++)if(u==v[x]){t=v[x-1];x=v[x+1];A=B=C=(x.y-t.y-t.height-u.height)/2;break}for(x=0;x<v.length-1;x++){var t=v[x],I=v[x+1],K=u==t||u==I,I=I.y-t.y-t.height,J=J|u==t;if(0==B&&
0==z)B=I,z=1;else if(Math.abs(B-I)<=(K||1==x&&J?q:0))z+=1;else if(1<z&&J){v=v.slice(0,x+1);break}else if(3<=v.length-x&&!J)z=0,A=B=0!=C?C:0,v.splice(0,0==x?1:x),x=-1;else break;0!=A||K||(B=A=I)}3==v.length&&v[1]==u&&(A=0)}if(1<y.length){y.push(u);y.sort(function(a,b){return a.x-b.x});J=!1;x=u==y[0];t=u==y[y.length-1];if(!x&&!t)for(x=1;x<y.length-1;x++)if(u==y[x]){t=y[x-1];x=y[x+1];E=F=G=(x.x-t.x-t.width-u.width)/2;break}for(x=0;x<y.length-1;x++){t=y[x];I=y[x+1];K=u==t||u==I;I=I.x-t.x-t.width;J|=u==
t;if(0==F&&0==D)F=I,D=1;else if(Math.abs(F-I)<=(K||1==x&&J?q:0))D+=1;else if(1<D&&J){y=y.slice(0,x+1);break}else if(3<=y.length-x&&!J)D=0,E=F=0!=G?G:0,y.splice(0,0==x?1:x),x=-1;else break;0!=E||K||(F=E=I)}3==y.length&&y[1]==u&&(E=0)}q=function(a,b,c,d){var e=[],f;d?(d=H,f=0):(d=0,f=H);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(p.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=p.guidesArrHor)for(var c=0;c<p.guidesArrHor.length;c++)p.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=p.guidesArrVer)for(c=0;c<p.guidesArrVer.length;c++)p.guidesArrVer[c].node.style.visibility="hidden"};if(1<D&&D==y.length-1){D=[];G=p.guidesArrHor;g=[];d=0;x=y[0]==u?1:0;J=y[x].y+y[x].height;if(0<E)for(x=0;x<y.length-1;x++)t=
y[x],I=y[x+1],u==t?(d=I.x-t.width-E,g.push(new mxPoint(d+t.width+H,J)),g.push(new mxPoint(I.x-H,J))):u==I?(g.push(new mxPoint(t.x+t.width+H,J)),d=t.x+t.width+E,g.push(new mxPoint(d-H,J))):(g.push(new mxPoint(t.x+t.width+H,J)),g.push(new mxPoint(I.x-H,J)));else t=y[0],x=y[2],d=t.x+t.width+(x.x-t.x-t.width-u.width)/2,g.push(new mxPoint(t.x+t.width+H,J)),g.push(new mxPoint(d-H,J)),g.push(new mxPoint(d+u.width+H,J)),g.push(new mxPoint(x.x-H,J));for(x=0;x<g.length;x+=2)y=g[x],E=g[x+1],y=q(y,E,null!=G?
G[x/2]:null),y.node.style.visibility="visible",y.redraw(),D.push(y);for(x=g.length/2;null!=G&&x<G.length;x++)G[x].destroy();p.guidesArrHor=D;d-=b.x;g=!0}else F(!0);if(1<z&&z==v.length-1){D=[];G=p.guidesArrVer;l=[];f=0;x=v[0]==u?1:0;z=v[x].x+v[x].width;if(0<B)for(x=0;x<v.length-1;x++)t=v[x],I=v[x+1],u==t?(f=I.y-t.height-B,l.push(new mxPoint(z,f+t.height+H)),l.push(new mxPoint(z,I.y-H))):u==I?(l.push(new mxPoint(z,t.y+t.height+H)),f=t.y+t.height+B,l.push(new mxPoint(z,f-H))):(l.push(new mxPoint(z,t.y+
G[x/2]:null),y.node.style.visibility="visible",y.redraw(),D.push(y);for(x=g.length/2;null!=G&&x<G.length;x++)G[x].destroy();p.guidesArrHor=D;d-=b.x;g=!0}else F(!0);if(1<z&&z==v.length-1){D=[];G=p.guidesArrVer;l=[];f=0;x=v[0]==u?1:0;z=v[x].x+v[x].width;if(0<A)for(x=0;x<v.length-1;x++)t=v[x],I=v[x+1],u==t?(f=I.y-t.height-A,l.push(new mxPoint(z,f+t.height+H)),l.push(new mxPoint(z,I.y-H))):u==I?(l.push(new mxPoint(z,t.y+t.height+H)),f=t.y+t.height+A,l.push(new mxPoint(z,f-H))):(l.push(new mxPoint(z,t.y+
t.height+H)),l.push(new mxPoint(z,I.y-H)));else t=v[0],x=v[2],f=t.y+t.height+(x.y-t.y-t.height-u.height)/2,l.push(new mxPoint(z,t.y+t.height+H)),l.push(new mxPoint(z,f-H)),l.push(new mxPoint(z,f+u.height+H)),l.push(new mxPoint(z,x.y-H));for(x=0;x<l.length;x+=2)y=l[x],E=l[x+1],y=q(y,E,null!=G?G[x/2]:null,!0),y.node.style.visibility="visible",y.redraw(),D.push(y);for(x=l.length/2;null!=G&&x<G.length;x++)G[x].destroy();p.guidesArrVer=D;f-=b.y;l=!0}else F(!1,!0)}if(g||l)return u=new mxPoint(d,f),v=a.call(this,
b,u,e,m),g&&!l?u.y=v.y:l&&!g&&(u.x=v.x),v.y!=u.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),v.x!=u.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),u;F(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,e=this.guidesArrHor;if(null!=b)for(var m=0;m<b.length;m++)b[m].node.style.visibility=a?"visible":"hidden";if(null!=
e)for(m=0;m<e.length;m++)e[m].node.style.visibility=a?"visible":"hidden"};var e=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){e.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var f=0;f<a.length;f++)a[f].destroy();this.guidesArrVer=null}if(null!=c){for(f=0;f<c.length;f++)c[f].destroy();this.guidesArrHor=null}}})();function mxRuler(a,c,e,b){function g(){var b=a.diagramContainer;p.style.top=b.offsetTop-d+"px";p.style.left=b.offsetLeft-d+"px";p.style.width=(e?0:b.offsetWidth)+d+"px";p.style.height=(e?b.offsetHeight:0)+d+"px"}function f(a,b,c){if(null!=m)return a;var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var m=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,
@ -11420,12 +11420,12 @@ n=window.cancelAnimationFrame||window.mozCancelAnimationFrame,d=this.RULER_THICK
l.strokeClr;p.style.borderLeft="0.5px solid "+l.strokeClr;document.body.appendChild(p);mxEvent.disableContextMenu(p);this.editorUiRefresh=a.refresh;a.refresh=function(b){k.editorUiRefresh.apply(a,arguments);g()};g();var u=document.createElement("canvas");u.width=p.offsetWidth;u.height=p.offsetHeight;p.style.overflow="hidden";u.style.position="relative";p.appendChild(u);var t=u.getContext("2d");this.ui=a;var q=a.editor.graph;this.graph=q;this.container=p;this.canvas=u;var v=function(a,b,c,d,f){a=Math.round(a);
b=Math.round(b);c=Math.round(c);d=Math.round(d);t.beginPath();t.moveTo(a+.5,b+.5);t.lineTo(c+.5,d+.5);t.stroke();f&&(e?(t.save(),t.translate(a,b),t.rotate(-Math.PI/2),t.fillText(f,0,0),t.restore()):t.fillText(f,a,b))},y=function(){t.clearRect(0,0,u.width,u.height);t.beginPath();t.lineWidth=.7;t.strokeStyle=l.strokeClr;t.setLineDash([]);t.font="9px Arial";t.textAlign="center";var a=q.view.scale,b=q.view.getBackgroundPageBounds(),c=q.view.translate,f=q.pageVisible,c=f?d+(e?b.y-q.container.scrollTop:
b.x-q.container.scrollLeft):d+(e?c.y*a-q.container.scrollTop:c.x*a-q.container.scrollLeft),g=0;f&&(g=q.getPageLayout(),g=e?g.y*q.pageFormat.height:g.x*q.pageFormat.width);var m,n,p;switch(k.unit){case mxConstants.POINTS:m=p=10;n=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:p=10;m=mxConstants.PIXELS_PER_MM;n=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:p=.5>=a||4<=a?8:16,m=mxConstants.PIXELS_PER_INCH/p,n=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var x=m;2<=a?x=m/(2*Math.floor(a/2)):.5>=
a&&(x=m*Math.floor(1/a/2)*(k.unit==mxConstants.MILLIMETERS?2:1));m=null;b=f?Math.min(c+(e?b.height:b.width),e?u.height:u.width):e?u.height:u.width;if(f)if(t.fillStyle=l.outBkgClr,e){var y=c-d;0<y&&t.fillRect(0,d,d,y);b<u.height&&t.fillRect(0,b,d,u.height)}else y=c-d,0<y&&t.fillRect(d,0,y,d),b<u.width&&t.fillRect(b,0,u.width,d);t.fillStyle=l.fontClr;for(f=f?c:c%(x*a);f<=b;f+=x*a)if(y=Math.round((f-c)/a/x),!(f<d||y==m)){m=y;var B=null;0==y%p&&(B=k.formatText(g+y*x)+"");e?v(d-n[Math.abs(y)%p],f,d,f,
B):v(f,d-n[Math.abs(y)%p],f,d,B)}t.lineWidth=1;v(e?0:d,e?d:0,d,d);t.fillStyle=l.cornerClr;t.fillRect(0,0,d,d)},x=-1,B=function(){null!=m?(null!=n&&n(x),x=m(y)):y()};this.drawRuler=B;this.sizeListener=c=f(function(){var a=q.container;e?(a=a.offsetHeight+d,u.height!=a&&(u.height=a,p.style.height=a+"px",B())):(a=a.offsetWidth+d,u.width!=a&&(u.width=a,p.style.width=a+"px",B()))},10);this.pageListener=function(){B()};this.scrollListener=b=f(function(){var a=e?q.container.scrollTop:q.container.scrollLeft;
k.lastScroll!=a&&(k.lastScroll=a,B())},10);this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};q.addListener(mxEvent.SIZE,c);q.container.addEventListener("scroll",b);q.view.addListener("unitChanged",this.unitListener);a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){l=a;p.style.background=l.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=
function(a,b,c,f){var g;if(e&&4<a.height||!e&&4<a.width){if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3)}catch(L){}g=k.origGuideMove.apply(this,arguments);try{var m,n,p,q,u,x,y,z,B;t.lineWidth=.5;t.strokeStyle=l.guideClr;t.setLineDash([2]);e?(n=a.y+g.y+d-this.graph.container.scrollTop,m=0,u=n+a.height/2,q=d/2,z=n+a.height,
y=0,p=t.getImageData(m,n-1,d,3),v(m,n,d,n),n--,x=t.getImageData(q,u-1,d,3),v(q,u,d,u),u--,B=t.getImageData(y,z-1,d,3),v(y,z,d,z),z--):(n=0,m=a.x+g.x+d-this.graph.container.scrollLeft,u=d/2,q=m+a.width/2,z=0,y=m+a.width,p=t.getImageData(m-1,n,3,d),v(m,n,m,d),m--,x=t.getImageData(q-1,u,3,d),v(q,u,q,d),q--,B=t.getImageData(y-1,z,3,d),v(y,z,y,d),y--);if(null==k.guidePart||k.guidePart.x1!=m||k.guidePart.y1!=n)k.guidePart={imgData1:p,x1:m,y1:n,imgData2:x,x2:q,y2:u,imgData3:B,x3:y,y3:z}}catch(L){}}else g=
k.origGuideMove.apply(this,arguments);return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this,arguments);if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null}catch(C){}return a}}mxRuler.prototype.RULER_THICKNESS=14;
a&&(x=m*Math.floor(1/a/2)*(k.unit==mxConstants.MILLIMETERS?2:1));m=null;b=f?Math.min(c+(e?b.height:b.width),e?u.height:u.width):e?u.height:u.width;if(f)if(t.fillStyle=l.outBkgClr,e){var y=c-d;0<y&&t.fillRect(0,d,d,y);b<u.height&&t.fillRect(0,b,d,u.height)}else y=c-d,0<y&&t.fillRect(d,0,y,d),b<u.width&&t.fillRect(b,0,u.width,d);t.fillStyle=l.fontClr;for(f=f?c:c%(x*a);f<=b;f+=x*a)if(y=Math.round((f-c)/a/x),!(f<d||y==m)){m=y;var A=null;0==y%p&&(A=k.formatText(g+y*x)+"");e?v(d-n[Math.abs(y)%p],f,d,f,
A):v(f,d-n[Math.abs(y)%p],f,d,A)}t.lineWidth=1;v(e?0:d,e?d:0,d,d);t.fillStyle=l.cornerClr;t.fillRect(0,0,d,d)},x=-1,A=function(){null!=m?(null!=n&&n(x),x=m(y)):y()};this.drawRuler=A;this.sizeListener=c=f(function(){var a=q.container;e?(a=a.offsetHeight+d,u.height!=a&&(u.height=a,p.style.height=a+"px",A())):(a=a.offsetWidth+d,u.width!=a&&(u.width=a,p.style.width=a+"px",A()))},10);this.pageListener=function(){A()};this.scrollListener=b=f(function(){var a=e?q.container.scrollTop:q.container.scrollLeft;
k.lastScroll!=a&&(k.lastScroll=a,A())},10);this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};q.addListener(mxEvent.SIZE,c);q.container.addEventListener("scroll",b);q.view.addListener("unitChanged",this.unitListener);a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){l=a;p.style.background=l.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=
function(a,b,c,f){var g;if(e&&4<a.height||!e&&4<a.width){if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3)}catch(L){}g=k.origGuideMove.apply(this,arguments);try{var m,n,p,q,u,x,y,z,A;t.lineWidth=.5;t.strokeStyle=l.guideClr;t.setLineDash([2]);e?(n=a.y+g.y+d-this.graph.container.scrollTop,m=0,u=n+a.height/2,q=d/2,z=n+a.height,
y=0,p=t.getImageData(m,n-1,d,3),v(m,n,d,n),n--,x=t.getImageData(q,u-1,d,3),v(q,u,d,u),u--,A=t.getImageData(y,z-1,d,3),v(y,z,d,z),z--):(n=0,m=a.x+g.x+d-this.graph.container.scrollLeft,u=d/2,q=m+a.width/2,z=0,y=m+a.width,p=t.getImageData(m-1,n,3,d),v(m,n,m,d),m--,x=t.getImageData(q-1,u,3,d),v(q,u,q,d),q--,A=t.getImageData(y-1,z,3,d),v(y,z,y,d),y--);if(null==k.guidePart||k.guidePart.x1!=m||k.guidePart.y1!=n)k.guidePart={imgData1:p,x1:m,y1:n,imgData2:x,x2:q,y2:u,imgData3:A,x3:y,y3:z}}catch(L){}}else g=
k.origGuideMove.apply(this,arguments);return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this,arguments);if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null}catch(B){}return a}}mxRuler.prototype.RULER_THICKNESS=14;
mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()};mxRuler.prototype.formatText=function(a){switch(this.unit){case mxConstants.POINTS:return Math.round(a);case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}};
mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener("unitChanged",this.unitListener);this.ui.removeListener("pageViewChanged",this.pageListener);this.ui.removeListener("pageScaleChanged",this.pageListener);this.ui.removeListener("pageFormatChanged",
this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};

View file

@ -302,13 +302,12 @@ App.startTime = new Date();
/**
* Defines plugin IDs for loading via p URL parameter. Update the table at
* https://desk.draw.io/solution/articles/16000042546
* https://www.diagrams.net/doc/faq/supported-url-parameters
*/
App.pluginRegistry = {'4xAKTrabTpTzahoLthkwPNUn': '/plugins/explore.js',
'ex': '/plugins/explore.js', 'p1': '/plugins/p1.js',
'ac': '/plugins/connect.js', 'acj': '/plugins/connectJira.js',
'ac148': '/plugins/cConf-1-4-8.js', 'ac148cmnt': '/plugins/cConf-comments.js',
'ac148lic': '/plugins/cConf-license.js',
'voice': '/plugins/voice.js',
'tips': '/plugins/tooltips.js', 'svgdata': '/plugins/svgdata.js',
'electron': 'plugins/electron.js',

View file

@ -4526,7 +4526,7 @@ var LinkDialog = function(editorUi, initialValue, btnLabel, fn, showPages)
var helpBtn = mxUtils.button(mxResources.get('help'), function()
{
editorUi.openLink('https://desk.draw.io/support/solutions/articles/16000080137');
editorUi.openLink('https://www.diagrams.net/doc/faq/custom-links');
});
helpBtn.style.verticalAlign = 'middle';
@ -6005,7 +6005,7 @@ var FindWindow = function(ui, x, y, w, h)
mxUtils.write(regexLabel, mxResources.get('regularExpression'));
div.appendChild(regexLabel);
var help = ui.menus.createHelpLink('https://desk.draw.io/support/solutions/articles/16000088250');
var help = ui.menus.createHelpLink('https://www.diagrams.net/doc/faq/find-shapes');
help.style.position = 'relative';
help.style.marginLeft = '6px';
help.style.top = '-1px';
@ -7356,10 +7356,9 @@ var PluginsDialog = function(editorUi, addFn, delFn)
buttons.style.marginTop = '14px';
buttons.style.textAlign = 'right';
var helpBtn = mxUtils.button(mxResources.get('help'), function()
{
editorUi.openLink('https://desk.draw.io/support/solutions/articles/16000056430');
editorUi.openLink('https://www.diagrams.net/doc/faq/plugins');
});
helpBtn.className = 'geBtn';
@ -8731,7 +8730,7 @@ var EditShapeDialog = function(editorUi, cell, title, w, h)
{
var helpBtn = mxUtils.button(mxResources.get('help'), function()
{
editorUi.openLink('https://desk.draw.io/support/solutions/articles/16000052874');
editorUi.openLink('https://www.diagrams.net/doc/faq/shape-complex-create-edit');
});
helpBtn.className = 'geBtn';

View file

@ -1584,7 +1584,7 @@ DrawioFile.prototype.addConflictStatus = function(fn, message)
DrawioFile.prototype.setConflictStatus = function(message)
{
this.ui.editor.setStatus('<div title="'+ message + '" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">' +
message + ' <a href="https://desk.draw.io/support/solutions/articles/16000087947" target="_blank"><img border="0" ' +
message + ' <a href="https://www.diagrams.net/doc/faq/synchronize" target="_blank"><img border="0" ' +
'style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="' + Editor.helpImage +
'" style=""/></a></div>');
};

View file

@ -298,7 +298,7 @@ DriveClient.prototype.execute = function(fn)
this.ui.showError(mxResources.get('error'), msg, mxResources.get('help'), mxUtils.bind(this, function()
{
this.ui.openLink('https://desk.draw.io/support/solutions/articles/16000074659');
this.ui.openLink('https://www.diagrams.net/doc/faq/gsuite-authorisation-troubleshoot');
}), null, mxResources.get('ok'));
}), remember);
}));

View file

@ -1673,7 +1673,7 @@
/**
* Global configuration of the Editor
* see https://desk.draw.io/solution/articles/16000058316
* see https://www.diagrams.net/doc/faq/configure-diagram-editor
*
* For defaultVertexStyle, defaultEdgeStyle and defaultLibraries, this must be called before
* mxSettings.load via global config variable window.mxLoadSettings = false.
@ -3898,7 +3898,7 @@
option.style.paddingTop = '5px';
div.appendChild(option);
var help = ui.menus.createHelpLink('https://desk.draw.io/support/solutions/articles/16000032875');
var help = ui.menus.createHelpLink('https://www.diagrams.net/doc/faq/math-typesetting');
help.style.position = 'relative';
help.style.marginLeft = '6px';
help.style.top = '2px';
@ -7327,7 +7327,7 @@
{
var helpBtn = mxUtils.button(mxResources.get('help'), function()
{
graph.openLink('https://desk.draw.io/support/solutions/articles/16000048947');
graph.openLink('https://www.diagrams.net/doc/faq/print-diagram');
});
helpBtn.className = 'geBtn';

View file

@ -11639,17 +11639,7 @@
}
});
if (typeof data === 'object')
{
this.loadDescriptor(data, mxUtils.bind(this, function(e)
{
doLoad(getData(), evt);
}), mxUtils.bind(this, function(e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}));
}
else if (data != null && typeof data.substring === 'function' && data.substring(0, 34) == 'data:application/vnd.visio;base64,')
if (data != null && typeof data.substring === 'function' && data.substring(0, 34) == 'data:application/vnd.visio;base64,')
{
// Checks VND binary magic number in base64
var filename = (data.substring(34, 45) == '0M8R4KGxGuE') ? 'raw.vsd' : 'raw.vsdx';
@ -11684,6 +11674,16 @@
this.handleError(e);
}));
}
else if (data != null && typeof data === 'object' && data.format != null && (data.data != null || data.url != null))
{
this.loadDescriptor(data, mxUtils.bind(this, function(e)
{
doLoad(getData(), evt);
}), mxUtils.bind(this, function(e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}));
}
else
{
data = extractDiagramXml(data);

View file

@ -244,7 +244,7 @@ LucidImporter = {};
'UMLOptionLoopBlock' : s + 'sysml.package2;xSize=90;overflow=fill',
'UMLAlternativeBlock2' : s + 'sysml.package2;xSize=90;overflow=fill',
'UMLStartBlock' : 'ellipse;fillColor=#000000',
'UMLStateBlock' : 'rounded=1;arcSize=20',
'UMLStateBlock' : cs,
'UMLDecisionBlock' : 'shape=rhombus;',
'UMLHForkJoinBlock' : 'fillColor=#000000',
'UMLVForkJoinBlock' : 'fillColor=#000000',
@ -284,6 +284,7 @@ LucidImporter = {};
'UMLRequiredInterfaceBlock' : 'shape=requires;direction=north',
'UMLRequiredInterfaceBlockV2' : 'shape=requires;direction=north',
'UMLSwimLaneBlockV2': cs,
'UMLSwimLaneBlock': 'swimlane;startSize=25;container=1;collapsible=0;dropTarget=0;fontStyle=0',
//UML Deployment
//UML Entity Relationship
'UMLEntityBlock' : '',
@ -3769,7 +3770,7 @@ LucidImporter = {};
// actual code start
//TODO This can be optimized more
function convertTxt2Html(txt, srcM)
function convertTxt2Html(txt, srcM, props)
{
var blockStyles = {'a': true, 'il': true, 'ir': true, 'mt': true, 'mb': true, 'p': true, 't': true, 'l': true};
var nonBlockStyles = {'lk': true, 's': true, 'c': true, 'b': true, 'fc': true, 'i': true, 'u': true, 'k': true};
@ -3804,7 +3805,7 @@ LucidImporter = {};
{
if (globalStyles[i].s > newlines[expectedS])
{
globalStyles.splice(i, 0, {s: newlines[expectedS], n: 'a', v: 'center'});
globalStyles.splice(i, 0, {s: newlines[expectedS], n: 'a', v: props.TextAlign || 'center'});
}
else
{
@ -3821,7 +3822,7 @@ LucidImporter = {};
if (newlines[expectedS] != null)
{
globalStyles.push({s: newlines[expectedS], n: 'a', v: 'center'});
globalStyles.push({s: newlines[expectedS], n: 'a', v: props.TextAlign || 'center'});
}
var html = '', ends = m.slice();
@ -3914,7 +3915,7 @@ LucidImporter = {};
if (t != null)
{
str += '<li style="text-align:' + (styles['a']? styles['a'].v : 'center') + ';';
str += '<li style="text-align:' + (styles['a']? styles['a'].v : (props.TextAlign || 'center')) + ';';
if (nonBlockStyles != null && nonBlockStyles['c'])
{
@ -3940,7 +3941,7 @@ LucidImporter = {};
if (!listActive)
{
var tmp = styles['a']? styles['a'].v : 'center';
var tmp = styles['a']? styles['a'].v : (props.TextAlign || 'center');
var jc = tmp;
if (tmp == 'left')
@ -4215,7 +4216,7 @@ LucidImporter = {};
return html;
};
function convertText(props)
function convertText(props, forceHTML)
{
isLastLblHTML = false;
var text = (props.Text != null) ? props.Text :
@ -4292,9 +4293,11 @@ LucidImporter = {};
}
}
isLastLblHTML = isLastLblHTML || forceHTML;
if (isLastLblHTML)
{
return convertTxt2Html(txt, m);
return convertTxt2Html(txt, m, props);
}
}
catch(e)
@ -4383,7 +4386,8 @@ LucidImporter = {};
getTextBottomSpacing(properties)
) +
getTextGlobalSpacing(properties) +
getTextVerticalAlignment(properties);
getTextVerticalAlignment(properties) +
getTextGlobalAlignment(properties);
return style;
}
@ -4404,12 +4408,13 @@ LucidImporter = {};
addStyle(mxConstants.STYLE_FONTSIZE, style, properties, action, cell) +
addStyle(mxConstants.STYLE_FONTCOLOR, style, properties, action, cell) +
addStyle(mxConstants.STYLE_FONTSTYLE, style, properties, action, cell) +
addStyle(mxConstants.STYLE_ALIGN, style, properties, action, cell) +
addStyle(mxConstants.STYLE_ALIGN, style, properties, action, cell) +
addStyle(mxConstants.STYLE_SPACING_LEFT, style, properties, action, cell) +
addStyle(mxConstants.STYLE_SPACING_RIGHT, style, properties, action, cell) +
addStyle(mxConstants.STYLE_SPACING_TOP, style, properties, action, cell) +
addStyle(mxConstants.STYLE_SPACING_BOTTOM, style, properties, action, cell)
) +
) +
addStyle(mxConstants.STYLE_ALIGN + 'Global', style, properties, action, cell) +
addStyle(mxConstants.STYLE_SPACING, style, properties, action, cell) +
addStyle(mxConstants.STYLE_VERTICAL_ALIGN, style, properties, action, cell) +
addStyle(mxConstants.STYLE_STROKECOLOR, style, properties, action, cell) +
@ -4444,6 +4449,9 @@ LucidImporter = {};
case mxConstants.STYLE_ALIGN :
return getTextAlignment(properties);
case mxConstants.STYLE_ALIGN + 'Global':
return getTextGlobalAlignment(properties);
case mxConstants.STYLE_SPACING_LEFT :
return getTextLeftSpacing(properties);
@ -4880,6 +4888,11 @@ LucidImporter = {};
return createStyle(mxConstants.STYLE_VERTICAL_ALIGN, properties.TextVAlign, 'middle');
}
function getTextGlobalAlignment(properties)
{
return createStyle(mxConstants.STYLE_ALIGN, properties.TextAlign, 'center');
}
function getStrokeColor(properties, action)
{
if (properties.LineWidth == 0)
@ -5465,7 +5478,7 @@ LucidImporter = {};
// Anchor points and arrows
var p1, p2;
if (source == null || !source.geometry.isRotated) //TODO Rotate the endpoint instead of ignoring it
if (source == null || !source.geometry.isRotated) //TODO Rotate the endpoint instead of ignoring it (The same for flipped shapes)
{
p1 = updateEndpoint(cell, p.Endpoint1, true, implicitY);
}
@ -5481,7 +5494,7 @@ LucidImporter = {};
LucidImporter.stylePointsSet.add(source);
}
if (target == null || !target.geometry.isRotated) //TODO Rotate the endpoint instead of ignoring it
if (target == null || !target.geometry.isRotated) //TODO Rotate the endpoint instead of ignoring it (The same for flipped shapes)
{
p2 = updateEndpoint(cell, p.Endpoint2, false, implicitY);
}
@ -6774,6 +6787,28 @@ LucidImporter = {};
getTextVerticalAlignment(p[curCol]);
}
break;
case 'UMLStateBlock' :
if (p.Composite == 0)
{
v.style = 'rounded=1;arcSize=20';
v.value = convertText(p.State, true);
v.style += addAllStyles(v.style, p, a, v, isLastLblHTML);
}
else
{
v.style = 'swimlane;startSize=25;html=1;whiteSpace=wrap;container=1;collapsible=0;childLayout=stackLayout;' +
'resizeParent=1;dropTarget=0;rounded=1;arcSize=20;fontStyle=0';
v.value = convertText(p.State, true);
v.style += addAllStyles(v.style, p, a, v, isLastLblHTML);
v.style += getFillColor(p, a).replace('fillColor', 'swimlaneFillColor');
var content = new mxCell('', new mxGeometry(0, 0, w, h - 25), 'rounded=1;arcSize=20;strokeColor=none;fillColor=none');
content.value = convertText(p.Action, true);
content.style += addAllStyles(content.style, p, a, content, isLastLblHTML);
content.vertex = true;
v.insert(content);
}
break;
case 'AndroidDevice' :
if (p.AndroidDeviceName != null)
{

View file

@ -1202,7 +1202,7 @@
if (e.keyCode == 13 && term.length > 0)
{
this.editorUi.openLink('https://desk.draw.io/support/search/solutions?term=' +
this.editorUi.openLink('https://www.google.com/search?q=site%3Adiagrams.net+inurl%3A%2Fdoc%2Ffaq%2F+' +
encodeURIComponent(term));
input.value = '';
EditorUi.logEvent({category: 'SEARCH-HELP', action: 'search', label: term});

View file

@ -89,7 +89,7 @@
Sidebar.prototype.electrical = ['LogicGates', 'Resistors', 'Capacitors', 'Inductors', 'SwitchesRelays', 'Diodes', 'Sources', 'Transistors', 'Misc', 'Audio', 'PlcLadder', 'Abstract', 'Optical', 'VacuumTubes', 'Waveforms', 'Instruments', 'RotMech', 'Transmission'];
/**
* Description of custom libraries, see https://desk.draw.io/a/solutions/articles/16000058316
* Description of custom libraries, see https://www.diagrams.net/doc/faq/configure-diagram-editor
*/
Sidebar.prototype.customEntries = null;
@ -97,7 +97,7 @@
* Array of strings for the built-in libraries to be enabled in the more shapes dialog. Null means all,
* empty array means none, possible keys are listed for the libs parameter at
*
* https://desk.draw.io/support/solutions/articles/16000042546
* https://www.diagrams.net/doc/faq/supported-url-parameters
*/
Sidebar.prototype.enabledLibraries = null;

File diff suppressed because one or more lines are too long

View file

@ -2592,7 +2592,7 @@ Graph.prototype.isExtendParent=function(a){var c=this.model.getParent(a);if(null
function(a,b,d){if(b||d)c.apply(this,arguments);else{var f=this.getSelectionCell(),g=null,e=[],l=mxUtils.bind(this,function(c){if(null!=this.view.getState(c)&&(this.model.isVertex(c)||this.model.isEdge(c)))if(e.push(c),c==f)g=e.length-1;else if(a&&null==f&&0<e.length||null!=g&&a&&e.length>g||!a&&0<g)return;for(var b=0;b<this.model.getChildCount(c);b++)l(this.model.getChildAt(c,b))});l(this.model.root);0<e.length&&(g=null!=g?mxUtils.mod(g+(a?1:-1),e.length):0,this.setSelectionCell(e[g]))}};var f=Graph.prototype.moveCells;
Graph.prototype.moveCells=function(a,c,b,d,g,e,l){l=null!=l?l:{};if(this.isTable(g)){for(var v=[],n=0;n<a.length;n++)this.isTable(a[n])?v=v.concat(this.model.getChildCells(a[n],!0).reverse()):v.push(a[n]);a=v}this.model.beginUpdate();try{v=[];for(n=0;n<a.length;n++)if(null!=g&&this.isTableRow(a[n])){var p=this.model.getParent(a[n]),t=this.getCellGeometry(a[n]);this.isTable(p)&&v.push(p);if(null!=p&&null!=t&&this.isTable(p)&&this.isTable(g)&&(d||p!=g)){if(!d){var k=this.getCellGeometry(p);null!=k&&
(k=k.clone(),k.height-=t.height,this.model.setGeometry(p,k))}k=this.getCellGeometry(g);null!=k&&(k=k.clone(),k.height+=t.height,this.model.setGeometry(g,k));var x=this.model.getChildCells(g,!0);if(0<x.length){a[n]=d?this.cloneCell(a[n]):a[n];var S=this.model.getChildCells(a[n],!0),q=this.model.getChildCells(x[0],!0),K=q.length-S.length;if(0<K)for(var m=0;m<K;m++){var P=this.cloneCell(S[S.length-1]);null!=P&&(P.value="",this.model.add(a[n],P))}else if(0>K)for(m=0;m>K;m--)this.model.remove(S[S.length+
m-1]);S=this.model.getChildCells(a[n],!0);for(m=0;m<q.length;m++){var G=this.getCellGeometry(q[m]),ca=this.getCellGeometry(S[m]);null!=G&&null!=ca&&(ca=ca.clone(),ca.width=G.width,this.model.setGeometry(S[m],ca))}}}}for(var y=f.apply(this,arguments),n=0;n<v.length;n++)!d&&this.model.contains(v[n])&&0==this.model.getChildCount(v[n])&&this.model.remove(v[n]);d&&this.updateCustomLinks(this.createCellMapping(l,this.createCellLookup(a)),y)}finally{this.model.endUpdate()}return y};var g=Graph.prototype.removeCells;
m-1]);S=this.model.getChildCells(a[n],!0);for(m=0;m<q.length;m++){var G=this.getCellGeometry(q[m]),y=this.getCellGeometry(S[m]);null!=G&&null!=y&&(y=y.clone(),y.width=G.width,this.model.setGeometry(S[m],y))}}}}for(var da=f.apply(this,arguments),n=0;n<v.length;n++)!d&&this.model.contains(v[n])&&0==this.model.getChildCount(v[n])&&this.model.remove(v[n]);d&&this.updateCustomLinks(this.createCellMapping(l,this.createCellLookup(a)),da)}finally{this.model.endUpdate()}return da};var g=Graph.prototype.removeCells;
Graph.prototype.removeCells=function(a,c){var b=[];this.model.beginUpdate();try{for(var d=0;d<a.length;d++)if(this.isTableCell(a[d])){var f=this.model.getParent(a[d]),e=this.model.getParent(f);1==this.model.getChildCount(f)&&1==this.model.getChildCount(e)?0>mxUtils.indexOf(a,e)&&0>mxUtils.indexOf(b,e)&&b.push(e):this.labelChanged(a[d],"")}else{if(this.isTableRow(a[d])&&(e=this.model.getParent(a[d]),0>mxUtils.indexOf(a,e)&&0>mxUtils.indexOf(b,e))){for(var l=this.model.getChildCells(e,!0),n=0,v=0;v<
l.length;v++)0<=mxUtils.indexOf(a,l[v])&&n++;n==l.length&&b.push(e)}b.push(a[d])}b=g.apply(this,[b,c])}finally{this.model.endUpdate()}return b};Graph.prototype.updateCustomLinks=function(a,c){for(var b=0;b<c.length;b++)null!=c[b]&&this.updateCustomLinksForCell(a,c[b])};Graph.prototype.updateCustomLinksForCell=function(a,c){};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var d=[];try{for(var f=JSON.parse(b),b=0;b<f.length;b++){var g=
f[b];d.push(new mxConnectionConstraint(new mxPoint(g[0],g[1]),2<g.length?"0"!=g[2]:!0,null,3<g.length?g[3]:0,4<g.length?g[4]:0))}}catch(ka){}return d}if(null!=a.shape&&null!=a.shape.bounds){g=a.shape.direction;f=a.shape.bounds;b=a.shape.scale;d=f.width/b;f=f.height/b;if(g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH)g=d,d=f,f=g;b=a.shape.getConstraints(a.style,d,f);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;if(null!=
@ -2719,8 +2719,8 @@ this.secondDiv=null)),c.consume()}};var U=mxRubberband.prototype.reset;mxRubberb
b};var ia=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<ea||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&ia.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,d=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-
1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),f):null)?this.fixedHandleImage:null!=f&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,
mxConstants.HANDLE_STROKECOLOR)};var Z=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return Z.apply(this,arguments)};var aa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);
if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return aa.apply(this,arguments)};var fa=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=fa.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var da=mxVertexHandler.prototype.getSelectionBounds;
mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):da.apply(this,arguments)};var ba=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,
if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return aa.apply(this,arguments)};var fa=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=fa.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var ca=mxVertexHandler.prototype.getSelectionBounds;
mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):ca.apply(this,arguments)};var ba=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,
c){var b=this.graph.getModel(),d=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(d)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ba.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var a=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),c=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);
this.state.view.graph.model.isVertex(this.state.cell)&&a==mxConstants.NONE&&c==mxConstants.NONE?(a=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,a,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var ja=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){ja.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&
null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Q=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,c){Q.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display=
@ -2744,8 +2744,8 @@ function(){na.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNo
function p(){mxActor.call(this)}function t(){mxActor.call(this)}function x(){mxActor.call(this)}function B(){mxActor.call(this)}function y(){mxActor.call(this)}function C(){mxActor.call(this)}function J(){mxActor.call(this)}function z(a,c){this.canvas=a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,z.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,
z.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,z.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,z.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,z.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,z.prototype.arcTo)}function A(){mxRectangleShape.call(this)}function F(){mxRectangleShape.call(this)}function D(){mxActor.call(this)}
function I(){mxActor.call(this)}function H(){mxActor.call(this)}function M(){mxRectangleShape.call(this)}function L(){mxRectangleShape.call(this)}function E(){mxCylinder.call(this)}function v(){mxShape.call(this)}function K(){mxShape.call(this)}function P(){mxEllipse.call(this)}function W(){mxShape.call(this)}function G(){mxShape.call(this)}function U(){mxRectangleShape.call(this)}function Y(){mxShape.call(this)}function ea(){mxShape.call(this)}function ha(){mxShape.call(this)}function ia(){mxShape.call(this)}
function Z(){mxShape.call(this)}function aa(){mxCylinder.call(this)}function fa(){mxCylinder.call(this)}function da(){mxRectangleShape.call(this)}function ba(){mxDoubleEllipse.call(this)}function ja(){mxDoubleEllipse.call(this)}function Q(){mxArrowConnector.call(this);this.spacing=0}function N(){mxArrowConnector.call(this);this.spacing=0}function ma(){mxActor.call(this)}function R(){mxRectangleShape.call(this)}function X(){mxActor.call(this)}function ga(){mxActor.call(this)}function pa(){mxActor.call(this)}
function O(){mxActor.call(this)}function na(){mxActor.call(this)}function S(){mxActor.call(this)}function ca(){mxActor.call(this)}function Aa(){mxActor.call(this)}function qa(){mxActor.call(this)}function ta(){mxActor.call(this)}function ra(){mxEllipse.call(this)}function ka(){mxEllipse.call(this)}function Ba(){mxEllipse.call(this)}function Da(){mxRhombus.call(this)}function xa(){mxEllipse.call(this)}function va(){mxEllipse.call(this)}function Ea(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}
function Z(){mxShape.call(this)}function aa(){mxCylinder.call(this)}function fa(){mxCylinder.call(this)}function ca(){mxRectangleShape.call(this)}function ba(){mxDoubleEllipse.call(this)}function ja(){mxDoubleEllipse.call(this)}function Q(){mxArrowConnector.call(this);this.spacing=0}function N(){mxArrowConnector.call(this);this.spacing=0}function ma(){mxActor.call(this)}function R(){mxRectangleShape.call(this)}function X(){mxActor.call(this)}function ga(){mxActor.call(this)}function pa(){mxActor.call(this)}
function O(){mxActor.call(this)}function na(){mxActor.call(this)}function S(){mxActor.call(this)}function da(){mxActor.call(this)}function Aa(){mxActor.call(this)}function qa(){mxActor.call(this)}function ta(){mxActor.call(this)}function ra(){mxEllipse.call(this)}function ka(){mxEllipse.call(this)}function Ba(){mxEllipse.call(this)}function Da(){mxRhombus.call(this)}function xa(){mxEllipse.call(this)}function va(){mxEllipse.call(this)}function Ea(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}
function ya(){mxActor.call(this)}function sa(){mxActor.call(this)}function oa(){mxActor.call(this)}function la(){mxConnector.call(this)}function Ia(a,c,b,d,f,g,e,l,n,v){e+=n;var T=d.clone();d.x-=f*(2*e+n);d.y-=g*(2*e+n);f*=e+n;g*=e+n;return function(){a.ellipse(T.x-f-e,T.y-g-e,2*e,2*e);v?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxSwimlane);a.prototype.getLabelBounds=function(a){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,
arguments)};a.prototype.paintVertexShape=function(a,c,b,d,f){0==this.getTitleSize()?mxRectangleShape.prototype.paintBackground.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),a.translate(-c,-b));this.paintForeground(a,c,b,d,f)};a.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.state){var T=this.flipH,g=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)var e=T,T=g,g=e;a.rotate(-this.getShapeRotation(),
T,g,c+d/2,b+f/2);s=this.scale;c=this.bounds.x/s;b=this.bounds.y/s;d=this.bounds.width/s;f=this.bounds.height/s;this.paintTableForeground(a,c,b,d,f)}};a.prototype.paintTableForeground=function(a,c,b,d,f){var g=this.state.view.graph,T=g.getActualStartSize(this.state.cell),e=g.model.getChildCells(this.state.cell,!0);if(0<e.length){var l="0"!=mxUtils.getValue(this.state.style,"rowLines","1"),n="0"!=mxUtils.getValue(this.state.style,"columnLines","1");if(l)for(l=1;l<e.length;l++){var v=g.getCellGeometry(e[l]);
@ -2823,8 +2823,8 @@ mxPerimeter.HexagonPerimeter2);mxUtils.extend(ea,mxShape);ea.prototype.size=10;e
a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",ia);mxUtils.extend(Z,mxShape);Z.prototype.inset=2;Z.prototype.paintBackground=function(a,c,b,d,f){var g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.ellipse(0,g,d-2*g,f-2*g);a.fillAndStroke();a.begin();a.moveTo(d/2,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,d/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Z);mxUtils.extend(aa,mxCylinder);aa.prototype.jettyWidth=
20;aa.prototype.jettyHeight=10;aa.prototype.redrawPath=function(a,c,b,d,f,g){var e=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=e/2;var e=b+e/2,l=Math.min(c,f-c),n=Math.min(l+2*c,f-c);g?(a.moveTo(b,l),a.lineTo(e,l),a.lineTo(e,l+c),a.lineTo(b,l+c),a.moveTo(b,n),a.lineTo(e,n),a.lineTo(e,n+c),a.lineTo(b,n+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,n+c),a.lineTo(0,n+c),a.lineTo(0,
n),a.lineTo(b,n),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("module",aa);mxUtils.extend(fa,mxCylinder);fa.prototype.jettyWidth=32;fa.prototype.jettyHeight=12;fa.prototype.redrawPath=function(a,c,b,d,f,g){var e=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=e/2;var e=b+e/2,l=.3*f-c/2,n=.7*f-c/2;g?(a.moveTo(b,l),a.lineTo(e,l),a.lineTo(e,
l+c),a.lineTo(b,l+c),a.moveTo(b,n),a.lineTo(e,n),a.lineTo(e,n+c),a.lineTo(b,n+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,n+c),a.lineTo(0,n+c),a.lineTo(0,n),a.lineTo(b,n),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("component",fa);mxUtils.extend(da,mxRectangleShape);da.prototype.paintForeground=function(a,c,b,d,f){var g=d/2,e=f/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
2;a.begin();this.addPoints(a,[new mxPoint(c+g,b),new mxPoint(c+d,b+e),new mxPoint(c+g,b+f),new mxPoint(c,b+e)],this.isRounded,l,!0);a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",da);mxUtils.extend(ba,mxDoubleEllipse);ba.prototype.outerStroke=!0;ba.prototype.paintVertexShape=function(a,c,b,d,f){var g=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+g,b+g,d-2*g,f-2*g),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&
l+c),a.lineTo(b,l+c),a.moveTo(b,n),a.lineTo(e,n),a.lineTo(e,n+c),a.lineTo(b,n+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,n+c),a.lineTo(0,n+c),a.lineTo(0,n),a.lineTo(b,n),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("component",fa);mxUtils.extend(ca,mxRectangleShape);ca.prototype.paintForeground=function(a,c,b,d,f){var g=d/2,e=f/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
2;a.begin();this.addPoints(a,[new mxPoint(c+g,b),new mxPoint(c+d,b+e),new mxPoint(c+g,b+f),new mxPoint(c,b+e)],this.isRounded,l,!0);a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",ca);mxUtils.extend(ba,mxDoubleEllipse);ba.prototype.outerStroke=!0;ba.prototype.paintVertexShape=function(a,c,b,d,f){var g=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+g,b+g,d-2*g,f-2*g),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&
(a.ellipse(c,b,d,f),a.stroke())};mxCellRenderer.registerShape("endState",ba);mxUtils.extend(ja,ba);ja.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",ja);mxUtils.extend(Q,mxArrowConnector);Q.prototype.defaultWidth=4;Q.prototype.isOpenEnded=function(){return!0};Q.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Q.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",
Q);mxUtils.extend(N,mxArrowConnector);N.prototype.defaultWidth=10;N.prototype.defaultArrowWidth=20;N.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};N.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};N.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",
N);mxUtils.extend(ma,mxActor);ma.prototype.size=30;ma.prototype.isRoundable=function(){return!0};ma.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(0,c),new mxPoint(d,0),new mxPoint(d,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ma);mxUtils.extend(R,mxRectangleShape);R.prototype.dx=
@ -2835,8 +2835,8 @@ mxUtils.extend(pa,mxActor);pa.prototype.dx=20;pa.prototype.dy=20;pa.prototype.re
2,b),new mxPoint((d+c)/2,f),new mxPoint((d-c)/2,f),new mxPoint((d-c)/2,b),new mxPoint(0,b)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("tee",pa);mxUtils.extend(O,mxActor);O.prototype.arrowWidth=.3;O.prototype.arrowSize=.2;O.prototype.redrawPath=function(a,c,b,d,f){var g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-g)/2;var g=b+g,e=
mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,g),new mxPoint(0,g)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("singleArrow",O);mxUtils.extend(na,mxActor);na.prototype.redrawPath=function(a,c,b,d,f){var g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",O.prototype.arrowWidth))));c=d*Math.max(0,
Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",O.prototype.arrowSize))));b=(f-g)/2;var g=b+g,e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,g),new mxPoint(c,g),new mxPoint(c,f)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",na);mxUtils.extend(S,mxActor);S.prototype.size=
.1;S.prototype.fixedSize=20;S.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(d,0);a.quadTo(d-2*c,f/2,d,f);a.lineTo(c,f);a.quadTo(c-2*c,f/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",S);mxUtils.extend(ca,mxActor);ca.prototype.redrawPath=function(a,
c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",ca);mxUtils.extend(Aa,mxActor);Aa.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.quadTo(d/2,f/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",Aa);mxUtils.extend(qa,mxActor);qa.prototype.size=20;qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d/2,Math.min(f,parseFloat(mxUtils.getValue(this.style,
.1;S.prototype.fixedSize=20;S.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(d,0);a.quadTo(d-2*c,f/2,d,f);a.lineTo(c,f);a.quadTo(c-2*c,f/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",S);mxUtils.extend(da,mxActor);da.prototype.redrawPath=function(a,
c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",da);mxUtils.extend(Aa,mxActor);Aa.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.quadTo(d/2,f/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",Aa);mxUtils.extend(qa,mxActor);qa.prototype.size=20;qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d/2,Math.min(f,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.8*c),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",qa);mxUtils.extend(ta,mxActor);ta.prototype.size=.375;ta.prototype.isRoundable=function(){return!0};ta.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-c),new mxPoint(d/2,f),new mxPoint(0,f-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",ta);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/2,b+f);a.lineTo(c+d,b+f);a.end();a.stroke()};
mxCellRenderer.registerShape("tapeData",ra);mxUtils.extend(ka,mxEllipse);ka.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+f/2);a.lineTo(c+d,b+f/2);a.end();a.stroke();a.begin();a.moveTo(c+d/2,b);a.lineTo(c+d/2,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("orEllipse",ka);mxUtils.extend(Ba,mxEllipse);Ba.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,
@ -2943,7 +2943,7 @@ function(a,c,b){a=[];var d=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(t
function(a,c,b){a=[];var d=Math.min(b,c),f=Math.max(0,Math.min(d,d*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),d=(b-f)/2,g=d+f,e=(c-f)/2,f=e+f;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,0));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,b-.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,b));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b-.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),d));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,d));return a};U.prototype.constraints=null;ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,
0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,d));return a};U.prototype.constraints=null;da.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,
.9),!1)];Aa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];ia.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];Z.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,
.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}
Actions.prototype.init=function(){var a=this.editorUi,d=a.editor,b=d.graph,e=function(){return Action.prototype.isEnabled.apply(this,arguments)&&b.isEnabled()};this.addAction("new...",function(){b.openLink(a.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";a.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){a.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,
@ -3046,7 +3046,7 @@ null!=b&&(d=mxResources.get("lastSaved",[b]))}null!=d&&60<d.length&&(d=d.substri
null!=d&&0<d.length?mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!=this.ui.mode&&this.isEditable()?"save":"saveAs").funct()})):(d=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert" style="overflow:hidden;">'+d+" ("+mxUtils.htmlEntities(a.message)+")</div>"));EditorUi.enableDrafts&&(null==this.getMode()||EditorUi.isElectronApp)&&(null!=this.saveDraftThread&&window.clearTimeout(this.saveDraftThread),
this.saveDraftThread=window.setTimeout(mxUtils.bind(this,function(){this.saveDraft()}),0))}};
DrawioFile.prototype.addConflictStatus=function(a,d){this.invalidChecksum&&null==d&&(d=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":""));this.ui.spinner.stop();this.clearAutosave();var b=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=b&&0<b.length?mxEvent.addListener(b[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&&
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://desk.draw.io/support/solutions/articles/16000087947" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://www.diagrams.net/doc/faq/synchronize" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
DrawioFile.prototype.showRefreshDialog=function(a,d,b){null==b&&(b=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,d)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,d)}),b),this.ui.showError(mxResources.get("error")+" ("+b+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,
d)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,d)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))};
DrawioFile.prototype.showCopyDialog=function(a,d,b){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,d)}),null,mxResources.get("overwrite"),b,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)};
@ -3165,7 +3165,7 @@ function(a,b,d,f){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.r
Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var c=a.convert,b=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=Editor.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||b.crossOriginImages&&b.isCorsEnabledForUrl(d)?"chrome-extension://"==d.substring(0,19)||mxClient.IS_CHROMEAPP||(d=c.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};
return a};Editor.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,c){try{var b=!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c(Editor.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);b&&c(Editor.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d);b&&c(Editor.svgBrokenImage.src)});else{var f=new Image;
this.crossOriginImages&&(f.crossOrigin="anonymous");f.onload=function(){window.clearTimeout(d);if(b)try{var a=document.createElement("canvas"),g=a.getContext("2d");a.height=f.height;a.width=f.width;g.drawImage(f,0,0);c(a.toDataURL())}catch(ea){c(Editor.svgBrokenImage.src)}};f.onerror=function(){window.clearTimeout(d);b&&c(Editor.svgBrokenImage.src)};f.src=a}}catch(U){c(Editor.svgBrokenImage.src)}};Editor.prototype.convertImages=function(a,c,b,d){null==d&&(d=this.createImageUrlConverter());var f=0,
g=b||{};b=mxUtils.bind(this,function(b,e){for(var l=a.getElementsByTagName(b),n=0;n<l.length;n++)mxUtils.bind(this,function(b){try{if(null!=b){var l=d.convert(b.getAttribute(e));if(null!=l&&"data:"!=l.substring(0,5)){var n=g[l];null==n?(f++,this.convertImageToDataUri(l,function(d){null!=d&&(g[l]=d,b.setAttribute(e,d));f--;0==f&&c(a)})):b.setAttribute(e,n)}else null!=l&&b.setAttribute(e,l)}}catch(da){}})(l[n])});b("image","xlink:href");b("img","src");0==f&&c(a)};Editor.base64Encode=function(a){for(var c=
g=b||{};b=mxUtils.bind(this,function(b,e){for(var l=a.getElementsByTagName(b),n=0;n<l.length;n++)mxUtils.bind(this,function(b){try{if(null!=b){var l=d.convert(b.getAttribute(e));if(null!=l&&"data:"!=l.substring(0,5)){var n=g[l];null==n?(f++,this.convertImageToDataUri(l,function(d){null!=d&&(g[l]=d,b.setAttribute(e,d));f--;0==f&&c(a)})):b.setAttribute(e,n)}else null!=l&&b.setAttribute(e,l)}}catch(ca){}})(l[n])});b("image","xlink:href");b("img","src");0==f&&c(a)};Editor.base64Encode=function(a){for(var c=
"",b=0,d=a.length,f,g,e;b<d;){f=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);c+="==";break}g=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&
15)<<2);c+="=";break}e=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(e&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e&63)}return c};Editor.prototype.loadUrl=function(a,c,b,d,f,g,e,l){try{var n=!e&&(d||/(\.png)($|\?)/i.test(a)||
/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a)||/(\.pdf)($|\?)/i.test(a));f=null!=f?f:!0;var p=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=c){var d=a.getText();if(n){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),f=0;f<a.length;f++)d[f]=String.fromCharCode(a[f]);d=d.join("")}g=
@ -3189,7 +3189,7 @@ function(a,c){var b=null;null!=a.editor.graph.getModel().getParent(c)?b=c.getId(
this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile();return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var n=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=n.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,d=this.createOption(mxResources.get("shadow"),
function(){return b.shadowVisible},function(a){var d=new ChangePageSetup(c);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;b.model.execute(d)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(d.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(d,60));a.appendChild(d)}return a};var l=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=l.apply(this,arguments);var c=this.editorUi,b=c.editor.graph;if(b.isEnabled()){var d=c.getCurrentFile();if(null!=d&&d.isAutosaveOptional()){var f=this.createOption(mxResources.get("autosave"),function(){return c.editor.autosave},function(a){c.editor.setAutosave(a);c.editor.autosave&&d.isModified()&&d.fileChanged()},{install:function(a){this.listener=function(){a(c.editor.autosave)};c.editor.addListener("autosaveChanged",this.listener)},destroy:function(){c.editor.removeListener(this.listener)}});
a.appendChild(f)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){f=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var g=c.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");
a.appendChild(f)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){f=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var g=c.menus.createHelpLink("https://www.diagrams.net/doc/faq/math-typesetting");
g.style.position="relative";g.style.marginLeft="6px";g.style.top="2px";f.appendChild(g)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},
@ -3305,7 +3305,7 @@ e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");p
mxResources.get("fitTo"));var L=document.createElement("input");L.style.cssText="margin:0 8px 0 8px;";L.setAttribute("value","1");L.setAttribute("min","1");L.setAttribute("type","number");L.style.width="40px";E.appendChild(L);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));F.appendChild(e);mxUtils.write(J,mxResources.get("fitToBy"));var H=L.cloneNode(!0);M.appendChild(H);mxEvent.addListener(L,"focus",function(){B.checked=!0});mxEvent.addListener(H,"focus",function(){B.checked=
!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));D.appendChild(e);A.appendChild(u);A.appendChild(E);A.appendChild(F);C.appendChild(J);C.appendChild(M);C.appendChild(D);v.appendChild(A);v.appendChild(C);y.appendChild(v);p.appendChild(y);g.appendChild(p);p=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom="12px";mxUtils.write(e,mxResources.get("paperSize"));p.appendChild(e);e=document.createElement("div");
e.style.marginBottom="12px";var I=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);p.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));p.appendChild(e);var K=document.createElement("input");K.style.cssText="margin:0 8px 0 8px;";K.setAttribute("value","100 %");K.style.width="60px";p.appendChild(K);g.appendChild(p);e=document.createElement("div");e.style.cssText="text-align:right;margin:48px 0 0 0;";
p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&e.appendChild(p);a.isOffline()||(y=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),y.className="geBtn",e.appendChild(y));PrintDialog.previewEnabled&&(y=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),y.className="geBtn",e.appendChild(y));y=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&e.appendChild(p);a.isOffline()||(y=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://www.diagrams.net/doc/faq/print-diagram")}),y.className="geBtn",e.appendChild(y));PrintDialog.previewEnabled&&(y=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),y.className="geBtn",e.appendChild(y));y=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
"print":"ok"),function(){a.hideDialog();d(!0)});y.className="geBtn gePrimaryBtn";e.appendChild(y);a.editor.cancelFirst||e.appendChild(p);g.appendChild(e);this.container=g};var M=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(M.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var L=document.createElement("canvas"),E=new Image;E.onload=function(){try{L.getContext("2d").drawImage(E,0,0);var a=L.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(K){}};E.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(v){}})();
@ -3524,10 +3524,10 @@ g=mxUtils.bind(this,function(a){var c=null;null!=a&&"<mxlibrary"==a.substring(0,
null,"",d,e,l,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,g)):null!=q&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(c=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(c=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==
a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=x&&x(null))}),m)):0==a.indexOf("PK")&&null!=q?(c=!0,this.importZipFile(q,g,mxUtils.bind(this,function(){f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,y);x(f)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,y));c||null==x||x(f);return f};EditorUi.prototype.importFiles=function(a,b,d,e,l,k,m,q,u,y,C,J){e=null!=e?e:this.maxImageSize;y=null!=y?y:this.maxImageBytes;
var c=null!=b&&null!=d,f=!0;b=null!=b?b:0;d=null!=d?d:0;var g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=C||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>n){g=!0;break}var t=mxUtils.bind(this,function(){var g=this.editor.graph,n=g.gridSize;l=null!=l?l:mxUtils.bind(this,function(a,b,d,f,e,g,l,k,n){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,d,f,e,g,l,
k,n,c,J)}catch(da){return this.handleError(da),null}});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,t=p,x=[],u=mxUtils.bind(this,function(a,c){x[a]=c;if(0==--t){this.spinner.stop();if(null!=q)q(x);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<x.length;d++){var f=x[d]();null!=f&&(b=b.concat(f))}}finally{g.getModel().endUpdate()}}k(b)}}),z=0;z<p;z++)mxUtils.bind(this,function(c){var k=
k,n,c,J)}catch(ca){return this.handleError(ca),null}});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,t=p,x=[],u=mxUtils.bind(this,function(a,c){x[a]=c;if(0==--t){this.spinner.stop();if(null!=q)q(x);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<x.length;d++){var f=x[d]();null!=f&&(b=b.concat(f))}}finally{g.getModel().endUpdate()}}k(b)}}),z=0;z<p;z++)mxUtils.bind(this,function(c){var k=
a[c];if(null!=k){var p=new FileReader;p.onload=mxUtils.bind(this,function(a){if(null==m||m(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var p=a.target.result,t=p.indexOf(","),q=decodeURIComponent(escape(atob(p.substring(t+1)))),x=mxUtils.parseXml(q),q=x.getElementsByTagName("svg");if(0<q.length){var q=q[0],v=J?null:q.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?u(c,mxUtils.bind(this,function(){try{if(p.substring(0,t+1),null!=x){var a=x.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=f.getAttribute("width"),q=f.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,q=null!=q&&"%"!=q.charAt(q.length-1)?parseFloat(q):NaN,v=f.getAttribute("viewBox");if(null==v||0==v.length)f.setAttribute("viewBox","0 0 "+m+" "+q);else if(isNaN(m)||
isNaN(q)){var u=v.split(" ");3<u.length&&(m=parseFloat(u[2]),q=parseFloat(u[3]))}p=Editor.createSvgDataUri(mxUtils.getXml(f));var y=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,q)),z=l(p,k.type,b+c*n,d+c*n,Math.max(1,Math.round(m*y)),Math.max(1,Math.round(q*y)),k.name);if(isNaN(m)||isNaN(q)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=Math.max(1,A.width);q=Math.max(1,A.height);z[0].geometry.width=m;z[0].geometry.height=q;f.setAttribute("viewBox","0 0 "+m+" "+q);p=Editor.createSvgDataUri(mxUtils.getXml(f));
isNaN(q)){var y=v.split(" ");3<y.length&&(m=parseFloat(y[2]),q=parseFloat(y[3]))}p=Editor.createSvgDataUri(mxUtils.getXml(f));var u=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,q)),z=l(p,k.type,b+c*n,d+c*n,Math.max(1,Math.round(m*u)),Math.max(1,Math.round(q*u)),k.name);if(isNaN(m)||isNaN(q)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=Math.max(1,A.width);q=Math.max(1,A.height);z[0].geometry.width=m;z[0].geometry.height=q;f.setAttribute("viewBox","0 0 "+m+" "+q);p=Editor.createSvgDataUri(mxUtils.getXml(f));
var a=p.indexOf(";");0<a&&(p=p.substring(0,a)+p.substring(p.indexOf(",",a+1)));g.setCellStyles("image",p,[z[0]])});A.src=Editor.createSvgDataUri(mxUtils.getXml(f))}return z}}}catch(na){}return null})):u(c,mxUtils.bind(this,function(){return l(v,"text/xml",b+c*n,d+c*n,0,0,k.name)}))}else u(c,mxUtils.bind(this,function(){return null}))}else{q=!1;if("image/png"==k.type){var z=J?null:this.extractGraphModelFromPng(a.target.result);if(null!=z&&0<z.length){var A=new Image;A.src=a.target.result;u(c,mxUtils.bind(this,
function(){return l(z,"text/xml",b+c*n,d+c*n,A.width,A.height,k.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(a,g,p){u(c,mxUtils.bind(this,
function(){if(null!=a&&a.length<y){var m=f&&this.isResampleImageSize(k.size,C)?Math.min(1,Math.min(e/g,e/p)):1;return l(a,k.type,b+c*n,d+c*n,Math.round(g*m),Math.round(p*m),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,C,k.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else p=a.target.result,l(p,k.type,b+c*n,d+c*n,240,160,k.name,function(a){u(c,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||
@ -3615,28 +3615,28 @@ Editor.createSvgDataUri(a);m.postMessage(JSON.stringify(u),"*")});if("xmlsvg"==g
function(a){g.embedImages||null==g.embedImages?this.editor.convertImages(a,mxUtils.bind(this,function(a){ia(mxUtils.getXml(a))})):ia(mxUtils.getXml(a))}))}return}m.postMessage(JSON.stringify(u),"*")}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.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=g.noSaveBtn);
null!=g.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=g.noExitBtn);null!=g.title&&null!=this.buttonContainer&&(n=document.createElement("span"),mxUtils.write(n,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
this.buttonContainer.appendChild(n),this.embedFilenameSpan=n);try{g.libs&&this.sidebar.showEntries(g.libs)}catch(ba){}g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.descriptor?g.descriptor:g.xml}else{if("merge"==g.action){var aa=this.getCurrentFile();null!=aa&&(n=l(g.xml),null!=n&&""!=n&&aa.mergeFile(new LocalFile(this,n),function(){m.postMessage(JSON.stringify({event:"merge",message:g}),"*")},function(a){m.postMessage(JSON.stringify({event:"merge",message:g,error:a}),"*")}))}else"remoteInvokeReady"==
g.action?this.handleRemoteInvokeReady(m):"remoteInvoke"==g.action?this.handleRemoteInvoke(g,f.origin):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}catch(ba){this.handleError(ba)}}var fa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),da=mxUtils.bind(this,function(f,g){c=!0;try{a(f,
g.action?this.handleRemoteInvokeReady(m):"remoteInvoke"==g.action?this.handleRemoteInvoke(g,f.origin):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}catch(ba){this.handleError(ba)}}var fa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ca=mxUtils.bind(this,function(f,g){c=!0;try{a(f,
g)}catch(N){this.handleError(N)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");e=fa();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=fa();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;(window.opener||window.parent).postMessage(JSON.stringify(f),"*")}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));if("1"==urlParams.returnbounds||"json"==urlParams.proto){var l=this.createLoadMessage("load");l.xml=f;m.postMessage(JSON.stringify(l),"*")}});"object"===typeof g?this.loadDescriptor(g,mxUtils.bind(this,
function(a){da(fa(),f)}),mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))})):null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){da(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&
this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&da(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){da(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),da(g,f))}}));var m=window.opener||window.parent,k="json"==urlParams.proto?
JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(k,"*");if("json"==urlParams.proto){var q=this.editor.graph.openLink;this.editor.graph.openLink=function(a,b,c){q.apply(this,arguments);m.postMessage(JSON.stringify({event:"openLink",href:a,target:b,allowOpener:c}),"*")}}};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":"0px";
a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";var d=b;if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var e="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(b,e);b.setAttribute("title",e);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));a.appendChild(b)}}else mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",
mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b),
d=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),d="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,d),b.setAttribute("title",d),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),d=b);d.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=
function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var k in a[f].config)e[k]=a[f].config[k];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var k={},m=null,q=null,u=null,C=null,J=null,z=null,A=null,F=null,D=null,I="",H="auto",M="auto",L=null,E=null,v=40,K=40,
P=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var U=function(){null!=b?b(ka):(G.setSelectionCells(ka),G.scrollCellToVisible(G.getSelectionCell()))},Y=G.getFreeInsertPoint(),ea=Y.x,ha=Y.y,Y=ha,ia=null,Z="auto",D=null,aa=[],fa=null,da=null,ba=0;ba<c.length&&"#"==c[ba].charAt(0);){a=c[ba];for(ba++;ba<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[ba].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[ba].substring(1)),ba++;if("#"!=a.charAt(1)){var ja=a.indexOf(":");if(0<ja){var Q=mxUtils.trim(a.substring(1,
ja)),N=mxUtils.trim(a.substring(ja+1));"label"==Q?ia=G.sanitizeHtml(N):"labelname"==Q&&0<N.length&&"-"!=N?J=N:"labels"==Q&&0<N.length&&"-"!=N?z=JSON.parse(N):"style"==Q?q=N:"parentstyle"==Q?A=N:"stylename"==Q&&0<N.length&&"-"!=N?C=N:"styles"==Q&&0<N.length&&"-"!=N?u=JSON.parse(N):"vars"==Q&&0<N.length&&"-"!=N?m=JSON.parse(N):"identity"==Q&&0<N.length&&"-"!=N?F=N:"parent"==Q&&0<N.length&&"-"!=N?D=N:"namespace"==Q&&0<N.length&&"-"!=N?I=N:"width"==Q?H=N:"height"==Q?M=N:"left"==Q&&0<N.length?L=N:"top"==
Q&&0<N.length?E=N:"ignore"==Q?da=N.split(","):"connect"==Q?aa.push(JSON.parse(N)):"link"==Q?fa=N:"padding"==Q?W=parseFloat(N):"edgespacing"==Q?v=parseFloat(N):"nodespacing"==Q?K=parseFloat(N):"levelspacing"==Q?P=parseFloat(N):"layout"==Q&&(Z=N)}}}if(null==c[ba])throw Error(mxResources.get("invalidOrMissingFile"));for(var ma=this.editor.csvToArray(c[ba]),Q=ja=null,N=[],R=0;R<ma.length;R++)F==ma[R]&&(ja=R),D==ma[R]&&(Q=R),N.push(mxUtils.trim(ma[R]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,
""));null==ia&&(ia="%"+N[0]+"%");if(null!=aa)for(var X=0;X<aa.length;X++)null==k[aa[X].to]&&(k[aa[X].to]={});F=[];for(R=ba+1;R<c.length;R++){var ga=this.editor.csvToArray(c[R]);if(null==ga){var pa=40<c[R].length?c[R].substring(0,40)+"...":c[R];throw Error(pa+" ("+R+"):\n"+mxResources.get("containsValidationErrors"));}0<ga.length&&F.push(ga)}G.model.beginUpdate();try{for(R=0;R<F.length;R++){var ga=F[R],O=null,na=null!=ja?I+ga[ja]:null;null!=na&&(O=G.model.getCell(na));var c=null!=O,S=new mxCell(ia,
new mxGeometry(ea,Y,0,0),q||"whiteSpace=wrap;html=1;");S.vertex=!0;S.id=na;for(var ca=0;ca<ga.length;ca++)G.setAttributeForCell(S,N[ca],ga[ca]);if(null!=J&&null!=z){var Aa=z[S.getAttribute(J)];null!=Aa&&G.labelChanged(S,Aa)}if(null!=C&&null!=u){var qa=u[S.getAttribute(C)];null!=qa&&(S.style=qa)}G.setAttributeForCell(S,"placeholders","1");S.style=G.replacePlaceholders(S,S.style,m);c&&(G.model.setGeometry(O,S.geometry),G.model.setStyle(O,S.style),0>mxUtils.indexOf(f,O)&&f.push(O));O=S;if(!c)for(X=0;X<
aa.length;X++)k[aa[X].to][O.getAttribute(aa[X].to)]=O;null!=fa&&"link"!=fa&&(G.setLinkForCell(O,O.getAttribute(fa)),G.setAttributeForCell(O,fa,null));G.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var ta=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=L&&null!=O.getAttribute(L)&&(O.geometry.x=ea+parseFloat(O.getAttribute(L))),null!=E&&null!=O.getAttribute(E)&&(O.geometry.y=ha+parseFloat(O.getAttribute(E))),"@"==H.charAt(0)&&null!=O.getAttribute(H.substring(1))?O.geometry.width=
parseFloat(O.getAttribute(H.substring(1))):O.geometry.width="auto"==H?ta.width+W:parseFloat(H),"@"==M.charAt(0)&&null!=O.getAttribute(M.substring(1))?O.geometry.height=parseFloat(O.getAttribute(M.substring(1))):O.geometry.height="auto"==M?ta.height+W:parseFloat(M),Y+=O.geometry.height+K);c?(null==e[na]&&(e[na]=[]),e[na].push(O)):(D=null!=Q?G.model.getCell(I+ga[Q]):null,d.push(O),null!=D?(D.style=G.replacePlaceholders(D,A,m),G.addCell(O,D)):f.push(G.addCell(O)))}for(var ra=f.slice(),ka=f.slice(),X=
0;X<aa.length;X++)for(var Ba=aa[X],R=0;R<d.length;R++){var O=d[R],Da=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(G.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),f=0;f<d.length;f++){var e=k[c.to][d[f]];if(null!=e){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)||"")+(g||""));null!=c.tolabel&&(g=(g||"")+(e.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?e:a,l=null!=c.style?G.replacePlaceholders(l,c.style,m):
G.createCurrentEdgeStyle(),g=G.insertEdge(null,null,g||"",c.invert?e:a,c.invert?a:e,l);if(null!=c.labels)for(l=0;l<c.labels.length;l++){var n=c.labels[l],p=new mxCell(n.label||l,new mxGeometry(null!=n.x?n.x:0,null!=n.y?n.y:0,0,0),"resizable=0;html=1;");p.vertex=!0;p.connectable=!1;p.geometry.relative=!0;if(null!=n.dx||null!=n.dy)p.geometry.offset=new mxPoint(null!=n.dx?n.dx:0,null!=n.dy?n.dy:0);g.insert(p)}ka.push(g);mxUtils.remove(c.invert?a:e,ra)}}});Da(O,O,Ba);if(null!=e[O.id])for(ca=0;ca<e[O.id].length;ca++)Da(O,
e[O.id][ca],Ba)}if(null!=da)for(R=0;R<d.length;R++)for(O=d[R],ca=0;ca<da.length;ca++)G.setAttributeForCell(O,mxUtils.trim(da[ca]),null);if(0<f.length){var xa=new mxParallelEdgeLayout(G);xa.spacing=v;xa.checkOverlap=!0;var va=function(){0<xa.spacing&&xa.execute(G.getDefaultParent());for(var a=0;a<f.length;a++){var b=G.getCellGeometry(f[a]);b.x=Math.round(G.snap(b.x));b.y=Math.round(G.snap(b.y));"auto"==H&&(b.width=Math.round(G.snap(b.width)));"auto"==M&&(b.height=Math.round(G.snap(b.height)))}};if("["==
Z.charAt(0)){var Ea=U;G.view.validate();this.executeLayoutList(JSON.parse(Z),function(){va();Ea()});U=null}else if("circle"==Z){var ua=new mxCircleLayout(G);ua.disableEdgeStyle=!1;ua.resetEdges=!1;var ya=ua.isVertexIgnored;ua.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){ua.execute(G.getDefaultParent());va()},!0,U);U=null}else if("horizontaltree"==Z||"verticaltree"==Z||"auto"==Z&&ka.length==2*f.length-1&&1==ra.length){G.view.validate();
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));if("1"==urlParams.returnbounds||"json"==urlParams.proto){var l=this.createLoadMessage("load");l.xml=f;m.postMessage(JSON.stringify(l),"*")}});null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==
g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){ca(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,
13)&&ca(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){ca(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):null==g||"object"!==typeof g||null==g.format||null==g.data&&null==g.url?(g=l(g),ca(g,f)):this.loadDescriptor(g,mxUtils.bind(this,function(a){ca(fa(),f)}),mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}}));var m=window.opener||window.parent,k="json"==
urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(k,"*");if("json"==urlParams.proto){var q=this.editor.graph.openLink;this.editor.graph.openLink=function(a,b,c){q.apply(this,arguments);m.postMessage(JSON.stringify({event:"openLink",href:a,target:b,allowOpener:c}),"*")}}};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";var d=b;if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var e="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(b,e);b.setAttribute("title",e);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));a.appendChild(b)}}else mxUtils.write(b,mxResources.get("save")),
b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
a.appendChild(b),d=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),d="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,d),b.setAttribute("title",d),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),d=b);d.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};
EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var k in a[f].config)e[k]=a[f].config[k];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var k={},m=null,q=null,u=null,C=null,J=null,z=null,A=null,F=null,D=null,I="",H="auto",
M="auto",L=null,E=null,v=40,K=40,P=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var U=function(){null!=b?b(ka):(G.setSelectionCells(ka),G.scrollCellToVisible(G.getSelectionCell()))},Y=G.getFreeInsertPoint(),ea=Y.x,ha=Y.y,Y=ha,ia=null,Z="auto",D=null,aa=[],fa=null,ca=null,ba=0;ba<c.length&&"#"==c[ba].charAt(0);){a=c[ba];for(ba++;ba<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[ba].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[ba].substring(1)),ba++;if("#"!=a.charAt(1)){var ja=a.indexOf(":");
if(0<ja){var Q=mxUtils.trim(a.substring(1,ja)),N=mxUtils.trim(a.substring(ja+1));"label"==Q?ia=G.sanitizeHtml(N):"labelname"==Q&&0<N.length&&"-"!=N?J=N:"labels"==Q&&0<N.length&&"-"!=N?z=JSON.parse(N):"style"==Q?q=N:"parentstyle"==Q?A=N:"stylename"==Q&&0<N.length&&"-"!=N?C=N:"styles"==Q&&0<N.length&&"-"!=N?u=JSON.parse(N):"vars"==Q&&0<N.length&&"-"!=N?m=JSON.parse(N):"identity"==Q&&0<N.length&&"-"!=N?F=N:"parent"==Q&&0<N.length&&"-"!=N?D=N:"namespace"==Q&&0<N.length&&"-"!=N?I=N:"width"==Q?H=N:"height"==
Q?M=N:"left"==Q&&0<N.length?L=N:"top"==Q&&0<N.length?E=N:"ignore"==Q?ca=N.split(","):"connect"==Q?aa.push(JSON.parse(N)):"link"==Q?fa=N:"padding"==Q?W=parseFloat(N):"edgespacing"==Q?v=parseFloat(N):"nodespacing"==Q?K=parseFloat(N):"levelspacing"==Q?P=parseFloat(N):"layout"==Q&&(Z=N)}}}if(null==c[ba])throw Error(mxResources.get("invalidOrMissingFile"));for(var ma=this.editor.csvToArray(c[ba]),Q=ja=null,N=[],R=0;R<ma.length;R++)F==ma[R]&&(ja=R),D==ma[R]&&(Q=R),N.push(mxUtils.trim(ma[R]).replace(/[^a-z0-9]+/ig,
"_").replace(/^\d+/,"").replace(/_+$/,""));null==ia&&(ia="%"+N[0]+"%");if(null!=aa)for(var X=0;X<aa.length;X++)null==k[aa[X].to]&&(k[aa[X].to]={});F=[];for(R=ba+1;R<c.length;R++){var ga=this.editor.csvToArray(c[R]);if(null==ga){var pa=40<c[R].length?c[R].substring(0,40)+"...":c[R];throw Error(pa+" ("+R+"):\n"+mxResources.get("containsValidationErrors"));}0<ga.length&&F.push(ga)}G.model.beginUpdate();try{for(R=0;R<F.length;R++){var ga=F[R],O=null,na=null!=ja?I+ga[ja]:null;null!=na&&(O=G.model.getCell(na));
var c=null!=O,S=new mxCell(ia,new mxGeometry(ea,Y,0,0),q||"whiteSpace=wrap;html=1;");S.vertex=!0;S.id=na;for(var da=0;da<ga.length;da++)G.setAttributeForCell(S,N[da],ga[da]);if(null!=J&&null!=z){var Aa=z[S.getAttribute(J)];null!=Aa&&G.labelChanged(S,Aa)}if(null!=C&&null!=u){var qa=u[S.getAttribute(C)];null!=qa&&(S.style=qa)}G.setAttributeForCell(S,"placeholders","1");S.style=G.replacePlaceholders(S,S.style,m);c&&(G.model.setGeometry(O,S.geometry),G.model.setStyle(O,S.style),0>mxUtils.indexOf(f,O)&&
f.push(O));O=S;if(!c)for(X=0;X<aa.length;X++)k[aa[X].to][O.getAttribute(aa[X].to)]=O;null!=fa&&"link"!=fa&&(G.setLinkForCell(O,O.getAttribute(fa)),G.setAttributeForCell(O,fa,null));G.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var ta=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=L&&null!=O.getAttribute(L)&&(O.geometry.x=ea+parseFloat(O.getAttribute(L))),null!=E&&null!=O.getAttribute(E)&&(O.geometry.y=ha+parseFloat(O.getAttribute(E))),"@"==H.charAt(0)&&null!=O.getAttribute(H.substring(1))?
O.geometry.width=parseFloat(O.getAttribute(H.substring(1))):O.geometry.width="auto"==H?ta.width+W:parseFloat(H),"@"==M.charAt(0)&&null!=O.getAttribute(M.substring(1))?O.geometry.height=parseFloat(O.getAttribute(M.substring(1))):O.geometry.height="auto"==M?ta.height+W:parseFloat(M),Y+=O.geometry.height+K);c?(null==e[na]&&(e[na]=[]),e[na].push(O)):(D=null!=Q?G.model.getCell(I+ga[Q]):null,d.push(O),null!=D?(D.style=G.replacePlaceholders(D,A,m),G.addCell(O,D)):f.push(G.addCell(O)))}for(var ra=f.slice(),
ka=f.slice(),X=0;X<aa.length;X++)for(var Ba=aa[X],R=0;R<d.length;R++){var O=d[R],Da=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(G.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),f=0;f<d.length;f++){var e=k[c.to][d[f]];if(null!=e){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)||"")+(g||""));null!=c.tolabel&&(g=(g||"")+(e.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?e:a,l=null!=c.style?G.replacePlaceholders(l,
c.style,m):G.createCurrentEdgeStyle(),g=G.insertEdge(null,null,g||"",c.invert?e:a,c.invert?a:e,l);if(null!=c.labels)for(l=0;l<c.labels.length;l++){var n=c.labels[l],p=new mxCell(n.label||l,new mxGeometry(null!=n.x?n.x:0,null!=n.y?n.y:0,0,0),"resizable=0;html=1;");p.vertex=!0;p.connectable=!1;p.geometry.relative=!0;if(null!=n.dx||null!=n.dy)p.geometry.offset=new mxPoint(null!=n.dx?n.dx:0,null!=n.dy?n.dy:0);g.insert(p)}ka.push(g);mxUtils.remove(c.invert?a:e,ra)}}});Da(O,O,Ba);if(null!=e[O.id])for(da=
0;da<e[O.id].length;da++)Da(O,e[O.id][da],Ba)}if(null!=ca)for(R=0;R<d.length;R++)for(O=d[R],da=0;da<ca.length;da++)G.setAttributeForCell(O,mxUtils.trim(ca[da]),null);if(0<f.length){var xa=new mxParallelEdgeLayout(G);xa.spacing=v;xa.checkOverlap=!0;var va=function(){0<xa.spacing&&xa.execute(G.getDefaultParent());for(var a=0;a<f.length;a++){var b=G.getCellGeometry(f[a]);b.x=Math.round(G.snap(b.x));b.y=Math.round(G.snap(b.y));"auto"==H&&(b.width=Math.round(G.snap(b.width)));"auto"==M&&(b.height=Math.round(G.snap(b.height)))}};
if("["==Z.charAt(0)){var Ea=U;G.view.validate();this.executeLayoutList(JSON.parse(Z),function(){va();Ea()});U=null}else if("circle"==Z){var ua=new mxCircleLayout(G);ua.disableEdgeStyle=!1;ua.resetEdges=!1;var ya=ua.isVertexIgnored;ua.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){ua.execute(G.getDefaultParent());va()},!0,U);U=null}else if("horizontaltree"==Z||"verticaltree"==Z||"auto"==Z&&ka.length==2*f.length-1&&1==ra.length){G.view.validate();
var sa=new mxCompactTreeLayout(G,"horizontaltree"==Z);sa.levelDistance=K;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(G.getDefaultParent(),0<ra.length?ra[0]:null)},!0,U);U=null}else if("horizontalflow"==Z||"verticalflow"==Z||"auto"==Z&&1==ra.length){G.view.validate();var oa=new mxHierarchicalLayout(G,"horizontalflow"==Z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);oa.intraCellSpacing=K;oa.parallelEdgeSpacing=v;oa.interRankCellSpacing=P;oa.disableEdgeStyle=
!1;this.executeLayout(function(){oa.execute(G.getDefaultParent(),ka);G.moveCells(ka,ea,ha)},!0,U);U=null}else if("organic"==Z||"auto"==Z&&ka.length>f.length){G.view.validate();var la=new mxFastOrganicLayout(G);la.forceConstant=3*K;la.disableEdgeStyle=!1;la.resetEdges=!1;var Ia=la.isVertexIgnored;la.isVertexIgnored=function(a){return Ia.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){la.execute(G.getDefaultParent());va()},!0,U);U=null}}this.hideDialog()}finally{G.model.endUpdate()}null!=
U&&U()}}catch(Fa){this.handleError(Fa)}};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(" "),
@ -3780,7 +3780,7 @@ t.model.getTerminal(d[0],!0),!0);var f=u(a),g=c.geometry;f==mxConstants.DIRECTIO
(Math.min(m.y+m.height,v.y+v.height)-Math.max(m.y,v.y))/l))}}p?g=0:d=0;for(q=0;q<n.length;q++)if(x=t.model.getTerminal(n[q],!1),f==u(x)&&(v=t.view.getState(x),x!=a&&null!=v&&(p&&b!=v.getCenterX()<k.getCenterX()||!p&&b!=v.getCenterY()<k.getCenterY()))){var z=[];t.traverse(v.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});t.moveCells(z,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=u(a),c=t.getIncomingEdges(a),
d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&
(l=0);t.moveCells(g,k,l);return t.addCells(d,e)}finally{t.model.endUpdate()}}function g(a,b){t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=u(a);0==d.length&&(d=[t.createEdge(c,null,"",null,null,t.createCurrentEdgeStyle())],e=b);var f=t.cloneCells([d[0],a]);t.model.setTerminal(f[0],a,!0);if(null==t.model.getTerminal(f[0],!1)){t.model.setTerminal(f[0],f[1],!1);var g=t.getCellStyle(f[1]).newEdgeStyle;if(null!=g)try{var k=JSON.parse(g),l;for(l in k)t.setCellStyles(l,k[l],
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&t.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(da){}}var d=t.getOutgoingEdges(a),m=c.geometry,g=[];t.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var n=t.model.getTerminal(d[k],!1);null!=n&&g.push(n)}var p=t.view.getBounds(g),q=t.view.translate,x=t.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&t.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(ca){}}var d=t.getOutgoingEdges(a),m=c.geometry,g=[];t.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var n=t.model.getTerminal(d[k],!1);null!=n&&g.push(n)}var p=t.view.getBounds(g),q=t.view.translate,x=t.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
2:(p.x+p.width)/x-q.x-m.x+10,f[1].geometry.y+=f[1].geometry.height-m.y+40):e==mxConstants.DIRECTION_NORTH?(f[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-f[1].geometry.width)/2:(p.x+p.width)/x-q.x+-m.x+10,f[1].geometry.y-=f[1].geometry.height+m.y+40):(f[1].geometry.x=e==mxConstants.DIRECTION_WEST?f[1].geometry.x-(f[1].geometry.width+m.x+40):f[1].geometry.x+(f[1].geometry.width-m.x+40),f[1].geometry.y=null==p?a.geometry.y+(a.geometry.height-f[1].geometry.height)/2:(p.y+p.height)/x-q.y+-m.y+
10);return t.addCells(f,c)}finally{t.model.endUpdate()}}function n(a,b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=t.view.getState(t.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function l(a,b){var c=u(a),d=b==mxConstants.DIRECTION_EAST||
b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=b?p.actions.get("selectParent").funct():c==b?(d=t.getOutgoingEdges(a),null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(a),null!=c&&0<c.length&&(d=n(t.model.getTerminal(c[0],!0),d,a),c=t.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&t.setSelectionCell(d[c].cell)))))}

View file

@ -2592,7 +2592,7 @@ Graph.prototype.isExtendParent=function(a){var c=this.model.getParent(a);if(null
function(a,b,d){if(b||d)c.apply(this,arguments);else{var f=this.getSelectionCell(),g=null,e=[],l=mxUtils.bind(this,function(c){if(null!=this.view.getState(c)&&(this.model.isVertex(c)||this.model.isEdge(c)))if(e.push(c),c==f)g=e.length-1;else if(a&&null==f&&0<e.length||null!=g&&a&&e.length>g||!a&&0<g)return;for(var b=0;b<this.model.getChildCount(c);b++)l(this.model.getChildAt(c,b))});l(this.model.root);0<e.length&&(g=null!=g?mxUtils.mod(g+(a?1:-1),e.length):0,this.setSelectionCell(e[g]))}};var f=Graph.prototype.moveCells;
Graph.prototype.moveCells=function(a,c,b,d,g,e,l){l=null!=l?l:{};if(this.isTable(g)){for(var v=[],n=0;n<a.length;n++)this.isTable(a[n])?v=v.concat(this.model.getChildCells(a[n],!0).reverse()):v.push(a[n]);a=v}this.model.beginUpdate();try{v=[];for(n=0;n<a.length;n++)if(null!=g&&this.isTableRow(a[n])){var p=this.model.getParent(a[n]),t=this.getCellGeometry(a[n]);this.isTable(p)&&v.push(p);if(null!=p&&null!=t&&this.isTable(p)&&this.isTable(g)&&(d||p!=g)){if(!d){var k=this.getCellGeometry(p);null!=k&&
(k=k.clone(),k.height-=t.height,this.model.setGeometry(p,k))}k=this.getCellGeometry(g);null!=k&&(k=k.clone(),k.height+=t.height,this.model.setGeometry(g,k));var x=this.model.getChildCells(g,!0);if(0<x.length){a[n]=d?this.cloneCell(a[n]):a[n];var S=this.model.getChildCells(a[n],!0),q=this.model.getChildCells(x[0],!0),K=q.length-S.length;if(0<K)for(var m=0;m<K;m++){var P=this.cloneCell(S[S.length-1]);null!=P&&(P.value="",this.model.add(a[n],P))}else if(0>K)for(m=0;m>K;m--)this.model.remove(S[S.length+
m-1]);S=this.model.getChildCells(a[n],!0);for(m=0;m<q.length;m++){var G=this.getCellGeometry(q[m]),ca=this.getCellGeometry(S[m]);null!=G&&null!=ca&&(ca=ca.clone(),ca.width=G.width,this.model.setGeometry(S[m],ca))}}}}for(var y=f.apply(this,arguments),n=0;n<v.length;n++)!d&&this.model.contains(v[n])&&0==this.model.getChildCount(v[n])&&this.model.remove(v[n]);d&&this.updateCustomLinks(this.createCellMapping(l,this.createCellLookup(a)),y)}finally{this.model.endUpdate()}return y};var g=Graph.prototype.removeCells;
m-1]);S=this.model.getChildCells(a[n],!0);for(m=0;m<q.length;m++){var G=this.getCellGeometry(q[m]),y=this.getCellGeometry(S[m]);null!=G&&null!=y&&(y=y.clone(),y.width=G.width,this.model.setGeometry(S[m],y))}}}}for(var da=f.apply(this,arguments),n=0;n<v.length;n++)!d&&this.model.contains(v[n])&&0==this.model.getChildCount(v[n])&&this.model.remove(v[n]);d&&this.updateCustomLinks(this.createCellMapping(l,this.createCellLookup(a)),da)}finally{this.model.endUpdate()}return da};var g=Graph.prototype.removeCells;
Graph.prototype.removeCells=function(a,c){var b=[];this.model.beginUpdate();try{for(var d=0;d<a.length;d++)if(this.isTableCell(a[d])){var f=this.model.getParent(a[d]),e=this.model.getParent(f);1==this.model.getChildCount(f)&&1==this.model.getChildCount(e)?0>mxUtils.indexOf(a,e)&&0>mxUtils.indexOf(b,e)&&b.push(e):this.labelChanged(a[d],"")}else{if(this.isTableRow(a[d])&&(e=this.model.getParent(a[d]),0>mxUtils.indexOf(a,e)&&0>mxUtils.indexOf(b,e))){for(var l=this.model.getChildCells(e,!0),n=0,v=0;v<
l.length;v++)0<=mxUtils.indexOf(a,l[v])&&n++;n==l.length&&b.push(e)}b.push(a[d])}b=g.apply(this,[b,c])}finally{this.model.endUpdate()}return b};Graph.prototype.updateCustomLinks=function(a,c){for(var b=0;b<c.length;b++)null!=c[b]&&this.updateCustomLinksForCell(a,c[b])};Graph.prototype.updateCustomLinksForCell=function(a,c){};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var d=[];try{for(var f=JSON.parse(b),b=0;b<f.length;b++){var g=
f[b];d.push(new mxConnectionConstraint(new mxPoint(g[0],g[1]),2<g.length?"0"!=g[2]:!0,null,3<g.length?g[3]:0,4<g.length?g[4]:0))}}catch(ka){}return d}if(null!=a.shape&&null!=a.shape.bounds){g=a.shape.direction;f=a.shape.bounds;b=a.shape.scale;d=f.width/b;f=f.height/b;if(g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH)g=d,d=f,f=g;b=a.shape.getConstraints(a.style,d,f);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;if(null!=
@ -2719,8 +2719,8 @@ this.secondDiv=null)),c.consume()}};var U=mxRubberband.prototype.reset;mxRubberb
b};var ia=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<ea||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&ia.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,d=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-
1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),f):null)?this.fixedHandleImage:null!=f&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,
mxConstants.HANDLE_STROKECOLOR)};var Z=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return Z.apply(this,arguments)};var aa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);
if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return aa.apply(this,arguments)};var fa=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=fa.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var da=mxVertexHandler.prototype.getSelectionBounds;
mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):da.apply(this,arguments)};var ba=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,
if(c.isEdge(b)&&null!=d&&d.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return aa.apply(this,arguments)};var fa=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=fa.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var ca=mxVertexHandler.prototype.getSelectionBounds;
mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):ca.apply(this,arguments)};var ba=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,
c){var b=this.graph.getModel(),d=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(d)||null==f||!f.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ba.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var a=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),c=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);
this.state.view.graph.model.isVertex(this.state.cell)&&a==mxConstants.NONE&&c==mxConstants.NONE?(a=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,a,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var ja=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){ja.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&
null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Q=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,c){Q.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display=
@ -2744,8 +2744,8 @@ function(){na.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNo
function p(){mxActor.call(this)}function t(){mxActor.call(this)}function x(){mxActor.call(this)}function B(){mxActor.call(this)}function y(){mxActor.call(this)}function C(){mxActor.call(this)}function J(){mxActor.call(this)}function z(a,c){this.canvas=a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,z.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,
z.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,z.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,z.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,z.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,z.prototype.arcTo)}function A(){mxRectangleShape.call(this)}function F(){mxRectangleShape.call(this)}function D(){mxActor.call(this)}
function I(){mxActor.call(this)}function H(){mxActor.call(this)}function M(){mxRectangleShape.call(this)}function L(){mxRectangleShape.call(this)}function E(){mxCylinder.call(this)}function v(){mxShape.call(this)}function K(){mxShape.call(this)}function P(){mxEllipse.call(this)}function W(){mxShape.call(this)}function G(){mxShape.call(this)}function U(){mxRectangleShape.call(this)}function Y(){mxShape.call(this)}function ea(){mxShape.call(this)}function ha(){mxShape.call(this)}function ia(){mxShape.call(this)}
function Z(){mxShape.call(this)}function aa(){mxCylinder.call(this)}function fa(){mxCylinder.call(this)}function da(){mxRectangleShape.call(this)}function ba(){mxDoubleEllipse.call(this)}function ja(){mxDoubleEllipse.call(this)}function Q(){mxArrowConnector.call(this);this.spacing=0}function N(){mxArrowConnector.call(this);this.spacing=0}function ma(){mxActor.call(this)}function R(){mxRectangleShape.call(this)}function X(){mxActor.call(this)}function ga(){mxActor.call(this)}function pa(){mxActor.call(this)}
function O(){mxActor.call(this)}function na(){mxActor.call(this)}function S(){mxActor.call(this)}function ca(){mxActor.call(this)}function Aa(){mxActor.call(this)}function qa(){mxActor.call(this)}function ta(){mxActor.call(this)}function ra(){mxEllipse.call(this)}function ka(){mxEllipse.call(this)}function Ba(){mxEllipse.call(this)}function Da(){mxRhombus.call(this)}function xa(){mxEllipse.call(this)}function va(){mxEllipse.call(this)}function Ea(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}
function Z(){mxShape.call(this)}function aa(){mxCylinder.call(this)}function fa(){mxCylinder.call(this)}function ca(){mxRectangleShape.call(this)}function ba(){mxDoubleEllipse.call(this)}function ja(){mxDoubleEllipse.call(this)}function Q(){mxArrowConnector.call(this);this.spacing=0}function N(){mxArrowConnector.call(this);this.spacing=0}function ma(){mxActor.call(this)}function R(){mxRectangleShape.call(this)}function X(){mxActor.call(this)}function ga(){mxActor.call(this)}function pa(){mxActor.call(this)}
function O(){mxActor.call(this)}function na(){mxActor.call(this)}function S(){mxActor.call(this)}function da(){mxActor.call(this)}function Aa(){mxActor.call(this)}function qa(){mxActor.call(this)}function ta(){mxActor.call(this)}function ra(){mxEllipse.call(this)}function ka(){mxEllipse.call(this)}function Ba(){mxEllipse.call(this)}function Da(){mxRhombus.call(this)}function xa(){mxEllipse.call(this)}function va(){mxEllipse.call(this)}function Ea(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}
function ya(){mxActor.call(this)}function sa(){mxActor.call(this)}function oa(){mxActor.call(this)}function la(){mxConnector.call(this)}function Ia(a,c,b,d,f,g,e,l,n,v){e+=n;var T=d.clone();d.x-=f*(2*e+n);d.y-=g*(2*e+n);f*=e+n;g*=e+n;return function(){a.ellipse(T.x-f-e,T.y-g-e,2*e,2*e);v?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxSwimlane);a.prototype.getLabelBounds=function(a){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,
arguments)};a.prototype.paintVertexShape=function(a,c,b,d,f){0==this.getTitleSize()?mxRectangleShape.prototype.paintBackground.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),a.translate(-c,-b));this.paintForeground(a,c,b,d,f)};a.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.state){var T=this.flipH,g=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)var e=T,T=g,g=e;a.rotate(-this.getShapeRotation(),
T,g,c+d/2,b+f/2);s=this.scale;c=this.bounds.x/s;b=this.bounds.y/s;d=this.bounds.width/s;f=this.bounds.height/s;this.paintTableForeground(a,c,b,d,f)}};a.prototype.paintTableForeground=function(a,c,b,d,f){var g=this.state.view.graph,T=g.getActualStartSize(this.state.cell),e=g.model.getChildCells(this.state.cell,!0);if(0<e.length){var l="0"!=mxUtils.getValue(this.state.style,"rowLines","1"),n="0"!=mxUtils.getValue(this.state.style,"columnLines","1");if(l)for(l=1;l<e.length;l++){var v=g.getCellGeometry(e[l]);
@ -2823,8 +2823,8 @@ mxPerimeter.HexagonPerimeter2);mxUtils.extend(ea,mxShape);ea.prototype.size=10;e
a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",ia);mxUtils.extend(Z,mxShape);Z.prototype.inset=2;Z.prototype.paintBackground=function(a,c,b,d,f){var g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.ellipse(0,g,d-2*g,f-2*g);a.fillAndStroke();a.begin();a.moveTo(d/2,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,d/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Z);mxUtils.extend(aa,mxCylinder);aa.prototype.jettyWidth=
20;aa.prototype.jettyHeight=10;aa.prototype.redrawPath=function(a,c,b,d,f,g){var e=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=e/2;var e=b+e/2,l=Math.min(c,f-c),n=Math.min(l+2*c,f-c);g?(a.moveTo(b,l),a.lineTo(e,l),a.lineTo(e,l+c),a.lineTo(b,l+c),a.moveTo(b,n),a.lineTo(e,n),a.lineTo(e,n+c),a.lineTo(b,n+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,n+c),a.lineTo(0,n+c),a.lineTo(0,
n),a.lineTo(b,n),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("module",aa);mxUtils.extend(fa,mxCylinder);fa.prototype.jettyWidth=32;fa.prototype.jettyHeight=12;fa.prototype.redrawPath=function(a,c,b,d,f,g){var e=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=e/2;var e=b+e/2,l=.3*f-c/2,n=.7*f-c/2;g?(a.moveTo(b,l),a.lineTo(e,l),a.lineTo(e,
l+c),a.lineTo(b,l+c),a.moveTo(b,n),a.lineTo(e,n),a.lineTo(e,n+c),a.lineTo(b,n+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,n+c),a.lineTo(0,n+c),a.lineTo(0,n),a.lineTo(b,n),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("component",fa);mxUtils.extend(da,mxRectangleShape);da.prototype.paintForeground=function(a,c,b,d,f){var g=d/2,e=f/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
2;a.begin();this.addPoints(a,[new mxPoint(c+g,b),new mxPoint(c+d,b+e),new mxPoint(c+g,b+f),new mxPoint(c,b+e)],this.isRounded,l,!0);a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",da);mxUtils.extend(ba,mxDoubleEllipse);ba.prototype.outerStroke=!0;ba.prototype.paintVertexShape=function(a,c,b,d,f){var g=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+g,b+g,d-2*g,f-2*g),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&
l+c),a.lineTo(b,l+c),a.moveTo(b,n),a.lineTo(e,n),a.lineTo(e,n+c),a.lineTo(b,n+c)):(a.moveTo(b,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(b,f),a.lineTo(b,n+c),a.lineTo(0,n+c),a.lineTo(0,n),a.lineTo(b,n),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("component",fa);mxUtils.extend(ca,mxRectangleShape);ca.prototype.paintForeground=function(a,c,b,d,f){var g=d/2,e=f/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
2;a.begin();this.addPoints(a,[new mxPoint(c+g,b),new mxPoint(c+d,b+e),new mxPoint(c+g,b+f),new mxPoint(c,b+e)],this.isRounded,l,!0);a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",ca);mxUtils.extend(ba,mxDoubleEllipse);ba.prototype.outerStroke=!0;ba.prototype.paintVertexShape=function(a,c,b,d,f){var g=Math.min(4,Math.min(d/5,f/5));0<d&&0<f&&(a.ellipse(c+g,b+g,d-2*g,f-2*g),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&
(a.ellipse(c,b,d,f),a.stroke())};mxCellRenderer.registerShape("endState",ba);mxUtils.extend(ja,ba);ja.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",ja);mxUtils.extend(Q,mxArrowConnector);Q.prototype.defaultWidth=4;Q.prototype.isOpenEnded=function(){return!0};Q.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Q.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",
Q);mxUtils.extend(N,mxArrowConnector);N.prototype.defaultWidth=10;N.prototype.defaultArrowWidth=20;N.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};N.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};N.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",
N);mxUtils.extend(ma,mxActor);ma.prototype.size=30;ma.prototype.isRoundable=function(){return!0};ma.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(0,c),new mxPoint(d,0),new mxPoint(d,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ma);mxUtils.extend(R,mxRectangleShape);R.prototype.dx=
@ -2835,8 +2835,8 @@ mxUtils.extend(pa,mxActor);pa.prototype.dx=20;pa.prototype.dy=20;pa.prototype.re
2,b),new mxPoint((d+c)/2,f),new mxPoint((d-c)/2,f),new mxPoint((d-c)/2,b),new mxPoint(0,b)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("tee",pa);mxUtils.extend(O,mxActor);O.prototype.arrowWidth=.3;O.prototype.arrowSize=.2;O.prototype.redrawPath=function(a,c,b,d,f){var g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-g)/2;var g=b+g,e=
mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,g),new mxPoint(0,g)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("singleArrow",O);mxUtils.extend(na,mxActor);na.prototype.redrawPath=function(a,c,b,d,f){var g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",O.prototype.arrowWidth))));c=d*Math.max(0,
Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",O.prototype.arrowSize))));b=(f-g)/2;var g=b+g,e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d-c,b),new mxPoint(d-c,0),new mxPoint(d,f/2),new mxPoint(d-c,f),new mxPoint(d-c,g),new mxPoint(c,g),new mxPoint(c,f)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",na);mxUtils.extend(S,mxActor);S.prototype.size=
.1;S.prototype.fixedSize=20;S.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(d,0);a.quadTo(d-2*c,f/2,d,f);a.lineTo(c,f);a.quadTo(c-2*c,f/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",S);mxUtils.extend(ca,mxActor);ca.prototype.redrawPath=function(a,
c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",ca);mxUtils.extend(Aa,mxActor);Aa.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.quadTo(d/2,f/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",Aa);mxUtils.extend(qa,mxActor);qa.prototype.size=20;qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d/2,Math.min(f,parseFloat(mxUtils.getValue(this.style,
.1;S.prototype.fixedSize=20;S.prototype.redrawPath=function(a,c,b,d,f){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(d,0);a.quadTo(d-2*c,f/2,d,f);a.lineTo(c,f);a.quadTo(c-2*c,f/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",S);mxUtils.extend(da,mxActor);da.prototype.redrawPath=function(a,
c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",da);mxUtils.extend(Aa,mxActor);Aa.prototype.redrawPath=function(a,c,b,d,f){a.moveTo(0,0);a.quadTo(d,0,d,f/2);a.quadTo(d,f,0,f);a.quadTo(d/2,f/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",Aa);mxUtils.extend(qa,mxActor);qa.prototype.size=20;qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(a,c,b,d,f){c=Math.min(d/2,Math.min(f,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(d-c,0),new mxPoint(d,.8*c),new mxPoint(d,f),new mxPoint(0,f),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",qa);mxUtils.extend(ta,mxActor);ta.prototype.size=.375;ta.prototype.isRoundable=function(){return!0};ta.prototype.redrawPath=function(a,c,b,d,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,f-c),new mxPoint(d/2,f),new mxPoint(0,f-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",ta);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/2,b+f);a.lineTo(c+d,b+f);a.end();a.stroke()};
mxCellRenderer.registerShape("tapeData",ra);mxUtils.extend(ka,mxEllipse);ka.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+f/2);a.lineTo(c+d,b+f/2);a.end();a.stroke();a.begin();a.moveTo(c+d/2,b);a.lineTo(c+d/2,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("orEllipse",ka);mxUtils.extend(Ba,mxEllipse);Ba.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,
@ -2943,7 +2943,7 @@ function(a,c,b){a=[];var d=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(t
function(a,c,b){a=[];var d=Math.min(b,c),f=Math.max(0,Math.min(d,d*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),d=(b-f)/2,g=d+f,e=(c-f)/2,f=e+f;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,0));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,b-.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,b));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b-.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),d));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,d));return a};U.prototype.constraints=null;ca.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,
0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,d));return a};U.prototype.constraints=null;da.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,
.9),!1)];Aa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];ia.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];Z.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,
.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}
Actions.prototype.init=function(){var a=this.editorUi,d=a.editor,b=d.graph,e=function(){return Action.prototype.isEnabled.apply(this,arguments)&&b.isEnabled()};this.addAction("new...",function(){b.openLink(a.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";a.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){a.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,
@ -3046,7 +3046,7 @@ null!=b&&(d=mxResources.get("lastSaved",[b]))}null!=d&&60<d.length&&(d=d.substri
null!=d&&0<d.length?mxEvent.addListener(d[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!=this.ui.mode&&this.isEditable()?"save":"saveAs").funct()})):(d=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+d+'" class="geStatusAlert" style="overflow:hidden;">'+d+" ("+mxUtils.htmlEntities(a.message)+")</div>"));EditorUi.enableDrafts&&(null==this.getMode()||EditorUi.isElectronApp)&&(null!=this.saveDraftThread&&window.clearTimeout(this.saveDraftThread),
this.saveDraftThread=window.setTimeout(mxUtils.bind(this,function(){this.saveDraft()}),0))}};
DrawioFile.prototype.addConflictStatus=function(a,d){this.invalidChecksum&&null==d&&(d=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":""));this.ui.spinner.stop();this.clearAutosave();var b=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=b&&0<b.length?mxEvent.addListener(b[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&&
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://desk.draw.io/support/solutions/articles/16000087947" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://www.diagrams.net/doc/faq/synchronize" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
DrawioFile.prototype.showRefreshDialog=function(a,d,b){null==b&&(b=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,d)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,d)}),b),this.ui.showError(mxResources.get("error")+" ("+b+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,
d)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,d)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))};
DrawioFile.prototype.showCopyDialog=function(a,d,b){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,d)}),null,mxResources.get("overwrite"),b,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)};
@ -3165,7 +3165,7 @@ function(a,b,d,f){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.r
Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var c=a.convert,b=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=Editor.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||b.crossOriginImages&&b.isCorsEnabledForUrl(d)?"chrome-extension://"==d.substring(0,19)||mxClient.IS_CHROMEAPP||(d=c.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};
return a};Editor.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,c){try{var b=!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c(Editor.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);b&&c(Editor.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d);b&&c(Editor.svgBrokenImage.src)});else{var f=new Image;
this.crossOriginImages&&(f.crossOrigin="anonymous");f.onload=function(){window.clearTimeout(d);if(b)try{var a=document.createElement("canvas"),g=a.getContext("2d");a.height=f.height;a.width=f.width;g.drawImage(f,0,0);c(a.toDataURL())}catch(ea){c(Editor.svgBrokenImage.src)}};f.onerror=function(){window.clearTimeout(d);b&&c(Editor.svgBrokenImage.src)};f.src=a}}catch(U){c(Editor.svgBrokenImage.src)}};Editor.prototype.convertImages=function(a,c,b,d){null==d&&(d=this.createImageUrlConverter());var f=0,
g=b||{};b=mxUtils.bind(this,function(b,e){for(var l=a.getElementsByTagName(b),n=0;n<l.length;n++)mxUtils.bind(this,function(b){try{if(null!=b){var l=d.convert(b.getAttribute(e));if(null!=l&&"data:"!=l.substring(0,5)){var n=g[l];null==n?(f++,this.convertImageToDataUri(l,function(d){null!=d&&(g[l]=d,b.setAttribute(e,d));f--;0==f&&c(a)})):b.setAttribute(e,n)}else null!=l&&b.setAttribute(e,l)}}catch(da){}})(l[n])});b("image","xlink:href");b("img","src");0==f&&c(a)};Editor.base64Encode=function(a){for(var c=
g=b||{};b=mxUtils.bind(this,function(b,e){for(var l=a.getElementsByTagName(b),n=0;n<l.length;n++)mxUtils.bind(this,function(b){try{if(null!=b){var l=d.convert(b.getAttribute(e));if(null!=l&&"data:"!=l.substring(0,5)){var n=g[l];null==n?(f++,this.convertImageToDataUri(l,function(d){null!=d&&(g[l]=d,b.setAttribute(e,d));f--;0==f&&c(a)})):b.setAttribute(e,n)}else null!=l&&b.setAttribute(e,l)}}catch(ca){}})(l[n])});b("image","xlink:href");b("img","src");0==f&&c(a)};Editor.base64Encode=function(a){for(var c=
"",b=0,d=a.length,f,g,e;b<d;){f=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);c+="==";break}g=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&
15)<<2);c+="=";break}e=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(e&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e&63)}return c};Editor.prototype.loadUrl=function(a,c,b,d,f,g,e,l){try{var n=!e&&(d||/(\.png)($|\?)/i.test(a)||
/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a)||/(\.pdf)($|\?)/i.test(a));f=null!=f?f:!0;var p=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=c){var d=a.getText();if(n){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),f=0;f<a.length;f++)d[f]=String.fromCharCode(a[f]);d=d.join("")}g=
@ -3189,7 +3189,7 @@ function(a,c){var b=null;null!=a.editor.graph.getModel().getParent(c)?b=c.getId(
this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile();return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var n=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=n.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,d=this.createOption(mxResources.get("shadow"),
function(){return b.shadowVisible},function(a){var d=new ChangePageSetup(c);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;b.model.execute(d)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(d.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(d,60));a.appendChild(d)}return a};var l=DiagramFormatPanel.prototype.addOptions;
DiagramFormatPanel.prototype.addOptions=function(a){a=l.apply(this,arguments);var c=this.editorUi,b=c.editor.graph;if(b.isEnabled()){var d=c.getCurrentFile();if(null!=d&&d.isAutosaveOptional()){var f=this.createOption(mxResources.get("autosave"),function(){return c.editor.autosave},function(a){c.editor.setAutosave(a);c.editor.autosave&&d.isModified()&&d.fileChanged()},{install:function(a){this.listener=function(){a(c.editor.autosave)};c.editor.addListener("autosaveChanged",this.listener)},destroy:function(){c.editor.removeListener(this.listener)}});
a.appendChild(f)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){f=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var g=c.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");
a.appendChild(f)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){f=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var g=c.menus.createHelpLink("https://www.diagrams.net/doc/faq/math-typesetting");
g.style.position="relative";g.style.marginLeft="6px";g.style.top="2px";f.appendChild(g)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=
[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",
dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},
@ -3305,7 +3305,7 @@ e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");p
mxResources.get("fitTo"));var L=document.createElement("input");L.style.cssText="margin:0 8px 0 8px;";L.setAttribute("value","1");L.setAttribute("min","1");L.setAttribute("type","number");L.style.width="40px";E.appendChild(L);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));F.appendChild(e);mxUtils.write(J,mxResources.get("fitToBy"));var H=L.cloneNode(!0);M.appendChild(H);mxEvent.addListener(L,"focus",function(){B.checked=!0});mxEvent.addListener(H,"focus",function(){B.checked=
!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));D.appendChild(e);A.appendChild(u);A.appendChild(E);A.appendChild(F);C.appendChild(J);C.appendChild(M);C.appendChild(D);v.appendChild(A);v.appendChild(C);y.appendChild(v);p.appendChild(y);g.appendChild(p);p=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom="12px";mxUtils.write(e,mxResources.get("paperSize"));p.appendChild(e);e=document.createElement("div");
e.style.marginBottom="12px";var I=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);p.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));p.appendChild(e);var K=document.createElement("input");K.style.cssText="margin:0 8px 0 8px;";K.setAttribute("value","100 %");K.style.width="60px";p.appendChild(K);g.appendChild(p);e=document.createElement("div");e.style.cssText="text-align:right;margin:48px 0 0 0;";
p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&e.appendChild(p);a.isOffline()||(y=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),y.className="geBtn",e.appendChild(y));PrintDialog.previewEnabled&&(y=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),y.className="geBtn",e.appendChild(y));y=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&e.appendChild(p);a.isOffline()||(y=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://www.diagrams.net/doc/faq/print-diagram")}),y.className="geBtn",e.appendChild(y));PrintDialog.previewEnabled&&(y=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),y.className="geBtn",e.appendChild(y));y=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
"print":"ok"),function(){a.hideDialog();d(!0)});y.className="geBtn gePrimaryBtn";e.appendChild(y);a.editor.cancelFirst||e.appendChild(p);g.appendChild(e);this.container=g};var M=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(M.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var L=document.createElement("canvas"),E=new Image;E.onload=function(){try{L.getContext("2d").drawImage(E,0,0);var a=L.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(K){}};E.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(v){}})();
@ -3524,10 +3524,10 @@ g=mxUtils.bind(this,function(a){var c=null;null!=a&&"<mxlibrary"==a.substring(0,
null,"",d,e,l,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,g)):null!=q&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(c=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(c=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==
a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=x&&x(null))}),m)):0==a.indexOf("PK")&&null!=q?(c=!0,this.importZipFile(q,g,mxUtils.bind(this,function(){f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,y);x(f)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,y));c||null==x||x(f);return f};EditorUi.prototype.importFiles=function(a,b,d,e,l,k,m,q,u,y,C,J){e=null!=e?e:this.maxImageSize;y=null!=y?y:this.maxImageBytes;
var c=null!=b&&null!=d,f=!0;b=null!=b?b:0;d=null!=d?d:0;var g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=C||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>n){g=!0;break}var t=mxUtils.bind(this,function(){var g=this.editor.graph,n=g.gridSize;l=null!=l?l:mxUtils.bind(this,function(a,b,d,f,e,g,l,k,n){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,d,f,e,g,l,
k,n,c,J)}catch(da){return this.handleError(da),null}});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,t=p,x=[],u=mxUtils.bind(this,function(a,c){x[a]=c;if(0==--t){this.spinner.stop();if(null!=q)q(x);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<x.length;d++){var f=x[d]();null!=f&&(b=b.concat(f))}}finally{g.getModel().endUpdate()}}k(b)}}),z=0;z<p;z++)mxUtils.bind(this,function(c){var k=
k,n,c,J)}catch(ca){return this.handleError(ca),null}});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,t=p,x=[],u=mxUtils.bind(this,function(a,c){x[a]=c;if(0==--t){this.spinner.stop();if(null!=q)q(x);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<x.length;d++){var f=x[d]();null!=f&&(b=b.concat(f))}}finally{g.getModel().endUpdate()}}k(b)}}),z=0;z<p;z++)mxUtils.bind(this,function(c){var k=
a[c];if(null!=k){var p=new FileReader;p.onload=mxUtils.bind(this,function(a){if(null==m||m(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var p=a.target.result,t=p.indexOf(","),q=decodeURIComponent(escape(atob(p.substring(t+1)))),x=mxUtils.parseXml(q),q=x.getElementsByTagName("svg");if(0<q.length){var q=q[0],v=J?null:q.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?u(c,mxUtils.bind(this,function(){try{if(p.substring(0,t+1),null!=x){var a=x.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=f.getAttribute("width"),q=f.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,q=null!=q&&"%"!=q.charAt(q.length-1)?parseFloat(q):NaN,v=f.getAttribute("viewBox");if(null==v||0==v.length)f.setAttribute("viewBox","0 0 "+m+" "+q);else if(isNaN(m)||
isNaN(q)){var u=v.split(" ");3<u.length&&(m=parseFloat(u[2]),q=parseFloat(u[3]))}p=Editor.createSvgDataUri(mxUtils.getXml(f));var y=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,q)),z=l(p,k.type,b+c*n,d+c*n,Math.max(1,Math.round(m*y)),Math.max(1,Math.round(q*y)),k.name);if(isNaN(m)||isNaN(q)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=Math.max(1,A.width);q=Math.max(1,A.height);z[0].geometry.width=m;z[0].geometry.height=q;f.setAttribute("viewBox","0 0 "+m+" "+q);p=Editor.createSvgDataUri(mxUtils.getXml(f));
isNaN(q)){var y=v.split(" ");3<y.length&&(m=parseFloat(y[2]),q=parseFloat(y[3]))}p=Editor.createSvgDataUri(mxUtils.getXml(f));var u=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,q)),z=l(p,k.type,b+c*n,d+c*n,Math.max(1,Math.round(m*u)),Math.max(1,Math.round(q*u)),k.name);if(isNaN(m)||isNaN(q)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=Math.max(1,A.width);q=Math.max(1,A.height);z[0].geometry.width=m;z[0].geometry.height=q;f.setAttribute("viewBox","0 0 "+m+" "+q);p=Editor.createSvgDataUri(mxUtils.getXml(f));
var a=p.indexOf(";");0<a&&(p=p.substring(0,a)+p.substring(p.indexOf(",",a+1)));g.setCellStyles("image",p,[z[0]])});A.src=Editor.createSvgDataUri(mxUtils.getXml(f))}return z}}}catch(na){}return null})):u(c,mxUtils.bind(this,function(){return l(v,"text/xml",b+c*n,d+c*n,0,0,k.name)}))}else u(c,mxUtils.bind(this,function(){return null}))}else{q=!1;if("image/png"==k.type){var z=J?null:this.extractGraphModelFromPng(a.target.result);if(null!=z&&0<z.length){var A=new Image;A.src=a.target.result;u(c,mxUtils.bind(this,
function(){return l(z,"text/xml",b+c*n,d+c*n,A.width,A.height,k.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(a,g,p){u(c,mxUtils.bind(this,
function(){if(null!=a&&a.length<y){var m=f&&this.isResampleImageSize(k.size,C)?Math.min(1,Math.min(e/g,e/p)):1;return l(a,k.type,b+c*n,d+c*n,Math.round(g*m),Math.round(p*m),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,C,k.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else p=a.target.result,l(p,k.type,b+c*n,d+c*n,240,160,k.name,function(a){u(c,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||
@ -3615,28 +3615,28 @@ Editor.createSvgDataUri(a);m.postMessage(JSON.stringify(u),"*")});if("xmlsvg"==g
function(a){g.embedImages||null==g.embedImages?this.editor.convertImages(a,mxUtils.bind(this,function(a){ia(mxUtils.getXml(a))})):ia(mxUtils.getXml(a))}))}return}m.postMessage(JSON.stringify(u),"*")}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.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=g.noSaveBtn);
null!=g.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=g.noExitBtn);null!=g.title&&null!=this.buttonContainer&&(n=document.createElement("span"),mxUtils.write(n,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
this.buttonContainer.appendChild(n),this.embedFilenameSpan=n);try{g.libs&&this.sidebar.showEntries(g.libs)}catch(ba){}g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.descriptor?g.descriptor:g.xml}else{if("merge"==g.action){var aa=this.getCurrentFile();null!=aa&&(n=l(g.xml),null!=n&&""!=n&&aa.mergeFile(new LocalFile(this,n),function(){m.postMessage(JSON.stringify({event:"merge",message:g}),"*")},function(a){m.postMessage(JSON.stringify({event:"merge",message:g,error:a}),"*")}))}else"remoteInvokeReady"==
g.action?this.handleRemoteInvokeReady(m):"remoteInvoke"==g.action?this.handleRemoteInvoke(g,f.origin):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}catch(ba){this.handleError(ba)}}var fa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),da=mxUtils.bind(this,function(f,g){c=!0;try{a(f,
g.action?this.handleRemoteInvokeReady(m):"remoteInvoke"==g.action?this.handleRemoteInvoke(g,f.origin):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}catch(ba){this.handleError(ba)}}var fa=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ca=mxUtils.bind(this,function(f,g){c=!0;try{a(f,
g)}catch(N){this.handleError(N)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");e=fa();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=fa();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;(window.opener||window.parent).postMessage(JSON.stringify(f),"*")}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));if("1"==urlParams.returnbounds||"json"==urlParams.proto){var l=this.createLoadMessage("load");l.xml=f;m.postMessage(JSON.stringify(l),"*")}});"object"===typeof g?this.loadDescriptor(g,mxUtils.bind(this,
function(a){da(fa(),f)}),mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))})):null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){da(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&
this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&da(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){da(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),da(g,f))}}));var m=window.opener||window.parent,k="json"==urlParams.proto?
JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(k,"*");if("json"==urlParams.proto){var q=this.editor.graph.openLink;this.editor.graph.openLink=function(a,b,c){q.apply(this,arguments);m.postMessage(JSON.stringify({event:"openLink",href:a,target:b,allowOpener:c}),"*")}}};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":"0px";
a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";var d=b;if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var e="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(b,e);b.setAttribute("title",e);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));a.appendChild(b)}}else mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",
mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b),
d=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),d="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,d),b.setAttribute("title",d),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),d=b);d.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=
function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var k in a[f].config)e[k]=a[f].config[k];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var k={},m=null,q=null,u=null,C=null,J=null,z=null,A=null,F=null,D=null,I="",H="auto",M="auto",L=null,E=null,v=40,K=40,
P=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var U=function(){null!=b?b(ka):(G.setSelectionCells(ka),G.scrollCellToVisible(G.getSelectionCell()))},Y=G.getFreeInsertPoint(),ea=Y.x,ha=Y.y,Y=ha,ia=null,Z="auto",D=null,aa=[],fa=null,da=null,ba=0;ba<c.length&&"#"==c[ba].charAt(0);){a=c[ba];for(ba++;ba<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[ba].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[ba].substring(1)),ba++;if("#"!=a.charAt(1)){var ja=a.indexOf(":");if(0<ja){var Q=mxUtils.trim(a.substring(1,
ja)),N=mxUtils.trim(a.substring(ja+1));"label"==Q?ia=G.sanitizeHtml(N):"labelname"==Q&&0<N.length&&"-"!=N?J=N:"labels"==Q&&0<N.length&&"-"!=N?z=JSON.parse(N):"style"==Q?q=N:"parentstyle"==Q?A=N:"stylename"==Q&&0<N.length&&"-"!=N?C=N:"styles"==Q&&0<N.length&&"-"!=N?u=JSON.parse(N):"vars"==Q&&0<N.length&&"-"!=N?m=JSON.parse(N):"identity"==Q&&0<N.length&&"-"!=N?F=N:"parent"==Q&&0<N.length&&"-"!=N?D=N:"namespace"==Q&&0<N.length&&"-"!=N?I=N:"width"==Q?H=N:"height"==Q?M=N:"left"==Q&&0<N.length?L=N:"top"==
Q&&0<N.length?E=N:"ignore"==Q?da=N.split(","):"connect"==Q?aa.push(JSON.parse(N)):"link"==Q?fa=N:"padding"==Q?W=parseFloat(N):"edgespacing"==Q?v=parseFloat(N):"nodespacing"==Q?K=parseFloat(N):"levelspacing"==Q?P=parseFloat(N):"layout"==Q&&(Z=N)}}}if(null==c[ba])throw Error(mxResources.get("invalidOrMissingFile"));for(var ma=this.editor.csvToArray(c[ba]),Q=ja=null,N=[],R=0;R<ma.length;R++)F==ma[R]&&(ja=R),D==ma[R]&&(Q=R),N.push(mxUtils.trim(ma[R]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,
""));null==ia&&(ia="%"+N[0]+"%");if(null!=aa)for(var X=0;X<aa.length;X++)null==k[aa[X].to]&&(k[aa[X].to]={});F=[];for(R=ba+1;R<c.length;R++){var ga=this.editor.csvToArray(c[R]);if(null==ga){var pa=40<c[R].length?c[R].substring(0,40)+"...":c[R];throw Error(pa+" ("+R+"):\n"+mxResources.get("containsValidationErrors"));}0<ga.length&&F.push(ga)}G.model.beginUpdate();try{for(R=0;R<F.length;R++){var ga=F[R],O=null,na=null!=ja?I+ga[ja]:null;null!=na&&(O=G.model.getCell(na));var c=null!=O,S=new mxCell(ia,
new mxGeometry(ea,Y,0,0),q||"whiteSpace=wrap;html=1;");S.vertex=!0;S.id=na;for(var ca=0;ca<ga.length;ca++)G.setAttributeForCell(S,N[ca],ga[ca]);if(null!=J&&null!=z){var Aa=z[S.getAttribute(J)];null!=Aa&&G.labelChanged(S,Aa)}if(null!=C&&null!=u){var qa=u[S.getAttribute(C)];null!=qa&&(S.style=qa)}G.setAttributeForCell(S,"placeholders","1");S.style=G.replacePlaceholders(S,S.style,m);c&&(G.model.setGeometry(O,S.geometry),G.model.setStyle(O,S.style),0>mxUtils.indexOf(f,O)&&f.push(O));O=S;if(!c)for(X=0;X<
aa.length;X++)k[aa[X].to][O.getAttribute(aa[X].to)]=O;null!=fa&&"link"!=fa&&(G.setLinkForCell(O,O.getAttribute(fa)),G.setAttributeForCell(O,fa,null));G.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var ta=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=L&&null!=O.getAttribute(L)&&(O.geometry.x=ea+parseFloat(O.getAttribute(L))),null!=E&&null!=O.getAttribute(E)&&(O.geometry.y=ha+parseFloat(O.getAttribute(E))),"@"==H.charAt(0)&&null!=O.getAttribute(H.substring(1))?O.geometry.width=
parseFloat(O.getAttribute(H.substring(1))):O.geometry.width="auto"==H?ta.width+W:parseFloat(H),"@"==M.charAt(0)&&null!=O.getAttribute(M.substring(1))?O.geometry.height=parseFloat(O.getAttribute(M.substring(1))):O.geometry.height="auto"==M?ta.height+W:parseFloat(M),Y+=O.geometry.height+K);c?(null==e[na]&&(e[na]=[]),e[na].push(O)):(D=null!=Q?G.model.getCell(I+ga[Q]):null,d.push(O),null!=D?(D.style=G.replacePlaceholders(D,A,m),G.addCell(O,D)):f.push(G.addCell(O)))}for(var ra=f.slice(),ka=f.slice(),X=
0;X<aa.length;X++)for(var Ba=aa[X],R=0;R<d.length;R++){var O=d[R],Da=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(G.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),f=0;f<d.length;f++){var e=k[c.to][d[f]];if(null!=e){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)||"")+(g||""));null!=c.tolabel&&(g=(g||"")+(e.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?e:a,l=null!=c.style?G.replacePlaceholders(l,c.style,m):
G.createCurrentEdgeStyle(),g=G.insertEdge(null,null,g||"",c.invert?e:a,c.invert?a:e,l);if(null!=c.labels)for(l=0;l<c.labels.length;l++){var n=c.labels[l],p=new mxCell(n.label||l,new mxGeometry(null!=n.x?n.x:0,null!=n.y?n.y:0,0,0),"resizable=0;html=1;");p.vertex=!0;p.connectable=!1;p.geometry.relative=!0;if(null!=n.dx||null!=n.dy)p.geometry.offset=new mxPoint(null!=n.dx?n.dx:0,null!=n.dy?n.dy:0);g.insert(p)}ka.push(g);mxUtils.remove(c.invert?a:e,ra)}}});Da(O,O,Ba);if(null!=e[O.id])for(ca=0;ca<e[O.id].length;ca++)Da(O,
e[O.id][ca],Ba)}if(null!=da)for(R=0;R<d.length;R++)for(O=d[R],ca=0;ca<da.length;ca++)G.setAttributeForCell(O,mxUtils.trim(da[ca]),null);if(0<f.length){var xa=new mxParallelEdgeLayout(G);xa.spacing=v;xa.checkOverlap=!0;var va=function(){0<xa.spacing&&xa.execute(G.getDefaultParent());for(var a=0;a<f.length;a++){var b=G.getCellGeometry(f[a]);b.x=Math.round(G.snap(b.x));b.y=Math.round(G.snap(b.y));"auto"==H&&(b.width=Math.round(G.snap(b.width)));"auto"==M&&(b.height=Math.round(G.snap(b.height)))}};if("["==
Z.charAt(0)){var Ea=U;G.view.validate();this.executeLayoutList(JSON.parse(Z),function(){va();Ea()});U=null}else if("circle"==Z){var ua=new mxCircleLayout(G);ua.disableEdgeStyle=!1;ua.resetEdges=!1;var ya=ua.isVertexIgnored;ua.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){ua.execute(G.getDefaultParent());va()},!0,U);U=null}else if("horizontaltree"==Z||"verticaltree"==Z||"auto"==Z&&ka.length==2*f.length-1&&1==ra.length){G.view.validate();
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));if("1"==urlParams.returnbounds||"json"==urlParams.proto){var l=this.createLoadMessage("load");l.xml=f;m.postMessage(JSON.stringify(l),"*")}});null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==
g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){ca(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,
13)&&ca(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){ca(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):null==g||"object"!==typeof g||null==g.format||null==g.data&&null==g.url?(g=l(g),ca(g,f)):this.loadDescriptor(g,mxUtils.bind(this,function(a){ca(fa(),f)}),mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}}));var m=window.opener||window.parent,k="json"==
urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(k,"*");if("json"==urlParams.proto){var q=this.editor.graph.openLink;this.editor.graph.openLink=function(a,b,c){q.apply(this,arguments);m.postMessage(JSON.stringify({event:"openLink",href:a,target:b,allowOpener:c}),"*")}}};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";var d=b;if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var e="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit");mxUtils.write(b,e);b.setAttribute("title",e);mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()}));a.appendChild(b)}}else mxUtils.write(b,mxResources.get("save")),
b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
a.appendChild(b),d=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),d="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,d),b.setAttribute("title",d),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),d=b);d.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};
EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var k in a[f].config)e[k]=a[f].config[k];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var k={},m=null,q=null,u=null,C=null,J=null,z=null,A=null,F=null,D=null,I="",H="auto",
M="auto",L=null,E=null,v=40,K=40,P=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var U=function(){null!=b?b(ka):(G.setSelectionCells(ka),G.scrollCellToVisible(G.getSelectionCell()))},Y=G.getFreeInsertPoint(),ea=Y.x,ha=Y.y,Y=ha,ia=null,Z="auto",D=null,aa=[],fa=null,ca=null,ba=0;ba<c.length&&"#"==c[ba].charAt(0);){a=c[ba];for(ba++;ba<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[ba].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[ba].substring(1)),ba++;if("#"!=a.charAt(1)){var ja=a.indexOf(":");
if(0<ja){var Q=mxUtils.trim(a.substring(1,ja)),N=mxUtils.trim(a.substring(ja+1));"label"==Q?ia=G.sanitizeHtml(N):"labelname"==Q&&0<N.length&&"-"!=N?J=N:"labels"==Q&&0<N.length&&"-"!=N?z=JSON.parse(N):"style"==Q?q=N:"parentstyle"==Q?A=N:"stylename"==Q&&0<N.length&&"-"!=N?C=N:"styles"==Q&&0<N.length&&"-"!=N?u=JSON.parse(N):"vars"==Q&&0<N.length&&"-"!=N?m=JSON.parse(N):"identity"==Q&&0<N.length&&"-"!=N?F=N:"parent"==Q&&0<N.length&&"-"!=N?D=N:"namespace"==Q&&0<N.length&&"-"!=N?I=N:"width"==Q?H=N:"height"==
Q?M=N:"left"==Q&&0<N.length?L=N:"top"==Q&&0<N.length?E=N:"ignore"==Q?ca=N.split(","):"connect"==Q?aa.push(JSON.parse(N)):"link"==Q?fa=N:"padding"==Q?W=parseFloat(N):"edgespacing"==Q?v=parseFloat(N):"nodespacing"==Q?K=parseFloat(N):"levelspacing"==Q?P=parseFloat(N):"layout"==Q&&(Z=N)}}}if(null==c[ba])throw Error(mxResources.get("invalidOrMissingFile"));for(var ma=this.editor.csvToArray(c[ba]),Q=ja=null,N=[],R=0;R<ma.length;R++)F==ma[R]&&(ja=R),D==ma[R]&&(Q=R),N.push(mxUtils.trim(ma[R]).replace(/[^a-z0-9]+/ig,
"_").replace(/^\d+/,"").replace(/_+$/,""));null==ia&&(ia="%"+N[0]+"%");if(null!=aa)for(var X=0;X<aa.length;X++)null==k[aa[X].to]&&(k[aa[X].to]={});F=[];for(R=ba+1;R<c.length;R++){var ga=this.editor.csvToArray(c[R]);if(null==ga){var pa=40<c[R].length?c[R].substring(0,40)+"...":c[R];throw Error(pa+" ("+R+"):\n"+mxResources.get("containsValidationErrors"));}0<ga.length&&F.push(ga)}G.model.beginUpdate();try{for(R=0;R<F.length;R++){var ga=F[R],O=null,na=null!=ja?I+ga[ja]:null;null!=na&&(O=G.model.getCell(na));
var c=null!=O,S=new mxCell(ia,new mxGeometry(ea,Y,0,0),q||"whiteSpace=wrap;html=1;");S.vertex=!0;S.id=na;for(var da=0;da<ga.length;da++)G.setAttributeForCell(S,N[da],ga[da]);if(null!=J&&null!=z){var Aa=z[S.getAttribute(J)];null!=Aa&&G.labelChanged(S,Aa)}if(null!=C&&null!=u){var qa=u[S.getAttribute(C)];null!=qa&&(S.style=qa)}G.setAttributeForCell(S,"placeholders","1");S.style=G.replacePlaceholders(S,S.style,m);c&&(G.model.setGeometry(O,S.geometry),G.model.setStyle(O,S.style),0>mxUtils.indexOf(f,O)&&
f.push(O));O=S;if(!c)for(X=0;X<aa.length;X++)k[aa[X].to][O.getAttribute(aa[X].to)]=O;null!=fa&&"link"!=fa&&(G.setLinkForCell(O,O.getAttribute(fa)),G.setAttributeForCell(O,fa,null));G.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var ta=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=L&&null!=O.getAttribute(L)&&(O.geometry.x=ea+parseFloat(O.getAttribute(L))),null!=E&&null!=O.getAttribute(E)&&(O.geometry.y=ha+parseFloat(O.getAttribute(E))),"@"==H.charAt(0)&&null!=O.getAttribute(H.substring(1))?
O.geometry.width=parseFloat(O.getAttribute(H.substring(1))):O.geometry.width="auto"==H?ta.width+W:parseFloat(H),"@"==M.charAt(0)&&null!=O.getAttribute(M.substring(1))?O.geometry.height=parseFloat(O.getAttribute(M.substring(1))):O.geometry.height="auto"==M?ta.height+W:parseFloat(M),Y+=O.geometry.height+K);c?(null==e[na]&&(e[na]=[]),e[na].push(O)):(D=null!=Q?G.model.getCell(I+ga[Q]):null,d.push(O),null!=D?(D.style=G.replacePlaceholders(D,A,m),G.addCell(O,D)):f.push(G.addCell(O)))}for(var ra=f.slice(),
ka=f.slice(),X=0;X<aa.length;X++)for(var Ba=aa[X],R=0;R<d.length;R++){var O=d[R],Da=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(G.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),f=0;f<d.length;f++){var e=k[c.to][d[f]];if(null!=e){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)||"")+(g||""));null!=c.tolabel&&(g=(g||"")+(e.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?e:a,l=null!=c.style?G.replacePlaceholders(l,
c.style,m):G.createCurrentEdgeStyle(),g=G.insertEdge(null,null,g||"",c.invert?e:a,c.invert?a:e,l);if(null!=c.labels)for(l=0;l<c.labels.length;l++){var n=c.labels[l],p=new mxCell(n.label||l,new mxGeometry(null!=n.x?n.x:0,null!=n.y?n.y:0,0,0),"resizable=0;html=1;");p.vertex=!0;p.connectable=!1;p.geometry.relative=!0;if(null!=n.dx||null!=n.dy)p.geometry.offset=new mxPoint(null!=n.dx?n.dx:0,null!=n.dy?n.dy:0);g.insert(p)}ka.push(g);mxUtils.remove(c.invert?a:e,ra)}}});Da(O,O,Ba);if(null!=e[O.id])for(da=
0;da<e[O.id].length;da++)Da(O,e[O.id][da],Ba)}if(null!=ca)for(R=0;R<d.length;R++)for(O=d[R],da=0;da<ca.length;da++)G.setAttributeForCell(O,mxUtils.trim(ca[da]),null);if(0<f.length){var xa=new mxParallelEdgeLayout(G);xa.spacing=v;xa.checkOverlap=!0;var va=function(){0<xa.spacing&&xa.execute(G.getDefaultParent());for(var a=0;a<f.length;a++){var b=G.getCellGeometry(f[a]);b.x=Math.round(G.snap(b.x));b.y=Math.round(G.snap(b.y));"auto"==H&&(b.width=Math.round(G.snap(b.width)));"auto"==M&&(b.height=Math.round(G.snap(b.height)))}};
if("["==Z.charAt(0)){var Ea=U;G.view.validate();this.executeLayoutList(JSON.parse(Z),function(){va();Ea()});U=null}else if("circle"==Z){var ua=new mxCircleLayout(G);ua.disableEdgeStyle=!1;ua.resetEdges=!1;var ya=ua.isVertexIgnored;ua.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){ua.execute(G.getDefaultParent());va()},!0,U);U=null}else if("horizontaltree"==Z||"verticaltree"==Z||"auto"==Z&&ka.length==2*f.length-1&&1==ra.length){G.view.validate();
var sa=new mxCompactTreeLayout(G,"horizontaltree"==Z);sa.levelDistance=K;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(G.getDefaultParent(),0<ra.length?ra[0]:null)},!0,U);U=null}else if("horizontalflow"==Z||"verticalflow"==Z||"auto"==Z&&1==ra.length){G.view.validate();var oa=new mxHierarchicalLayout(G,"horizontalflow"==Z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);oa.intraCellSpacing=K;oa.parallelEdgeSpacing=v;oa.interRankCellSpacing=P;oa.disableEdgeStyle=
!1;this.executeLayout(function(){oa.execute(G.getDefaultParent(),ka);G.moveCells(ka,ea,ha)},!0,U);U=null}else if("organic"==Z||"auto"==Z&&ka.length>f.length){G.view.validate();var la=new mxFastOrganicLayout(G);la.forceConstant=3*K;la.disableEdgeStyle=!1;la.resetEdges=!1;var Ia=la.isVertexIgnored;la.isVertexIgnored=function(a){return Ia.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){la.execute(G.getDefaultParent());va()},!0,U);U=null}}this.hideDialog()}finally{G.model.endUpdate()}null!=
U&&U()}}catch(Fa){this.handleError(Fa)}};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(" "),
@ -3780,7 +3780,7 @@ t.model.getTerminal(d[0],!0),!0);var f=u(a),g=c.geometry;f==mxConstants.DIRECTIO
(Math.min(m.y+m.height,v.y+v.height)-Math.max(m.y,v.y))/l))}}p?g=0:d=0;for(q=0;q<n.length;q++)if(x=t.model.getTerminal(n[q],!1),f==u(x)&&(v=t.view.getState(x),x!=a&&null!=v&&(p&&b!=v.getCenterX()<k.getCenterX()||!p&&b!=v.getCenterY()<k.getCenterY()))){var z=[];t.traverse(v.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});t.moveCells(z,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=u(a),c=t.getIncomingEdges(a),
d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&
(l=0);t.moveCells(g,k,l);return t.addCells(d,e)}finally{t.model.endUpdate()}}function g(a,b){t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=u(a);0==d.length&&(d=[t.createEdge(c,null,"",null,null,t.createCurrentEdgeStyle())],e=b);var f=t.cloneCells([d[0],a]);t.model.setTerminal(f[0],a,!0);if(null==t.model.getTerminal(f[0],!1)){t.model.setTerminal(f[0],f[1],!1);var g=t.getCellStyle(f[1]).newEdgeStyle;if(null!=g)try{var k=JSON.parse(g),l;for(l in k)t.setCellStyles(l,k[l],
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&t.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(da){}}var d=t.getOutgoingEdges(a),m=c.geometry,g=[];t.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var n=t.model.getTerminal(d[k],!1);null!=n&&g.push(n)}var p=t.view.getBounds(g),q=t.view.translate,x=t.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&t.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(ca){}}var d=t.getOutgoingEdges(a),m=c.geometry,g=[];t.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var n=t.model.getTerminal(d[k],!1);null!=n&&g.push(n)}var p=t.view.getBounds(g),q=t.view.translate,x=t.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
2:(p.x+p.width)/x-q.x-m.x+10,f[1].geometry.y+=f[1].geometry.height-m.y+40):e==mxConstants.DIRECTION_NORTH?(f[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-f[1].geometry.width)/2:(p.x+p.width)/x-q.x+-m.x+10,f[1].geometry.y-=f[1].geometry.height+m.y+40):(f[1].geometry.x=e==mxConstants.DIRECTION_WEST?f[1].geometry.x-(f[1].geometry.width+m.x+40):f[1].geometry.x+(f[1].geometry.width-m.x+40),f[1].geometry.y=null==p?a.geometry.y+(a.geometry.height-f[1].geometry.height)/2:(p.y+p.height)/x-q.y+-m.y+
10);return t.addCells(f,c)}finally{t.model.endUpdate()}}function n(a,b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=t.view.getState(t.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function l(a,b){var c=u(a),d=b==mxConstants.DIRECTION_EAST||
b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=b?p.actions.get("selectParent").funct():c==b?(d=t.getOutgoingEdges(a),null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(a),null!=c&&0<c.length&&(d=n(t.model.getTerminal(c[0],!0),d,a),c=t.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&t.setSelectionCell(d[c].cell)))))}

View file

@ -85,10 +85,10 @@ Draw.loadPlugin(function(ui)
var xdm_e = decodeURIComponent(urlParams['site']);
var license = urlParams['atlas-lic'];
ui.checkConfLicense(license, xdm_e, function(licenseValid)
ui.remoteInvoke('checkConfLicense', [license, xdm_e], null, function(licenseValid)
{
if (!licenseValid)
if (!licenseValid)
{
ui.menus.get('file').funct = function(menu, parent)
{
@ -135,33 +135,6 @@ Draw.loadPlugin(function(ui)
div.appendChild(link);
};
ui.actions.addAction('support...', function()
{
ui.remoteInvoke('getPageInfo', [true], null, function(info)
{
var url = info.url;
if (url != null)
{
var wikiPos = url.indexOf('/wiki/');
if (wikiPos > -1)
{
url = url.substring(0, wikiPos);
}
ui.openLink(url + '/wiki/plugins/servlet/ac/com.mxgraph.confluence.plugins.diagramly/support');
}
else
{
ui.openLink('https://about.draw.io/support/');
}
}, function()
{
ui.openLink('https://about.draw.io/support/');
});
});
DrawioFileSync.prototype.fileChangedNotify = function()
{
//Disable RT syncing
@ -184,8 +157,9 @@ Draw.loadPlugin(function(ui)
error();
}
}
});
},
function(){});
renameAction.funct = function()
{
var dlg = new FilenameDialog(ui, macroData.diagramDisplayName || "",

View file

@ -6,11 +6,11 @@ if (workbox)
workbox.precaching.precacheAndRoute([
{
"url": "js/app.min.js",
"revision": "ab9664745dd6fd0d9995491ae1e85f2f"
"revision": "50d9a1d155a9976bdb503bb8b0787177"
},
{
"url": "js/extensions.min.js",
"revision": "c2c9c58a0546e7778478a1c776522371"
"revision": "aae98a54f385472d95f5eb30c1bfbe83"
},
{
"url": "js/stencils.min.js",
@ -34,7 +34,7 @@ if (workbox)
},
{
"url": "styles/grapheditor.css",
"revision": "35b5b9d556faa375612c04addcd5819c"
"revision": "9f1555fdbfde8e5f789b05b595d6078e"
},
{
"url": "styles/atlas.css",
@ -58,7 +58,7 @@ if (workbox)
},
{
"url": "js/viewer-static.min.js",
"revision": "a5ddc3d436695ead0b667108603fe0b8"
"revision": "f9e30dee44f679ab5b2e4c20b856e165"
},
{
"url": "connect/jira/editor-1-3-3.html",
@ -102,11 +102,11 @@ if (workbox)
},
{
"url": "plugins/cConf-1-4-8.js",
"revision": "d4b6949adc409b03e1d5b59a86097c2c"
"revision": "4b7c6ea1cd878f501963a86b94d599d5"
},
{
"url": "connect/confluence/connectUtils-1-4-8.js",
"revision": "d0962e29c83060e4a28525161d583ee4"
"revision": "38448282f113992b1f346eb97ccc3542"
},
{
"url": "connect/new_common/cac.js",

View file

@ -394,7 +394,7 @@ div.mxWindow .geButton {
padding:6px;
margin:6px;
color:#a0a0a0;
fontSize:13px;
font-size:13px;
}
.geTitle img {
opacity:0.5;
@ -557,7 +557,7 @@ div.mxWindow .geButton {
white-space: nowrap;
border-radius:3px;
background-color:#0052cc;
currsor:pointer;
cursor:pointer;
transition: background-color 0.1s ease-out;
overflow:hidden;
text-overflow: ellipsis;