6.8.18 release

This commit is contained in:
Gaudenz Alder 2017-07-18 12:25:10 +02:00
parent 26d9518e05
commit 9356d63bea
12 changed files with 978 additions and 968 deletions

View file

@ -1,3 +1,8 @@
18-JUL-2017: 6.8.18
- Ctrl+drop for images shows size dialog to reset default
- Adds dialog before unloading modified page in embed mode
17-JUL-2017: 6.8.17
- Adds dialog for importing large images

View file

@ -1 +1 @@
6.8.17
6.8.18

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 07/17/2017 03:24 PM
# 07/18/2017 12:11 PM
app.html
index.html?offline=1

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

@ -7398,17 +7398,17 @@ StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.sav
StorageFile.prototype.saveFile=function(a,b,c,d){if(this.isEditable()){var f=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=c&&c()}))}catch(g){null!=d&&d(g)}});this.isRenamable()&&"."==a.charAt(0)&&null!=d?d({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(b){this.isRenamable()&&this.getTitle()!=a&&null!=b?this.ui.confirm(mxResources.get("replaceIt",
[a]),f,d):f()}))}else null!=c&&c()};StorageFile.prototype.rename=function(a,b,c){var d=this.getTitle();this.title=a;this.hasSameExtension(d,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){d!=a&&this.ui.removeLocalData(d,b)}),c)};StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};
StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,b,c){StorageFile.call(this,a,b,c)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,b,c){this.saveFile(a,!1,b,c)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
StorageLibrary.prototype.isRenamable=function(a,b,c){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,c){StorageFile.call(this,a,b,c);a=c;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,c){return!1};UrlLibrary.prototype.saveAs=function(a,b,c){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,c){function d(d,e,f,n){function w(){mxEvent.addListener(u,"click",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,l.checked);b()})):(a.setMode(f,l.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var u=document.createElement("a");u.style.overflow="hidden";var g=document.createElement("img");
g.setAttribute("src",d);g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";u.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";u.className="geBaseButton";u.style.position="relative";u.style.margin="4px";u.style.padding="8px 10px 12px 10px";u.style.whiteSpace="nowrap";mxClient.IS_QUIRKS&&(u.style.cssFloat="left",u.style.zoom="1");u.appendChild(g);var p=document.createElement("div");u.appendChild(p);mxUtils.write(p,
e);if(null!=n&&null==a[n]){g.style.visibility="hidden";mxUtils.setOpacity(p,10);var y=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});y.spin(u);var k=window.setTimeout(function(){null==a[n]&&(y.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[n]&&(window.clearTimeout(k),mxUtils.setOpacity(p,100),g.style.visibility="",y.stop(),w())}))}else w();h.appendChild(u);
StorageLibrary.prototype.isRenamable=function(a,b,c){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,c){StorageFile.call(this,a,b,c);a=c;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,c){return!1};UrlLibrary.prototype.saveAs=function(a,b,c){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,c){function d(d,e,f,g){function v(){mxEvent.addListener(t,"click",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,l.checked);b()})):(a.setMode(f,l.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var t=document.createElement("a");t.style.overflow="hidden";var n=document.createElement("img");
n.setAttribute("src",d);n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.width="60px";n.style.height="60px";n.style.paddingBottom="6px";t.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.position="relative";t.style.margin="4px";t.style.padding="8px 10px 12px 10px";t.style.whiteSpace="nowrap";mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");t.appendChild(n);var q=document.createElement("div");t.appendChild(q);mxUtils.write(q,
e);if(null!=g&&null==a[g]){n.style.visibility="hidden";mxUtils.setOpacity(q,10);var x=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});x.spin(t);var p=window.setTimeout(function(){null==a[g]&&(x.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(p),mxUtils.setOpacity(q,100),n.style.visibility="",x.stop(),v())}))}else v();h.appendChild(t);
++m>=c&&(mxUtils.br(h),m=0)}c=null!=c?c:3;var f=document.createElement("div");f.style.textAlign="center";f.style.whiteSpace="nowrap";f.style.paddingTop="0px";f.style.paddingBottom="20px";var g=a.addLanguageMenu(f);null!=g&&(g.style.bottom="28px");if(!a.isOffline()&&1<a.getServiceCount()){g=document.createElement("a");g.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");g.setAttribute("title",mxResources.get("help"));g.setAttribute("target","_blank");g.style.position="absolute";
g.style.textDecoration="none";g.style.cursor="pointer";g.style.fontSize="12px";g.style.bottom="28px";g.style.left="26px";g.style.color="gray";var k=document.createElement("img");k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";g.appendChild(k);mxUtils.write(g,mxResources.get("help"));f.appendChild(g)}var e=document.createElement("div");e.style.position="absolute";e.style.cursor="pointer";e.style.fontSize="12px";e.style.bottom=
"28px";e.style.color="gray";mxUtils.write(e,mxResources.get("decideLater"));a.isOfflineApp()?e.style.right="20px":(mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,0)"),e.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)e.style.marginLeft=-Math.round(e.clientWidth/2)+"px"};f.appendChild(e);mxEvent.addListener(e,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=
b});var h=document.createElement("div");mxClient.IS_QUIRKS&&(h.style.whiteSpace="nowrap",h.style.cssFloat="left");h.style.border="1px solid #d3d3d3";h.style.borderWidth="1px 0px 1px 0px";h.style.padding="18px 0px 18px 0px";var l=document.createElement("input");l.setAttribute("type","checkbox");l.setAttribute("checked","checked");l.defaultChecked=!0;var m=0,g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.paddingTop="4px";g.style.paddingBottom="16px";g.style.margin=
"0px";g.style.color="gray";mxUtils.write(g,mxResources.get("saveDiagramsTo")+":");f.appendChild(g);"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=a.gitHub&&d(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");"function"===typeof window.DropboxClient&&d(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");"function"===typeof window.OneDriveClient&&
d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");mxClient.IS_IOS&&"device"!=urlParams.storage||d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);f.appendChild(h);g=document.createElement("p");g.style.marginTop="12px";g.style.marginBottom="10px";g.appendChild(l);k=document.createElement("span");
k.style.color="gray";k.style.fontSize="12px";mxUtils.write(k," "+mxResources.get("rememberThisSetting"));g.appendChild(k);mxUtils.br(g);var n=a.getRecent();if(null!=n&&0<n.length){var t=document.createElement("select");t.style.marginTop="14px";t.style.width="140px";var q=document.createElement("option");q.setAttribute("value","");q.setAttribute("selected","selected");q.style.textAlign="center";mxUtils.write(q,mxResources.get("openRecent")+"...");t.appendChild(q);for(q=0;q<n.length;q++)(function(a){var b=
a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",a.id);mxUtils.write(c,a.title+" ("+mxResources.get(b)+")");t.appendChild(c)})(n[q]);g.appendChild(t);mxEvent.addListener(t,"change",function(b){""!=t.value&&a.loadFile(t.value)})}else g.style.marginTop="20px",h.style.padding="30px 0px 26px 0px";h.appendChild(g);mxEvent.addListener(k,"click",function(a){l.checked=!l.checked;mxEvent.consume(a)});mxClient.IS_SVG&&
k.style.color="gray";k.style.fontSize="12px";mxUtils.write(k," "+mxResources.get("rememberThisSetting"));g.appendChild(k);mxUtils.br(g);var n=a.getRecent();if(null!=n&&0<n.length){var u=document.createElement("select");u.style.marginTop="14px";u.style.width="140px";var p=document.createElement("option");p.setAttribute("value","");p.setAttribute("selected","selected");p.style.textAlign="center";mxUtils.write(p,mxResources.get("openRecent")+"...");u.appendChild(p);for(p=0;p<n.length;p++)(function(a){var b=
a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",a.id);mxUtils.write(c,a.title+" ("+mxResources.get(b)+")");u.appendChild(c)})(n[p]);g.appendChild(u);mxEvent.addListener(u,"change",function(b){""!=u.value&&a.loadFile(u.value)})}else g.style.marginTop="20px",h.style.padding="30px 0px 26px 0px";h.appendChild(g);mxEvent.addListener(k,"click",function(a){l.checked=!l.checked;mxEvent.consume(a)});mxClient.IS_SVG&&
isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){if(null==a.drive){var b=document.createElement("p");b.style.padding="8px";b.style.fontSize="9pt";b.style.marginTop="-14px";b.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+
"</a>";f.appendChild(b)}},5E3);this.container=f},SplashDialog=function(a){var b=document.createElement("div");b.style.textAlign="center";a.addLanguageMenu(b);var c=null,d=a.getServiceCount();if(!a.isOffline()&&1<d){c=document.createElement("a");c.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");c.setAttribute("title",mxResources.get("help"));c.setAttribute("target","_blank");c.style.position="absolute";c.style.fontSize="12px";c.style.textDecoration="none";c.style.cursor=
"pointer";c.style.bottom="22px";c.style.left="26px";c.style.color="gray";var f=document.createElement("img");f.setAttribute("border","0");f.setAttribute("valign","bottom");f.setAttribute("src",Editor.helpImage);f.style.marginRight="2px";c.appendChild(f);mxUtils.write(c,mxResources.get("help"));b.appendChild(c)}f=document.createElement("p");f.style.fontSize="16pt";f.style.padding="0px";f.style.paddingTop="2px";f.style.margin="0px";f.style.color="gray";var g=document.createElement("img");g.setAttribute("border",
@ -7428,29 +7428,29 @@ m.appendChild(k),l.appendChild(m),mxEvent.addListener(k,"click",function(a){n.ch
a.hideDialog();null!=e&&e()}),d.className="geBtn gePrimaryBtn",c.appendChild(d));this.init=function(){n.focus()};l.appendChild(c);this.container=l},EmbedDialog=function(a,b,c,d,f){d=document.createElement("div");var g=/^https?:\/\//.test(b)||/^mailto:\/\//.test(b);mxUtils.write(d,mxResources.get(5E5>b.length?g?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);var k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.right="30px";k.style.color="gray";mxUtils.write(k,
a.formatFileSize(b.length));d.appendChild(k);var e=document.createElement("textarea");e.setAttribute("autocomplete","off");e.setAttribute("autocorrect","off");e.setAttribute("autocapitalize","off");e.setAttribute("spellcheck","false");e.style.marginTop="10px";e.style.resize="none";e.style.height="150px";e.style.width="440px";e.style.border="1px solid gray";e.value=mxResources.get("updatingDocument");d.appendChild(e);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>b.length?(e.value=
b,e.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?e.select():document.execCommand("selectAll",!1,null)):(e.setAttribute("readonly","true"),e.value=b.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};k=document.createElement("div");k.style.position="absolute";k.style.bottom="36px";k.style.right="32px";var h=null;mxClient.IS_CHROMEAPP||navigator.standalone||!(g||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(h=mxUtils.button(mxResources.get(5E5>
b.length?"preview":"openInNewWindow"),function(){var d=5E5>b.length?e.value:b;if(null!=f)f(d);else if(g)try{var h=window.open(d);(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){null!=h&&null!=h.location.href&&h.location.href.substring(0,8)!=d.substring(0,8)&&(h.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),c||500)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}else{var l=window.open().document;l.writeln("<html><head><title>"+
encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+b+"</body></html>");l.close()}}),h.className="geBtn",k.appendChild(h));if(!g||7500<b.length){var l=mxUtils.button(mxResources.get("download"),function(){a.saveData("embed.txt","txt",b,"text/plain")});l.className="geBtn";k.appendChild(l)}if(g&&!a.isOffline()){if(51200>b.length){var m=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(e.value);window.open(b)}catch(t){a.handleError({message:t.message||
b.length?"preview":"openInNewWindow"),function(){var d=5E5>b.length?e.value:b;if(null!=f)f(d);else if(g)try{var h=window.open(d);(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){null!=h&&null!=h.location.href&&h.location.href.substring(0,8)!=d.substring(0,8)&&(h.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),c||500)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}else{var l=window.open().document;l.writeln("<html><head><title>"+
encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+b+"</body></html>");l.close()}}),h.className="geBtn",k.appendChild(h));if(!g||7500<b.length){var l=mxUtils.button(mxResources.get("download"),function(){a.saveData("embed.txt","txt",b,"text/plain")});l.className="geBtn";k.appendChild(l)}if(g&&!a.isOffline()){if(51200>b.length){var m=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(e.value);window.open(b)}catch(u){a.handleError({message:u.message||
mxResources.get("drawingTooLarge")})}}),l=document.createElement("img");l.setAttribute("src",Editor.facebookImage);l.setAttribute("border","0");m.appendChild(l);m.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");m.style.verticalAlign="bottom";m.style.paddingTop="4px";m.style.minWidth="46px";m.className="geBtn";k.appendChild(m)}7168>b.length&&(m=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+
"&url="+encodeURIComponent(e.value);window.open(b)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),l=document.createElement("img"),l.setAttribute("src",Editor.tweetImage),l.setAttribute("border","0"),l.style.marginBottom="5px",m.appendChild(l),m.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),m.style.verticalAlign="bottom",m.style.paddingTop="4px",m.style.minWidth="46px",m.className="geBtn",k.appendChild(m))}l=mxUtils.button(mxResources.get("close"),
"&url="+encodeURIComponent(e.value);window.open(b)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),l=document.createElement("img"),l.setAttribute("src",Editor.tweetImage),l.setAttribute("border","0"),l.style.marginBottom="5px",m.appendChild(l),m.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),m.style.verticalAlign="bottom",m.style.paddingTop="4px",m.style.minWidth="46px",m.className="geBtn",k.appendChild(m))}l=mxUtils.button(mxResources.get("close"),
function(){a.hideDialog()});k.appendChild(l);m=mxUtils.button(mxResources.get("copy"),function(){e.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?e.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>b.length?mxClient.IS_SF||null!=document.documentMode?l.className="geBtn gePrimaryBtn":(k.appendChild(m),m.className="geBtn gePrimaryBtn",l.className="geBtn"):(k.appendChild(h),l.className="geBtn",h.className=
"geBtn gePrimaryBtn");d.appendChild(k);this.container=d},GoogleSitesDialog=function(a,b){function c(){var a=null!=z.getTitle()?z.getTitle():this.defaultFilename;if(C.checked&&""!=t.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<D.length&&(b+="&s="+D);""!=q.value&&"0"!=q.value&&(b+="&border="+q.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(p.checked?"1":"0");b+="&zoom="+(w.checked?
"1":"0");b+="&fit="+(x.checked?"1":"0");b+="&resize="+(v.checked?"1":"0");b+="&x0="+Number(m.value);b+="&y0="+h;f.mathEnabled&&(b+="&math=1");y.checked?b+="&edit=_blank":u.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));l.value=b}else z.constructor==DriveFile||z.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?b+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(b+=z.getHash().substring(1),b=z.constructor==DropboxFile?
"geBtn gePrimaryBtn");d.appendChild(k);this.container=d},GoogleSitesDialog=function(a,b){function c(){var a=null!=z.getTitle()?z.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<D.length&&(b+="&s="+D);""!=p.value&&"0"!=p.value&&(b+="&border="+p.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?
"1":"0");b+="&fit="+(y.checked?"1":"0");b+="&resize="+(w.checked?"1":"0");b+="&x0="+Number(m.value);b+="&y0="+h;f.mathEnabled&&(b+="&math=1");x.checked?b+="&edit=_blank":t.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));l.value=b}else z.constructor==DriveFile||z.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?b+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(b+=z.getHash().substring(1),b=z.constructor==DropboxFile?
b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(m.value),b+="&height="+a),l.value=b):l.value=""}var d=document.createElement("div"),f=a.editor.graph,g=f.getGraphBounds(),k=f.view.scale,e=Math.floor(g.x/k-f.view.translate.x),h=Math.floor(g.y/k-f.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var l=document.createElement("input");l.setAttribute("type","text");l.style.marginBottom="8px";l.style.marginTop=
"2px";l.style.width="410px";d.appendChild(l);mxUtils.br(d);this.init=function(){l.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var m=document.createElement("input");m.setAttribute("type","text");m.setAttribute("size","4");m.style.marginRight="16px";m.style.marginLeft="4px";m.value=e;d.appendChild(m);mxUtils.write(d,mxResources.get("height")+":");var n=document.createElement("input");
n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(g.height/k);d.appendChild(n);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var t=document.createElement("input");t.setAttribute("type","text");t.setAttribute("size","28");t.style.marginBottom="8px";t.style.marginTop="2px";t.style.width=
"410px";t.value=b||"";d.appendChild(t);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","3");q.style.marginBottom="8px";q.style.marginLeft="4px";q.value="0";d.appendChild(q);mxUtils.br(d);var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="16px";d.appendChild(p);mxUtils.write(d,mxResources.get("pan")+
" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="8px";d.appendChild(w);mxUtils.write(d,mxResources.get("zoom")+" ");var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginLeft="8px";u.setAttribute("title",window.location.href);d.appendChild(u);mxUtils.write(d,mxResources.get("edit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft=
"8px";d.appendChild(y);mxUtils.write(d,mxResources.get("asNew")+" ");mxUtils.br(d);var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="16px";d.appendChild(v);mxUtils.write(d,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";d.appendChild(x);mxUtils.write(d,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type",
"checkbox");C.style.marginLeft="8px";d.appendChild(C);mxUtils.write(d,mxResources.get("embed")+" ");var D=a.getBasenames().join(";"),z=a.getCurrentFile();mxEvent.addListener(p,"change",c);mxEvent.addListener(w,"change",c);mxEvent.addListener(v,"change",c);mxEvent.addListener(x,"change",c);mxEvent.addListener(u,"change",c);mxEvent.addListener(y,"change",c);mxEvent.addListener(C,"change",c);mxEvent.addListener(n,"change",c);mxEvent.addListener(m,"change",c);mxEvent.addListener(q,"change",c);mxEvent.addListener(t,
n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(g.height/k);d.appendChild(n);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var 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=b||"";d.appendChild(u);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","3");p.style.marginBottom="8px";p.style.marginLeft="4px";p.value="0";d.appendChild(p);mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";d.appendChild(q);mxUtils.write(d,mxResources.get("pan")+
" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";d.appendChild(v);mxUtils.write(d,mxResources.get("zoom")+" ");var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.marginLeft="8px";t.setAttribute("title",window.location.href);d.appendChild(t);mxUtils.write(d,mxResources.get("edit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft=
"8px";d.appendChild(x);mxUtils.write(d,mxResources.get("asNew")+" ");mxUtils.br(d);var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="16px";d.appendChild(w);mxUtils.write(d,mxResources.get("resize")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";d.appendChild(y);mxUtils.write(d,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type",
"checkbox");C.style.marginLeft="8px";d.appendChild(C);mxUtils.write(d,mxResources.get("embed")+" ");var D=a.getBasenames().join(";"),z=a.getCurrentFile();mxEvent.addListener(q,"change",c);mxEvent.addListener(v,"change",c);mxEvent.addListener(w,"change",c);mxEvent.addListener(y,"change",c);mxEvent.addListener(t,"change",c);mxEvent.addListener(x,"change",c);mxEvent.addListener(C,"change",c);mxEvent.addListener(n,"change",c);mxEvent.addListener(m,"change",c);mxEvent.addListener(p,"change",c);mxEvent.addListener(u,
"change",c);c();mxEvent.addListener(l,"click",function(){l.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null)});g=document.createElement("div");g.style.paddingTop="12px";g.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";g.appendChild(k);d.appendChild(g);this.container=d},CreateGraphDialog=function(a,b,c){var d=document.createElement("div");d.style.textAlign=
"right";this.init=function(){var b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.width="100%";b.style.height="360px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);d.appendChild(b);var g=new Graph(b);g.setCellsCloneable(!0);g.setPanning(!0);g.setAllowDanglingEdges(!1);g.connectionHandler.select=!1;g.view.setTranslate(20,20);g.border=20;g.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";g.cellRenderer.installCellOverlayListeners=
function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};g.getAllConnectionConstraints=function(){return null};g.connectionHandler.marker.highlight.keepOnTop=
!1;g.connectionHandler.createEdgeState=function(a){a=g.createEdge(null,null,null,null,null,k);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var e=g.getDefaultParent(),h=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){g.connectionHandler.reset();g.clearSelection();var d=g.getCellGeometry(a),l;n(function(){l=g.insertVertex(e,null,"Entry",d.x,d.y,80,30,"rounded=1;");h(l);g.view.refresh(l);
g.insertEdge(e,null,"",a,l,k)},function(){g.scrollCellToVisible(l)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),d=b.getProperty("state");g.popupMenuHandler.hideMenu();g.stopEditing(!1);var e=mxUtils.convertPoint(g.container,mxEvent.getClientX(c),mxEvent.getClientY(c));g.connectionHandler.start(d,e.x,e.y);g.isMouseDown=!0;g.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});g.addCellOverlay(a,b)});g.getModel().beginUpdate();var l;try{l=g.insertVertex(e,null,"Start",
0,0,80,30,"ellipse"),h(l)}finally{g.getModel().endUpdate()}var m;"horizontalTree"==c?(m=new mxCompactTreeLayout(g),m.edgeRouting=!1,m.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==c?(m=new mxCompactTreeLayout(g,!1),m.edgeRouting=!1,m.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"verticalFlow"==c?m=new mxHierarchicalLayout(g,mxConstants.DIRECTION_NORTH):"horizontalFlow"==c?m=new mxHierarchicalLayout(g,mxConstants.DIRECTION_WEST):"organic"==c?(m=
new mxFastOrganicLayout(g,!1),m.forceConstant=80):"circle"==c&&(m=new mxCircleLayout(g));if(null!=m){var n=function(a,b){g.getModel().beginUpdate();try{null!=a&&a(),m.execute(g.getDefaultParent(),l)}catch(v){throw v;}finally{var c=new mxMorphing(g);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){g.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},t=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(a,b,c,d,e){t.apply(this,arguments);n()};g.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,
arguments);n()};g.connectionHandler.addListener(mxEvent.CONNECT,function(){n()})}var q=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=b.parentNode&&(g.destroy(),b.parentNode.removeChild(b));a.hideDialog()})});q.className="geBtn";a.editor.cancelFirst&&d.appendChild(q);var p=mxUtils.button(mxResources.get("insert"),function(){g.clearCellOverlays();var c=a.editor.graph.getFreeInsertPoint(),c=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),
c.x,c.y),d=a.editor.graph.view,e=d.getBounds(c);e.x-=d.translate.x;e.y-=d.translate.y;a.editor.graph.scrollRectToVisible(e);a.editor.graph.setSelectionCells(c);null!=b.parentNode&&(g.destroy(),b.parentNode.removeChild(b));a.hideDialog()});d.appendChild(p);p.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(q)};this.container=d};
new mxFastOrganicLayout(g,!1),m.forceConstant=80):"circle"==c&&(m=new mxCircleLayout(g));if(null!=m){var n=function(a,b){g.getModel().beginUpdate();try{null!=a&&a(),m.execute(g.getDefaultParent(),l)}catch(w){throw w;}finally{var c=new mxMorphing(g);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){g.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(a,b,c,d,e){u.apply(this,arguments);n()};g.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,
arguments);n()};g.connectionHandler.addListener(mxEvent.CONNECT,function(){n()})}var p=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=b.parentNode&&(g.destroy(),b.parentNode.removeChild(b));a.hideDialog()})});p.className="geBtn";a.editor.cancelFirst&&d.appendChild(p);var q=mxUtils.button(mxResources.get("insert"),function(){g.clearCellOverlays();var c=a.editor.graph.getFreeInsertPoint(),c=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),
c.x,c.y),d=a.editor.graph.view,e=d.getBounds(c);e.x-=d.translate.x;e.y-=d.translate.y;a.editor.graph.scrollRectToVisible(e);a.editor.graph.setSelectionCells(c);null!=b.parentNode&&(g.destroy(),b.parentNode.removeChild(b));a.hideDialog()});d.appendChild(q);q.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(p)};this.container=d};
CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":IMAGE_PATH+
"/handle-connect.png",26,26);
var BackgroundImageDialog=function(a,b){var c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h2");mxUtils.write(d,mxResources.get("backgroundImage"));d.style.marginTop="0px";c.appendChild(d);mxUtils.write(c,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(c);var d=a.editor.graph.backgroundImage,f=document.createElement("input");f.setAttribute("type","text");f.style.marginTop="4px";f.style.marginBottom="4px";f.style.width="350px";f.value=
@ -7467,37 +7467,37 @@ h(c4&63)},g=new XMLHttpRequest;g.open("GET",d+function(a){r="";for(n=0;n<a.lengt
e.getModel().beginUpdate();try{cell=e.insertVertex(null,null,b,f.x,f.y,d.width,d.height,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c.target.result)+";")}finally{e.getModel().endUpdate()}e.setSelectionCell(cell);e.scrollCellToVisible(e.getSelectionCell())};d.src=c.target.result},c.onerror=function(b){a.handleError(b)}):(a.spinner.stop(),a.handleError(c))};g.onerror=function(b){a.handleError(b)};g.send()}}else if("list"==c){if(0<d.length){var e=a.editor.graph,
m=new mxCell(d[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");m.vertex=!0;g=e.getPreferredSizeForCell(m);null!=g&&m.geometry.width<g.width+10&&(m.geometry.width=g.width+10);if(1<d.length)for(var n=1;n<d.length;n++)if("--"==d[n])g=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),
g.vertex=!0,m.geometry.height+=g.geometry.height,m.insert(g);else if(0<d[n].length&&";"!=d[n].charAt(0)){var k=new mxCell(d[n],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");k.vertex=!0;g=e.getPreferredSizeForCell(k);null!=g&&k.geometry.width<g.width&&(k.geometry.width=g.width);m.geometry.width=Math.max(m.geometry.width,k.geometry.width);m.geometry.height+=
k.geometry.height;m.insert(k)}e.setSelectionCells(e.importCells([m],f.x,f.y));e.scrollCellToVisible(e.getSelectionCell())}}else{for(var k=function(a){var b=t[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30)),b.vertex=!0,t[a]=b,z.push(b));return b},t={},z=[],n=0;n<d.length;n++)if(";"!=d[n].charAt(0)){var B=d[n].split("->");if(2==B.length){var A=k(B[0]),B=k(B[1]),G=new mxCell("",new mxGeometry);G.edge=!0;A.insertEdge(G,!0);B.insertEdge(G,!1);z.push(G)}}if(0<z.length){d=document.createElement("div");
k.geometry.height;m.insert(k)}e.setSelectionCells(e.importCells([m],f.x,f.y));e.scrollCellToVisible(e.getSelectionCell())}}else{for(var k=function(a){var b=u[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30)),b.vertex=!0,u[a]=b,z.push(b));return b},u={},z=[],n=0;n<d.length;n++)if(";"!=d[n].charAt(0)){var B=d[n].split("->");if(2==B.length){var A=k(B[0]),B=k(B[1]),G=new mxCell("",new mxGeometry);G.edge=!0;A.insertEdge(G,!0);B.insertEdge(G,!1);z.push(G)}}if(0<z.length){d=document.createElement("div");
d.style.visibility="hidden";document.body.appendChild(d);e=new Graph(d);e.getModel().beginUpdate();try{z=e.importCells(z);for(n=0;n<z.length;n++)e.getModel().isVertex(z[n])&&(g=e.getPreferredSizeForCell(z[n]),z[n].geometry.width=Math.max(z[n].geometry.width,g.width),z[n].geometry.height=Math.max(z[n].geometry.height,g.height));m=new mxFastOrganicLayout(e);m.disableEdgeStyle=!1;m.forceConstant=120;m.execute(e.getDefaultParent())}finally{e.getModel().endUpdate()}e.clearCellOverlays();a.editor.graph.setSelectionCells(a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),
f.x,f.y));a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());e.destroy();d.parentNode.removeChild(d)}}}function d(){return"list"==e.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":"plantUmlPng"==e.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
"plantUmlSvg"==e.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":";Example:\na->b\nb->c\nc->a\n"}var f=a.editor.graph.getFreeInsertPoint(),g=document.createElement("div");g.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height="354px";k.style.marginBottom=
"16px";var e=document.createElement("select"),h=document.createElement("option");h.setAttribute("value","list");h.setAttribute("selected","selected");mxUtils.write(h,mxResources.get("list"));e.appendChild(h);h=document.createElement("option");h.setAttribute("value","diagram");mxUtils.write(h,mxResources.get("diagram"));e.appendChild(h);h=document.createElement("option");h.setAttribute("value","plantUmlSvg");mxUtils.write(h,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");var l=document.createElement("option");
l.setAttribute("value","plantUmlPng");mxUtils.write(l,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");/.*\.draw\.io$/.test(window.location.hostname)&&Graph.fileSupport&&!a.isOffline()&&(e.appendChild(h),e.appendChild(l));var m=d();k.value=m;g.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=
a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){k.value=a.target.result};b.readAsText(a)}},!1));g.appendChild(e);mxEvent.addListener(e,"change",function(){var a=d();if(0==k.value.length||k.value==m)m=a,k.value=m});h=mxUtils.button(mxResources.get("close"),function(){k.value==m?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});h.className="geBtn";a.editor.cancelFirst&&g.appendChild(h);l=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();
c(k.value,e.value)});g.appendChild(l);l.className="geBtn gePrimaryBtn";a.editor.cancelFirst||g.appendChild(h);this.container=g},NewDialog=function(a,b,c,d){function f(){if(d)c||a.hideDialog(),d(q,n.value);else{var b=n.value;if(null!=b&&0<b.length){var e=a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null;a.pickFolder(e,function(c){a.createFile(b,q,null!=t&&0<t.length?t:null,null,function(){a.hideDialog()},null,c)},e!=App.MODE_GOOGLE)}}}function g(a,
b,c){null!=p&&(p.style.backgroundColor="transparent",p.style.border="1px solid transparent");q=b;t=c;p=a;p.style.backgroundColor="#e6eff8";p.style.border="1px solid #ccd9ea"}function k(a,b,c,d,e){var h=document.createElement("div");h.className="geTemplate";h.style.height="140px";h.style.width="140px";null!=d&&0<d.length&&h.setAttribute("title",d);if(null!=a&&0<a.length){a.substring(0,a.length-4);h.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";h.style.backgroundPosition=
"center center";h.style.backgroundRepeat="no-repeat";var l=!1;mxEvent.addListener(h,"click",function(c){w.setAttribute("disabled","disabled");h.style.backgroundColor="transparent";h.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(w.removeAttribute("disabled"),g(h,a.getText(),b),l&&f())}))});mxEvent.addListener(h,"dblclick",function(a){l=!0})}else h.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
mxResources.get(c)+"</td></tr></table>",e&&g(h),mxEvent.addListener(h,"click",function(a){g(h)}),mxEvent.addListener(h,"dblclick",function(a){f()});u.appendChild(h)}function e(){function a(){for(var a=!0;b<C.length&&(a||0!=mxUtils.mod(b,30));)a=C[b++],k(a.url,a.libs,a.title,a.tooltip,a.select),a=!1}var b=0;mxEvent.addListener(u,"scroll",function(b){u.scrollTop+u.clientHeight>=u.scrollHeight&&(a(),mxEvent.consume(b))});var c=null,d;for(d in v){var e=document.createElement("div"),h=mxResources.get(d),
l=v[d];null==h&&(h=d.substring(0,1).toUpperCase()+d.substring(1));18<h.length&&(h=h.substring(0,18)+"&hellip;");e.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";e.setAttribute("title",h+" ("+l.length+")");mxUtils.write(e,e.getAttribute("title"));y.appendChild(e);null==c&&(c=e,c.style.backgroundColor="#ebf2f9");(function(d,h){mxEvent.addListener(e,"click",function(){c!=h&&(c.style.backgroundColor="",c=h,c.style.backgroundColor=
"#ebf2f9",u.scrollTop=0,u.innerHTML="",b=0,C=v[d],a())})})(d,e)}a()}c=null!=c?c:!0;var h=document.createElement("div");h.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="46px";h.appendChild(l);var m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.width="40px";m.style.height="40px";m.style.marginRight="10px";m.style.paddingBottom="4px";m.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":
c(k.value,e.value)});g.appendChild(l);l.className="geBtn gePrimaryBtn";a.editor.cancelFirst||g.appendChild(h);this.container=g},NewDialog=function(a,b,c,d){function f(){if(d)c||a.hideDialog(),d(p,n.value);else{var b=n.value;if(null!=b&&0<b.length){var e=a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null;a.pickFolder(e,function(c){a.createFile(b,p,null!=u&&0<u.length?u:null,null,function(){a.hideDialog()},null,c)},e!=App.MODE_GOOGLE)}}}function g(a,
b,c){null!=q&&(q.style.backgroundColor="transparent",q.style.border="1px solid transparent");p=b;u=c;q=a;q.style.backgroundColor="#e6eff8";q.style.border="1px solid #ccd9ea"}function k(a,b,c,d,e){var h=document.createElement("div");h.className="geTemplate";h.style.height="140px";h.style.width="140px";null!=d&&0<d.length&&h.setAttribute("title",d);if(null!=a&&0<a.length){a.substring(0,a.length-4);h.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";h.style.backgroundPosition=
"center center";h.style.backgroundRepeat="no-repeat";var l=!1;mxEvent.addListener(h,"click",function(c){v.setAttribute("disabled","disabled");h.style.backgroundColor="transparent";h.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(v.removeAttribute("disabled"),g(h,a.getText(),b),l&&f())}))});mxEvent.addListener(h,"dblclick",function(a){l=!0})}else h.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
mxResources.get(c)+"</td></tr></table>",e&&g(h),mxEvent.addListener(h,"click",function(a){g(h)}),mxEvent.addListener(h,"dblclick",function(a){f()});t.appendChild(h)}function e(){function a(){for(var a=!0;b<C.length&&(a||0!=mxUtils.mod(b,30));)a=C[b++],k(a.url,a.libs,a.title,a.tooltip,a.select),a=!1}var b=0;mxEvent.addListener(t,"scroll",function(b){t.scrollTop+t.clientHeight>=t.scrollHeight&&(a(),mxEvent.consume(b))});var c=null,d;for(d in w){var e=document.createElement("div"),h=mxResources.get(d),
l=w[d];null==h&&(h=d.substring(0,1).toUpperCase()+d.substring(1));18<h.length&&(h=h.substring(0,18)+"&hellip;");e.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";e.setAttribute("title",h+" ("+l.length+")");mxUtils.write(e,e.getAttribute("title"));x.appendChild(e);null==c&&(c=e,c.style.backgroundColor="#ebf2f9");(function(d,h){mxEvent.addListener(e,"click",function(){c!=h&&(c.style.backgroundColor="",c=h,c.style.backgroundColor=
"#ebf2f9",t.scrollTop=0,t.innerHTML="",b=0,C=w[d],a())})})(d,e)}a()}c=null!=c?c:!0;var h=document.createElement("div");h.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="46px";h.appendChild(l);var m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.width="40px";m.style.height="40px";m.style.marginRight="10px";m.style.paddingBottom="4px";m.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":
a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&c&&l.appendChild(m);c&&mxUtils.write(l,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");m=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?m=a.drive.extension:
a.mode==App.MODE_DROPBOX&&null!=a.dropbox?m=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?m=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub&&(m=a.gitHub.extension);var n=document.createElement("input");n.setAttribute("value",a.defaultFilename+m);n.style.marginRight="20px";n.style.marginLeft="10px";n.style.width=b?"220px":"450px";this.init=function(){c&&(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",
!1,null))};c&&l.appendChild(n);var t=null,q=null,p=null,w=mxUtils.button(mxResources.get("create"),function(){f()});w.className="geBtn gePrimaryBtn";var u=document.createElement("div");u.style.border="1px solid #d3d3d3";u.style.position="absolute";u.style.left="160px";u.style.right="34px";u.style.top=c?"72px":"40px";u.style.bottom="76px";u.style.margin="6px 0 0 -1px";u.style.padding="6px";u.style.overflow="auto";var y=document.createElement("div");y.style.cssText="position:absolute;left:30px;width:128px;top:72px;bottom:76px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
c||(y.style.top="40px");var v={},x=1;v.basic=[{title:"blankDiagram",select:!0}];var C=v.basic;if(!b){h.appendChild(y);h.appendChild(u);var D=!1;mxUtils.get(TEMPLATE_PATH+"/index.xml",function(a){if(!D){D=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=v[b];null==c&&(x++,c=[],v[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),
!1,null))};c&&l.appendChild(n);var u=null,p=null,q=null,v=mxUtils.button(mxResources.get("create"),function(){f()});v.className="geBtn gePrimaryBtn";var t=document.createElement("div");t.style.border="1px solid #d3d3d3";t.style.position="absolute";t.style.left="160px";t.style.right="34px";t.style.top=c?"72px":"40px";t.style.bottom="76px";t.style.margin="6px 0 0 -1px";t.style.padding="6px";t.style.overflow="auto";var x=document.createElement("div");x.style.cssText="position:absolute;left:30px;width:128px;top:72px;bottom:76px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
c||(x.style.top="40px");var w={},y=1;w.basic=[{title:"blankDiagram",select:!0}];var C=w.basic;if(!b){h.appendChild(x);h.appendChild(t);var D=!1;mxUtils.get(TEMPLATE_PATH+"/index.xml",function(a){if(!D){D=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=w[b];null==c&&(y++,c=[],w[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),
tooltip:a.getAttribute("url")})}}a=a.nextSibling}e()}})}mxEvent.addListener(n,"keypress",function(a){13==a.keyCode&&f()});l=document.createElement("div");l.style.marginTop=b?"4px":"16px";l.style.textAlign="right";l.style.position="absolute";l.style.left="40px";l.style.bottom="30px";l.style.right="40px";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});m.className="geBtn";a.editor.cancelFirst&&l.appendChild(m);if(!b&&!a.isOffline()&&c&&null==d){var z=mxUtils.button(mxResources.get("help"),
function(){window.open("https://support.draw.io/display/DO/Creating+and+Opening+Files")});z.className="geBtn";l.appendChild(z)}b||"1"==urlParams.embed||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(n.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},
mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",l.appendChild(b));l.appendChild(w);a.editor.cancelFirst||null!=d||l.appendChild(m);h.appendChild(l);this.container=h},CreateDialog=function(a,b,c,d,f,g,k,e,h,l,m,n){function t(c,d,e,h){function l(){mxEvent.addListener(f,"click",function(){var c=e;if(k){var d=u.value,h=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>h){var c=null!=c?c:x.value,l="";c==App.MODE_GOOGLE?l=a.drive.extension:c==App.MODE_GITHUB?l=
a.gitHub.extension:c==App.MODE_DROPBOX?l=a.dropbox.extension:c==App.MODE_ONEDRIVE?l=a.oneDrive.extension:c==App.MODE_DEVICE&&(l=".xml");0<=h&&(d=d.substring(0,h));u.value=d+l}}q(e)})}var f=document.createElement("a");f.style.overflow="hidden";var w=document.createElement("img");w.src=c;w.setAttribute("border","0");w.setAttribute("align","absmiddle");w.style.width="60px";w.style.height="60px";w.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(w);mxClient.IS_QUIRKS&&(f.style.cssFloat="left",f.style.zoom="1");f.style.color="gray";f.style.fontSize="11px";var g=document.createElement("div");f.appendChild(g);mxUtils.write(g,d);if(null!=h&&null==a[h]){w.style.visibility="hidden";mxUtils.setOpacity(g,10);var m=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});m.spin(f);var p=window.setTimeout(function(){null==a[h]&&(m.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[h]&&(window.clearTimeout(p),mxUtils.setOpacity(g,100),w.style.visibility="",m.stop(),l())}))}else l();y.appendChild(f);++v==n&&(mxUtils.br(y),v=0)}function q(b){var d=u.value;if(null==b||null!=d&&0<d.length)a.hideDialog(),c(d,b)}k=null!=k?k:!0;e=null!=e?e:!0;n=null!=n?n:3;var p=document.createElement("div");null==
d&&a.addLanguageMenu(p);var w=document.createElement("h2");mxUtils.write(w,f||mxResources.get("create"));w.style.marginTop="0px";w.style.marginBottom="24px";p.appendChild(w);mxUtils.write(p,mxResources.get("filename")+":");var u=document.createElement("input");u.setAttribute("value",b);u.style.width="280px";u.style.marginLeft="10px";u.style.marginBottom="20px";this.init=function(){u.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,
null)};p.appendChild(u);mxUtils.br(p);var y=document.createElement("div");y.style.textAlign="center";var v=0;y.style.marginTop="6px";p.appendChild(y);var x=document.createElement("select");x.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(f,mxResources.get("googleDrive")),x.appendChild(f),t(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,
"drive")),null!=a.gitHub&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GITHUB),mxUtils.write(f,mxResources.get("github")),x.appendChild(f),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.DropboxClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(f,mxResources.get("dropbox")),x.appendChild(f),a.mode==App.MODE_DROPBOX&&f.setAttribute("selected","selected"),t(IMAGE_PATH+
"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),"function"===typeof window.OneDriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(f,mxResources.get("oneDrive")),x.appendChild(f),a.mode==App.MODE_ONEDRIVE&&f.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&
!mxClient.IS_IOS)f=document.createElement("option"),f.setAttribute("value",App.MODE_DEVICE),mxUtils.write(f,mxResources.get("device")),x.appendChild(f),a.mode!=App.MODE_DEVICE&&e||f.setAttribute("selected","selected"),m&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);e&&isLocalStorage&&"0"!=urlParams.browser&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_BROWSER),mxUtils.write(e,mxResources.get("browser")),x.appendChild(e),a.mode==App.MODE_BROWSER&&
e.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));e=document.createElement("div");e.style.marginTop="26px";e.style.textAlign="center";null!=l&&(f=mxUtils.button(mxResources.get("help"),function(){window.open(l)}),f.className="geBtn",e.appendChild(f));f=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});f.className="geBtn";a.editor.cancelFirst&&
e.appendChild(f);null==d&&(w=mxUtils.button(mxResources.get("decideLater"),function(){q(null)}),w.className="geBtn",e.appendChild(w));h&&(h=mxUtils.button(mxResources.get("openInNewWindow"),function(){q("_blank")}),h.className="geBtn",e.appendChild(h));mxClient.IS_IOS||(g=mxUtils.button(g||mxResources.get("create"),function(){q(m?"download":App.MODE_DEVICE)}),g.className="geBtn gePrimaryBtn",e.appendChild(g));a.editor.cancelFirst||e.appendChild(f);mxEvent.addListener(u,"keypress",function(b){13==
b.keyCode?q(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});p.appendChild(e);this.container=p},PopupDialog=function(a,b,c,d,f){f=null!=f?f:!0;var g=document.createElement("div");g.style.textAlign="left";mxUtils.write(g,mxResources.get("fileOpenLocation"));mxUtils.br(g);mxUtils.br(g);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){f&&a.hideDialog();null!=d&&d()});k.className="geBtn";k.style.marginBottom="8px";k.style.width="280px";g.appendChild(k);
mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",l.appendChild(b));l.appendChild(v);a.editor.cancelFirst||null!=d||l.appendChild(m);h.appendChild(l);this.container=h},CreateDialog=function(a,b,c,d,f,g,k,e,h,l,m,n){function u(c,d,e,h){function l(){mxEvent.addListener(f,"click",function(){var c=e;if(k){var d=t.value,h=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>h){var c=null!=c?c:y.value,l="";c==App.MODE_GOOGLE?l=a.drive.extension:c==App.MODE_GITHUB?l=
a.gitHub.extension:c==App.MODE_DROPBOX?l=a.dropbox.extension:c==App.MODE_ONEDRIVE?l=a.oneDrive.extension:c==App.MODE_DEVICE&&(l=".xml");0<=h&&(d=d.substring(0,h));t.value=d+l}}p(e)})}var f=document.createElement("a");f.style.overflow="hidden";var v=document.createElement("img");v.src=c;v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.width="60px";v.style.height="60px";v.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(v);mxClient.IS_QUIRKS&&(f.style.cssFloat="left",f.style.zoom="1");f.style.color="gray";f.style.fontSize="11px";var g=document.createElement("div");f.appendChild(g);mxUtils.write(g,d);if(null!=h&&null==a[h]){v.style.visibility="hidden";mxUtils.setOpacity(g,10);var m=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});m.spin(f);var q=window.setTimeout(function(){null==a[h]&&(m.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[h]&&(window.clearTimeout(q),mxUtils.setOpacity(g,100),v.style.visibility="",m.stop(),l())}))}else l();x.appendChild(f);++w==n&&(mxUtils.br(x),w=0)}function p(b){var d=t.value;if(null==b||null!=d&&0<d.length)a.hideDialog(),c(d,b)}k=null!=k?k:!0;e=null!=e?e:!0;n=null!=n?n:3;var q=document.createElement("div");null==
d&&a.addLanguageMenu(q);var v=document.createElement("h2");mxUtils.write(v,f||mxResources.get("create"));v.style.marginTop="0px";v.style.marginBottom="24px";q.appendChild(v);mxUtils.write(q,mxResources.get("filename")+":");var t=document.createElement("input");t.setAttribute("value",b);t.style.width="280px";t.style.marginLeft="10px";t.style.marginBottom="20px";this.init=function(){t.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,
null)};q.appendChild(t);mxUtils.br(q);var x=document.createElement("div");x.style.textAlign="center";var w=0;x.style.marginTop="6px";q.appendChild(x);var y=document.createElement("select");y.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(f,mxResources.get("googleDrive")),y.appendChild(f),u(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,
"drive")),null!=a.gitHub&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GITHUB),mxUtils.write(f,mxResources.get("github")),y.appendChild(f),u(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.DropboxClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(f,mxResources.get("dropbox")),y.appendChild(f),a.mode==App.MODE_DROPBOX&&f.setAttribute("selected","selected"),u(IMAGE_PATH+
"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),"function"===typeof window.OneDriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(f,mxResources.get("oneDrive")),y.appendChild(f),a.mode==App.MODE_ONEDRIVE&&f.setAttribute("selected","selected"),u(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&
!mxClient.IS_IOS)f=document.createElement("option"),f.setAttribute("value",App.MODE_DEVICE),mxUtils.write(f,mxResources.get("device")),y.appendChild(f),a.mode!=App.MODE_DEVICE&&e||f.setAttribute("selected","selected"),m&&u(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);e&&isLocalStorage&&"0"!=urlParams.browser&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_BROWSER),mxUtils.write(e,mxResources.get("browser")),y.appendChild(e),a.mode==App.MODE_BROWSER&&
e.setAttribute("selected","selected"),u(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));e=document.createElement("div");e.style.marginTop="26px";e.style.textAlign="center";null!=l&&(f=mxUtils.button(mxResources.get("help"),function(){window.open(l)}),f.className="geBtn",e.appendChild(f));f=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});f.className="geBtn";a.editor.cancelFirst&&
e.appendChild(f);null==d&&(v=mxUtils.button(mxResources.get("decideLater"),function(){p(null)}),v.className="geBtn",e.appendChild(v));h&&(h=mxUtils.button(mxResources.get("openInNewWindow"),function(){p("_blank")}),h.className="geBtn",e.appendChild(h));mxClient.IS_IOS||(g=mxUtils.button(g||mxResources.get("create"),function(){p(m?"download":App.MODE_DEVICE)}),g.className="geBtn gePrimaryBtn",e.appendChild(g));a.editor.cancelFirst||e.appendChild(f);mxEvent.addListener(t,"keypress",function(b){13==
b.keyCode?p(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});q.appendChild(e);this.container=q},PopupDialog=function(a,b,c,d,f){f=null!=f?f:!0;var g=document.createElement("div");g.style.textAlign="left";mxUtils.write(g,mxResources.get("fileOpenLocation"));mxUtils.br(g);mxUtils.br(g);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){f&&a.hideDialog();null!=d&&d()});k.className="geBtn";k.style.marginBottom="8px";k.style.width="280px";g.appendChild(k);
mxUtils.br(g);var e=mxUtils.button(mxResources.get("openInNewWindow"),function(){f&&a.hideDialog();null!=c&&c();window.open(b)});e.className="geBtn gePrimaryBtn";e.style.width=k.style.width;g.appendChild(e);mxUtils.br(g);mxUtils.br(g);mxUtils.write(g,mxResources.get("allowPopups"));this.container=g},ImageDialog=function(a,b,c,d,f,g){g=null!=g?g:!0;var k=a.editor.graph,e=document.createElement("div");mxUtils.write(e,b);b=document.createElement("div");b.className="geTitle";b.style.backgroundColor="transparent";
b.style.borderColor="transparent";b.style.whiteSpace="nowrap";b.style.textOverflow="clip";b.style.cursor="default";mxClient.IS_VML||(b.style.paddingRight="20px");var h=document.createElement("input");h.setAttribute("value",c);h.setAttribute("type","text");h.setAttribute("spellcheck","false");h.setAttribute("autocorrect","off");h.setAttribute("autocomplete","off");h.setAttribute("autocapitalize","off");h.style.marginTop="6px";h.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";
h.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";h.style.backgroundRepeat="no-repeat";h.style.backgroundPosition="100% 50%";h.style.paddingRight="14px";c=document.createElement("div");c.setAttribute("title",mxResources.get("reset"));c.style.position="relative";c.style.left="-16px";c.style.width="12px";c.style.height="14px";c.style.cursor="pointer";c.style.display=mxClient.IS_VML?"inline":"inline-block";c.style.top=(mxClient.IS_VML?0:3)+"px";c.style.background="url('"+a.editor.transparentImage+
@ -7506,24 +7506,24 @@ Math.round(Number(h.height)*l))},function(){a.spinner.stop();d(null);a.showError
var b=e.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(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,
0,0,a.maxImageSize,function(a,b,c,d,e,h){m(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&m(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};c=document.createElement("div");c.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";c.style.textAlign=
"right";b=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(h.value=a.url));h.focus()};if(Graph.fileSupport){var n=document.createElement("input");n.setAttribute("multiple","multiple");n.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(n,
"change",function(b){a.importFiles(n.files,0,0,a.maxImageSize,function(a,b,c,d,e,h){m(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var t=mxUtils.button(mxResources.get("open"),function(){n.click()});t.className="geBtn";c.appendChild(t)}}"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(t=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);
a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0);a.movePickersToTop()}),t.className="geBtn",c.appendChild(t),null!=a.drive&&"1"==urlParams.photos&&(t=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0);a.movePickersToTop()}))}),t.className="geBtn",c.appendChild(t)));mxEvent.addListener(h,"keypress",function(a){13==a.keyCode&&m(h.value)});t=mxUtils.button(mxResources.get("apply"),function(){m(h.value)});t.className="geBtn gePrimaryBtn";c.appendChild(t);a.editor.cancelFirst||c.appendChild(b);Graph.fileSupport&&(c.style.marginTop="120px",e.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",
"change",function(b){a.importFiles(n.files,0,0,a.maxImageSize,function(a,b,c,d,e,h){m(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var u=mxUtils.button(mxResources.get("open"),function(){n.click()});u.className="geBtn";c.appendChild(u)}}"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(u=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);
a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0);a.movePickersToTop()}),u.className="geBtn",c.appendChild(u),null!=a.drive&&"1"==urlParams.photos&&(u=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0);a.movePickersToTop()}))}),u.className="geBtn",c.appendChild(u)));mxEvent.addListener(h,"keypress",function(a){13==a.keyCode&&m(h.value)});u=mxUtils.button(mxResources.get("apply"),function(){m(h.value)});u.className="geBtn gePrimaryBtn";c.appendChild(u);a.editor.cancelFirst||c.appendChild(b);Graph.fileSupport&&(c.style.marginTop="120px",e.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",
e.style.backgroundPosition="center 65%",e.style.backgroundRepeat="no-repeat",b=document.createElement("div"),b.style.position="absolute",b.style.width="420px",b.style.top="58%",b.style.textAlign="center",b.style.fontSize="18px",b.style.color="#a0c3ff",mxUtils.write(b,mxResources.get("dragImagesHere")),e.appendChild(b));e.appendChild(c);this.container=e},LinkDialog=function(a,b,c,d,f){function g(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");
b.style.height="26px";b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);u.appendChild(c)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor="default";mxClient.IS_VML||(e.style.paddingRight="20px");var h=
b.style.height="26px";b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);t.appendChild(c)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor="default";mxClient.IS_VML||(e.style.paddingRight="20px");var h=
document.createElement("input");h.setAttribute("placeholder",mxResources.get("dragUrlsHere"));h.setAttribute("type","text");h.style.marginTop="6px";h.style.width="400px";h.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";h.style.backgroundRepeat="no-repeat";h.style.backgroundPosition="100% 50%";h.style.paddingRight="14px";var l=document.createElement("div");l.setAttribute("title",mxResources.get("reset"));l.style.position="relative";l.style.left="-16px";l.style.width="12px";l.style.height=
"14px";l.style.cursor="pointer";l.style.display=mxClient.IS_VML?"inline":"inline-block";l.style.top=(mxClient.IS_VML?0:3)+"px";l.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(l,"click",function(){h.value="";h.focus()});var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-bottom:8px;";m.setAttribute("value","url");m.setAttribute("type","radio");m.setAttribute("name","current-linkdialog");var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";
n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name","current-linkdialog");var t=document.createElement("select");t.style.width="380px";if(f&&null!=a.pages){null!=b&&a.editor.graph.isPageLink(b)?(n.setAttribute("checked","checked"),n.defaultChecked=!0):(h.setAttribute("value",b),m.setAttribute("checked","checked"),m.defaultChecked=!0);h.style.width="380px";e.appendChild(m);e.appendChild(h);e.appendChild(l);mxUtils.br(e);e.appendChild(n);f=!1;for(l=0;l<a.pages.length;l++){var q=
document.createElement("option");mxUtils.write(q,a.pages[l].getName()||mxResources.get("pageWithNumber",[l+1]));q.setAttribute("value","data:page/id,"+a.pages[l].getId());b==q.getAttribute("value")&&(q.setAttribute("selected","selected"),f=!0);t.appendChild(q)}if(!f&&n.checked){var p=document.createElement("option");mxUtils.write(p,mxResources.get("pageNotFound"));p.setAttribute("disabled","disabled");p.setAttribute("selected","selected");p.setAttribute("value","pageNotFound");t.appendChild(p);mxEvent.addListener(t,
"change",function(){null==p.parentNode||p.selected||p.parentNode.removeChild(p)})}e.appendChild(t)}else h.setAttribute("value",b),e.appendChild(h),e.appendChild(l);k.appendChild(e);var w=mxUtils.button(c,function(){a.hideDialog();d(n.checked?"pageNotFound"!==t.value?t.value:b:h.value,LinkDialog.selectedDocs)});w.style.verticalAlign="middle";w.className="geBtn gePrimaryBtn";this.init=function(){n.checked?t.focus():(h.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?h.select():document.execCommand("selectAll",
!1,null));mxEvent.addListener(t,"focus",function(){m.removeAttribute("checked");n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(h,"focus",function(){n.removeAttribute("checked");m.setAttribute("checked","checked");m.checked=!0});if(Graph.fileSupport){var b=k.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(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")&&(h.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),m.setAttribute("checked","checked"),m.checked=!0,w.click());a.stopPropagation();a.preventDefault()}),!1)}};var u=document.createElement("div");u.style.marginTop=
"20px";u.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.style.verticalAlign="middle";c.className="geBtn";a.editor.cancelFirst&&u.appendChild(c);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||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b="https://"+b+"/#G"+
n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name","current-linkdialog");var u=document.createElement("select");u.style.width="380px";if(f&&null!=a.pages){null!=b&&a.editor.graph.isPageLink(b)?(n.setAttribute("checked","checked"),n.defaultChecked=!0):(h.setAttribute("value",b),m.setAttribute("checked","checked"),m.defaultChecked=!0);h.style.width="380px";e.appendChild(m);e.appendChild(h);e.appendChild(l);mxUtils.br(e);e.appendChild(n);f=!1;for(l=0;l<a.pages.length;l++){var p=
document.createElement("option");mxUtils.write(p,a.pages[l].getName()||mxResources.get("pageWithNumber",[l+1]));p.setAttribute("value","data:page/id,"+a.pages[l].getId());b==p.getAttribute("value")&&(p.setAttribute("selected","selected"),f=!0);u.appendChild(p)}if(!f&&n.checked){var q=document.createElement("option");mxUtils.write(q,mxResources.get("pageNotFound"));q.setAttribute("disabled","disabled");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)})}e.appendChild(u)}else h.setAttribute("value",b),e.appendChild(h),e.appendChild(l);k.appendChild(e);var v=mxUtils.button(c,function(){a.hideDialog();d(n.checked?"pageNotFound"!==u.value?u.value:b:h.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){n.checked?u.focus():(h.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?h.select():document.execCommand("selectAll",
!1,null));mxEvent.addListener(u,"focus",function(){m.removeAttribute("checked");n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(h,"focus",function(){n.removeAttribute("checked");m.setAttribute("checked","checked");m.checked=!0});if(Graph.fileSupport){var b=k.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(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")&&(h.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),m.setAttribute("checked","checked"),m.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var t=document.createElement("div");t.style.marginTop=
"20px";t.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.style.verticalAlign="middle";c.className="geBtn";a.editor.cancelFirst&&t.appendChild(c);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||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b="https://"+b+"/#G"+
a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?(b=DriveClient.prototype.newAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);h.value=b;h.focus()}else LinkDialog.selectedDocs=null;h.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&g(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),
function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=gapi.auth.getToken().access_token,c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(c).addView(d).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);
"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0);a.movePickersToTop()}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&g(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){h.value=a[0].link;
h.focus()}})});null!=a.oneDrive&&g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a){h.value=a.value[0].webUrl;h.focus()},!0)});null!=a.gitHub&&g(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],d=a[2];a=a.slice(3,a.length).join("/");h.value="https://github.com/"+b+"/"+c+"/blob/"+d+"/"+a;h.focus()}})});mxEvent.addListener(h,"keypress",function(b){13==b.keyCode&&
(a.hideDialog(),d(n.checked?t.value:h.value,LinkDialog.selectedDocs))});u.appendChild(w);a.editor.cancelFirst||u.appendChild(c);k.appendChild(u);this.container=k},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var c=document.createElement("img");c.style.border="0px";c.setAttribute("width","176");c.setAttribute("width","151");c.style.width="170px";c.style.height="219px";c.setAttribute("src",IMAGE_PATH+"/logo-flat.png");b.appendChild(c);
(a.hideDialog(),d(n.checked?u.value:h.value,LinkDialog.selectedDocs))});t.appendChild(v);a.editor.cancelFirst||t.appendChild(c);k.appendChild(t);this.container=k},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var c=document.createElement("img");c.style.border="0px";c.setAttribute("width","176");c.setAttribute("width","151");c.style.width="170px";c.style.height="219px";c.setAttribute("src",IMAGE_PATH+"/logo-flat.png");b.appendChild(c);
mxUtils.br(b);c=document.createElement("small");c.innerHTML="v "+EditorUi.VERSION;c.style.color="#505050";b.appendChild(c);mxUtils.br(b);mxUtils.br(b);c=document.createElement("small");c.style.color="#505050";c.innerHTML='&copy; 2005-2017 <a href="https://www.jgraph.com/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';b.appendChild(c);mxEvent.addListener(b,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=b},FeedbackDialog=function(a){var b=
document.createElement("div"),c=document.createElement("div");mxUtils.write(c,mxResources.get("sendYourFeedbackToDrawIo"));c.style.fontSize="18px";c.style.marginBottom="18px";b.appendChild(c);c=document.createElement("div");mxUtils.write(c,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");b.appendChild(c);var d=document.createElement("input");d.setAttribute("type","text");d.style.marginTop="6px";d.style.width="600px";var f=mxUtils.button(mxResources.get("sendMessage"),function(){var b=
(k.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(d.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+h.value+b),function(b){a.spinner.stop();
@ -7533,54 +7533,54 @@ mxUtils.write(e," "+mxResources.get("includeCopyOfMyDiagram"));c.appendChild(e);
c.style.marginTop="26px";c.style.textAlign="right";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst?(c.appendChild(e),c.appendChild(f)):(c.appendChild(f),c.appendChild(e));b.appendChild(c);this.container=b};FeedbackDialog.maxAttachmentSize=1E6;
var RevisionDialog=function(a,b){var c=document.createElement("div"),d=document.createElement("h3");d.style.marginTop="0px";mxUtils.write(d,mxResources.get("revisionHistory"));c.appendChild(d);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";c.appendChild(f);var g=document.createElement("div");g.style.position="absolute";g.style.border="1px solid lightGray";g.style.left="199px";g.style.width="470px";g.style.height=
"376px";g.style.overflow="hidden";mxEvent.disableContextMenu(g);c.appendChild(g);var k=new Graph(g);k.setEnabled(!1);k.setPanning(!0);k.panningHandler.ignoreCell=!0;k.panningHandler.useLeftButtonForPanning=!0;k.minFitScale=null;k.maxFitScale=null;k.centerZoom=!0;var e=0,h=null,l=0,m=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a&&null!=h&&null!=h[l]?h[l].getAttribute("name"):"pagenumber"==a?l+1:m.apply(this,arguments)};k.getLinkForCell=function(){return null};Editor.MathJaxRender&&
k.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(k.container)}));var n=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,p=null,w=null,u=null,y=mxUtils.button("",function(){null!=w&&k.zoomIn()});y.className="geSprite geSprite-zoomin";y.setAttribute("title",mxResources.get("zoomIn"));
y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");mxUtils.setOpacity(y,20);var v=mxUtils.button("",function(){null!=w&&k.zoomOut()});v.className="geSprite geSprite-zoomout";v.setAttribute("title",mxResources.get("zoomOut"));v.style.outline="none";v.style.border="none";v.style.margin="2px";v.setAttribute("disabled","disabled");mxUtils.setOpacity(v,20);var x=mxUtils.button("",function(){null!=w&&(k.maxFitScale=8,k.fit(8),k.center())});x.className=
"geSprite geSprite-fit";x.setAttribute("title",mxResources.get("fit"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var C=mxUtils.button("",function(){null!=w&&(k.zoomActual(),k.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 z=mxUtils.button(mxResources.get("download"),function(){if(null!=w){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(w.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});z.className="geBtn";z.setAttribute("disabled","disabled");var B=mxUtils.button(mxResources.get("restore"),function(){null!=w&&null!=u&&a.confirm(mxResources.get("areYouSure"),function(){a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();
a.replaceFileData(u);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});B.className="geBtn";B.setAttribute("disabled","disabled");var A=document.createElement("select");A.setAttribute("disabled","disabled");A.style.maxWidth="80px";A.style.position="relative";A.style.top="-2px";A.style.verticalAlign="bottom";A.style.marginRight="6px";A.style.display="none";var G=null;mxEvent.addListener(A,"change",function(a){null!=
G&&(G(a),mxEvent.consume(a))});var H=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=w&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(w.documentElement)),window.openWindow(a.getUrl()))});H.className="geBtn";H.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("show"),function(){null!=p&&window.open(p.getUrl())});F.className="geBtn gePrimaryBtn";F.setAttribute("disabled","disabled");d=document.createElement("div");
d.style.position="absolute";d.style.top="482px";d.style.width="640px";d.style.textAlign="right";var E=document.createElement("div");E.className="geToolbarContainer";E.style.backgroundColor="transparent";E.style.padding="2px";E.style.border="none";E.style.left="199px";E.style.top="442px";var M=null;if(null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==window.DropboxFile)g.style.display="none",E.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"));
else if(null!=b&&0<b.length){g.style.cursor="move";var K=document.createElement("table");K.style.border="1px solid lightGray";K.style.borderCollapse="collapse";K.style.borderSpacing="0px";K.style.width="100%";var I=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(e=mxUtils.indexOf(a.pages,a.currentPage));for(var L=b.length-1;0<=L;L--){var N=function(c){var d=new Date(c.modifiedDate),f=null;if(0<=d.getTime()){var m=function(b){n.stop();var c=mxUtils.parseXml(b),
m=a.editor.extractGraphModel(c.documentElement,!0);if(null!=m){var p=function(b){null!=b&&(b=q(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},q=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";g.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,k.getModel());k.maxFitScale=1;k.fit(8);k.center();return a};A.style.display="none";A.innerHTML="";w=c;u=b;h=parseSelectFunction=null;l=0;if("mxfile"==
m.nodeName){c=m.getElementsByTagName("diagram");h=[];for(b=0;b<c.length;b++)h.push(c[b]);l=Math.min(e,h.length-1);0<h.length&&p(h[l]);if(1<h.length)for(A.removeAttribute("disabled"),A.style.display="",b=0;b<h.length;b++)c=document.createElement("option"),mxUtils.write(c,h[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==l&&c.setAttribute("selected","selected"),A.appendChild(c);G=function(){l=e=parseInt(A.value);p(h[e])}}else q(m);D.innerHTML="";mxUtils.write(D,
d.toLocaleDateString()+" "+d.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));y.removeAttribute("disabled");v.removeAttribute("disabled");x.removeAttribute("disabled");C.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&B.removeAttribute("disabled"),z.removeAttribute("disabled"),F.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(y,60);mxUtils.setOpacity(v,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(C,60)}else A.style.display=
k.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(k.container)}));var n=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),p=null,q=null,v=null,t=null,x=mxUtils.button("",function(){null!=v&&k.zoomIn()});x.className="geSprite geSprite-zoomin";x.setAttribute("title",mxResources.get("zoomIn"));
x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var w=mxUtils.button("",function(){null!=v&&k.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var y=mxUtils.button("",function(){null!=v&&(k.maxFitScale=8,k.fit(8),k.center())});y.className=
"geSprite geSprite-fit";y.setAttribute("title",mxResources.get("fit"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");mxUtils.setOpacity(y,20);var C=mxUtils.button("",function(){null!=v&&(k.zoomActual(),k.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 z=mxUtils.button(mxResources.get("download"),function(){if(null!=v){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(v.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});z.className="geBtn";z.setAttribute("disabled","disabled");var B=mxUtils.button(mxResources.get("restore"),function(){null!=v&&null!=t&&a.confirm(mxResources.get("areYouSure"),function(){a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
a.replaceFileData(t);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});B.className="geBtn";B.setAttribute("disabled","disabled");var A=document.createElement("select");A.setAttribute("disabled","disabled");A.style.maxWidth="80px";A.style.position="relative";A.style.top="-2px";A.style.verticalAlign="bottom";A.style.marginRight="6px";A.style.display="none";var G=null;mxEvent.addListener(A,"change",function(a){null!=
G&&(G(a),mxEvent.consume(a))});var H=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=v&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(v.documentElement)),window.openWindow(a.getUrl()))});H.className="geBtn";H.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("show"),function(){null!=q&&window.open(q.getUrl())});F.className="geBtn gePrimaryBtn";F.setAttribute("disabled","disabled");d=document.createElement("div");
d.style.position="absolute";d.style.top="482px";d.style.width="640px";d.style.textAlign="right";var E=document.createElement("div");E.className="geToolbarContainer";E.style.backgroundColor="transparent";E.style.padding="2px";E.style.border="none";E.style.left="199px";E.style.top="442px";var M=null;if(null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile)g.style.display="none",E.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"));
else if(null!=b&&0<b.length){g.style.cursor="move";var I=document.createElement("table");I.style.border="1px solid lightGray";I.style.borderCollapse="collapse";I.style.borderSpacing="0px";I.style.width="100%";var K=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(e=mxUtils.indexOf(a.pages,a.currentPage));for(var L=b.length-1;0<=L;L--){var N=function(c){var d=new Date(c.modifiedDate),f=null;if(0<=d.getTime()){var m=function(b){n.stop();var c=mxUtils.parseXml(b),
m=a.editor.extractGraphModel(c.documentElement,!0);if(null!=m){var q=function(b){null!=b&&(b=p(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},p=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";g.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,k.getModel());k.maxFitScale=1;k.fit(8);k.center();return a};A.style.display="none";A.innerHTML="";v=c;t=b;h=parseSelectFunction=null;l=0;if("mxfile"==
m.nodeName){c=m.getElementsByTagName("diagram");h=[];for(b=0;b<c.length;b++)h.push(c[b]);l=Math.min(e,h.length-1);0<h.length&&q(h[l]);if(1<h.length)for(A.removeAttribute("disabled"),A.style.display="",b=0;b<h.length;b++)c=document.createElement("option"),mxUtils.write(c,h[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==l&&c.setAttribute("selected","selected"),A.appendChild(c);G=function(){l=e=parseInt(A.value);q(h[e])}}else p(m);D.innerHTML="";mxUtils.write(D,
d.toLocaleDateString()+" "+d.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));x.removeAttribute("disabled");w.removeAttribute("disabled");y.removeAttribute("disabled");C.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&B.removeAttribute("disabled"),z.removeAttribute("disabled"),F.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(x,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(y,60);mxUtils.setOpacity(C,60)}else A.style.display=
"none",A.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 E=document.createElement("td");E.style.padding="6px";E.style.whiteSpace="nowrap";c==b[b.length-1]?mxUtils.write(E,mxResources.get("current")):d.toDateString()===T?mxUtils.write(E,d.toLocaleTimeString()):mxUtils.write(E,d.toLocaleDateString()+" "+d.toLocaleTimeString());f.appendChild(E);
f.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(f,"click",function(a){p!=c&&(n.stop(),null!=q&&(q.style.backgroundColor=""),p=c,q=f,q.style.backgroundColor="#ebf2f9",u=w=null,D.removeAttribute("title"),D.innerHTML=mxResources.get("loading")+"...",g.style.backgroundColor="#ffffff",k.getModel().clear(),B.setAttribute("disabled","disabled"),z.setAttribute("disabled",
"disabled"),y.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),mxUtils.setOpacity(y,20),mxUtils.setOpacity(v,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(C,20),n.spin(g),c.getXml(function(a){p==c&&m(a)},function(a){n.stop();A.style.display="none";A.innerHTML="";D.innerHTML="";mxUtils.write(D,
mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(f,"dblclick",function(a){F.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);I.appendChild(f)}return f}(b[L]);null!=N&&L==b.length-1&&(M=N)}K.appendChild(I);f.appendChild(K)}else g.style.display="none",E.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";E.appendChild(A);E.appendChild(y);E.appendChild(v);E.appendChild(C);E.appendChild(x);a.editor.cancelFirst?(d.appendChild(f),d.appendChild(z),d.appendChild(H),d.appendChild(B),d.appendChild(F)):(d.appendChild(z),d.appendChild(H),d.appendChild(B),d.appendChild(F),d.appendChild(f));c.appendChild(d);c.appendChild(E);c.appendChild(D);this.container=c},DraftDialog=function(a,b,c,d,f,g,k){var e=document.createElement("div"),h=document.createElement("div");
f.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(f,"click",function(a){q!=c&&(n.stop(),null!=p&&(p.style.backgroundColor=""),q=c,p=f,p.style.backgroundColor="#ebf2f9",t=v=null,D.removeAttribute("title"),D.innerHTML=mxResources.get("loading")+"...",g.style.backgroundColor="#ffffff",k.getModel().clear(),B.setAttribute("disabled","disabled"),z.setAttribute("disabled",
"disabled"),x.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),mxUtils.setOpacity(x,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(y,20),mxUtils.setOpacity(C,20),n.spin(g),c.getXml(function(a){q==c&&m(a)},function(a){n.stop();A.style.display="none";A.innerHTML="";D.innerHTML="";mxUtils.write(D,
mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(f,"dblclick",function(a){F.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);K.appendChild(f)}return f}(b[L]);null!=N&&L==b.length-1&&(M=N)}I.appendChild(K);f.appendChild(I)}else g.style.display="none",E.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";E.appendChild(A);E.appendChild(x);E.appendChild(w);E.appendChild(C);E.appendChild(y);a.editor.cancelFirst?(d.appendChild(f),d.appendChild(z),d.appendChild(H),d.appendChild(B),d.appendChild(F)):(d.appendChild(z),d.appendChild(H),d.appendChild(B),d.appendChild(F),d.appendChild(f));c.appendChild(d);c.appendChild(E);c.appendChild(D);this.container=c},DraftDialog=function(a,b,c,d,f,g,k){var e=document.createElement("div"),h=document.createElement("div");
h.style.marginTop="0px";h.style.whiteSpace="nowrap";h.style.overflow="auto";mxUtils.write(h,b);e.appendChild(h);var l=document.createElement("div");l.style.position="absolute";l.style.border="1px solid lightGray";l.style.marginTop="10px";l.style.width="640px";l.style.top="46px";l.style.bottom="74px";l.style.overflow="hidden";mxEvent.disableContextMenu(l);e.appendChild(l);var m=new Graph(l);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;
m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;b=mxUtils.parseXml(c);var n=a.editor.extractGraphModel(b.documentElement,!0),t=0,q=null,p=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[t]?q[t].getAttribute("name"):"pagenumber"==a?t+1:p.apply(this,arguments)};m.getLinkForCell=function(){return null};b=mxUtils.button("",function(){m.zoomIn()});b.className="geSprite geSprite-zoomin";b.setAttribute("title",mxResources.get("zoomIn"));b.style.outline="none";
m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;b=mxUtils.parseXml(c);var n=a.editor.extractGraphModel(b.documentElement,!0),u=0,p=null,q=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=p&&null!=p[u]?p[u].getAttribute("name"):"pagenumber"==a?u+1:q.apply(this,arguments)};m.getLinkForCell=function(){return null};b=mxUtils.button("",function(){m.zoomIn()});b.className="geSprite geSprite-zoomin";b.setAttribute("title",mxResources.get("zoomIn"));b.style.outline="none";
b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);c=mxUtils.button("",function(){m.zoomOut()});c.className="geSprite geSprite-zoomout";c.setAttribute("title",mxResources.get("zoomOut"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);h=mxUtils.button("",function(){m.maxFitScale=8;m.fit(8);m.center()});h.className="geSprite geSprite-fit";h.setAttribute("title",mxResources.get("fit"));h.style.outline="none";h.style.border="none";h.style.margin=
"2px";mxUtils.setOpacity(h,60);var w=mxUtils.button("",function(){m.zoomActual();m.center()});w.className="geSprite geSprite-actualsize";w.setAttribute("title",mxResources.get("actualSize"));w.style.outline="none";w.style.border="none";w.style.margin="2px";mxUtils.setOpacity(w,60);f=mxUtils.button(k||mxResources.get("discard"),f);f.className="geBtn";var u=document.createElement("select");u.style.maxWidth="80px";u.style.position="relative";u.style.top="-2px";u.style.verticalAlign="bottom";u.style.marginRight=
"6px";u.style.display="none";d=mxUtils.button(g||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.width="640px";g.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");
if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(u,"change",function(a){t=parseInt(u.value);c(q[t]);mxEvent.consume(a)});if("mxfile"==n.nodeName){var d=n.getElementsByTagName("diagram");q=[];for(var e=0;e<d.length;e++)q.push(d[e]);0<q.length&&
c(q[t]);if(1<q.length)for(u.style.display="",e=0;e<q.length;e++)d=document.createElement("option"),mxUtils.write(d,q[e].getAttribute("name")||mxResources.get("pageWithNumber",[e+1])),d.setAttribute("value",e),e==t&&d.setAttribute("selected","selected"),u.appendChild(d)}else b(n)};k.appendChild(u);k.appendChild(b);k.appendChild(c);k.appendChild(w);k.appendChild(h);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className="geBtn";a.editor.cancelFirst?(g.appendChild(b),g.appendChild(f),
g.appendChild(d)):(g.appendChild(d),g.appendChild(f),g.appendChild(b));e.appendChild(g);e.appendChild(k);this.container=e},FindWindow=function(a,b,c,d,f){function g(){var a=e.model.getDescendants(e.model.getRoot()),b=n.value.toLowerCase(),c=t.checked?new RegExp(b):null,d=null;h!=b&&(h=b,l=null);var f=null==l;if(e.isEnabled()&&0<b.length)for(var g=0;g<a.length;g++){var m=e.view.getState(a[g]);if(null!=m&&null!=m.cell.value&&(f||null==d)&&(e.model.isVertex(m.cell)||e.model.isEdge(m.cell))){e.isHtmlLabel(m.cell)?
(q.innerHTML=e.getLabel(m.cell),label=mxUtils.extractTextWithWhitespace([q])):label=e.getLabel(m.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var k;if(!(k=null==c&&label.substring(0,b.length)===b)&&(k=null!=c)&&!(k=c.test(label)))a:{k=c;var p=m.cell;if("object"===typeof p.value&&null!=p.value.attributes)for(var p=p.value.attributes,A=0;A<p.length;A++)if("label"!=p[A].nodeName&&k.test(p[A].nodeValue.toLowerCase())){k=!0;break a}k=!1}if(k)if(f){d=m;break}else null==
"2px";mxUtils.setOpacity(h,60);var v=mxUtils.button("",function(){m.zoomActual();m.center()});v.className="geSprite geSprite-actualsize";v.setAttribute("title",mxResources.get("actualSize"));v.style.outline="none";v.style.border="none";v.style.margin="2px";mxUtils.setOpacity(v,60);f=mxUtils.button(k||mxResources.get("discard"),f);f.className="geBtn";var t=document.createElement("select");t.style.maxWidth="80px";t.style.position="relative";t.style.top="-2px";t.style.verticalAlign="bottom";t.style.marginRight=
"6px";t.style.display="none";d=mxUtils.button(g||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.width="640px";g.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");
if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(t,"change",function(a){u=parseInt(t.value);c(p[u]);mxEvent.consume(a)});if("mxfile"==n.nodeName){var d=n.getElementsByTagName("diagram");p=[];for(var e=0;e<d.length;e++)p.push(d[e]);0<p.length&&
c(p[u]);if(1<p.length)for(t.style.display="",e=0;e<p.length;e++)d=document.createElement("option"),mxUtils.write(d,p[e].getAttribute("name")||mxResources.get("pageWithNumber",[e+1])),d.setAttribute("value",e),e==u&&d.setAttribute("selected","selected"),t.appendChild(d)}else b(n)};k.appendChild(t);k.appendChild(b);k.appendChild(c);k.appendChild(v);k.appendChild(h);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className="geBtn";a.editor.cancelFirst?(g.appendChild(b),g.appendChild(f),
g.appendChild(d)):(g.appendChild(d),g.appendChild(f),g.appendChild(b));e.appendChild(g);e.appendChild(k);this.container=e},FindWindow=function(a,b,c,d,f){function g(){var a=e.model.getDescendants(e.model.getRoot()),b=n.value.toLowerCase(),c=u.checked?new RegExp(b):null,d=null;h!=b&&(h=b,l=null);var f=null==l;if(e.isEnabled()&&0<b.length)for(var g=0;g<a.length;g++){var m=e.view.getState(a[g]);if(null!=m&&null!=m.cell.value&&(f||null==d)&&(e.model.isVertex(m.cell)||e.model.isEdge(m.cell))){e.isHtmlLabel(m.cell)?
(p.innerHTML=e.getLabel(m.cell),label=mxUtils.extractTextWithWhitespace([p])):label=e.getLabel(m.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var k;if(!(k=null==c&&label.substring(0,b.length)===b)&&(k=null!=c)&&!(k=c.test(label)))a:{k=c;var q=m.cell;if("object"===typeof q.value&&null!=q.value.attributes)for(var q=q.value.attributes,A=0;A<q.length;A++)if("label"!=q[A].nodeName&&k.test(q[A].nodeValue.toLowerCase())){k=!0;break a}k=!1}if(k)if(f){d=m;break}else null==
d&&(d=m)}f=f||m==l}null!=d?(l=d,e.setSelectionCell(l.cell),e.scrollCellToVisible(l.cell)):e.clearSelection();return!e.isEnabled()||0==b.length||null!=d}var k=a.actions.get("find"),e=a.editor.graph,h=null,l=null,m=document.createElement("div");m.style.userSelect="none";m.style.overflow="hidden";m.style.padding="10px";m.style.height="100%";var n=document.createElement("input");n.setAttribute("placeholder",mxResources.get("find"));n.setAttribute("type","text");n.style.marginTop="4px";n.style.marginBottom=
"6px";n.style.width="170px";n.style.fontSize="12px";n.style.borderRadius="4px";n.style.padding="6px";m.appendChild(n);var t=document.createElement("input");t.setAttribute("type","checkbox");m.appendChild(t);mxUtils.write(m,mxResources.get("regularExpression"));var q=document.createElement("div");mxUtils.br(m);var p=mxUtils.button(mxResources.get("reset"),function(){n.value="";n.style.backgroundColor="";h=l=null;n.focus()});p.setAttribute("title",mxResources.get("reset"));p.style.marginTop="6px";p.style.marginRight=
"4px";p.style.backgroundColor="#f5f5f5";p.style.backgroundImage="none";p.className="geBtn";m.appendChild(p);p=mxUtils.button(mxResources.get("find"),function(){try{n.style.backgroundColor=g()?"":"#ffcfcf"}catch(w){a.handleError(w)}});p.setAttribute("title",mxResources.get("find")+" (Enter)");p.style.marginTop="6px";p.style.backgroundColor="#4d90fe";p.style.backgroundImage="none";p.className="geBtn gePrimaryBtn";m.appendChild(p);mxEvent.addListener(n,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);
else if(27==a.keyCode)k.funct();else if(h!=n.value.toLowerCase()||13==a.keyCode)try{n.style.backgroundColor=g()?"":"#ffcfcf"}catch(u){n.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(m,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(k.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),m,b,c,d,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);
"6px";n.style.width="170px";n.style.fontSize="12px";n.style.borderRadius="4px";n.style.padding="6px";m.appendChild(n);var u=document.createElement("input");u.setAttribute("type","checkbox");m.appendChild(u);mxUtils.write(m,mxResources.get("regularExpression"));var p=document.createElement("div");mxUtils.br(m);var q=mxUtils.button(mxResources.get("reset"),function(){n.value="";n.style.backgroundColor="";h=l=null;n.focus()});q.setAttribute("title",mxResources.get("reset"));q.style.marginTop="6px";q.style.marginRight=
"4px";q.style.backgroundColor="#f5f5f5";q.style.backgroundImage="none";q.className="geBtn";m.appendChild(q);q=mxUtils.button(mxResources.get("find"),function(){try{n.style.backgroundColor=g()?"":"#ffcfcf"}catch(v){a.handleError(v)}});q.setAttribute("title",mxResources.get("find")+" (Enter)");q.style.marginTop="6px";q.style.backgroundColor="#4d90fe";q.style.backgroundImage="none";q.className="geBtn gePrimaryBtn";m.appendChild(q);mxEvent.addListener(n,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);
else if(27==a.keyCode)k.funct();else if(h!=n.value.toLowerCase()||13==a.keyCode)try{n.style.backgroundColor=g()?"":"#ffcfcf"}catch(t){n.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(m,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(k.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),m,b,c,d,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);
this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):e.container.focus()}))},TagsWindow=function(a,b,c,d,f){function g(a){a=null!=a?a:e.model.getDescendants(e.model.getRoot());for(var b=m.value.split(" "),c=[],d=0;d<a.length;d++)if(e.model.isVertex(a[d])||e.model.isEdge(a[d])){var l=null!=a[d].value&&"object"==typeof a[d].value?mxUtils.trim(a[d].value.getAttribute(h)||
""):"",f=!0;if(0<l.length)for(var l=l.toLowerCase().split(" "),g=0;g<b.length&&f;g++)var n=mxUtils.trim(b[g]).toLowerCase(),f=f&&(0==n.length||0<=mxUtils.indexOf(l,n));else f=0==mxUtils.trim(m.value).length;f&&c.push(a[d])}return c}function k(a,b){e.model.beginUpdate();try{for(var c=0;c<a.length;c++)e.model.setVisible(a[c],b)}finally{e.model.endUpdate()}}var e=a.editor.graph,h="tags",l=document.createElement("div");l.style.userSelect="none";l.style.overflow="hidden";l.style.padding="10px";l.style.height=
"100%";var m=document.createElement("input");m.setAttribute("placeholder",mxResources.get("allTags"));m.setAttribute("type","text");m.style.marginTop="4px";m.style.width="240px";m.style.fontSize="12px";m.style.borderRadius="4px";m.style.padding="6px";l.appendChild(m);mxEvent.addListener(m,"dblclick",function(){var b=new FilenameDialog(a,h,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(h=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});
m.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(l);var n=mxUtils.button(mxResources.get("hide"),function(){k(g(),!1)});n.setAttribute("title",mxResources.get("hide"));n.style.marginTop="8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className="geBtn";l.appendChild(n);n=mxUtils.button(mxResources.get("show"),function(){var a=g();k(a,!0);e.setSelectionCells(a)});n.setAttribute("title",mxResources.get("show"));n.style.marginTop=
"8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className="geBtn";l.appendChild(n);var t=a.actions.get("tags"),n=mxUtils.button(mxResources.get("close"),function(){t.funct()});n.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");n.style.marginTop="8px";n.style.backgroundColor="#4d90fe";n.style.backgroundImage="none";n.className="geBtn gePrimaryBtn";l.appendChild(n);mxEvent.addListener(m,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||
t.funct()});this.window=new mxWindow(mxResources.get("tags"),l,b,c,d,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(m.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):e.container.focus()}))},AuthDialog=function(a,b,c,d){var f=document.createElement("div");f.style.textAlign=
"8px";n.style.marginRight="4px";n.style.backgroundColor="#f5f5f5";n.style.backgroundImage="none";n.className="geBtn";l.appendChild(n);var u=a.actions.get("tags"),n=mxUtils.button(mxResources.get("close"),function(){u.funct()});n.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");n.style.marginTop="8px";n.style.backgroundColor="#4d90fe";n.style.backgroundImage="none";n.className="geBtn gePrimaryBtn";l.appendChild(n);mxEvent.addListener(m,"keyup",function(a){13!=a.keyCode&&27!=a.keyCode||
u.funct()});this.window=new mxWindow(mxResources.get("tags"),l,b,c,d,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(m.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):e.container.focus()}))},AuthDialog=function(a,b,c,d){var f=document.createElement("div");f.style.textAlign=
"center";var g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("authorizationRequired"));var k="Unknown",e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("align","absmiddle");e.style.marginRight="10px";b==a.drive?(k=mxResources.get("googleDrive"),e.src=IMAGE_PATH+"/google-drive-logo-white.svg"):b==a.dropbox?(k=mxResources.get("dropbox"),e.src=IMAGE_PATH+"/dropbox-logo-white.svg"):
b==a.oneDrive?(k=mxResources.get("oneDrive"),e.src=IMAGE_PATH+"/onedrive-logo-white.svg"):b==a.gitHub&&(k=mxResources.get("github"),e.src=IMAGE_PATH+"/github-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[k]));var h=document.createElement("input");h.setAttribute("type","checkbox");k=mxUtils.button(mxResources.get("authorize"),function(){d(h.checked)});k.insertBefore(e,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";f.appendChild(g);
f.appendChild(a);f.appendChild(k);c&&(c=document.createElement("p"),c.style.marginTop="20px",c.appendChild(h),g=document.createElement("span"),mxUtils.write(g," "+mxResources.get("rememberMe")),c.appendChild(g),f.appendChild(c),h.checked=!0,h.defaultChecked=!0,mxEvent.addListener(g,"click",function(a){h.checked=!h.checked;mxEvent.consume(a)}));this.container=f},MoreShapesDialog=function(a,b,c){c=null!=c?c:a.sidebar.entries;var d=document.createElement("div");if(b){b=document.createElement("div");
b.className="geDialogTitle";mxUtils.write(b,mxResources.get("shapes"));b.style.position="absolute";b.style.top="0px";b.style.left="0px";b.style.lineHeight="40px";b.style.height="40px";b.style.right="0px";mxClient.IS_QUIRKS&&(b.style.width="718px");var f=document.createElement("div"),g=document.createElement("div");f.style.position="absolute";f.style.top="40px";f.style.left="0px";f.style.width="202px";f.style.bottom="60px";f.style.overflow="auto";mxClient.IS_QUIRKS&&(f.style.height="437px",f.style.marginTop=
"1px");g.style.position="absolute";g.style.left="202px";g.style.right="0px";g.style.top="40px";g.style.bottom="60px";g.style.overflow="auto";g.style.borderLeft="1px solid rgb(211, 211, 211)";g.style.textAlign="center";mxClient.IS_QUIRKS&&(g.style.width=parseInt(b.style.width)-202+"px",g.style.height=f.style.height,g.style.marginTop=f.style.marginTop);var k=null,e=[],h=document.createElement("div");h.style.position="relative";h.style.left="0px";h.style.right="0px";for(var l=0;l<c.length;l++)(function(b){var c=
h.cloneNode(!1);c.style.fontWeight="bold";c.style.backgroundColor="#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,b.title);f.appendChild(c);for(var d=0;d<b.entries.length;d++)(function(b){var c=h.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.checked=a.sidebar.isEntryVisible(b.id);m.defaultChecked=m.checked;c.appendChild(m);mxUtils.write(c," "+b.title);f.appendChild(c);var w=function(a){if(null==
a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCallback?b.imageCallback(g):null!=b.image?g.innerHTML='<img border="0" src="'+b.image+'"/>':(g.innerHTML="<br>",mxUtils.write(g,mxResources.get("noPreview"))),null!=k&&(k.style.backgroundColor=""),k=c,k.style.backgroundColor="#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(c,"click",w);mxEvent.addListener(c,"dblclick",function(a){m.checked=!m.checked;mxEvent.consume(a)});e.push(function(){return m.checked?b.id:null});0==l&&0==d&&w()})(b.entries[d])})(c[l]);
h.cloneNode(!1);c.style.fontWeight="bold";c.style.backgroundColor="#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,b.title);f.appendChild(c);for(var d=0;d<b.entries.length;d++)(function(b){var c=h.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";var m=document.createElement("input");m.setAttribute("type","checkbox");m.checked=a.sidebar.isEntryVisible(b.id);m.defaultChecked=m.checked;c.appendChild(m);mxUtils.write(c," "+b.title);f.appendChild(c);var v=function(a){if(null==
a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCallback?b.imageCallback(g):null!=b.image?g.innerHTML='<img border="0" src="'+b.image+'"/>':(g.innerHTML="<br>",mxUtils.write(g,mxResources.get("noPreview"))),null!=k&&(k.style.backgroundColor=""),k=c,k.style.backgroundColor="#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(c,"click",v);mxEvent.addListener(c,"dblclick",function(a){m.checked=!m.checked;mxEvent.consume(a)});e.push(function(){return m.checked?b.id:null});0==l&&0==d&&v()})(b.entries[d])})(c[l]);
d.style.padding="30px";d.appendChild(b);d.appendChild(f);d.appendChild(g);c=document.createElement("div");c.className="geDialogFooter";c.style.position="absolute";c.style.paddingRight="16px";c.style.color="gray";c.style.left="0px";c.style.right="0px";c.style.bottom="0px";c.style.height="60px";c.style.lineHeight="52px";mxClient.IS_QUIRKS&&(c.style.width=b.style.width,c.style.paddingTop="12px");var m=document.createElement("input");m.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)b=
document.createElement("span"),b.style.paddingRight="20px",b.appendChild(m),mxUtils.write(b," "+mxResources.get("rememberThisSetting")),m.checked=!0,m.defaultChecked=!0,mxEvent.addListener(b,"click",function(a){mxEvent.getSource(a)!=m&&(m.checked=!m.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.top="-6px"),c.appendChild(b);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var n=mxUtils.button(mxResources.get("apply"),
function(){a.hideDialog();for(var b=[],c=0;c<e.length;c++){var d=e[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),m.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var t=document.createElement("table"),q=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";var p=document.createElement("tr");t.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),w=document.createElement("td"),u=mxUtils.bind(this,function(b,
c,d){var e=document.createElement("input");e.type="checkbox";t.appendChild(e);e.checked=a.sidebar.isEntryVisible(d);var h=document.createElement("span");mxUtils.write(h,c);c=document.createElement("div");c.style.display="block";c.appendChild(e);c.appendChild(h);mxEvent.addListener(h,"click",function(a){e.checked=!e.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return e.checked?d:null}});p.appendChild(b);p.appendChild(n);p.appendChild(w);q.appendChild(p);t.appendChild(q);for(var e=
[],y=0,l=0;l<c.length;l++)for(q=0;q<c[l].entries.length;q++)y++;for(var v=[b,n,w],x=0,l=0;l<c.length;l++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];e.push(u(v[Math.floor(x/(y/3))],c.title,c.id));x++}})(c[l]);d.appendChild(t);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";m=document.createElement("input");isLocalStorage&&(m.setAttribute("type","checkbox"),m.checked=!0,m.defaultChecked=!0,c.appendChild(m),b=document.createElement("span"),
function(){a.hideDialog();for(var b=[],c=0;c<e.length;c++){var d=e[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),m.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var u=document.createElement("table"),p=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";var q=document.createElement("tr");u.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),v=document.createElement("td"),t=mxUtils.bind(this,function(b,
c,d){var e=document.createElement("input");e.type="checkbox";u.appendChild(e);e.checked=a.sidebar.isEntryVisible(d);var h=document.createElement("span");mxUtils.write(h,c);c=document.createElement("div");c.style.display="block";c.appendChild(e);c.appendChild(h);mxEvent.addListener(h,"click",function(a){e.checked=!e.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return e.checked?d:null}});q.appendChild(b);q.appendChild(n);q.appendChild(v);p.appendChild(q);u.appendChild(p);for(var e=
[],x=0,l=0;l<c.length;l++)for(p=0;p<c[l].entries.length;p++)x++;for(var w=[b,n,v],y=0,l=0;l<c.length;l++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];e.push(t(w[Math.floor(y/(x/3))],c.title,c.id));y++}})(c[l]);d.appendChild(u);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";m=document.createElement("input");isLocalStorage&&(m.setAttribute("type","checkbox"),m.checked=!0,m.defaultChecked=!0,c.appendChild(m),b=document.createElement("span"),
mxUtils.write(b," "+mxResources.get("rememberThisSetting")),c.appendChild(b),mxEvent.addListener(b,"click",function(a){m.checked=!m.checked;mxEvent.consume(a)}));d.appendChild(c);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<e.length;c++){var d=e[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(0<b.length?b.join(";"):"",m.checked);a.hideDialog()});n.className=
"geBtn gePrimaryBtn";c=document.createElement("div");c.style.marginTop="26px";c.style.textAlign="right"}a.editor.cancelFirst?(c.appendChild(b),c.appendChild(n)):(c.appendChild(n),c.appendChild(b));d.appendChild(c);this.container=d},PluginsDialog=function(a){function b(){if(0==f.length)d.innerHTML=mxResources.get("noPlugins");else{d.innerHTML="";for(var c=0;c<f.length;c++){var e=document.createElement("span");e.style.whiteSpace="nowrap";var h=document.createElement("span");h.className="geSprite geSprite-delete";
h.style.position="relative";h.style.cursor="pointer";h.style.top="5px";h.style.marginRight="4px";h.style.display="inline-block";e.appendChild(h);mxUtils.write(e,f[c]);d.appendChild(e);mxUtils.br(d);mxEvent.addListener(h,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+f[c]+'"?',function(){f.splice(c,1);b()})}}(c))}}}var c=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var f=mxSettings.getPlugins().slice();
@ -7588,36 +7588,36 @@ c.appendChild(d);b();var g=mxUtils.button(mxResources.get("add"),function(){var
")");a.showDialog(c.container,300,80,!0,!0);c.init()});g.className="geBtn";var k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";var e=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(f);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});e.className="geBtn gePrimaryBtn";var h=document.createElement("div");h.style.marginTop="14px";h.style.textAlign="right";a.editor.cancelFirst?(h.appendChild(k),h.appendChild(g),
h.appendChild(e)):(h.appendChild(g),h.appendChild(e),h.appendChild(k));c.appendChild(h);this.container=c},EditGeometryDialog=function(a,b){var c=a.editor.graph,d=1==b.length?c.getCellGeometry(b[0]):null,f=document.createElement("div"),g=document.createElement("table"),k=document.createElement("tbody"),e=document.createElement("tr"),h=document.createElement("td"),l=document.createElement("td");g.style.paddingLeft="6px";mxUtils.write(h,mxResources.get("left")+":");var m=document.createElement("input");
m.setAttribute("type","text");m.style.width="100px";m.value=null!=d?d.x:"";this.init=function(){m.focus();m.select()};l.appendChild(m);e.appendChild(h);e.appendChild(l);k.appendChild(e);e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.y:"";l.appendChild(n);e.appendChild(h);e.appendChild(l);k.appendChild(e);
e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";l.appendChild(t);e.appendChild(h);e.appendChild(l);k.appendChild(e);e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("height")+":");var q=document.createElement("input");
q.setAttribute("type","text");q.style.width="100px";q.value=null!=d?d.height:"";l.appendChild(q);e.appendChild(h);e.appendChild(l);k.appendChild(e);e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("rotation")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=1==b.length?mxUtils.getValue(c.getCellStyle(b[0]),mxConstants.STYLE_ROTATION,0):"";l.appendChild(p);e.appendChild(h);
e.appendChild(l);k.appendChild(e);g.appendChild(k);f.appendChild(g);var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),w=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c.getModel().beginUpdate();try{for(var d=0;d<b.length;d++){var e=c.getCellGeometry(b[d]);null!=e&&(e=e.clone(),c.isCellMovable(b[d])&&(0<mxUtils.trim(m.value).length&&(e.x=Number(m.value)),0<mxUtils.trim(n.value).length&&(e.y=Number(n.value))),c.isCellResizable(b[d])&&(0<mxUtils.trim(t.value).length&&
(e.width=Number(t.value)),0<mxUtils.trim(q.value).length&&(e.height=Number(q.value))),c.getModel().setGeometry(b[d],e));0<mxUtils.trim(p.value).length&&c.setCellStyles(mxConstants.STYLE_ROTATION,Number(p.value),[b[d]])}}finally{c.getModel().endUpdate()}});mxEvent.addListener(f,"keypress",function(a){13==a.keyCode&&w.click()});g=document.createElement("div");g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(w)):(g.appendChild(w),g.appendChild(d));
f.appendChild(g);this.container=f},LibraryDialog=function(a,b,c,d,f,g){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=q;)a=a.parentNode;var b=null;if(null!=a)for(var c=q.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function e(b,c,d,h,l,f,g,n,y){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==w[b]){var t=function(){F.innerHTML="";F.style.cursor="pointer";F.style.whiteSpace="nowrap";F.style.textOverflow="ellipsis";mxUtils.write(F,
null!=M.title&&0<M.title.length?M.title:mxResources.get("untitled"));F.style.color=null==M.title||0==M.title.length?"#d0d0d0":""};q.style.backgroundImage="";p.style.display="none";var B=l,A=f;if(l>a.maxImageSize||f>a.maxImageSize){var D=Math.min(1,Math.min(a.maxImageSize/Math.max(1,l)),a.maxImageSize/Math.max(1,f));l*=D;f*=D}B>A?(A=Math.round(100*A/B),B=100):(B=Math.round(100*B/A),A=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=mxClient.IS_QUIRKS?"inline":
"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var z=document.createElement("img");z.setAttribute("src",x.convert(b));z.style.width=B+"px";z.style.height=A+"px";z.style.margin="10px";z.style.paddingBottom=Math.floor((100-A)/2)+"px";z.style.paddingLeft=Math.floor((100-B)/2)+"px";H.appendChild(z)}else if(null!=g){var G=a.stringToCells(a.editor.graph.decompress(g.xml));0<G.length&&(a.sidebar.createThumb(G,
e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("width")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=d?d.width:"";l.appendChild(u);e.appendChild(h);e.appendChild(l);k.appendChild(e);e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("height")+":");var p=document.createElement("input");
p.setAttribute("type","text");p.style.width="100px";p.value=null!=d?d.height:"";l.appendChild(p);e.appendChild(h);e.appendChild(l);k.appendChild(e);e=document.createElement("tr");h=document.createElement("td");l=document.createElement("td");mxUtils.write(h,mxResources.get("rotation")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=1==b.length?mxUtils.getValue(c.getCellStyle(b[0]),mxConstants.STYLE_ROTATION,0):"";l.appendChild(q);e.appendChild(h);
e.appendChild(l);k.appendChild(e);g.appendChild(k);f.appendChild(g);var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c.getModel().beginUpdate();try{for(var d=0;d<b.length;d++){var e=c.getCellGeometry(b[d]);null!=e&&(e=e.clone(),c.isCellMovable(b[d])&&(0<mxUtils.trim(m.value).length&&(e.x=Number(m.value)),0<mxUtils.trim(n.value).length&&(e.y=Number(n.value))),c.isCellResizable(b[d])&&(0<mxUtils.trim(u.value).length&&
(e.width=Number(u.value)),0<mxUtils.trim(p.value).length&&(e.height=Number(p.value))),c.getModel().setGeometry(b[d],e));0<mxUtils.trim(q.value).length&&c.setCellStyles(mxConstants.STYLE_ROTATION,Number(q.value),[b[d]])}}finally{c.getModel().endUpdate()}});mxEvent.addListener(f,"keypress",function(a){13==a.keyCode&&v.click()});g=document.createElement("div");g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(v)):(g.appendChild(v),g.appendChild(d));
f.appendChild(g);this.container=f},LibraryDialog=function(a,b,c,d,f,g){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=p;)a=a.parentNode;var b=null;if(null!=a)for(var c=p.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function e(b,c,d,h,l,f,g,n,u){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==v[b]){var x=function(){F.innerHTML="";F.style.cursor="pointer";F.style.whiteSpace="nowrap";F.style.textOverflow="ellipsis";mxUtils.write(F,
null!=M.title&&0<M.title.length?M.title:mxResources.get("untitled"));F.style.color=null==M.title||0==M.title.length?"#d0d0d0":""};p.style.backgroundImage="";q.style.display="none";var B=l,A=f;if(l>a.maxImageSize||f>a.maxImageSize){var D=Math.min(1,Math.min(a.maxImageSize/Math.max(1,l)),a.maxImageSize/Math.max(1,f));l*=D;f*=D}B>A?(A=Math.round(100*A/B),B=100):(B=Math.round(100*B/A),A=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=mxClient.IS_QUIRKS?"inline":
"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var z=document.createElement("img");z.setAttribute("src",y.convert(b));z.style.width=B+"px";z.style.height=A+"px";z.style.margin="10px";z.style.paddingBottom=Math.floor((100-A)/2)+"px";z.style.paddingLeft=Math.floor((100-B)/2)+"px";H.appendChild(z)}else if(null!=g){var G=a.stringToCells(a.editor.graph.decompress(g.xml));0<G.length&&(a.sidebar.createThumb(G,
100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var E=document.createElement("img");E.setAttribute("src",Editor.closeImage);E.setAttribute("border","0");E.setAttribute("title",mxResources.get("delete"));E.setAttribute("align","top");E.style.paddingTop="4px";E.style.marginLeft="-22px";E.style.cursor="pointer";mxEvent.addListener(E,"dragstart",function(a){mxEvent.consume(a)});null==b&&null!=g&&(E.style.position="relative");(function(a,
b,c){mxEvent.addListener(E,"click",function(d){w[b]=null;for(var e=0;e<m.length;e++)if(null!=m[e].data&&m[e].data==b||null!=m[e].xml&&null!=c&&m[e].xml==c.xml){m.splice(e,1);break}H.parentNode.removeChild(a);0==m.length&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",p.style.display="");mxEvent.consume(d)});mxEvent.addListener(E,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(E);H.style.marginBottom="30px";var F=document.createElement("div");F.style.position="absolute";
F.style.boxSizing="border-box";F.style.bottom="-18px";F.style.left="10px";F.style.right="10px";F.style.backgroundColor="#ffffff";F.style.overflow="hidden";F.style.textAlign="center";var M=null;null!=b?(M={data:b,w:l,h:f,title:y},null!=n&&(M.aspect=n),w[b]=z,m.push(M)):null!=g&&(g.aspect="fixed",m.push(g),M=g);mxEvent.addListener(F,"keydown",function(a){13==a.keyCode&&null!=v&&(v(),v=null,mxEvent.consume(a))});t();H.appendChild(F);mxEvent.addListener(F,"mousedown",function(a){"true"!=F.getAttribute("contentEditable")&&
mxEvent.consume(a)});G=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,M.title||"",mxResources.get("ok"),function(a){null!=a&&(M.title=a,t())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=F.getAttribute("contentEditable")){null!=v&&(v(),v=null);if(null==M.title||0==M.title.length)F.innerHTML="";F.style.textOverflow="";F.style.whiteSpace=
"";F.style.cursor="text";F.style.color="";F.setAttribute("contentEditable","true");F.focus();document.execCommand("selectAll",!1,null);v=function(){F.removeAttribute("contentEditable");F.style.cursor="pointer";M.title=F.innerHTML;t()};mxEvent.consume(b)}};mxEvent.addListener(F,"click",G);mxEvent.addListener(H,"dblclick",G);q.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(E.style.visibility="hidden",F.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",
g.xml);u=k(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);E.style.visibility="";F.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==E.style.visibility&&(E.style.visibility="",F.style.visibility="");u=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else C||(C=!0,a.handleError({message:mxResources.get("fileExists")}));else{l=
b,c){mxEvent.addListener(E,"click",function(d){v[b]=null;for(var e=0;e<m.length;e++)if(null!=m[e].data&&m[e].data==b||null!=m[e].xml&&null!=c&&m[e].xml==c.xml){m.splice(e,1);break}H.parentNode.removeChild(a);0==m.length&&(p.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(d)});mxEvent.addListener(E,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(E);H.style.marginBottom="30px";var F=document.createElement("div");F.style.position="absolute";
F.style.boxSizing="border-box";F.style.bottom="-18px";F.style.left="10px";F.style.right="10px";F.style.backgroundColor="#ffffff";F.style.overflow="hidden";F.style.textAlign="center";var M=null;null!=b?(M={data:b,w:l,h:f,title:u},null!=n&&(M.aspect=n),v[b]=z,m.push(M)):null!=g&&(g.aspect="fixed",m.push(g),M=g);mxEvent.addListener(F,"keydown",function(a){13==a.keyCode&&null!=w&&(w(),w=null,mxEvent.consume(a))});x();H.appendChild(F);mxEvent.addListener(F,"mousedown",function(a){"true"!=F.getAttribute("contentEditable")&&
mxEvent.consume(a)});G=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,M.title||"",mxResources.get("ok"),function(a){null!=a&&(M.title=a,x())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=F.getAttribute("contentEditable")){null!=w&&(w(),w=null);if(null==M.title||0==M.title.length)F.innerHTML="";F.style.textOverflow="";F.style.whiteSpace=
"";F.style.cursor="text";F.style.color="";F.setAttribute("contentEditable","true");F.focus();document.execCommand("selectAll",!1,null);w=function(){F.removeAttribute("contentEditable");F.style.cursor="pointer";M.title=F.innerHTML;x()};mxEvent.consume(b)}};mxEvent.addListener(F,"click",G);mxEvent.addListener(H,"dblclick",G);p.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(E.style.visibility="hidden",F.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",
g.xml);t=k(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);E.style.visibility="";F.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==E.style.visibility&&(E.style.visibility="",F.style.visibility="");t=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else C||(C=!0,a.handleError({message:mxResources.get("fileExists")}));else{l=
!1;try{if(a.spinner.stop(),B=mxUtils.parseXml(b),"mxlibrary"==B.documentElement.nodeName){A=JSON.parse(mxUtils.getTextContent(B.documentElement));if(null!=A&&0<A.length)for(var I=0;I<A.length;I++)null!=A[I].xml?e(null,null,0,0,0,0,A[I]):e(A[I].data,null,0,0,A[I].w,A[I].h,null,"fixed",A[I].title);l=!0}else if("mxfile"==B.documentElement.nodeName){for(var K=B.documentElement.getElementsByTagName("diagram"),I=0;I<K.length;I++){var A=mxUtils.getTextContent(K[I]),G=a.stringToCells(a.editor.graph.decompress(A)),
S=a.editor.graph.getBoundingBoxFromGeometry(G);e(null,null,0,0,0,0,{xml:A,w:S.width,h:S.height})}l=!0}}catch(X){}l||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(X){}return null}function h(a){a.dataTransfer.dropEffect=null!=u?"move":"copy";a.stopPropagation();a.preventDefault()}function l(b){b.stopPropagation();b.preventDefault();C=!1;y=k(b);if(null!=u)null!=y&&y<q.children.length?(m.splice(y>u?y-1:y,0,m.splice(u,1)[0]),q.insertBefore(q.children[u],q.children[y])):
(m.push(m.splice(u,1)[0]),q.appendChild(q.children[u]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,D(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){e(c,null,0,0,a.width,a.height);q.scrollTop=q.scrollHeight})}b.stopPropagation();b.preventDefault()}
var m=[];c=document.createElement("div");c.style.height="100%";var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="40px";c.appendChild(n);mxUtils.write(n,mxResources.get("filename")+":");null==b&&(b=a.defaultLibraryName+".xml");var t=document.createElement("input");t.setAttribute("value",b);t.style.marginRight="20px";t.style.marginLeft="10px";t.style.width="500px";null==f||f.isRenamable()||t.setAttribute("disabled","true");this.init=function(){if(null==f||f.isRenamable())t.focus(),
mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};n.appendChild(t);var q=document.createElement("div");q.style.borderWidth="1px 0px 1px 0px";q.style.borderColor="#d3d3d3";q.style.borderStyle="solid";q.style.marginTop="6px";q.style.overflow="auto";q.style.height="340px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";0==m.length&&Graph.fileSupport&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");
var p=document.createElement("div");p.style.position="absolute";p.style.width="640px";p.style.top="260px";p.style.textAlign="center";p.style.fontSize="22px";p.style.color="#a0c3ff";mxUtils.write(p,mxResources.get("dragImagesHere"));c.appendChild(p);var w={},u=null,y=null,v=null;b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=v&&(v(),v=null,mxEvent.consume(a))};mxEvent.addListener(q,"mousedown",b);mxEvent.addListener(q,"pointerdown",b);mxEvent.addListener(q,"touchstart",
b);var x=new mxUrlConverter,C=!1;if(null!=d)for(b=0;b<d.length;b++)n=d[b],e(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(q,"dragleave",function(a){p.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==q||b==p){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var D=function(b){return function(c,d,h,l,f,g,m,w,n){null!=n&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,n.name)?a.parseFile(n,mxUtils.bind(this,function(c){4==c.readyState&&
(a.spinner.stop(),200<=c.status&&299>=c.status&&(e(c.responseText,d,h,l,f,g,m,"fixed",mxEvent.isAltDown(b)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight))})):(e(c,d,h,l,f,g,m,"fixed",mxEvent.isAltDown(b)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight)}};mxEvent.addListener(q,"dragover",h);mxEvent.addListener(q,"drop",l);mxEvent.addListener(p,"dragover",h);mxEvent.addListener(p,"drop",l);c.appendChild(q);d=document.createElement("div");
d.style.textAlign="right";d.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&d.appendChild(b);window.chrome&&chrome.app&&chrome.app.runtime?t.setAttribute("disabled","disabled"):(n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(m),c=t.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):
(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")}),n.setAttribute("id","btnDownload"),n.className="geBtn",d.appendChild(n));var z=document.createElement("input");z.setAttribute("multiple","multiple");z.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(z,"change",function(b){C=!1;a.importFiles(z.files,0,0,a.maxImageSize,function(a,c,d,e,h,l,f,g,m){D(b)(a,c,d,e,h,l,f,g,m);z.value=""});q.scrollTop=
q.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=v&&(v(),v=null);z.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",d.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=v&&(v(),v=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){C=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}e(a,null,0,0,b,c);q.scrollTop=q.scrollHeight}})});
n.setAttribute("id","btnAddImageUrl");n.className="geBtn";d.appendChild(n);this.saveBtnClickHandler=function(b,c,d,e){a.saveLibrary(b,c,d,e)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=v&&(v(),v=null);this.saveBtnClickHandler(t.value,m,f,g)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";d.appendChild(n);a.editor.cancelFirst||d.appendChild(b);c.appendChild(d);this.container=c},EditShapeDialog=function(a,b,c,d,f){d=null!=d?d:300;f=null!=f?f:120;var g,
S=a.editor.graph.getBoundingBoxFromGeometry(G);e(null,null,0,0,0,0,{xml:A,w:S.width,h:S.height})}l=!0}}catch(X){}l||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(X){}return null}function h(a){a.dataTransfer.dropEffect=null!=t?"move":"copy";a.stopPropagation();a.preventDefault()}function l(b){b.stopPropagation();b.preventDefault();C=!1;x=k(b);if(null!=t)null!=x&&x<p.children.length?(m.splice(x>t?x-1:x,0,m.splice(t,1)[0]),p.insertBefore(p.children[t],p.children[x])):
(m.push(m.splice(t,1)[0]),p.appendChild(p.children[t]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,D(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){e(c,null,0,0,a.width,a.height);p.scrollTop=p.scrollHeight})}b.stopPropagation();b.preventDefault()}
var m=[];c=document.createElement("div");c.style.height="100%";var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="40px";c.appendChild(n);mxUtils.write(n,mxResources.get("filename")+":");null==b&&(b=a.defaultLibraryName+".xml");var u=document.createElement("input");u.setAttribute("value",b);u.style.marginRight="20px";u.style.marginLeft="10px";u.style.width="500px";null==f||f.isRenamable()||u.setAttribute("disabled","true");this.init=function(){if(null==f||f.isRenamable())u.focus(),
mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};n.appendChild(u);var p=document.createElement("div");p.style.borderWidth="1px 0px 1px 0px";p.style.borderColor="#d3d3d3";p.style.borderStyle="solid";p.style.marginTop="6px";p.style.overflow="auto";p.style.height="340px";p.style.backgroundPosition="center center";p.style.backgroundRepeat="no-repeat";0==m.length&&Graph.fileSupport&&(p.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"));c.appendChild(q);var v={},t=null,x=null,w=null;b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=w&&(w(),w=null,mxEvent.consume(a))};mxEvent.addListener(p,"mousedown",b);mxEvent.addListener(p,"pointerdown",b);mxEvent.addListener(p,"touchstart",
b);var y=new mxUrlConverter,C=!1;if(null!=d)for(b=0;b<d.length;b++)n=d[b],e(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(p,"dragleave",function(a){q.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==p||b==q){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var D=function(b){return function(c,d,h,l,f,g,m,v,n){null!=n&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,n.name)?a.parseFile(n,mxUtils.bind(this,function(c){4==c.readyState&&
(a.spinner.stop(),200<=c.status&&299>=c.status&&(e(c.responseText,d,h,l,f,g,m,"fixed",mxEvent.isAltDown(b)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),p.scrollTop=p.scrollHeight))})):(e(c,d,h,l,f,g,m,"fixed",mxEvent.isAltDown(b)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),p.scrollTop=p.scrollHeight)}};mxEvent.addListener(p,"dragover",h);mxEvent.addListener(p,"drop",l);mxEvent.addListener(q,"dragover",h);mxEvent.addListener(q,"drop",l);c.appendChild(p);d=document.createElement("div");
d.style.textAlign="right";d.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&d.appendChild(b);window.chrome&&chrome.app&&chrome.app.runtime?u.setAttribute("disabled","disabled"):(n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(m),c=u.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):
(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")}),n.setAttribute("id","btnDownload"),n.className="geBtn",d.appendChild(n));var z=document.createElement("input");z.setAttribute("multiple","multiple");z.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(z,"change",function(b){C=!1;a.importFiles(z.files,0,0,a.maxImageSize,function(a,c,d,e,h,l,f,g,m){D(b)(a,c,d,e,h,l,f,g,m);z.value=""});p.scrollTop=
p.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=w&&(w(),w=null);z.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",d.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=w&&(w(),w=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){C=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}e(a,null,0,0,b,c);p.scrollTop=p.scrollHeight}})});
n.setAttribute("id","btnAddImageUrl");n.className="geBtn";d.appendChild(n);this.saveBtnClickHandler=function(b,c,d,e){a.saveLibrary(b,c,d,e)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=w&&(w(),w=null);this.saveBtnClickHandler(u.value,m,f,g)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";d.appendChild(n);a.editor.cancelFirst||d.appendChild(b);c.appendChild(d);this.container=c},EditShapeDialog=function(a,b,c,d,f){d=null!=d?d:300;f=null!=f?f:120;var g,
k,e=document.createElement("table"),h=document.createElement("tbody");e.style.cellPadding="4px";g=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,c);g.appendChild(k);h.appendChild(g);g=document.createElement("tr");k=document.createElement("td");var l=document.createElement("textarea");l.style.outline="none";l.style.resize="none";l.style.width=d-200+"px";l.style.height=f+"px";this.textarea=l;this.init=function(){l.focus();
l.scrollTop=0};k.appendChild(l);g.appendChild(k);k=document.createElement("td");c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.top="6px";c.style.width="200px";c.style.height=f+4+"px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);k.appendChild(c);var m=new Graph(c);m.setEnabled(!1);var n=a.editor.graph.cloneCells([b])[0];m.addCells([n]);c=m.view.getState(n);var t="";null!=c.shape&&null!=c.shape.stencil&&(t=mxUtils.getPrettyXml(c.shape.stencil.desc));
mxUtils.write(l,t||"");c=m.getGraphBounds();f=Math.min(160/c.width,(f-40)/c.height);m.view.scaleAndTranslate(f,20/f-c.x,20/f-c.y);g.appendChild(k);h.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";a.editor.cancelFirst&&k.appendChild(f);a.isOffline()||(c=mxUtils.button(mxResources.get("help"),
function(){window.open("https://desk.draw.io/support/solutions/articles/16000052874")}),c.className="geBtn",k.appendChild(c));var q=function(b,c,d){var e=l.value,h=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(h.documentElement),h=h.documentElement.getElementsByTagName("parsererror");if(null!=h&&0<h.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),h=!b.model.contains(c),!d||h||e!=t){e=a.editor.graph.compress(e);b.getModel().beginUpdate();
try{if(h){var f=a.editor.graph.getInsertPoint();c.geometry.x=f.x;c.geometry.y=f.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+e+")",[c])}catch(C){throw C;}finally{b.getModel().endUpdate()}h&&b.setSelectionCell(c)}};c=mxUtils.button(mxResources.get("preview"),function(){q(m,n,!1)});c.className="geBtn";k.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,b,!0)});c.className="geBtn gePrimaryBtn";k.appendChild(c);a.editor.cancelFirst||k.appendChild(f);
l.scrollTop=0};k.appendChild(l);g.appendChild(k);k=document.createElement("td");c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.top="6px";c.style.width="200px";c.style.height=f+4+"px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);k.appendChild(c);var m=new Graph(c);m.setEnabled(!1);var n=a.editor.graph.cloneCells([b])[0];m.addCells([n]);c=m.view.getState(n);var u="";null!=c.shape&&null!=c.shape.stencil&&(u=mxUtils.getPrettyXml(c.shape.stencil.desc));
mxUtils.write(l,u||"");c=m.getGraphBounds();f=Math.min(160/c.width,(f-40)/c.height);m.view.scaleAndTranslate(f,20/f-c.x,20/f-c.y);g.appendChild(k);h.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";a.editor.cancelFirst&&k.appendChild(f);a.isOffline()||(c=mxUtils.button(mxResources.get("help"),
function(){window.open("https://desk.draw.io/support/solutions/articles/16000052874")}),c.className="geBtn",k.appendChild(c));var p=function(b,c,d){var e=l.value,h=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(h.documentElement),h=h.documentElement.getElementsByTagName("parsererror");if(null!=h&&0<h.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),h=!b.model.contains(c),!d||h||e!=u){e=a.editor.graph.compress(e);b.getModel().beginUpdate();
try{if(h){var f=a.editor.graph.getInsertPoint();c.geometry.x=f.x;c.geometry.y=f.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+e+")",[c])}catch(C){throw C;}finally{b.getModel().endUpdate()}h&&b.setSelectionCell(c)}};c=mxUtils.button(mxResources.get("preview"),function(){p(m,n,!1)});c.className="geBtn";k.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){p(a.editor.graph,b,!0)});c.className="geBtn gePrimaryBtn";k.appendChild(c);a.editor.cancelFirst||k.appendChild(f);
g.appendChild(k);h.appendChild(g);e.appendChild(h);this.container=e},CustomDialog=function(a,b,c,d,f,g){var k=document.createElement("div");k.appendChild(b);b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="right";var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d()});e.className="geBtn";a.editor.cancelFirst&&b.appendChild(e);if(!a.isOffline()&&null!=g){var h=mxUtils.button(mxResources.get("help"),function(){window.open(g)});h.className="geBtn";
b.appendChild(h)}f=mxUtils.button(f||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c()});b.appendChild(f);f.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(e);k.appendChild(b);this.cancelBtn=e;this.okButton=f;this.container=k};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
@ -7634,7 +7634,7 @@ b=0;b<a.plugins.length;b++)mxscript(a.plugins[b])}};Editor.prototype.editButtonL
null!=d&&0<d.length&&(c=d[0]);throw{message:mxUtils.getTextContent(c)};}if("mxGraphModel"==b.nodeName){c=b.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=c&&""!=c)c!=this.graph.currentStyle&&(d=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+"/"+c+".xml").getDocumentElement(),null!=d&&(e=new mxCodec(d.ownerDocument),e.decode(d,this.graph.getStylesheet())));else if(d=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),
null!=d){var e=new mxCodec(d.ownerDocument);e.decode(d,this.graph.getStylesheet())}this.graph.currentStyle=c;this.graph.mathEnabled="1"==urlParams.math||"1"==b.getAttribute("math");c=b.getAttribute("backgroundImage");null!=c?(c=JSON.parse(c),this.graph.setBackgroundImage(new mxImage(c.src,c.width,c.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;this.graph.setShadowVisible("1"==b.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||
"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=b.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?
"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(y){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==
"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(x){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==
typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),d=[];if(null!=c&&0<c.length)for(var e=0;e<c.length;e++)if("mxgraph"==c[e].getAttribute("class")){d.push(c[e]);break}0<d.length&&(c=d[0].getAttribute("data-mxgraph"),null!=c?(d=JSON.parse(c),null!=d&&null!=d.xml&&(d=mxUtils.parseXml(d.xml),a=d.documentElement)):(d=d[0].getElementsByTagName("div"),0<d.length&&(c=mxUtils.getTextContent(d[0]),c=this.graph.decompress(c),0<c.length&&(d=mxUtils.parseXml(c),a=d.documentElement))))}if(null!=a&&
"svg"==a.nodeName)if(c=a.getAttribute("content"),null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)a=mxUtils.parseXml(c).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||b||(d=null,"diagram"==a.nodeName?d=a:"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),0<c.length&&(d=c[Math.max(0,Math.min(c.length-1,urlParams.page||0))])),null!=d&&
(c=this.graph.decompress(mxUtils.getTextContent(d)),null!=c&&0<c.length&&(a=mxUtils.parseXml(c).documentElement)));null==a||"mxGraphModel"==a.nodeName||b&&"mxfile"==a.nodeName||(a=null);return a};var c=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled?!0:this.originalNoForeignObject;c.apply(this,arguments)};Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
@ -7660,7 +7660,7 @@ function(a){this.editorUi.actions.get("editShape").funct()})),b.setAttribute("ti
(c.style.width="100px",b.style.width="100px",b.style.marginLeft="2px"),a.appendChild(b));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.edgeMode="move"!=urlParams.edge;var n=Graph.prototype.init;Graph.prototype.init=function(){function a(a){b=a;if(mxClient.IS_QUIRKS||
7==document.documentMode||8==document.documentMode)b=mxUtils.clone(a)}n.apply(this,arguments);var b=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){b=null});this.isMouseInsertPoint=function(){return null!=b};var c=this.getInsertPoint;this.getInsertPoint=function(){return null!=b?this.getPointForEvent(b):c.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=
function(a){var b=this.graph.view.getState(a),b=null!=b?b.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==b.childLayout){var c=new mxStackLayout(this.graph,!1);c.setChildGeometry=function(a,b){b.height=Math.max(b.height,20);if(1<b.height/20){var c=b.height%20;b.height+=10<c?20-c:-c}this.graph.getModel().setGeometry(a,b)};c.fill=!0;c.unitSize=mxRackContainer.unitSize|20;c.marginLeft=b.marginLeft||0;c.marginRight=b.marginRight||0;c.marginTop=b.marginTop||0;c.marginBottom=
b.marginBottom||0;c.resizeParent=!1;return c}return d.apply(this,arguments)}};var t=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){t.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;var d=a.ownerDocument,e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"filter"):d.createElement("filter");e.setAttribute("id",
b.marginBottom||0;c.resizeParent=!1;return c}return d.apply(this,arguments)}};var u=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){u.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.isPageLink=function(a){return null!=a&&"data:page/"==a.substring(0,10)};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;var d=a.ownerDocument,e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"filter"):d.createElement("filter");e.setAttribute("id",
this.shadowId);var h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):d.createElement("feGaussianBlur");h.setAttribute("in","SourceAlpha");h.setAttribute("stdDeviation","1.7");h.setAttribute("result","blur");e.appendChild(h);h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feOffset"):d.createElement("feOffset");h.setAttribute("in","blur");h.setAttribute("dx","3");h.setAttribute("dy","3");h.setAttribute("result","offsetBlur");e.appendChild(h);h=null!=d.createElementNS?
d.createElementNS(mxConstants.NS_SVG,"feFlood"):d.createElement("feFlood");h.setAttribute("flood-color","#3D4574");h.setAttribute("flood-opacity","0.4");h.setAttribute("result","offsetColor");e.appendChild(h);h=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feComposite"):d.createElement("feComposite");h.setAttribute("in","offsetColor");h.setAttribute("in2","offsetBlur");h.setAttribute("operator","in");h.setAttribute("result","offsetBlur");e.appendChild(h);h=null!=d.createElementNS?
d.createElementNS(mxConstants.NS_SVG,"feBlend"):d.createElement("feBlend");h.setAttribute("in","SourceGraphic");h.setAttribute("in2","offsetBlur");e.appendChild(h);h=a.getElementsByTagName("defs");0==h.length?(d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"defs"):d.createElement("defs"),null!=a.firstChild?a.insertBefore(d,a.firstChild):a.appendChild(d)):d=h[0];d.appendChild(e);c||((b||a.getElementsByTagName("g")[0]).setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||
@ -7672,23 +7672,23 @@ mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.lib
[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",
STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];
mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};
var q=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,d,e,h,l,f,g,m){if(null!=c&&null==mxMarker.markers[c]){var n=this.getPackageForType(c);null!=n&&mxStencilRegistry.getStencil(n)}return q.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){t.value=Math.max(1,Math.min(f,Math.max(parseInt(t.value),parseInt(k.value))));k.value=Math.max(1,Math.min(f,Math.min(parseInt(t.value),parseInt(k.value))))}function d(b){function c(b,c,e){var h=b.getGraphBounds(),l=0,f=0,
g=V.get(),m=1/b.pageScale,n=I.checked;if(n)var m=parseInt(O.value),w=parseInt(R.value),m=Math.min(g.height*w/(h.height/b.view.scale),g.width*m/(h.width/b.view.scale));else m=parseInt(K.value)/(100*b.pageScale),isNaN(m)&&(d=1/b.pageScale,K.value="100 %");g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*d);g.height=Math.ceil(g.height*d);m*=d;!n&&b.pageVisible?(h=b.getPageLayout(),l-=h.x*g.width,f-=h.y*g.height):n=!0;if(null==c){c=PrintDialog.createPrintPreview(b,m,g,0,l,f,n);c.pageSelector=
!1;c.mathEnabled=!1;var u=c.writeHead;c.writeHead=function(b){u.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var k=c.renderPage;c.renderPage=function(a,b,c,d,e,h){var l=k.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:l.className="geDisableMathJax";return l}}c.open(null,null,e,!0)}else{g=b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=
g;c.autoOrigin=n;c.appendGraph(b,m,l,f,e,!0)}return c}var d=parseInt(S.value)/100;isNaN(d)&&(d=1,S.value="100 %");var d=.75*d,h=k.value,l=t.value,f=!n.checked,m=null;f&&(f=h==g&&l==g);if(!f&&null!=a.pages&&a.pages.length){var w=0,f=a.pages.length-1;n.checked||(w=parseInt(h)-1,f=parseInt(l)-1);for(var u=w;u<=f;u++){var q=a.pages[u],h=q==a.currentPage?e:null;if(null==h){var h=a.createTemporaryGraph(e.getStylesheet()),l=!0,w=!1,y=null,p=null;null==q.viewState&&null==q.mapping&&null==q.root&&a.updatePageRoot(q);
null!=q.viewState?(l=q.viewState.pageVisible,w=q.viewState.mathEnabled,y=q.viewState.background,p=q.viewState.backgroundImage):null!=q.mapping&&null!=q.mapping.diagramMap&&(w="0"!=q.mapping.diagramMap.get("mathEnabled"),y=q.mapping.diagramMap.get("background"),p=q.mapping.diagramMap.get("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null);h.background=y;h.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height):null;h.pageVisible=l;h.mathEnabled=w;var v=h.getGlobalVariable;h.getGlobalVariable=
function(a){return"page"==a?q.getName():"pagenumber"==a?u+1:v.apply(this,arguments)};document.body.appendChild(h.container);a.updatePageRoot(q);h.model.setRoot(q.root)}m=c(h,m,u!=f);h!=e&&h.container.parentNode.removeChild(h.container)}}else m=c(e);m.mathEnabled&&(f=m.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),f.writeln("MathJax.Hub.Config({"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
var p=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,d,e,h,l,f,g,m){if(null!=c&&null==mxMarker.markers[c]){var n=this.getPackageForType(c);null!=n&&mxStencilRegistry.getStencil(n)}return p.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){u.value=Math.max(1,Math.min(f,Math.max(parseInt(u.value),parseInt(k.value))));k.value=Math.max(1,Math.min(f,Math.min(parseInt(u.value),parseInt(k.value))))}function d(b){function c(b,c,e){var h=b.getGraphBounds(),l=0,f=0,
m=V.get(),g=1/b.pageScale,n=K.checked;if(n)var g=parseInt(O.value),v=parseInt(R.value),g=Math.min(m.height*v/(h.height/b.view.scale),m.width*g/(h.width/b.view.scale));else g=parseInt(I.value)/(100*b.pageScale),isNaN(g)&&(d=1/b.pageScale,I.value="100 %");m=mxRectangle.fromRectangle(m);m.width=Math.ceil(m.width*d);m.height=Math.ceil(m.height*d);g*=d;!n&&b.pageVisible?(h=b.getPageLayout(),l-=h.x*m.width,f-=h.y*m.height):n=!0;if(null==c){c=PrintDialog.createPrintPreview(b,g,m,0,l,f,n);c.pageSelector=
!1;c.mathEnabled=!1;var t=c.writeHead;c.writeHead=function(b){t.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var k=c.renderPage;c.renderPage=function(a,b,c,d,e,h){var l=k.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:l.className="geDisableMathJax";return l}}c.open(null,null,e,!0)}else{m=b.background;if(null==m||""==m||m==mxConstants.NONE)m="#ffffff";c.backgroundColor=
m;c.autoOrigin=n;c.appendGraph(b,g,l,f,e,!0)}return c}var d=parseInt(S.value)/100;isNaN(d)&&(d=1,S.value="100 %");var d=.75*d,h=k.value,l=u.value,f=!n.checked,m=null;f&&(f=h==g&&l==g);if(!f&&null!=a.pages&&a.pages.length){var v=0,f=a.pages.length-1;n.checked||(v=parseInt(h)-1,f=parseInt(l)-1);for(var t=v;t<=f;t++){var p=a.pages[t],h=p==a.currentPage?e:null;if(null==h){var h=a.createTemporaryGraph(e.getStylesheet()),l=!0,v=!1,x=null,q=null;null==p.viewState&&null==p.mapping&&null==p.root&&a.updatePageRoot(p);
null!=p.viewState?(l=p.viewState.pageVisible,v=p.viewState.mathEnabled,x=p.viewState.background,q=p.viewState.backgroundImage):null!=p.mapping&&null!=p.mapping.diagramMap&&(v="0"!=p.mapping.diagramMap.get("mathEnabled"),x=p.mapping.diagramMap.get("background"),q=p.mapping.diagramMap.get("backgroundImage"),q=null!=q&&0<q.length?JSON.parse(q):null);h.background=x;h.backgroundImage=null!=q?new mxImage(q.src,q.width,q.height):null;h.pageVisible=l;h.mathEnabled=v;var w=h.getGlobalVariable;h.getGlobalVariable=
function(a){return"page"==a?p.getName():"pagenumber"==a?t+1:w.apply(this,arguments)};document.body.appendChild(h.container);a.updatePageRoot(p);h.model.setRoot(p.root)}m=c(h,m,t!=f);h!=e&&h.container.parentNode.removeChild(h.container)}}else m=c(e);m.mathEnabled&&(f=m.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),f.writeln("MathJax.Hub.Config({"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
f.writeln("TeX: {"),f.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),f.writeln("},"),f.writeln("tex2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("},"),f.writeln("asciimath2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("}"),f.writeln("});"),b&&(f.writeln("MathJax.Hub.Queue(function () {"),f.writeln("window.print();"),f.writeln("});")),f.writeln("\x3c/script>"),f.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));
m.closeDocument();!m.mathEnabled&&b&&PrintDialog.printPreview(m)}var e=a.editor.graph,h=document.createElement("div"),l=document.createElement("h3");l.style.width="100%";l.style.textAlign="center";l.style.marginTop="0px";mxUtils.write(l,b||mxResources.get("print"));h.appendChild(l);var f=1,g=1,m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";
n.setAttribute("value","all");n.setAttribute("type","radio");n.setAttribute("name","pages-printdialog");m.appendChild(n);l=document.createElement("span");mxUtils.write(l,mxResources.get("printAllPages"));m.appendChild(l);mxUtils.br(m);var w=n.cloneNode(!0);n.setAttribute("checked","checked");w.setAttribute("value","range");m.appendChild(w);l=document.createElement("span");mxUtils.write(l,mxResources.get("pages")+":");m.appendChild(l);var k=document.createElement("input");k.style.cssText="margin:0 8px 0 8px;";
k.setAttribute("value","1");k.setAttribute("type","number");k.setAttribute("min","1");k.style.width="50px";m.appendChild(k);l=document.createElement("span");mxUtils.write(l,mxResources.get("to"));m.appendChild(l);var t=k.cloneNode(!0);m.appendChild(t);mxEvent.addListener(k,"focus",function(){w.checked=!0});mxEvent.addListener(t,"focus",function(){w.checked=!0});mxEvent.addListener(k,"change",c);mxEvent.addListener(t,"change",c);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]){g=l+1;k.value=g;t.value=g;break}k.setAttribute("max",f);t.setAttribute("max",f);1<f&&h.appendChild(m);var q=document.createElement("div");q.style.marginBottom="10px";var p=document.createElement("input");p.style.marginRight="8px";p.setAttribute("value","adjust");p.setAttribute("type","radio");p.setAttribute("name","printZoom");q.appendChild(p);l=document.createElement("span");mxUtils.write(l,mxResources.get("adjustTo"));q.appendChild(l);var K=document.createElement("input");K.style.cssText=
"margin:0 8px 0 8px;";K.setAttribute("value","100 %");K.style.width="50px";q.appendChild(K);mxEvent.addListener(K,"focus",function(){p.checked=!0});h.appendChild(q);var m=m.cloneNode(!1),I=p.cloneNode(!0);I.setAttribute("value","fit");p.setAttribute("checked","checked");l=document.createElement("div");l.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";l.appendChild(I);m.appendChild(l);q=document.createElement("table");q.style.display="inline-block";var T=document.createElement("tbody"),
n.setAttribute("value","all");n.setAttribute("type","radio");n.setAttribute("name","pages-printdialog");m.appendChild(n);l=document.createElement("span");mxUtils.write(l,mxResources.get("printAllPages"));m.appendChild(l);mxUtils.br(m);var v=n.cloneNode(!0);n.setAttribute("checked","checked");v.setAttribute("value","range");m.appendChild(v);l=document.createElement("span");mxUtils.write(l,mxResources.get("pages")+":");m.appendChild(l);var k=document.createElement("input");k.style.cssText="margin:0 8px 0 8px;";
k.setAttribute("value","1");k.setAttribute("type","number");k.setAttribute("min","1");k.style.width="50px";m.appendChild(k);l=document.createElement("span");mxUtils.write(l,mxResources.get("to"));m.appendChild(l);var u=k.cloneNode(!0);m.appendChild(u);mxEvent.addListener(k,"focus",function(){v.checked=!0});mxEvent.addListener(u,"focus",function(){v.checked=!0});mxEvent.addListener(k,"change",c);mxEvent.addListener(u,"change",c);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]){g=l+1;k.value=g;u.value=g;break}k.setAttribute("max",f);u.setAttribute("max",f);1<f&&h.appendChild(m);var p=document.createElement("div");p.style.marginBottom="10px";var q=document.createElement("input");q.style.marginRight="8px";q.setAttribute("value","adjust");q.setAttribute("type","radio");q.setAttribute("name","printZoom");p.appendChild(q);l=document.createElement("span");mxUtils.write(l,mxResources.get("adjustTo"));p.appendChild(l);var I=document.createElement("input");I.style.cssText=
"margin:0 8px 0 8px;";I.setAttribute("value","100 %");I.style.width="50px";p.appendChild(I);mxEvent.addListener(I,"focus",function(){q.checked=!0});h.appendChild(p);var m=m.cloneNode(!1),K=q.cloneNode(!0);K.setAttribute("value","fit");q.setAttribute("checked","checked");l=document.createElement("div");l.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";l.appendChild(K);m.appendChild(l);p=document.createElement("table");p.style.display="inline-block";var T=document.createElement("tbody"),
L=document.createElement("tr"),N=L.cloneNode(!0),Q=document.createElement("td"),J=Q.cloneNode(!0),W=Q.cloneNode(!0),P=Q.cloneNode(!0),Y=Q.cloneNode(!0),U=Q.cloneNode(!0);Q.style.textAlign="right";P.style.textAlign="right";mxUtils.write(Q,mxResources.get("fitTo"));var O=document.createElement("input");O.style.cssText="margin:0 8px 0 8px;";O.setAttribute("value","1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";J.appendChild(O);l=document.createElement("span");mxUtils.write(l,
mxResources.get("fitToSheetsAcross"));W.appendChild(l);mxUtils.write(P,mxResources.get("fitToBy"));var R=O.cloneNode(!0);Y.appendChild(R);mxEvent.addListener(O,"focus",function(){I.checked=!0});mxEvent.addListener(R,"focus",function(){I.checked=!0});l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsDown"));U.appendChild(l);L.appendChild(Q);L.appendChild(J);L.appendChild(W);N.appendChild(P);N.appendChild(Y);N.appendChild(U);T.appendChild(L);T.appendChild(N);q.appendChild(T);
m.appendChild(q);h.appendChild(m);m=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));m.appendChild(l);l=document.createElement("div");l.style.marginBottom="12px";var V=PageSetupDialog.addPageFormatPanel(l,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);m.appendChild(l);l=document.createElement("span");mxUtils.write(l,mxResources.get("pageScale"));m.appendChild(l);
var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","100 %");S.style.width="60px";m.appendChild(S);h.appendChild(m);l=document.createElement("div");l.style.cssText="text-align:right;margin:62px 0 0 0;";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst&&l.appendChild(m);a.isOffline()||(q=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),
q.className="geBtn",l.appendChild(q));PrintDialog.previewEnabled&&(q=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),q.className="geBtn",l.appendChild(q));q=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});q.className="geBtn gePrimaryBtn";l.appendChild(q);a.editor.cancelFirst||l.appendChild(m);h.appendChild(l);this.container=h}})();(function(){EditorUi.VERSION="6.8.17";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
mxResources.get("fitToSheetsAcross"));W.appendChild(l);mxUtils.write(P,mxResources.get("fitToBy"));var R=O.cloneNode(!0);Y.appendChild(R);mxEvent.addListener(O,"focus",function(){K.checked=!0});mxEvent.addListener(R,"focus",function(){K.checked=!0});l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsDown"));U.appendChild(l);L.appendChild(Q);L.appendChild(J);L.appendChild(W);N.appendChild(P);N.appendChild(Y);N.appendChild(U);T.appendChild(L);T.appendChild(N);p.appendChild(T);
m.appendChild(p);h.appendChild(m);m=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));m.appendChild(l);l=document.createElement("div");l.style.marginBottom="12px";var V=PageSetupDialog.addPageFormatPanel(l,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);m.appendChild(l);l=document.createElement("span");mxUtils.write(l,mxResources.get("pageScale"));m.appendChild(l);
var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","100 %");S.style.width="60px";m.appendChild(S);h.appendChild(m);l=document.createElement("div");l.style.cssText="text-align:right;margin:62px 0 0 0;";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst&&l.appendChild(m);a.isOffline()||(p=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),
p.className="geBtn",l.appendChild(p));PrintDialog.previewEnabled&&(p=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),p.className="geBtn",l.appendChild(p));p=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});p.className="geBtn gePrimaryBtn";l.appendChild(p);a.editor.cancelFirst||l.appendChild(m);h.appendChild(l);this.container=h}})();(function(){EditorUi.VERSION="6.8.18";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=
1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b,0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=
null!=c&&6<c.length}catch(n){}};b.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(m){}try{a=document.createElement("canvas");a.width=a.height=1;var c=a.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(m){}})();
@ -7698,15 +7698,15 @@ length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"#000",spee
2E9,l.style.left=Math.max(0,a)+"px",l.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(l.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(l.style,"boxShadow","2px 2px 3px 0px #ddd"),mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,-50%)"),l.innerHTML=h+"...",c.appendChild(l),d.status=l,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(l.style.left=Math.round(Math.max(0,a-l.offsetWidth/2))+"px",l.style.top=Math.round(Math.max(0,b+70-l.offsetHeight/2))+
"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,h)}));this.stop();return a}),l=!0);return l};var h=d.stop;d.stop=function(){h.call(this);this.active=!1;null!=d.status&&(d.status.parentNode.removeChild(d.status),d.status=null)};d.pause=function(){return function(){}};return d};EditorUi.parsePng=function(a,b,c){function d(a,b){var c=h;h+=b;return a.substring(c,h)}function e(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var h=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(d(a,4),"IHDR"!=d(a,4))null!=c&&c();else{d(a,17);do{c=e(a);var l=d(a,4);if(null!=b&&b(h-8,l,c))break;value=d(a,c);d(a,4);if("IEND"==l)break}while(c)}};EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(m){}return!1};
var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var d=b.indexOf("&lt;mxfile ");if(0<=d){var e=b.lastIndexOf("&lt;/mxfile&gt;");e>d&&(c=b.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(b),g=this.editor.extractGraphModel(f.documentElement,null!=this.pages),c=null!=g?mxUtils.getXml(g):""}catch(q){}return c};EditorUi.prototype.validateFileData=
var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var d=b.indexOf("&lt;mxfile ");if(0<=d){var e=b.lastIndexOf("&lt;/mxfile&gt;");e>d&&(c=b.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(b),g=this.editor.extractGraphModel(f.documentElement,null!=this.pages),c=null!=g?mxUtils.getXml(g):""}catch(p){}return c};EditorUi.prototype.validateFileData=
function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");
if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var f=this.updatePageRoot(new DiagramPage(d[e]));null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[e+1]));b.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])),b.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!=c)for(e=0;e<c.length;e++)b.model.execute(new ChangePage(this,c[e],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,f,g,k,p,w,u){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;w=null!=w?w:!0;var e,h=null;null==c||
c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?e="_blank":h=e=d;if(null==a)return"";var l=a;if("mxfile"!=l.nodeName.toLowerCase()){var m=b.zapGremlins(mxUtils.getXml(a)),l=b.compress(m);if(b.decompress(l)!=m)return m;m=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(m,l);l=a.ownerDocument.createElement("mxfile");l.appendChild(m)}u?(l=l.cloneNode(!0),l.removeAttribute("userAgent"),l.removeAttribute("version"),l.removeAttribute("editor"),l.removeAttribute("type")):(l.setAttribute("userAgent",
navigator.userAgent),l.setAttribute("version",EditorUi.VERSION),l.setAttribute("editor","www.draw.io"),a=null!=c?c.getMode():this.mode,null!=a&&l.setAttribute("type",a));a=mxUtils.getXml(l);if(!g&&!f&&(k||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(l),b,null!=c?c.getTitle():null,e,h);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,p,w,h);return a};EditorUi.prototype.getXmlFileData=
this.currentPage.setName(mxResources.get("pageWithNumber",[1])),b.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!=c)for(e=0;e<c.length;e++)b.model.execute(new ChangePage(this,c[e],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,f,g,k,q,v,t){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;v=null!=v?v:!0;var e,h=null;null==c||
c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?e="_blank":h=e=d;if(null==a)return"";var l=a;if("mxfile"!=l.nodeName.toLowerCase()){var m=b.zapGremlins(mxUtils.getXml(a)),l=b.compress(m);if(b.decompress(l)!=m)return m;m=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(m,l);l=a.ownerDocument.createElement("mxfile");l.appendChild(m)}t?(l=l.cloneNode(!0),l.removeAttribute("userAgent"),l.removeAttribute("version"),l.removeAttribute("editor"),l.removeAttribute("type")):(l.setAttribute("userAgent",
navigator.userAgent),l.setAttribute("version",EditorUi.VERSION),l.setAttribute("editor","www.draw.io"),a=null!=c?c.getMode():this.mode,null!=a&&l.setAttribute("type",a));a=mxUtils.getXml(l);if(!g&&!f&&(k||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(l),b,null!=c?c.getTitle():null,e,h);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,q,v,h);return a};EditorUi.prototype.getXmlFileData=
function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var e=0;e<this.pages.length;e++){var h=this.pages[e].mapping;this.currentPage!=this.pages[e]&&null!=h&&h.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(h.graphModel),
h.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[e].node,d),h.needsUpdate=!1);c.appendChild(this.pages[e].node)}}return c};EditorUi.prototype.getFileData=function(a,b,c,d,f,g,k,p){f=null!=f?f:!0;k=null!=k?k:this.getXmlFileData(f,null!=g?g:!1);g=this.editor.graph;var e=this.getCurrentFile();if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=e&&/(\.svg)$/i.test(e.getTitle()))){g=this.createTemporaryGraph(g.getStylesheet());
var h=g.getGlobalVariable,l=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:h.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(l.root)}a=this.createFileData(k,g,e,window.location.href,a,b,c,d,f,p);g!=this.editor.graph&&g.container.parentNode.removeChild(g.container);return a};EditorUi.prototype.getHtml=function(a,b,c,d,f,g){g=null!=g?g:!0;var e=null,h="https://www.draw.io/js/embed-static.min.js";if(null!=b){var e=g?b.getGraphBounds():
h.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[e].node,d),h.needsUpdate=!1);c.appendChild(this.pages[e].node)}}return c};EditorUi.prototype.getFileData=function(a,b,c,d,f,g,k,q){f=null!=f?f:!0;k=null!=k?k:this.getXmlFileData(f,null!=g?g:!1);g=this.editor.graph;var e=this.getCurrentFile();if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=e&&/(\.svg)$/i.test(e.getTitle()))){g=this.createTemporaryGraph(g.getStylesheet());
var h=g.getGlobalVariable,l=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:h.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(l.root)}a=this.createFileData(k,g,e,window.location.href,a,b,c,d,f,q);g!=this.editor.graph&&g.container.parentNode.removeChild(g.container);return a};EditorUi.prototype.getHtml=function(a,b,c,d,f,g){g=null!=g?g:!0;var e=null,h="https://www.draw.io/js/embed-static.min.js";if(null!=b){var e=g?b.getGraphBounds():
b.getBoundingBox(b.getSelectionCells()),l=b.view.scale;g=Math.floor(e.x/l-b.view.translate.x);l=Math.floor(e.y/l-b.view.translate.y);e=b.background;null==f&&(b=this.getBasenames().join(";"),0<b.length&&(h="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",g);a.setAttribute("y0",l)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=d&&a.setAttribute("edit",d));null!=
f&&(f=f.replace(/&/g,"&amp;"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";d=this.editor.graph.compress(a);this.editor.graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=f?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==f?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=f?
'<meta http-equiv="refresh" content="0;URL=\''+f+"'\"/>\n":"")+"</head>\n<body"+(null==f&&null!=e&&e!=mxConstants.NONE?' style="background-color:'+e+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+"</div>\n</div>\n"+(null==f?'<script type="text/javascript" src="'+h+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+f+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+
@ -7717,35 +7717,35 @@ f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![end
b&&(this.fileNode=b.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(b.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(b);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(){var a=this.getCurrentFile(),a=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||
/(\.svg)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));return a};EditorUi.prototype.downloadFile=function(a,b,c,d,f,g){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var e=this.getBaseFilename(),h=e+"."+a;if("xml"==a){var l='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,f));this.saveData(h,a,l,"text/xml")}else if("html"==a)l=this.getHtml2(this.getFileData(!0),this.editor.graph,e),this.saveData(h,a,l,"text/html");
else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?h=e+".png":"jpeg"==a&&(h=e+".jpg"),this.saveRequest(h,a,mxUtils.bind(this,function(b,c){try{var e=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var h=this.createDownloadRequest(b,a,d,c);this.editor.graph.pageVisible=e;return h}catch(A){this.handleError(A)}}));else{var m=null,n=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",a,"image/svg+xml"):
this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(m)}))});if("svg"==a){var k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);var t=this.editor.graph.getSvg(k,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(t);this.convertImages(t,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();n('<?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'+
this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(m)}))});if("svg"==a){var k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);var u=this.editor.graph.getSvg(k,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(u);this.convertImages(u,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();n('<?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 h=e+".svg",m=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();n(a)}),d)}}catch(C){this.handleError(C)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d){var e=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=b);var h="";if(e.width*e.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==b&&(e="1",b="png",null!=this.pages&&null!=this.currentPage))for(var l=
0;l<this.pages.length;l++)if(this.pages[l]==this.currentPage){h="&from="+l;break}return new mxXmlRequest(EXPORT_URL,"format="+b+h+"&base64="+d+"&embedXml="+e+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.fileLoaded=function(a){var b=!1;this.hideDialog();var c=this.getCurrentFile();this.setCurrentFile(null);null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);
a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);this.descriptorChanged();a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("readOnly"))));this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():(this.editor.graph.selectUnlockedLayer(),
this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus());this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));b=!0;if(this.enableLogging&&!this.isOffline()&&null!=a.getMode())try{var e=new Image,f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e.src=f+"/log?msg=storageMode:"+encodeURIComponent(a.getMode())+"&v="+encodeURIComponent(EditorUi.VERSION)}catch(q){}if(this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&
null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),mode:a.getMode()})}catch(q){}}catch(q){null!=window.console&&console.log("error in fileLoaded:",a,q);if(this.enableLogging&&!this.isOffline())try{e=new Image,f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"",e.src=f+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=q&&null!=q.message?":err:"+encodeURIComponent(q.message):"")+(null!=q&&null!=q.stack?
"&stack="+encodeURIComponent(q.stack):"")}catch(p){}this.handleError(q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?c.constructor==DriveFile?this.loadFile(c.getHash()):this.fileLoaded(c):d()}))}else d();return b};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,f,g,k){};EditorUi.prototype.toggleScratchpad=
this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus());this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));b=!0;if(this.enableLogging&&!this.isOffline()&&null!=a.getMode())try{var e=new Image,f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e.src=f+"/log?msg=storageMode:"+encodeURIComponent(a.getMode())+"&v="+encodeURIComponent(EditorUi.VERSION)}catch(p){}if(this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&
null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),mode:a.getMode()})}catch(p){}}catch(p){null!=window.console&&console.log("error in fileLoaded:",a,p);if(this.enableLogging&&!this.isOffline())try{e=new Image,f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"",e.src=f+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=p&&null!=p.message?":err:"+encodeURIComponent(p.message):"")+(null!=p&&null!=p.stack?
"&stack="+encodeURIComponent(p.stack):"")}catch(q){}this.handleError(p,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?c.constructor==DriveFile?this.loadFile(c.getHash()):this.fileLoaded(c):d()}))}else d();return b};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,f,g,k){};EditorUi.prototype.toggleScratchpad=
function(){if(isLocalStorage||mxClient.IS_CHROMEAPP)null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad)};EditorUi.prototype.createLibraryDataFromImages=function(a){var b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);return mxUtils.getXml(b)};EditorUi.prototype.closeLibrary=
function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];
null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){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 e=null,h=mxUtils.bind(this,function(b,c){if(0==b.length&&a.isEditable())null==e&&(e=document.createElement("div"),mxUtils.setPrefixedStyle(e.style,"borderRadius",
"6px"),e.style.border="3px dotted lightGray",e.style.textAlign="center",e.style.padding="8px",e.style.color="#B3B3B3",mxUtils.write(e,mxResources.get("dragElementsHere"))),c.appendChild(e);else for(var d=0;d<b.length;d++){var h=b[d],f=h.data;if(null!=f){var f=this.convertDataUri(f),l="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==h.aspect&&(l+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(l+"image="+f,h.w,h.h,"",h.title||"",!1,!1,!1))}else null!=
h.xml&&(f=this.stringToCells(this.editor.graph.decompress(h.xml)),0<f.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(f,h.w,h.h,h.title||"",!0,!1,!1)))}});c=null!=c&&0<c.length?c:a.getTitle();var f=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){h(b,a)}));this.repositionLibrary(d);var l=f.parentNode.previousSibling;c=l.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var g=document.createElement("div");
g.style.position="absolute";g.style.right="0px";g.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(g.style.backgroundColor="inherit");l.style.position="relative";var u=document.createElement("img");u.setAttribute("src",Dialog.prototype.closeImage);u.setAttribute("title",mxResources.get("close"));u.setAttribute("align","top");u.setAttribute("border","0");u.className="geButton";u.style.marginRight="1px";u.style.marginTop="-1px";g.appendChild(u);var k=null;mxEvent.addListener(u,"click",
mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=k?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(a){mxEvent.getSource(a)==f?f.setAttribute("title",mxResources.get("libraryTooltip")):f.removeAttribute("title")}));if(a.isEditable()){var v=this.editor.graph,x=mxUtils.bind(this,
function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=B&&null!=B.parentNode&&B.parentNode.removeChild(B),B=u.cloneNode(!1),B.setAttribute("src",Editor.spinImage),B.setAttribute("title",mxResources.get("saving")),B.style.cursor="default",B.style.marginRight="2px",B.style.marginTop="-2px",g.insertBefore(B,g.firstChild),l.style.paddingRight=18*g.childNodes.length+"px",this.saveLibrary(a.getTitle(),
b,a,a.getMode(),!0,!0,function(){null!=B&&null!=B.parentNode&&(B.parentNode.removeChild(B),l.style.paddingRight=18*g.childNodes.length+"px")})):null==k&&(k=u.cloneNode(!1),k.setAttribute("src",IMAGE_PATH+"/download.png"),k.setAttribute("title",mxResources.get("save")),g.insertBefore(k,g.firstChild),mxEvent.addListener(k,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==k||a.isModified()||(l.style.paddingRight=18*g.childNodes.length+
"px",k.parentNode.removeChild(k),k=null)});mxEvent.consume(c)})),l.style.paddingRight=18*g.childNodes.length+"px")}),D=mxUtils.bind(this,function(a,c,d,h){a=v.cloneCells(mxUtils.sortCells(v.model.getTopmostCells(a)));for(var l=0;l<a.length;l++){var g=v.getCellGeometry(a[l]);null!=g&&g.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,h||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};
null!=h&&(a.title=h);b.push(a);C(d);null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)}),z=mxUtils.bind(this,function(a){if(v.isSelectionEmpty())v.getRubberband().isActive()?(v.getRubberband().execute(a),v.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=v.getSelectionCells(),c=v.view.getBounds(b),d=v.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=v.view.translate.x;c.y-=v.view.translate.y;
D(b,c)}mxEvent.consume(a)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.panningManager&&null!=v.graphHandler.shape&&(v.graphHandler.shape.node.style.visibility="hidden",null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",v.panningManager.stop(),v.autoScroll=!1,null!=v.graphHandler.guide&&v.graphHandler.guide.setVisible(!1),null!=v.graphHandler.hint&&
(v.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.panningManager&&null!=v.graphHandler&&(f.style.border="3px solid transparent",null!=e&&(e.style.border="3px dotted lightGray"),f.style.cursor="default",this.sidebar.showTooltips=!0,v.panningManager.stop(),v.graphHandler.reset(),v.isMouseDown=!1,v.autoScroll=!0,z(a),mxEvent.consume(a))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.graphHandler.shape&&
(v.graphHandler.shape.node.style.visibility="visible",f.style.border="3px solid transparent",f.style.cursor="",v.autoScroll=!0,null!=v.graphHandler.guide&&v.graphHandler.guide.setVisible(!0),null!=v.graphHandler.hint&&(v.graphHandler.hint.style.visibility="visible"),null!=e&&(e.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(a){null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)";
a.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.border="3px solid transparent";f.style.cursor="";null!=e&&(e.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,l,g,m,n,k,u,w){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null);else{var q=!1,t=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var l=mxUtils.parseXml(c);if("mxlibrary"==l.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(l.documentElement));h(g,f);b=b.concat(g);C(a);
this.spinner.stop();q=!0}catch(V){}else if("mxfile"==l.documentElement.nodeName)try{for(var m=l.documentElement.getElementsByTagName("diagram"),l=0;l<m.length;l++){var g=mxUtils.getTextContent(m[l]),n=this.stringToCells(this.editor.graph.decompress(g)),k=this.editor.graph.getBoundingBoxFromGeometry(n);D(n,new mxRectangle(0,0,k.width,k.height),a)}q=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}q||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)});!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,k)&&null!=w?this.parseFile(w,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?t(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):t(c,d)}}));a.stopPropagation();a.preventDefault()})),
mxEvent.addListener(f,"dragleave",function(a){null!=e?e.style.border="3px dotted lightGray":(f.style.border="3px solid transparent",f.style.cursor="");a.stopPropagation();a.preventDefault()}));u=u.cloneNode(!1);u.setAttribute("src",IMAGE_PATH+"/edit.gif");u.setAttribute("title",mxResources.get("edit"));g.insertBefore(u,g.firstChild);mxEvent.addListener(u,"click",x);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&x(a)});u=u.cloneNode(!1);u.setAttribute("src",Editor.plusImage);
u.setAttribute("title",mxResources.get("add"));g.insertBefore(u,g.firstChild);this.isOffline()||".scratchpad"!=a.title||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){window.open("https://desk.draw.io/support/solutions/articles/16000042367");mxEvent.consume(a)})),g.insertBefore(c,g.firstChild));var B=null;mxEvent.addListener(u,
g.style.position="absolute";g.style.right="0px";g.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(g.style.backgroundColor="inherit");l.style.position="relative";var t=document.createElement("img");t.setAttribute("src",Dialog.prototype.closeImage);t.setAttribute("title",mxResources.get("close"));t.setAttribute("align","top");t.setAttribute("border","0");t.className="geButton";t.style.marginRight="1px";t.style.marginTop="-1px";g.appendChild(t);var k=null;mxEvent.addListener(t,"click",
mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=k?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(a){mxEvent.getSource(a)==f?f.setAttribute("title",mxResources.get("libraryTooltip")):f.removeAttribute("title")}));if(a.isEditable()){var w=this.editor.graph,y=mxUtils.bind(this,
function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=B&&null!=B.parentNode&&B.parentNode.removeChild(B),B=t.cloneNode(!1),B.setAttribute("src",Editor.spinImage),B.setAttribute("title",mxResources.get("saving")),B.style.cursor="default",B.style.marginRight="2px",B.style.marginTop="-2px",g.insertBefore(B,g.firstChild),l.style.paddingRight=18*g.childNodes.length+"px",this.saveLibrary(a.getTitle(),
b,a,a.getMode(),!0,!0,function(){null!=B&&null!=B.parentNode&&(B.parentNode.removeChild(B),l.style.paddingRight=18*g.childNodes.length+"px")})):null==k&&(k=t.cloneNode(!1),k.setAttribute("src",IMAGE_PATH+"/download.png"),k.setAttribute("title",mxResources.get("save")),g.insertBefore(k,g.firstChild),mxEvent.addListener(k,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==k||a.isModified()||(l.style.paddingRight=18*g.childNodes.length+
"px",k.parentNode.removeChild(k),k=null)});mxEvent.consume(c)})),l.style.paddingRight=18*g.childNodes.length+"px")}),D=mxUtils.bind(this,function(a,c,d,h){a=w.cloneCells(mxUtils.sortCells(w.model.getTopmostCells(a)));for(var l=0;l<a.length;l++){var g=w.getCellGeometry(a[l]);null!=g&&g.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,h||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};
null!=h&&(a.title=h);b.push(a);C(d);null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)}),z=mxUtils.bind(this,function(a){if(w.isSelectionEmpty())w.getRubberband().isActive()?(w.getRubberband().execute(a),w.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=w.getSelectionCells(),c=w.view.getBounds(b),d=w.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=w.view.translate.x;c.y-=w.view.translate.y;
D(b,c)}mxEvent.consume(a)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.panningManager&&null!=w.graphHandler.shape&&(w.graphHandler.shape.node.style.visibility="hidden",null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",w.panningManager.stop(),w.autoScroll=!1,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!1),null!=w.graphHandler.hint&&
(w.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.panningManager&&null!=w.graphHandler&&(f.style.border="3px solid transparent",null!=e&&(e.style.border="3px dotted lightGray"),f.style.cursor="default",this.sidebar.showTooltips=!0,w.panningManager.stop(),w.graphHandler.reset(),w.isMouseDown=!1,w.autoScroll=!0,z(a),mxEvent.consume(a))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){w.isMouseDown&&null!=w.graphHandler.shape&&
(w.graphHandler.shape.node.style.visibility="visible",f.style.border="3px solid transparent",f.style.cursor="",w.autoScroll=!0,null!=w.graphHandler.guide&&w.graphHandler.guide.setVisible(!0),null!=w.graphHandler.hint&&(w.graphHandler.hint.style.visibility="visible"),null!=e&&(e.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(a){null!=e?e.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)";
a.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.border="3px solid transparent";f.style.cursor="";null!=e&&(e.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,l,g,m,n,k,t,v){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null);else{var p=!1,u=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var l=mxUtils.parseXml(c);if("mxlibrary"==l.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(l.documentElement));h(g,f);b=b.concat(g);C(a);
this.spinner.stop();p=!0}catch(V){}else if("mxfile"==l.documentElement.nodeName)try{for(var m=l.documentElement.getElementsByTagName("diagram"),l=0;l<m.length;l++){var g=mxUtils.getTextContent(m[l]),n=this.stringToCells(this.editor.graph.decompress(g)),k=this.editor.graph.getBoundingBoxFromGeometry(n);D(n,new mxRectangle(0,0,k.width,k.height),a)}p=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}p||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)});!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,k)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?u(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):u(c,d)}}));a.stopPropagation();a.preventDefault()})),
mxEvent.addListener(f,"dragleave",function(a){null!=e?e.style.border="3px dotted lightGray":(f.style.border="3px solid transparent",f.style.cursor="");a.stopPropagation();a.preventDefault()}));t=t.cloneNode(!1);t.setAttribute("src",IMAGE_PATH+"/edit.gif");t.setAttribute("title",mxResources.get("edit"));g.insertBefore(t,g.firstChild);mxEvent.addListener(t,"click",y);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&y(a)});t=t.cloneNode(!1);t.setAttribute("src",Editor.plusImage);
t.setAttribute("title",mxResources.get("add"));g.insertBefore(t,g.firstChild);this.isOffline()||".scratchpad"!=a.title||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){window.open("https://desk.draw.io/support/solutions/articles/16000042367");mxEvent.consume(a)})),g.insertBefore(c,g.firstChild));var B=null;mxEvent.addListener(t,
"click",z)}l.appendChild(g);l.style.paddingRight=18*g.childNodes.length+"px"};"1"==urlParams.offline?EditorUi.prototype.footerHeight=4:("atlas"==uiTheme?("undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=
188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=740>=screen.height?5:46,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");
b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};
@ -7759,15 +7759,15 @@ this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new Confir
function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};
EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,e=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(e,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};
EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,f){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height=
"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var e=document.createElement("a"),h=!mxClient.IS_SF&&"undefined"!==typeof e.download;if(h||this.isOffline()){e.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));h?e.download=b:e.setAttribute("target","_blank");document.body.appendChild(e);try{window.setTimeout(function(){URL.revokeObjectURL(e.href)},0),e.click(),e.parentNode.removeChild(e)}catch(p){}}else this.createEchoRequest(a,
b,c,d,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,f,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),h=Array(e),f=0;f<e;++f){for(var g=1024*f,k=Math.min(g+1024,d),u=Array(k-g),y=0;g<k;++y,++g)u[y]=
c[g].charCodeAt(0);h[f]=new Uint8Array(u)}return new Blob(h,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,f,g){g=null!=g?g:!1;f="vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG)h=window.open("about:blank"),null==h?mxUtils.popup(a,!0):(h.document.write(mxUtils.htmlEntities(a,!1)),h.document.close());else if(mxClient.IS_EDGE||
"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var e=document.createElement("a"),h=!mxClient.IS_SF&&"undefined"!==typeof e.download;if(h||this.isOffline()){e.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));h?e.download=b:e.setAttribute("target","_blank");document.body.appendChild(e);try{window.setTimeout(function(){URL.revokeObjectURL(e.href)},0),e.click(),e.parentNode.removeChild(e)}catch(q){}}else this.createEchoRequest(a,
b,c,d,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,f,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),h=Array(e),f=0;f<e;++f){for(var g=1024*f,k=Math.min(g+1024,d),t=Array(k-g),x=0;g<k;++x,++g)t[x]=
c[g].charCodeAt(0);h[f]=new Uint8Array(t)}return new Blob(h,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,f,g){g=null!=g?g:!1;f="vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG)h=window.open("about:blank"),null==h?mxUtils.popup(a,!0):(h.document.write(mxUtils.htmlEntities(a,!1)),h.document.close());else if(mxClient.IS_EDGE||
11==document.documentMode||10==document.documentMode){var h=window.open("about:blank");null==h?mxUtils.popup(a,!0):(h.document.write('<html><img src="data:'+c+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),h.document.close())}else h=window.open("data:"+c+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==h&&mxUtils.popup(a,!0);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(h){try{this.exportFile(a,
b,c,d,e,h)}catch(y){this.handleError(y)}}))}catch(u){this.handleError(u)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,f,null,null,g?3:4);this.showDialog(b.container,380,this.getServiceCount(g)-1<(g?4:5)?270:390,!0,!0);b.init()};EditorUi.prototype.saveData=function(a,b,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,a,d,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,e){return this.createEchoRequest(c,a,d,f,b,e)}),c,f,d)};
EditorUi.prototype.saveRequest=function(a,b,c,d,f,g){f=!mxClient.IS_IOS||!navigator.standalone;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var h=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=h&&(e==App.MODE_DEVICE||"_blank"==e?h.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,e,c)}catch(y){this.handleError(y)}else this.spinner.spin(document.body,
mxResources.get("saving"))&&h.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=h.getStatus()&&299>=h.getStatus())try{this.exportFile(h.getText(),a,g,!0,e,c)}catch(y){this.handleError(y)}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,f,null,null,4);this.showDialog(a.container,380,5>this.getServiceCount(!1)-
1?270:390,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,c,d,f,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,f,g,k,p,w){if(this.spinner.spin(document.body,mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=b?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==b&&(e="#ffffff");var h=this.editor.graph.getSvg(e,a,k,p,null,c);d&&this.editor.graph.addSvgShadow(h);var l=this.getBaseFilename()+
".svg",m=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,w));var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,
b,c,d,e,h)}catch(x){this.handleError(x)}}))}catch(t){this.handleError(t)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,f,null,null,g?3:4);this.showDialog(b.container,380,this.getServiceCount(g)-1<(g?4:5)?270:390,!0,!0);b.init()};EditorUi.prototype.saveData=function(a,b,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,a,d,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,e){return this.createEchoRequest(c,a,d,f,b,e)}),c,f,d)};
EditorUi.prototype.saveRequest=function(a,b,c,d,f,g){f=!mxClient.IS_IOS||!navigator.standalone;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var h=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=h&&(e==App.MODE_DEVICE||"_blank"==e?h.simulate(document,"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,e,c)}catch(x){this.handleError(x)}else this.spinner.spin(document.body,
mxResources.get("saving"))&&h.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=h.getStatus()&&299>=h.getStatus())try{this.exportFile(h.getText(),a,g,!0,e,c)}catch(x){this.handleError(x)}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,f,null,null,4);this.showDialog(a.container,380,5>this.getServiceCount(!1)-
1?270:390,!0,!0);a.init()};EditorUi.prototype.exportFile=function(a,b,c,d,f,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,f,g,k,q,v){if(this.spinner.spin(document.body,mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=b?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==b&&(e="#ffffff");var h=this.editor.graph.getSvg(e,a,k,q,null,c);d&&this.editor.graph.addSvgShadow(h);var l=this.getBaseFilename()+
".svg",m=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,v));var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,
h,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(h,m,this.thumbImageCache)):m(h)}))}};EditorUi.prototype.addCheckbox=function(a,b,c,d,f,g){g=null!=g?g:!0;var e=document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled","disabled");g&&(a.appendChild(e),mxUtils.write(a,b),f||mxUtils.br(a));return e};
EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var h=document.createElement("select");h.style.width="120px";h.style.marginLeft="8px";h.style.marginRight="10px";h.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));
h.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");h.appendChild(d);a.appendChild(h);mxEvent.addListener(h,"change",mxUtils.bind(this,function(){if("custom"==h.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:h.value="blank"},mxResources.get("url"),null,null,null,null,function(){h.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",
@ -7775,106 +7775,106 @@ mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?h.removeAttribute("
h:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value",
"blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var h="#0000ff",f=null,f=mxUtils.button("",
mxUtils.bind(this,function(a){this.pickColor(h||"none",function(a){h=a;c()});mxEvent.consume(a)}));c();f.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";f.style.marginLeft="4px";f.style.height="22px";f.style.width="22px";f.style.position="relative";f.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";f.className="geColorBtn";a.appendChild(f);mxUtils.br(a);return{getColor:function(){return h},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=
function(a,b,c,d,f,g,k,p){var e=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=a&&h.push("target="+a),null!=b&&b!=mxConstants.NONE&&h.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&h.push("edit="+encodeURIComponent(f)),g&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&h.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):
(e=this.getCurrentFile(),p||null==e||e.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+e.getHash(),a=!1));a&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<h.length?"?"+h.join("&"):"")+
c};EditorUi.prototype.createHtml=function(a,b,c,d,f,g,k,p,w,u,y){var e=this.getBasenames(),h={};""!=f&&f!=mxConstants.NONE&&(h.highlight=f);"auto"!==d&&(h.target=d);w||(h.lightbox=!1);h.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(h.zoom=c/100);c=[];k&&(c.push("pages"),h.resize=!0,null!=this.pages&&null!=this.currentPage&&(h.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),h.resize=!0);p&&c.push("layers");0<c.length&&(w&&c.push("lightbox"),h.toolbar=
c.join(" "));null!=u&&0<u.length&&(h.edit=u);null!=a?h.url=a:h.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(h))+'"></div>';e=0<e.length?"s="+e.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";y(b,'<script type="text/javascript" src="'+(0<e.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+e:"https://www.draw.io/embed2.js?"+
function(a,b,c,d,f,g,k,q){var e=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=a&&h.push("target="+a),null!=b&&b!=mxConstants.NONE&&h.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&h.push("edit="+encodeURIComponent(f)),g&&h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&h.push("page="+a);break}a=!0;null!=k?c="#U"+encodeURIComponent(k):
(e=this.getCurrentFile(),q||null==e||e.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+e.getHash(),a=!1));a&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&h.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?"https://www.draw.io/":"https://"+location.host+"/")+(0<h.length?"?"+h.join("&"):"")+
c};EditorUi.prototype.createHtml=function(a,b,c,d,f,g,k,q,v,t,x){var e=this.getBasenames(),h={};""!=f&&f!=mxConstants.NONE&&(h.highlight=f);"auto"!==d&&(h.target=d);v||(h.lightbox=!1);h.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(h.zoom=c/100);c=[];k&&(c.push("pages"),h.resize=!0,null!=this.pages&&null!=this.currentPage&&(h.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),h.resize=!0);q&&c.push("layers");0<c.length&&(v&&c.push("lightbox"),h.toolbar=
c.join(" "));null!=t&&0<t.length&&(h.edit=t);null!=a?h.url=a:h.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(h))+'"></div>';e=0<e.length?"s="+e.join(";"):"";a=null!=a?"fetch="+encodeURIComponent(a):"";x(b,'<script type="text/javascript" src="'+(0<e.length||0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1&"+e:"https://www.draw.io/embed2.js?"+
e)+"&"+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("html"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var f=document.createElement("div");f.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";
var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");h=g.cloneNode(!0);h.setAttribute("value","copy");f.appendChild(h);var l=document.createElement("span");mxUtils.write(l,mxResources.get("includeCopyOfMyDiagram"));f.appendChild(l);mxUtils.br(f);f.appendChild(g);l=document.createElement("span");mxUtils.write(l,mxResources.get("publicDiagramUrl"));
f.appendChild(l);var m=this.getCurrentFile();null==c&&null!=m&&m.constructor==window.DriveFile&&(l=document.createElement("a"),l.style.paddingLeft="12px",l.style.color="gray",l.setAttribute("href","javascript:void(0);"),mxUtils.write(l,mxResources.get("share")),f.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));h.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");e.appendChild(f);var k=
this.addLinkSection(e),v=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var x=document.createElement("input");x.setAttribute("type","text");x.style.marginRight="16px";x.style.width="60px";x.style.marginLeft="4px";x.style.marginRight="12px";x.value="100%";e.appendChild(x);var C=this.addCheckbox(e,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(e,mxResources.get("allPages"),f,!f),z=this.addCheckbox(e,mxResources.get("layers"),!0),
B=this.addCheckbox(e,mxResources.get("lightbox"),!0),A=this.addEditButton(e,B),G=A.getEditInput();G.style.marginBottom="16px";mxEvent.addListener(B,"change",function(){B.checked?G.removeAttribute("disabled"):G.setAttribute("disabled","disabled");G.checked&&B.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(g.checked?c:null,v.checked,x.value,k.getTarget(),k.getColor(),C.checked,D.checked,
this.addLinkSection(e),w=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var y=document.createElement("input");y.setAttribute("type","text");y.style.marginRight="16px";y.style.width="60px";y.style.marginLeft="4px";y.style.marginRight="12px";y.value="100%";e.appendChild(y);var C=this.addCheckbox(e,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(e,mxResources.get("allPages"),f,!f),z=this.addCheckbox(e,mxResources.get("layers"),!0),
B=this.addCheckbox(e,mxResources.get("lightbox"),!0),A=this.addEditButton(e,B),G=A.getEditInput();G.style.marginBottom="16px";mxEvent.addListener(B,"change",function(){B.checked?G.removeAttribute("disabled"):G.setAttribute("disabled","disabled");G.checked&&B.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(g.checked?c:null,w.checked,y.value,k.getTarget(),k.getColor(),C.checked,D.checked,
z.checked,B.checked,A.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);h.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,a||mxResources.get("link"));h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(h);var l=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=
l&&l.constructor==window.DriveFile&&!b){a=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var k=document.createElement("div");k.style.whiteSpace="normal";mxUtils.write(k,mxResources.get("linkAccountRequired"));m.appendChild(k);k=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(l.getId())}));
k.style.marginTop="12px";k.className="geBtn";m.appendChild(k);e.appendChild(m);k=document.createElement("a");k.style.paddingLeft="12px";k.style.color="gray";k.style.fontSize="11px";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("check"));m.appendChild(k);mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,
null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var n=null,t=null;if(null!=c||null!=d)a+=30,mxUtils.write(e,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",e.appendChild(n),mxUtils.write(e,mxResources.get("height")+
":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",e.appendChild(t),mxUtils.br(e);var C=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var D=null;if(null==l||l.constructor!=window.DriveFile||b)D=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var z=this.addCheckbox(e,mxResources.get("lightbox"),!0),B=this.addEditButton(e,z),A=B.getEditInput(),G=this.addCheckbox(e,mxResources.get("layers"),
null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var n=null,u=null;if(null!=c||null!=d)a+=30,mxUtils.write(e,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",e.appendChild(n),mxUtils.write(e,mxResources.get("height")+
":"),u=document.createElement("input"),u.setAttribute("type","text"),u.style.width="50px",u.style.marginLeft="6px",u.style.marginBottom="10px",u.value=d+"px",e.appendChild(u),mxUtils.br(e);var C=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var D=null;if(null==l||l.constructor!=window.DriveFile||b)D=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var z=this.addCheckbox(e,mxResources.get("lightbox"),!0),B=this.addEditButton(e,z),A=B.getEditInput(),G=this.addCheckbox(e,mxResources.get("layers"),
!0);G.style.marginLeft=A.style.marginLeft;G.style.marginBottom="16px";G.style.marginTop="8px";mxEvent.addListener(z,"change",function(){z.checked?(G.removeAttribute("disabled"),A.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"));A.checked&&z.checked?B.getEditSelect().removeAttribute("disabled"):B.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){f(C.getTarget(),C.getColor(),null==D?
!0:D.checked,z.checked,B.getLink(),G.checked,null!=n?n.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,246+a,!0,!0);null!=n?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):C.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("image"));
!0:D.checked,z.checked,B.getLink(),G.checked,null!=n?n.value:null,null!=u?u.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,246+a,!0,!0);null!=n?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):C.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,mxResources.get("image"));
h.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(h);var f=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=g&&(g.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!f.checked,null!=g?g.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(a,
b,c,d,f,g,k,p){k=null!=k?k:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph,l="jpeg"==p?170:280,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(m);mxUtils.write(e,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=
this.lastExportZoom||"100%";e.appendChild(n);mxUtils.write(e,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.value=this.lastExportBorder||"0";e.appendChild(t);mxUtils.br(e);var q=this.addCheckbox(e,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=p),z=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),
b,c,d,f,g,k,q){k=null!=k?k:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph,l="jpeg"==q?170:280,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(m);mxUtils.write(e,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=
this.lastExportZoom||"100%";e.appendChild(n);mxUtils.write(e,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";e.appendChild(p);mxUtils.br(e);var u=this.addCheckbox(e,mxResources.get("transparentBackground"),h.background==mxConstants.NONE||null==h.background,null,null,"jpeg"!=q),z=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),
B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");g&&(e.appendChild(B),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26);h.isSelectionEmpty()?B.setAttribute("disabled","disabled"):(B.setAttribute("checked","checked"),B.defaultChecked=!0);var A=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible),G=document.createElement("input");G.style.marginTop="16px";G.style.marginRight="8px";G.setAttribute("type","checkbox");
!this.isOffline()&&this.canvasSupported||G.setAttribute("disabled","disabled");b&&(e.appendChild(G),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),l+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=p),F=null!=this.pages&&1<this.pages.length,E=this.addCheckbox(e,F?mxResources.get("allPages"):"",F,!F,null,"jpeg"!=p);E.style.marginLeft="24px";E.style.marginBottom="16px";F||(E.style.visibility="hidden");mxEvent.addListener(H,"change",function(){H.checked&&
F?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")});k&&F||E.setAttribute("disabled","disabled");a=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=n.value;f(n.value,q.checked,!z.checked,A.checked,H.checked,G.checked,t.value,B.checked,!E.checked)}),null,c,d);this.showDialog(a.container,320,l,!0,!0);n.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=
function(a,b,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(g)}var l=this.addCheckbox(e,mxResources.get("fit"),!0),m=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible&&d,!d),k=this.addCheckbox(e,c),n=this.addCheckbox(e,mxResources.get("lightbox"),!0),x=this.addEditButton(e,n),C=x.getEditInput(),
D=1<h.model.getChildCount(h.model.getRoot()),z=this.addCheckbox(e,mxResources.get("layers"),D,!D);z.style.marginLeft=C.style.marginLeft;z.style.marginBottom="12px";z.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(D&&z.removeAttribute("disabled"),C.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"));C.checked&&n.checked?x.getEditSelect().removeAttribute("disabled"):x.getEditSelect().setAttribute("disabled","disabled")});
b=new CustomDialog(this,e,mxUtils.bind(this,function(){a(l.checked,m.checked,k.checked,n.checked,x.getLink(),z.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,f,g,k,p){function e(b){var e=" ",l="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");a&&(l+="max-width:100%;");var m="";c&&(m=' width="'+Math.round(h.width)+'" height="'+Math.round(h.height)+'"');k('<img src="'+b+'"'+m+(""!=l?' style="'+l+'"':"")+e+"/>")}var h=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");e(a)}),null,null,null,mxUtils.bind(this,function(a){p({message:mxResources.get("unknownError")})}),
null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),h.width*h.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*h.width)+"&h="+Math.round(2*h.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+l+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?e("data:image/png;base64,"+m.getText()):p({message:mxResources.get("unknownError")})}))}else p({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(a,b,c,d,f,g,k){var e=this.editor.graph.getSvg(),h=e.getElementsByTagName("a");if(null!=h)for(var l=0;l<h.length;l++){var m=h[l].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==h[l].getAttribute("target")&&h[l].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(e);if(c){var n=" ",t="";d&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",t+="cursor:pointer;");a&&(t+="max-width:100%;");this.convertImages(e,mxUtils.bind(this,function(a){k('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=t?' style="'+t+'"':"")+n+"/>")}))}else t="",d&&(e.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),t+="cursor:pointer;"),a&&(a=parseInt(e.getAttribute("width")),b=parseInt(e.getAttribute("height")),e.setAttribute("viewBox","0 0 "+a+" "+b),t+="max-width:100%;max-height:"+b+"px;",e.removeAttribute("height")),""!=t&&e.setAttribute("style",t),k(mxUtils.getXml(e))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+
!this.isOffline()&&this.canvasSupported||G.setAttribute("disabled","disabled");b&&(e.appendChild(G),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),l+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=q),F=null!=this.pages&&1<this.pages.length,E=this.addCheckbox(e,F?mxResources.get("allPages"):"",F,!F,null,"jpeg"!=q);E.style.marginLeft="24px";E.style.marginBottom="16px";F||(E.style.visibility="hidden");mxEvent.addListener(H,"change",function(){H.checked&&
F?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")});k&&F||E.setAttribute("disabled","disabled");a=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=n.value;f(n.value,u.checked,!z.checked,A.checked,H.checked,G.checked,p.value,B.checked,!E.checked)}),null,c,d);this.showDialog(a.container,320,l,!0,!0);n.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=
function(a,b,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var h=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(g)}var l=this.addCheckbox(e,mxResources.get("fit"),!0),m=this.addCheckbox(e,mxResources.get("shadow"),h.shadowVisible&&d,!d),k=this.addCheckbox(e,c),n=this.addCheckbox(e,mxResources.get("lightbox"),!0),y=this.addEditButton(e,n),C=y.getEditInput(),
D=1<h.model.getChildCount(h.model.getRoot()),z=this.addCheckbox(e,mxResources.get("layers"),D,!D);z.style.marginLeft=C.style.marginLeft;z.style.marginBottom="12px";z.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(D&&z.removeAttribute("disabled"),C.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"));C.checked&&n.checked?y.getEditSelect().removeAttribute("disabled"):y.getEditSelect().setAttribute("disabled","disabled")});
b=new CustomDialog(this,e,mxUtils.bind(this,function(){a(l.checked,m.checked,k.checked,n.checked,y.getLink(),z.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,f,g,k,q){function e(b){var e=" ",l="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");a&&(l+="max-width:100%;");var m="";c&&(m=' width="'+Math.round(h.width)+'" height="'+Math.round(h.height)+'"');k('<img src="'+b+'"'+m+(""!=l?' style="'+l+'"':"")+e+"/>")}var h=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");e(a)}),null,null,null,mxUtils.bind(this,function(a){q({message:mxResources.get("unknownError")})}),
null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),h.width*h.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*h.width)+"&h="+Math.round(2*h.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+l+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?e("data:image/png;base64,"+m.getText()):q({message:mxResources.get("unknownError")})}))}else q({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(a,b,c,d,f,g,k){var e=this.editor.graph.getSvg(),h=e.getElementsByTagName("a");if(null!=h)for(var l=0;l<h.length;l++){var m=h[l].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==h[l].getAttribute("target")&&h[l].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(e);if(c){var n=" ",p="";d&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");this.convertImages(e,mxUtils.bind(this,function(a){k('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=p?' style="'+p+'"':"")+n+"/>")}))}else p="",d&&(e.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),p+="cursor:pointer;"),a&&(a=parseInt(e.getAttribute("width")),b=parseInt(e.getAttribute("height")),e.setAttribute("viewBox","0 0 "+a+" "+b),p+="max-width:100%;max-height:"+b+"px;",e.removeAttribute("height")),""!=p&&e.setAttribute("style",p),k(mxUtils.getXml(e))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+
" "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,c,d){d()};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,f,g,k){k=b.background;k==mxConstants.NONE&&(k=null);b=b.getSvg(k,null,null,null,null,g);null!=a&&b.setAttribute("content",a);null!=
c&&b.setAttribute("resource",c);if(null!=f)this.convertImages(b,mxUtils.bind(this,function(a){f((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,f,g,k,
p,w){w=null!=w?w:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,p):null,w)}catch(v){"Invalid image"==v.message?this.downloadFile(w):this.handleError(v)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();
this.handleError(a)}),null,c,a||1,b,d,null,null,g,k)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=this.editor.fontCss.split("url("),c=0,d={},e=mxUtils.bind(this,function(){if(0==c){for(var e=[b[0]],h=1;h<b.length;h++){var f=b[h].indexOf(")");e.push("url(");e.push(d[b[h].substring(0,f)]);e.push(b[h].substring(f))}this.editor.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var f=
q,v){v=null!=v?v:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,q):null,v)}catch(w){"Invalid image"==w.message?this.downloadFile(v):this.handleError(w)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();
this.handleError(a)}),null,c,a||1,b,d,null,null,g,k)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=this.editor.fontCss.split("url("),c=0,d={},e=mxUtils.bind(this,function(){if(0==c){for(var e=[b[0]],h=1;h<b.length;h++){var f=b[h].indexOf(")");e.push("url(");e.push(d[b[h].substring(0,f)]);e.push(b[h].substring(f))}this.editor.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var f=
1;f<b.length;f++){var g=b[f].indexOf(")");mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;c++;var b="application/x-font-ttf";/(\.svg)($|\?)/i.test(a)?b="image/svg+xml":/(\.otf)($|\?)/i.test(a)?b="application/x-font-opentype":/(\.woff)($|\?)/i.test(a)?b="application/font-woff":/(\.woff2)($|\?)/i.test(a)?b="application/font-woff2":/(\.eot)($|\?)/i.test(a)?b="application/vnd.ms-fontobject":/(\.sfnt)($|\?)/i.test(a)&&(b="application/font-sfnt");var h=a;/^https?:\/\//.test(h)&&!this.isCorsEnabledForUrl(h)&&
(h=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(h,mxUtils.bind(this,function(b){d[a]=b;c--;e()}),mxUtils.bind(this,function(a){c--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b[f].substring(0,g))}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,f,g,k,p,w,u,y,v,x,C){g=null!=g?g:!0;v=null!=v?v:this.editor.graph;x=null!=x?x:0;var e=w?null:v.background;e==mxConstants.NONE&&(e=null);null==e&&(e=d);null==e&&0==w&&(e="#ffffff");this.convertImages(v.getSvg(e,null,null,C,null,
null!=k?k:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var h=document.createElement("canvas"),l=parseInt(c.getAttribute("width")),k=parseInt(c.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=g?Math.min(1,Math.min(3*b/(4*k),b/l)):b/l);l=Math.ceil(p*l)+2*x;k=Math.ceil(p*k)+2*x;h.setAttribute("width",l);h.setAttribute("height",k);var m=h.getContext("2d");null!=e&&(m.beginPath(),m.rect(0,0,l,k),m.fillStyle=e,m.fill());m.scale(p,p);m.drawImage(d,x/p,x/p);
a(h)}catch(M){null!=f&&f(M)}});d.onerror=function(a){null!=f&&f(a)};try{u&&this.editor.graph.addSvgShadow(c);var h=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(v,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(h)}catch(G){null!=f&&f(G)}}),c,y)};EditorUi.prototype.createImageUrlConverter=
(h=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(h,mxUtils.bind(this,function(b){d[a]=b;c--;e()}),mxUtils.bind(this,function(a){c--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b[f].substring(0,g))}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,f,g,k,q,v,t,x,w,y,C){g=null!=g?g:!0;w=null!=w?w:this.editor.graph;y=null!=y?y:0;var e=v?null:w.background;e==mxConstants.NONE&&(e=null);null==e&&(e=d);null==e&&0==v&&(e="#ffffff");this.convertImages(w.getSvg(e,null,null,C,null,
null!=k?k:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var h=document.createElement("canvas"),l=parseInt(c.getAttribute("width")),m=parseInt(c.getAttribute("height"));q=null!=q?q:1;null!=b&&(q=g?Math.min(1,Math.min(3*b/(4*m),b/l)):b/l);l=Math.ceil(q*l)+2*y;m=Math.ceil(q*m)+2*y;h.setAttribute("width",l);h.setAttribute("height",m);var k=h.getContext("2d");null!=e&&(k.beginPath(),k.rect(0,0,l,m),k.fillStyle=e,k.fill());k.scale(q,q);k.drawImage(d,y/q,y/q);
a(h)}catch(M){null!=f&&f(M)}});d.onerror=function(a){null!=f&&f(a)};try{t&&this.editor.graph.addSvgShadow(c);var h=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(w,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(h)}catch(G){null!=f&&f(G)}}),c,x)};EditorUi.prototype.createImageUrlConverter=
function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;a.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var e=0,h=c||{};c=mxUtils.bind(this,function(c,f){for(var g=a.getElementsByTagName(c),
l=0;l<g.length;l++)mxUtils.bind(this,function(c){var g=d.convert(c.getAttribute(f));if(null!=g&&"data:"!=g.substring(0,5)){var l=h[g];null==l?(e++,this.convertImageToDataUri(g,function(d){null!=d&&(h[g]=d,c.setAttribute(f,d));e--;0==e&&b(a)})):c.setAttribute(f,l)}})(g[l])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,f,g){try{var e=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);f=null!=f?f:!0;var h=mxUtils.bind(this,
function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(e){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),h=0;h<a.length;h++)d[h]=String.fromCharCode(a[h]);d=d.join("")}g=null!=g?g:"data:image/png;base64,";d=g+this.base64Encode(d)}b(d)}}else null!=c&&c({code:App.ERROR_UNKNOWN})}),function(){null!=
c&&c({code:App.ERROR_UNKNOWN})},e,this.timeout,function(){f&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:h})})});h()}catch(w){null!=c&&c(w)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),
c&&c({code:App.ERROR_UNKNOWN})},e,this.timeout,function(){f&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:h})})});h()}catch(v){null!=c&&c(v)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),
function(){b()});else{var c=new Image;c.onload=function(){var a=document.createElement("canvas"),d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,f){b=null!=b?b:0;c=null!=c?c:0;var e=[];try{var h=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),l=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=l&&"mxfile"==l.nodeName&&null!=this.pages){var k=
l.getElementsByTagName("diagram");if(1==k.length)l=mxUtils.parseXml(h.decompress(mxUtils.getTextContent(k[0]))).documentElement;else if(1<k.length){h.model.beginUpdate();try{for(var m=0;m<k.length;m++){var n=this.updatePageRoot(new DiagramPage(k[m])),x=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[x+1]));h.model.execute(new ChangePage(this,n,n,x))}}finally{h.model.endUpdate()}}}if(null!=l&&"mxGraphModel"===l.nodeName){var C=new mxGraphModel;(new mxCodec(l.ownerDocument)).decode(l,
l.getElementsByTagName("diagram");if(1==k.length)l=mxUtils.parseXml(h.decompress(mxUtils.getTextContent(k[0]))).documentElement;else if(1<k.length){h.model.beginUpdate();try{for(var m=0;m<k.length;m++){var n=this.updatePageRoot(new DiagramPage(k[m])),y=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[y+1]));h.model.execute(new ChangePage(this,n,n,y))}}finally{h.model.endUpdate()}}}if(null!=l&&"mxGraphModel"===l.nodeName){var C=new mxGraphModel;(new mxCodec(l.ownerDocument)).decode(l,
C);var D=C.getChildCount(C.getRoot());h.model.getChildCount(h.model.getRoot());h.model.beginUpdate();try{a={};for(m=0;m<D;m++){var z=C.getChildAt(C.getRoot(),m);if(1!=D||h.isCellLocked(h.getDefaultParent()))z=h.importCells([z],0,0,h.model.getRoot(),null,a)[0],B=h.model.getChildren(z),h.moveCells(B,b,c),e=e.concat(B);else var B=C.getChildren(z),e=e.concat(h.importCells(B,b,c,h.getDefaultParent(),null,a))}if(d){h.isGridEnabled()&&(b=h.snap(b),c=h.snap(c));var A=h.getBoundingBoxFromGeometry(e,!0);null!=
A&&h.moveCells(e,b-A.x,c-A.y)}}finally{h.model.endUpdate()}}}}catch(G){throw f||this.handleError(G,mxResources.get("invalidOrMissingFile")),G;}return e};EditorUi.prototype.insertLucidChart=function(a,b,c,d){var e=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.pasteLucidChart(a,b,c,d)}catch(t){}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(e,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("/js/diagramly/Extensions.js",e):mxscript("/js/extensions.min.js",
A&&h.moveCells(e,b-A.x,c-A.y)}}finally{h.model.endUpdate()}}}}catch(G){throw f||this.handleError(G,mxResources.get("invalidOrMissingFile")),G;}return e};EditorUi.prototype.insertLucidChart=function(a,b,c,d){var e=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.pasteLucidChart(a,b,c,d)}catch(u){}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(e,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("/js/diagramly/Extensions.js",e):mxscript("/js/extensions.min.js",
e))};EditorUi.prototype.insertTextAt=function(a,b,c,d,f,g,k){g=null!=g?g:!0;k=null!=k?k:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var e=
this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var h=this.extractGraphModelFromPng(a),l=this.importXml(h,b,c,g,!0);if(0<l.length)return l}if("data:image/svg+xml;"==a.substring(0,19))try{if(h=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(h=a.substring(a.indexOf(",")+1),h=window.atob&&!mxClient.IS_SF?atob(h):Base64.decode(h,!0)):h=decodeURIComponent(a.substring(a.indexOf(",")+1)),l=this.importXml(h,b,c,g,!0),0<l.length)return l}catch(v){}this.loadImage(a,mxUtils.bind(this,
this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var h=this.extractGraphModelFromPng(a),l=this.importXml(h,b,c,g,!0);if(0<l.length)return l}if("data:image/svg+xml;"==a.substring(0,19))try{if(h=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(h=a.substring(a.indexOf(",")+1),h=window.atob&&!mxClient.IS_SF?atob(h):Base64.decode(h,!0)):h=decodeURIComponent(a.substring(a.indexOf(",")+1)),l=this.importXml(h,b,c,g,!0),0<l.length)return l}catch(w){}this.loadImage(a,mxUtils.bind(this,
function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,h){e.setSelectionCell(e.insertVertex(null,null,"",e.snap(b),e.snap(c),d,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),k,this.maxImageSize);else{var h=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),f=Math.round(d.width*h);d=Math.round(d.height*h);e.setSelectionCell(e.insertVertex(null,
null,"",e.snap(b),e.snap(c),f,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var h=null;e.getModel().beginUpdate();try{h=e.insertVertex(e.getDefaultParent(),null,a,e.snap(b),e.snap(c),1,1,"text;"+(d?"html=1;":"")),e.updateCellSize(h),e.fireEvent(new mxEventObject("textInserted","cells",[h]))}finally{e.getModel().endUpdate()}e.setSelectionCell(h)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));
if(this.isCompatibleString(a))return this.importXml(a,b,c,g);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26)){f=JSON.parse(JSON.parse(a).state);var h=null,m;for(m in f.Pages)if(l=f.Pages[m],null!=l&&"0"==l.Properties.Order){h=l;break}null!=h&&this.insertLucidChart(h,b,c,g)}else{e=this.editor.graph;g=null;e.getModel().beginUpdate();try{g=e.insertVertex(e.getDefaultParent(),null,"",e.snap(b),e.snap(c),1,1,"text;"+(d?"html=1;":"")),e.fireEvent(new mxEventObject("textInserted","cells",
[g])),g.value=a,e.updateCellSize(g),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(g.value)&&e.setLinkForCell(g,g.value),g.geometry.width+=e.gridSize,g.geometry.height+=e.gridSize}finally{e.getModel().endUpdate()}return[g]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+
" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\.*<graphml xmlns=\".*)/.test(a)||/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,c,d,f,g,k,p,w,u,y){u=
null!=u?u:!0;var e=!1,h=null;"image"==b.substring(0,5)?(w=!1,"image/png"==b.substring(0,9)&&(b=y?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(h=this.importXml(b,c,d,u),w=!0)),w||(h=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),u&&h.isGridEnabled()&&(c=h.snap(c),d=h.snap(d)),h=[h.insertVertex(null,null,"",c,d,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+
";")])):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,k)?(e=!0,this.parseFile(null!=w?w:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=k&&".vssx"==k.toLowerCase().substring(k.length-5)&&(k=k.substring(0,k.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,k))):b=this.importXml(a,c,d,u));null!=p&&p(b)}}),k)):
/(\.vsd)($|\?)/i.test(k)||(h=this.insertTextAt(this.validateFileData(a),c,d,!0,null,u));e||null==p||p(h);return h};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,f,g;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\.*<graphml xmlns=\".*)/.test(a)||/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)||null!=b&&/(\.vsdx)($|\?)/i.test(b)||null!=b&&/(\.vssx)($|\?)/i.test(b)};EditorUi.prototype.importFile=function(a,b,c,d,f,g,k,q,v,t,x){t=
null!=t?t:!0;var e=!1,h=null;"image"==b.substring(0,5)?(v=!1,"image/png"==b.substring(0,9)&&(b=x?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(h=this.importXml(b,c,d,t),v=!0)),v||(h=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&h.isGridEnabled()&&(c=h.snap(c),d=h.snap(d)),h=[h.insertVertex(null,null,"",c,d,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+
";")])):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,k)?(e=!0,this.parseFile(null!=v?v:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){if(4==a.readyState){var b=null;200<=a.status&&299>=a.status&&(a=a.responseText,null!=a&&"<mxlibrary"==a.substring(0,10)?(null!=k&&".vssx"==k.toLowerCase().substring(k.length-5)&&(k=k.substring(0,k.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,a,k))):b=this.importXml(a,c,d,t));null!=q&&q(b)}}),k)):
/(\.vsd)($|\?)/i.test(k)||(h=this.insertTextAt(this.validateFileData(a),c,d,!0,null,t));e||null==q||q(h);return h};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,f,g;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);
b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,f,g,k,p,w,u,y,v){var e=null!=b&&null!=c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;u=null!=u?u:this.maxImageBytes;w=null!=w?w:!0;var h=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var l=y||this.resampleThreshold,m=0;m<a.length;m++)if("image/"==a[m].type.substring(0,6)&&a[m].size>l){h=!0;break}var n=mxUtils.bind(this,function(){var h=this.editor.graph,
l=h.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,d,h,f,g,l,k){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,h,f,g,l,k,e,v)});g=null!=g?g:mxUtils.bind(this,function(a){h.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var m=a.length,n=m,t=[],q=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--n){this.spinner.stop();if(null!=p)p(t);else{var c=[];h.getModel().beginUpdate();
try{for(var d=0;d<t.length;d++){var e=t[d]();null!=e&&(c=c.concat(e))}}finally{h.getModel().endUpdate()}}g(c)}}),B=0;B<m;B++)mxUtils.bind(this,function(e){var h=a[e],g=new FileReader;g.onload=mxUtils.bind(this,function(a){if(null==k||k(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var g=a.target.result,m=g.indexOf(","),n=atob(g.substring(m+1)),t=mxUtils.parseXml(n),n=t.getElementsByTagName("svg");if(0<n.length){var n=n[0],p=v?null:n.getAttribute("content");null!=p&&
"<"!=p.charAt(0)&&"%"!=p.charAt(0)&&(p=unescape(window.atob?atob(p):Base64.decode(p,!0)));null!=p&&"%"==p.charAt(0)&&(p=decodeURIComponent(p));null==p||"<mxfile "!==p.substring(0,8)&&"<mxGraphModel "!==p.substring(0,14)?q(e,mxUtils.bind(this,function(){try{if(g.substring(0,m+1),null!=t){var a=t.getElementsByTagName("svg");if(0<a.length){var k=a[0],n=parseFloat(k.getAttribute("width")),u=parseFloat(k.getAttribute("height")),w=k.getAttribute("viewBox");if(null==w||0==w.length)k.setAttribute("viewBox",
"0 0 "+n+" "+u);else if(isNaN(n)||isNaN(u)){var y=w.split(" ");3<y.length&&(n=parseFloat(y[2]),u=parseFloat(y[3]))}g=this.createSvgDataUri(mxUtils.getXml(a[0]));var q=Math.min(1,Math.min(d/Math.max(1,n)),d/Math.max(1,u));return f(g,h.type,b+e*l,c+e*l,Math.max(1,Math.round(n*q)),Math.max(1,Math.round(u*q)),h.name)}}}catch(fa){}return null})):q(e,mxUtils.bind(this,function(){return f(p,"text/xml",b+e*l,c+e*l,0,0,h.name)}))}}else{n=!1;if("image/png"==h.type){var B=v?null:this.extractGraphModelFromPng(a.target.result);
if(null!=B&&0<B.length){var x=new Image;x.src=a.target.result;q(e,mxUtils.bind(this,function(){return f(B,"text/xml",b+e*l,c+e*l,x.width,x.height,h.name)}));n=!0}}n||(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(g,k,m){q(e,mxUtils.bind(this,function(){if(null!=g&&g.length<u){var n=w&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(d/k,d/m)):1;return f(g,h.type,b+e*l,c+e*l,Math.round(k*n),Math.round(m*n),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),w,d,y)})))}else f(a.target.result,h.type,b+e*l,c+e*l,240,160,h.name,function(a){q(e,function(){return a})})});/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?
f(null,h.type,b+e*l,c+e*l,240,160,h.name,function(a){q(e,function(){return a})},h):"image"==h.type.substring(0,5)?g.readAsDataURL(h):g.readAsText(h)})(B)});h&&w?this.confirmImageResize(function(a){w=a;n()}):n()};EditorUi.prototype.confirmImageResize=function(a){var b=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=function(c,d){c&&(mxSettings.setResizeImages(d),mxSettings.save());b();a(d)},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null;null!=
d?c(!1,d):this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){c(a,!0)},function(a){c(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)};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)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,f,g){f=null!=f?f:this.maxImageSize;var e=Math.max(1,a.width),h=Math.max(1,a.height);if(d&&this.isResampleImage(b,g))try{var l=Math.max(e/f,h/f);if(1<l){var k=Math.round(e/l),m=Math.round(h/l),n=document.createElement("canvas");
n.width=k;n.height=m;n.getContext("2d").drawImage(a,0,0,k,m);var t=n.toDataURL();if(t.length<b.length){var C=document.createElement("canvas");C.width=k;C.height=m;var D=C.toDataURL();t!==D&&(b=t,e=k,h=m)}}}catch(z){}c(b,e,h)};EditorUi.prototype.crcTable=[];for(var b=0;256>b;b++)for(var c=b,d=0;8>d;d++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[b]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=
b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,f,g,k,q,v,t,x,w){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var e=null!=b&&null!=c,h=!0,l=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var m=x||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>m){l=!0;break}var p=mxUtils.bind(this,function(){var l=this.editor.graph,m=l.gridSize;
f=null!=f?f:mxUtils.bind(this,function(a,b,c,d,h,f,g,l,k){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,h,f,g,l,k,e,w)});g=null!=g?g:mxUtils.bind(this,function(a){l.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,v=n,p=[],u=mxUtils.bind(this,function(a,b){p[a]=b;if(0==--v){this.spinner.stop();if(null!=q)q(p);else{var c=[];l.getModel().beginUpdate();
try{for(var d=0;d<p.length;d++){var e=p[d]();null!=e&&(c=c.concat(e))}}finally{l.getModel().endUpdate()}}g(c)}}),B=0;B<n;B++)mxUtils.bind(this,function(e){var g=a[e],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==k||k(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var l=a.target.result,n=l.indexOf(","),v=atob(l.substring(n+1)),p=mxUtils.parseXml(v),v=p.getElementsByTagName("svg");if(0<v.length){var v=v[0],q=w?null:v.getAttribute("content");null!=q&&
"<"!=q.charAt(0)&&"%"!=q.charAt(0)&&(q=unescape(window.atob?atob(q):Base64.decode(q,!0)));null!=q&&"%"==q.charAt(0)&&(q=decodeURIComponent(q));null==q||"<mxfile "!==q.substring(0,8)&&"<mxGraphModel "!==q.substring(0,14)?u(e,mxUtils.bind(this,function(){try{if(l.substring(0,n+1),null!=p){var a=p.getElementsByTagName("svg");if(0<a.length){var h=a[0],k=parseFloat(h.getAttribute("width")),t=parseFloat(h.getAttribute("height")),v=h.getAttribute("viewBox");if(null==v||0==v.length)h.setAttribute("viewBox",
"0 0 "+k+" "+t);else if(isNaN(k)||isNaN(t)){var x=v.split(" ");3<x.length&&(k=parseFloat(x[2]),t=parseFloat(x[3]))}l=this.createSvgDataUri(mxUtils.getXml(a[0]));var u=Math.min(1,Math.min(d/Math.max(1,k)),d/Math.max(1,t));return f(l,g.type,b+e*m,c+e*m,Math.max(1,Math.round(k*u)),Math.max(1,Math.round(t*u)),g.name)}}}catch(Z){}return null})):u(e,mxUtils.bind(this,function(){return f(q,"text/xml",b+e*m,c+e*m,0,0,g.name)}))}}else{v=!1;if("image/png"==g.type){var B=w?null:this.extractGraphModelFromPng(a.target.result);
if(null!=B&&0<B.length){var y=new Image;y.src=a.target.result;u(e,mxUtils.bind(this,function(){return f(B,"text/xml",b+e*m,c+e*m,y.width,y.height,g.name)}));v=!0}}v||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(l){this.resizeImage(l,
a.target.result,mxUtils.bind(this,function(l,k,n){u(e,mxUtils.bind(this,function(){if(null!=l&&l.length<t){var v=h&&this.isResampleImage(a.target.result,x)?Math.min(1,Math.min(d/k,d/n)):1;return f(l,g.type,b+e*m,c+e*m,Math.round(k*v),Math.round(n*v),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),h,d,x)})))}else f(a.target.result,g.type,b+e*m,c+e*m,240,160,g.name,function(a){u(e,function(){return a})})});/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?
f(null,g.type,b+e*m,c+e*m,240,160,g.name,function(a){u(e,function(){return a})},g):"image"==g.type.substring(0,5)?l.readAsDataURL(g):l.readAsText(g)})(B)});l?this.confirmImageResize(function(a){h=a;p()},v):p()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=function(b,d){mxSettings.setResizeImages(b?d:null);mxSettings.save();c();a(d)},e=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():
null;null==e||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){d(a,!0)},function(a){d(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):d(!1,e)};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)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,f,g){f=null!=f?f:this.maxImageSize;var e=Math.max(1,a.width),h=Math.max(1,a.height);if(d&&this.isResampleImage(b,g))try{var l=Math.max(e/f,h/f);if(1<l){var k=Math.round(e/l),m=Math.round(h/l),n=document.createElement("canvas");
n.width=k;n.height=m;n.getContext("2d").drawImage(a,0,0,k,m);var u=n.toDataURL();if(u.length<b.length){var C=document.createElement("canvas");C.width=k;C.height=m;var D=C.toDataURL();u!==D&&(b=u,e=k,h=m)}}}catch(z){}c(b,e,h)};EditorUi.prototype.crcTable=[];for(var b=0;256>b;b++)for(var c=b,d=0;8>d;d++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[b]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.writeGraphModelToPng=
function(a,b,c,d,f){function e(a,b){var c=l;l+=b;return a.substring(c,l)}function h(a){a=e(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var l=0;if(e(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=f&&f();else if(e(a,4),"IHDR"!=e(a,4))null!=f&&f();else{e(a,17);f=a.substring(0,
l);do{var k=h(a);if("IDAT"==e(a,4)){f=a.substring(0,l-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);f+=g(c.length)+b+c+g(d^4294967295);f+=a.substring(l-8,a.length);break}f+=a.substring(l-8,l-4+k);d=e(a,k);e(a,4)}while(k);return"data:image/png;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=
window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(n){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));
null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a){var c=a.indexOf(",");0<c&&(a=b.getPageById(a.substring(c+1)))&&b.selectPage(a)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,c=this.editor.graph,d=c.addClickHandler;c.addClickHandler=function(b,
e,f){var h=e;e=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null!=d&&c.isPageLink(d)&&(a(d),mxEvent.consume(b));null!=h&&h(b,d)};d.call(this,b,e,f)};f.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");
var g=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:g.apply(this,arguments)};var k=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var h=d.indexOf(",");0<h&&(h=b.getPageById(d.substring(h+1)),e=null!=h?h.getName():mxResources.get("pageNotFound"))}h=k.apply(this,arguments);f&&mxEvent.addListener(h,"click",
function(b){a(d);mxEvent.consume(b)});return h};var q=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");c.isPageLink(f)?(a(f),mxEvent.consume(e)):q.apply(this,arguments)};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var p=this.actions.get("print");p.setEnabled(!mxClient.IS_IOS||!navigator.standalone);p.visible=p.isEnabled();if(!this.editor.chromeless){var w=function(){window.setTimeout(function(){u.innerHTML=
"&nbsp;";u.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=
function(b){a(d);mxEvent.consume(b)});return h};var p=c.labelLinkClicked;c.labelLinkClicked=function(b,d,e){var f=d.getAttribute("href");c.isPageLink(f)?(a(f),mxEvent.consume(e)):p.apply(this,arguments)};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless){var v=function(){window.setTimeout(function(){t.innerHTML=
"&nbsp;";t.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=
this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var h=f[index];if("file"===h.kind){if(b.isEditing())this.importFiles([h.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var g=this.editor.graph.getInsertPoint();
this.importFiles([h.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(I){}}),!1);var u=document.createElement("div");u.style.position="absolute";u.style.whiteSpace="nowrap";u.style.overflow="hidden";u.style.display="block";u.contentEditable=!0;mxUtils.setOpacity(u,0);u.style.width="1px";u.style.height="1px";u.innerHTML="&nbsp;";var y=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,
"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||y||(u.style.left=c.container.scrollLeft+10+"px",u.style.top=c.container.scrollTop+10+"px",c.container.appendChild(u),y=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){u.focus();document.execCommand("selectAll",!1,null)},
0):(u.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!y||224!=b&&17!=b&&91!=b||(y=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),u.parentNode.removeChild(u))}),0)}));mxEvent.addListener(u,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(u),w())}));mxEvent.addListener(u,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&
(this.copyCells(u,!0),w())}));mxEvent.addListener(u,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(u.innerHTML="&nbsp;",u.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,u);u.innerHTML="&nbsp;"}),0))}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==u?!0:v.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
this.importFiles([h.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(K){}}),!1);var t=document.createElement("div");t.style.position="absolute";t.style.whiteSpace="nowrap";t.style.overflow="hidden";t.style.display="block";t.contentEditable=!0;mxUtils.setOpacity(t,0);t.style.width="1px";t.style.height="1px";t.innerHTML="&nbsp;";var x=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,
"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||x||(t.style.left=c.container.scrollLeft+10+"px",t.style.top=c.container.scrollTop+10+"px",c.container.appendChild(t),x=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){t.focus();document.execCommand("selectAll",!1,null)},
0):(t.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!x||224!=b&&17!=b&&91!=b||(x=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),t.parentNode.removeChild(t))}),0)}));mxEvent.addListener(t,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(t),v())}));mxEvent.addListener(t,"cut",mxUtils.bind(this,function(a){c.isEnabled()&&
(this.copyCells(t,!0),v())}));mxEvent.addListener(t,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(t.innerHTML="&nbsp;",t.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,t);t.innerHTML="&nbsp;"}),0))}),!0);var w=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==t?!0:w.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();
a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");
a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,h){b.insertImage(a,f,h)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");
/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,
"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){p=document.createElement("div");p.style.position="absolute";p.style.top="95px";p.style.left="250px";p.style.width="2000px";p.style.height="30px";p.style.background="whiteSmoke";document.body.appendChild(p);var x=document.createElement("div");x.style.position="absolute";x.style.top="125px";x.style.left="220px";
x.style.width="30px";x.style.height="1000px";x.style.background="whiteSmoke";document.body.appendChild(x);var C=document.createElement("div");C.style.position="absolute";C.style.top="95px";C.style.left="220px";C.style.width="30px";C.style.height="30px";C.style.background="whiteSmoke";document.body.appendChild(C);this.vRuler=new mxRuler(this.editor.graph,x,!0);this.hRuler=new mxRuler(this.editor.graph,p,!1)}if("1"==urlParams.test){p=document.getElementById("geFooter");null!=p&&(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)})),p.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,
mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:D.apply(this,arguments)}}p=document.getElementById("geInfo");null!=p&&p.parentNode.removeChild(p);if(Graph.fileSupport){var z=
"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){q=document.createElement("div");q.style.position="absolute";q.style.top="95px";q.style.left="250px";q.style.width="2000px";q.style.height="30px";q.style.background="whiteSmoke";document.body.appendChild(q);var y=document.createElement("div");y.style.position="absolute";y.style.top="125px";y.style.left="220px";
y.style.width="30px";y.style.height="1000px";y.style.background="whiteSmoke";document.body.appendChild(y);var C=document.createElement("div");C.style.position="absolute";C.style.top="95px";C.style.left="220px";C.style.width="30px";C.style.height="30px";C.style.background="whiteSmoke";document.body.appendChild(C);this.vRuler=new mxRuler(this.editor.graph,y,!0);this.hRuler=new mxRuler(this.editor.graph,q,!1)}if("1"==urlParams.test){q=document.getElementById("geFooter");null!=q&&(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)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,
mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var D=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:D.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport){var z=
null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),z=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,function(a){null!=z&&(z.parentNode.removeChild(z),
z=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,h=b.y/e-d.y;mxEvent.isAltDown(a)&&(h=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,h,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var g=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,
null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,h,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=l;var k=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(k=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(l=b[0].getAttribute("href")));var m=!mxEvent.isControlDown(a),u=mxUtils.bind(this,
function(){c.setSelectionCells(this.insertTextAt(l,f,h,!0,k,null,m))});k&&m&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;u()}):u()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",f,h,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
z=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,h=b.y/e-d.y;mxEvent.isAltDown(a)&&(h=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,h,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var g=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,
null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,h,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=l;var k=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(k=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&(l=b[0].getAttribute("href")));var m=!0,t=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(l,
f,h,!0,k,null,m))});k&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;t()},mxEvent.isControlDown(a)):t()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",f,h,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
g+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(g,f,h,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,h,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();"undefined"!==typeof window.mxSettings&&this.installSettings()};EditorUi.prototype.installSettings=function(){if(isLocalStorage||mxClient.IS_CHROMEAPP)ColorDialog.recentColors=
mxSettings.getRecentColors(),this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle(),this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle(),this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[])),this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()})),this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()),
this.fireEvent(new mxEventObject("copyConnectChanged")),this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()})),this.editor.graph.pageFormat=mxSettings.getPageFormat(),this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()})),this.editor.graph.view.gridColor=mxSettings.getGridColor(),this.addListener("gridColorChanged",
mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()})),mxClient.IS_CHROMEAPP&&(this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave()),null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search),!this.editor.chromeless&&null!=this.sidebar&&(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||
0))&&(this.toggleScratchpad(),mxSettings.save()),this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=
e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.insertLucidChart(JSON.parse(d)),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):
b.textContent),f=!1;try{var h=e.lastIndexOf("%3E");0<=h&&h<e.length-3&&(e=e.substring(0,h+3))}catch(w){}try{var c=b.getElementsByTagName("span"),g=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(g)&&(f=!0,e=g)}catch(w){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),
d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(w){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),
b.textContent),f=!1;try{var h=e.lastIndexOf("%3E");0<=h&&h<e.length-3&&(e=e.substring(0,h+3))}catch(v){}try{var c=b.getElementsByTagName("span"),g=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(g)&&(f=!0,e=g)}catch(v){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),
d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),
b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"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[c],"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);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,
"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,
@ -7882,7 +7882,7 @@ function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText
var f=document.documentElement;d=(e.clientWidth||f.clientWidth)-3;e=Math.max(e.clientHeight||0,f.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;f=document.createElement("div");f.style.zIndex=mxPopupMenu.prototype.zIndex+2;f.style.border="3px dotted rgb(254, 137, 12)";f.style.pointerEvents="none";f.style.position="absolute";f.style.top=b+"px";f.style.left=c+"px";f.style.width=Math.max(0,d-3)+"px";f.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?
this.editor.graph.container.appendChild(f):document.body.appendChild(f);return f};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var b=
0;b<a.length;b++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){var c=b.target.result,d=a.name;if(null!=d&&0<d.length)if(/(\.png)$/i.test(d)&&(d=d.substring(0,d.length-4)+".xml"),Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,d))d=0<=d.lastIndexOf(".")?d.substring(0,d.lastIndexOf("."))+".xml":d+".xml",this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?
this.openLocalFile(a.responseText,d):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if("<mxlibrary"==b.target.result.substring(0,10)){this.spinner.stop();try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,
this.openLocalFile(a.responseText,d):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if("<mxlibrary"==b.target.result.substring(0,10)){this.spinner.stop();try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,
d)});b.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?b.readAsDataURL(a):b.readAsText(a)})(a[b])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,
a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null!=d&&d.isModified()?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))):e())};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),
this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),
@ -7895,10 +7895,10 @@ if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKe
mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){l=null;l="data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):h(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",
result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(H){g.postMessage(JSON.stringify({event:"draft",error:H.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?
g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=
k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var m=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var n=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,
t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.xml=encodeURIComponent(n);b.data=a;g.postMessage(JSON.stringify(b),"*")}),p=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=
this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),B=q.getGlobalVariable,A=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:B.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){p(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){p(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):p(null)}),mxUtils.bind(this,function(){p(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);m=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=
k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var m=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var n=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,
q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.xml=encodeURIComponent(n);b.data=a;g.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);q(a)});if(this.isExportToCanvas()){if(null!=
this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),B=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:B.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);m=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=
this.getFileData(null,null,!0,null,null,null,l),m.format=k.format;else if("html"==k.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),
"xmlsvg"==k.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
@ -7909,20 +7909,20 @@ b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pag
mxResources.get("save")+" (Ctrl+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor=
"pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);
this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=
a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",k="auto",w=40,u=40,y=0,v=this.editor.graph;v.getGraphBounds();for(var x=function(){v.setSelectionCells(O);v.scrollCellToVisible(v.getSelectionCell())},C=v.getFreeInsertPoint(),D=C.x,z=C.y,C=z,B=null,A="auto",G=[],H=null,F=null,E=0;E<b.length&&"#"==b[E].charAt(0);){a=b[E];for(E++;E<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[E].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[E].substring(1)),E++;if("#"!=a.charAt(1)){var M=a.indexOf(":");
if(0<M){var K=mxUtils.trim(a.substring(1,M)),I=mxUtils.trim(a.substring(M+1));"label"==K?B=v.sanitizeHtml(I):"style"==K?e=I:"identity"==K&&0<I.length&&"-"!=I?f=I:"width"==K?g=I:"height"==K?k=I:"ignore"==K?F=I.split(","):"connect"==K?G.push(JSON.parse(I)):"link"==K?H=I:"padding"==K?y=parseFloat(I):"edgespacing"==K?w=parseFloat(I):"nodespacing"==K?u=parseFloat(I):"layout"==K&&(A=I)}}}var T=this.editor.csvToArray(b[E]);a=null;if(null!=f)for(var L=0;L<T.length;L++)if(f==T[L]){a=L;break}null==B&&(B="%"+
T[0]+"%");if(null!=G)for(var N=0;N<G.length;N++)null==d[G[N].to]&&(d[G[N].to]={});v.model.beginUpdate();try{for(L=E+1;L<b.length;L++){var Q=this.editor.csvToArray(b[L]);if(Q.length==T.length){var J=null,W=null!=a?Q[a]:null;null!=W&&(J=v.model.getCell(W));null==J&&(J=new mxCell(B,new mxGeometry(D,C,0,0),e||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=W);for(var P=0;P<Q.length;P++)v.setAttributeForCell(J,T[P],Q[P]);v.setAttributeForCell(J,"placeholders","1");J.style=v.replacePlaceholders(J,J.style);
for(N=0;N<G.length;N++)d[G[N].to][J.getAttribute(G[N].to)]=J;null!=H&&"link"!=H&&(v.setLinkForCell(J,J.getAttribute(H)),v.setAttributeForCell(J,H,null));var Y=this.editor.graph.getPreferredSizeForCell(J);J.geometry.width="auto"==g?Y.width+y:parseFloat(g);J.geometry.height="auto"==k?Y.height+y:parseFloat(k);C+=J.geometry.height+u;c.push(v.addCell(J))}}null==e&&v.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var U=c.slice(),O=c.slice(),N=0;N<G.length;N++)for(var R=G[N],L=0;L<c.length;L++){var J=
c[L],V=J.getAttribute(R.from);if(null!=V){v.setAttributeForCell(J,R.from,null);for(var S=V.split(","),P=0;P<S.length;P++){var X=d[R.to][S[P]];null!=X&&(O.push(v.insertEdge(null,null,R.label||"",R.invert?X:J,R.invert?J:X,R.style||v.createCurrentEdgeStyle())),mxUtils.remove(R.invert?J:X,U))}}}if(null!=F)for(L=0;L<c.length;L++)for(J=c[L],P=0;P<F.length;P++)v.setAttributeForCell(J,mxUtils.trim(F[P]),null);var aa=new mxParallelEdgeLayout(v);aa.spacing=w;var ea=function(){aa.execute(v.getDefaultParent());
for(var a=0;a<c.length;a++){var b=v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==g&&(b.width=Math.round(v.snap(b.width)));"auto"==k&&(b.height=Math.round(v.snap(b.height)))}};if("circle"==A){var ba=new mxCircleLayout(v);ba.resetEdges=!1;var fa=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return fa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ea()},!0,x);x=null}else if("horizontaltree"==A||
"verticaltree"==A||"auto"==A&&O.length==2*c.length-1&&1==U.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==A);ca.levelDistance=u;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),0<U.length?U[0]:null)},!0,x);x=null}else if("horizontalflow"==A||"verticalflow"==A||"auto"==A&&1==U.length){v.view.validate();var da=new mxHierarchicalLayout(v,"horizontalflow"==A?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);da.intraCellSpacing=
u;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(v.getDefaultParent(),O);v.moveCells(O,D,z)},!0,x);x=null}else if("organic"==A||"auto"==A&&O.length>c.length){v.view.validate();var Z=new mxFastOrganicLayout(v);Z.forceConstant=3*u;Z.resetEdges=!1;var ga=Z.isVertexIgnored;Z.isVertexIgnored=function(a){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=w;this.executeLayout(function(){Z.execute(v.getDefaultParent());ea()},!0,x);x=null}this.hideDialog()}finally{v.model.endUpdate()}null!=
x&&x()}}catch(ha){this.handleError(ha)}};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(" "),
a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",k="auto",v=40,t=40,x=0,w=this.editor.graph;w.getGraphBounds();for(var y=function(){w.setSelectionCells(O);w.scrollCellToVisible(w.getSelectionCell())},C=w.getFreeInsertPoint(),D=C.x,z=C.y,C=z,B=null,A="auto",G=[],H=null,F=null,E=0;E<b.length&&"#"==b[E].charAt(0);){a=b[E];for(E++;E<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[E].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[E].substring(1)),E++;if("#"!=a.charAt(1)){var M=a.indexOf(":");
if(0<M){var I=mxUtils.trim(a.substring(1,M)),K=mxUtils.trim(a.substring(M+1));"label"==I?B=w.sanitizeHtml(K):"style"==I?e=K:"identity"==I&&0<K.length&&"-"!=K?f=K:"width"==I?g=K:"height"==I?k=K:"ignore"==I?F=K.split(","):"connect"==I?G.push(JSON.parse(K)):"link"==I?H=K:"padding"==I?x=parseFloat(K):"edgespacing"==I?v=parseFloat(K):"nodespacing"==I?t=parseFloat(K):"layout"==I&&(A=K)}}}var T=this.editor.csvToArray(b[E]);a=null;if(null!=f)for(var L=0;L<T.length;L++)if(f==T[L]){a=L;break}null==B&&(B="%"+
T[0]+"%");if(null!=G)for(var N=0;N<G.length;N++)null==d[G[N].to]&&(d[G[N].to]={});w.model.beginUpdate();try{for(L=E+1;L<b.length;L++){var Q=this.editor.csvToArray(b[L]);if(Q.length==T.length){var J=null,W=null!=a?Q[a]:null;null!=W&&(J=w.model.getCell(W));null==J&&(J=new mxCell(B,new mxGeometry(D,C,0,0),e||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=W);for(var P=0;P<Q.length;P++)w.setAttributeForCell(J,T[P],Q[P]);w.setAttributeForCell(J,"placeholders","1");J.style=w.replacePlaceholders(J,J.style);
for(N=0;N<G.length;N++)d[G[N].to][J.getAttribute(G[N].to)]=J;null!=H&&"link"!=H&&(w.setLinkForCell(J,J.getAttribute(H)),w.setAttributeForCell(J,H,null));var Y=this.editor.graph.getPreferredSizeForCell(J);J.geometry.width="auto"==g?Y.width+x:parseFloat(g);J.geometry.height="auto"==k?Y.height+x:parseFloat(k);C+=J.geometry.height+t;c.push(w.addCell(J))}}null==e&&w.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var U=c.slice(),O=c.slice(),N=0;N<G.length;N++)for(var R=G[N],L=0;L<c.length;L++){var J=
c[L],V=J.getAttribute(R.from);if(null!=V){w.setAttributeForCell(J,R.from,null);for(var S=V.split(","),P=0;P<S.length;P++){var X=d[R.to][S[P]];null!=X&&(O.push(w.insertEdge(null,null,R.label||"",R.invert?X:J,R.invert?J:X,R.style||w.createCurrentEdgeStyle())),mxUtils.remove(R.invert?J:X,U))}}}if(null!=F)for(L=0;L<c.length;L++)for(J=c[L],P=0;P<F.length;P++)w.setAttributeForCell(J,mxUtils.trim(F[P]),null);var ba=new mxParallelEdgeLayout(w);ba.spacing=v;var ea=function(){ba.execute(w.getDefaultParent());
for(var a=0;a<c.length;a++){var b=w.getCellGeometry(c[a]);b.x=Math.round(w.snap(b.x));b.y=Math.round(w.snap(b.y));"auto"==g&&(b.width=Math.round(w.snap(b.width)));"auto"==k&&(b.height=Math.round(w.snap(b.height)))}};if("circle"==A){var ca=new mxCircleLayout(w);ca.resetEdges=!1;var fa=ca.isVertexIgnored;ca.isVertexIgnored=function(a){return fa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ca.execute(w.getDefaultParent());ea()},!0,y);y=null}else if("horizontaltree"==A||
"verticaltree"==A||"auto"==A&&O.length==2*c.length-1&&1==U.length){w.view.validate();var Z=new mxCompactTreeLayout(w,"horizontaltree"==A);Z.levelDistance=t;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(w.getDefaultParent(),0<U.length?U[0]:null)},!0,y);y=null}else if("horizontalflow"==A||"verticalflow"==A||"auto"==A&&1==U.length){w.view.validate();var da=new mxHierarchicalLayout(w,"horizontalflow"==A?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);da.intraCellSpacing=
t;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(w.getDefaultParent(),O);w.moveCells(O,D,z)},!0,y);y=null}else if("organic"==A||"auto"==A&&O.length>c.length){w.view.validate();var aa=new mxFastOrganicLayout(w);aa.forceConstant=3*t;aa.resetEdges=!1;var ga=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ba=new mxParallelEdgeLayout(w);ba.spacing=v;this.executeLayout(function(){aa.execute(w.getDefaultParent());ea()},!0,y);y=null}this.hideDialog()}finally{w.model.endUpdate()}null!=
y&&y()}}catch(ha){this.handleError(ha)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var g=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=g.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var f=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return f.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
a,8/a)};var e=b.init;b.init=function(){e.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=
f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/
a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);
var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=
a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));
@ -7948,7 +7948,7 @@ mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.wai
mxAsyncCanvas.prototype.setAlpha=function(a){this.state.alpha=a};mxAsyncCanvas.prototype.setFontColor=function(a){this.state.fontColor=a};mxAsyncCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAsyncCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAsyncCanvas.prototype.setFontSize=function(a){this.state.fontSize=a};
mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,b,c,d){};mxAsyncCanvas.prototype.roundrect=function(a,b,c,d,f,g){};mxAsyncCanvas.prototype.ellipse=function(a,b,c,d){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a};
mxAsyncCanvas.prototype.image=function(a,b,c,d,f,g,k,e){f=this.rewriteImageSource(f);a=this.htmlCanvas.images[f];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[f]=a,a.src=f)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
mxAsyncCanvas.prototype.text=function(a,b,c,d,f,g,k,e,h,l,m,n){if(null!=f&&0!=f.length&&(a=this.state.scale,"html"==h&&"function"===typeof html2canvas)){this.incWaitCounter();var t=this.canvasIndex++;html2canvas(f,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[t]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
mxAsyncCanvas.prototype.text=function(a,b,c,d,f,g,k,e,h,l,m,n){if(null!=f&&0!=f.length&&(a=this.state.scale,"html"==h&&"function"===typeof html2canvas)){this.incWaitCounter();var u=this.canvasIndex++;html2canvas(f,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[u]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,f){return c+c+d+d+f+f});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};
mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a;this.ctx.scale(a,a)};mxJsCanvas.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b;this.ctx.translate(a,b)};
@ -8195,7 +8195,7 @@ this.contentChanged();null!=c&&c()}),mxUtils.bind(this,function(a){this.savingFi
GitHubClient.prototype.updateUser=function(a,b,c){var d=!0,f=window.setTimeout(mxUtils.bind(this,function(){d=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(g){window.clearTimeout(f);d&&(401===g.getStatus()?c?b({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,b,!0)}),b)):200>g.getStatus()||300<=g.getStatus()?b({message:mxResources.get("accessDenied")}):
(g=JSON.parse(g.getText()),this.setUser(new DrawioUser(g.id,g.email,g.name)),a()))}))};
GitHubClient.prototype.authenticate=function(a,b){if(null==window.onGitHubCallback){var c=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(f,g){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,e){if(d)if(window.onGitHubCallback=null,d=!1,null==k)b({message:mxResources.get("accessDenied"),retry:c});else{var h=mxUtils.bind(this,function(){var c=
!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:h})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(h){window.clearTimeout(d);if(c)try{if(200>h.getStatus()||300<=h.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=g&&g();var k=h.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);f&&this.setPersistentToken(this.token);a()}}catch(q){b(q)}finally{null!=e&&
!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:h})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(h){window.clearTimeout(d);if(c)try{if(200>h.getStatus()||300<=h.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=g&&g();var k=h.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);f&&this.setPersistentToken(this.token);a()}}catch(p){b(p)}finally{null!=e&&
e.close()}}))});h()}else null!=e&&e.close()}):b({message:mxResources.get("serviceUnavailableOrBlocked"),retry:c})}),mxUtils.bind(this,function(){d&&(window.onGitHubCallback=null,d=!1,b({message:mxResources.get("accessDenied"),retry:c}))}))});c()}else b({code:App.ERROR_BUSY})};
GitHubClient.prototype.executeRequest=function(a,b,c){var d=mxUtils.bind(this,function(g){var k=!0,e=window.setTimeout(mxUtils.bind(this,function(){k=!1;c({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),h=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+h)};a.send(mxUtils.bind(this,function(){window.clearTimeout(e);if(k)if(200<=a.getStatus()&&299>=a.getStatus())b(a);else if(401===a.getStatus())g?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
function(){this.authenticate(function(){f(!0)},c)})}):this.authenticate(function(){d(!0)},c);else if(403===a.getStatus()){var h=!1;try{var m=JSON.parse(a.getText());null!=m&&null!=m.errors&&0<m.errors.length&&(h="too_large"==m.errors[0].code)}catch(n){}c({message:mxResources.get(h?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?c({message:mxResources.get("fileNotFound")}):409===a.getStatus()?c({status:409}):c({message:mxResources.get("error")+" "+a.getStatus()})}),c)}),f=mxUtils.bind(this,
@ -8203,8 +8203,8 @@ function(a){null==this.user?this.updateUser(function(){f(!0)},c,a):d(a)});null==
GitHubClient.prototype.getFile=function(a,b,c,d,f){d=null!=d?d:!1;var g=a.split("/"),k=g[0],e=g[1],h=g[2];a=g.slice(3,g.length).join("/");!f&&(/\.vsdx$/i.test(a)||/\.gliffy$/i.test(a)||/\.png$/i.test(a))?null!=this.token?(f=this.baseUrl+"/repos/"+k+"/"+e+"/contents/"+a+"?ref="+h+"&token="+this.token,g=a.split("/"),this.ui.convertFile(f,0<g.length?g[g.length-1]:a,null,this.extension,b,c)):c({message:mxResources.get("accessDenied")}):(a=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+e+"/contents/"+a+
"?ref="+h,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.createGitHubFile(k,e,h,JSON.parse(a.getText()),d))}catch(m){c(m)}}),c))};
GitHubClient.prototype.createGitHubFile=function(a,b,c,d,f){a={org:a,repo:b,ref:c,name:d.name,path:d.path,sha:d.sha,html_url:d.html_url,download_url:d.download_url};b=d.content;"base64"===d.encoding&&(b=/\.jpe?g$/i.test(d.name)?"data:image/jpeg;base64,"+b:/\.gif$/i.test(d.name)?"data:image/gif;base64,"+b:Base64.decode(b));return f?new GitHubLibrary(this.ui,b,a):new GitHubFile(this.ui,b,a)};GitHubClient.prototype.insertLibrary=function(a,b,c,d,f){this.insertFile(a,b,c,d,!0,f,!1)};
GitHubClient.prototype.insertFile=function(a,b,c,d,f,g,k){f=null!=f?f:!1;g=g.split("/");var e=g[0],h=g[1],l=g[2],m=g.slice(3,g.length).join("/");0<m.length&&(m+="/");m+=a;this.checkExists(e+"/"+h+"/"+l+"/"+m,!0,mxUtils.bind(this,function(g,t){g?f?(k||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(e,h,l,m,a,b,t,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());c(this.createGitHubFile(e,h,l,b.content,f))}catch(u){d(u)}}),d)}),d)):c(new GitHubFile(this.ui,
b,{org:e,repo:h,ref:l,name:a,path:m,sha:t,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,b,c,d){var f=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(b?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){f();c(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
GitHubClient.prototype.insertFile=function(a,b,c,d,f,g,k){f=null!=f?f:!1;g=g.split("/");var e=g[0],h=g[1],l=g[2],m=g.slice(3,g.length).join("/");0<m.length&&(m+="/");m+=a;this.checkExists(e+"/"+h+"/"+l+"/"+m,!0,mxUtils.bind(this,function(g,u){g?f?(k||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(e,h,l,m,a,b,u,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());c(this.createGitHubFile(e,h,l,b.content,f))}catch(t){d(t)}}),d)}),d)):c(new GitHubFile(this.ui,
b,{org:e,repo:h,ref:l,name:a,path:m,sha:u,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,b,c,d){var f=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(b?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){f();c(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
GitHubClient.prototype.writeFile=function(a,b,c,d,f,g,k,e,h){g.length>=this.maxFileSize?h({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(g.length)+" / 1 MB)"}):(c={path:d,branch:decodeURIComponent(c),message:f,content:g},null!=k&&(c.sha=k),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+b+"/contents/"+d,JSON.stringify(c),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){e(a)}),h))};
GitHubClient.prototype.checkExists=function(a,b,c){this.getFile(a,mxUtils.bind(this,function(d){if(b&&null!=d.meta){var f=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){f();c(!0,d.meta.sha)},function(){f();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(a){c(!0)}),null,!0)};
GitHubClient.prototype.saveFile=function(a,b,c){var d=a.meta.org,f=a.meta.repo,g=a.meta.ref,k=a.meta.path;this.showCommitDialog(a.meta.name,null==a.meta.sha||a.meta.isNew,mxUtils.bind(this,function(e){var h=Base64.encode(a.getData()),l=mxUtils.bind(this,function(m){this.writeFile(d,f,g,k,e,h,m,mxUtils.bind(this,function(c){delete a.meta.isNew;b(JSON.parse(c.getText()))}),mxUtils.bind(this,function(a){null!=a&&409==a.status?(resume=this.ui.spinner.pause(),a=new ErrorDialog(this.ui,mxResources.get("errorSavingFile"),
@ -8212,14 +8212,14 @@ mxResources.get("fileChangedOverwrite"),mxResources.get("cancel"),mxUtils.bind(t
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,b){var c=null,d=null,f=null,g=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="224px";var e=document.createElement("h3");mxUtils.write(e,mxResources.get(a?"selectFile":"selectFolder"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(e);var h=document.createElement("div");h.style.whiteSpace="nowrap";h.style.overflow="auto";h.style.height="194px";
k.appendChild(h);var l=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){b(c+"/"+d+"/"+encodeURIComponent(f)+"/"+g)}));this.ui.showDialog(l.container,340,270,!0,!0);a&&l.okButton.parentNode.removeChild(l.okButton);var m=mxUtils.bind(this,function(a,b){var c=document.createElement("a");c.setAttribute("href","javascript:void(0);");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);return c}),n=mxUtils.bind(this,function(a){var b=document.createElement("div");b.style.marginBottom="8px";b.appendChild(m(c+
"/"+d,mxUtils.bind(this,function(){g=null;w()})));a||(mxUtils.write(b," / "),b.appendChild(m(decodeURIComponent(f),mxUtils.bind(this,function(){g=null;p()}))));if(null!=g&&0<g.length){var e=g.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(m(e[a],mxUtils.bind(this,function(){g=e.slice(0,a+1).join("/");q()})))})(a)}h.appendChild(b)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
(g=f=d=c=null,w()):this.ui.hideDialog()}))}),q=mxUtils.bind(this,function(){var e=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+d+"/contents/"+g+"?ref="+encodeURIComponent(f),null,"GET");l.okButton.removeAttribute("disabled");h.innerHTML="";this.ui.spinner.spin(h,mxResources.get("loading"));this.executeRequest(e,mxUtils.bind(this,function(e){n();this.ui.spinner.stop();var k=JSON.parse(e.getText());h.appendChild(m("../ [Up]",mxUtils.bind(this,function(){if(""==g)g=null,w();else{var a=g.split("/");
g=a.slice(0,a.length-1).join("/");q()}})));mxUtils.br(h);null==k||0==k.length?mxUtils.write(h,mxResources.get("noFiles")):(e=mxUtils.bind(this,function(e){for(var l=0;l<k.length;l++)mxUtils.bind(this,function(k){e==("dir"==k.type)&&(h.appendChild(m(k.name+("dir"==k.type?"/":""),mxUtils.bind(this,function(){"dir"==k.type?(g=k.path,q()):a&&"file"==k.type&&(this.ui.hideDialog(),b(c+"/"+d+"/"+encodeURIComponent(f)+"/"+k.path))}))),mxUtils.br(h))})(k[l])}),e(!0),a&&e(!1))}),t)}),p=mxUtils.bind(this,function(a){null==
a&&(h.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+d+"/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(h,mxResources.get("loading"));this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();n(!0);b=JSON.parse(b.getText());h.appendChild(m("../ [Up]",mxUtils.bind(this,function(){g=null;w()})));mxUtils.br(h);if(null==b||0==b.length)mxUtils.write(h,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,
function(a){h.appendChild(m(a.name,mxUtils.bind(this,function(){f=a.name;g="";q()})));mxUtils.br(h)})(b[c]);if(100==b.length){var d=mxUtils.bind(this,function(){h.scrollTop==h.scrollHeight-h.offsetHeight&&(mxEvent.removeListener(h,"scroll",d),p(a+1))});mxEvent.addListener(h,"scroll",d)}}}),t)}),w=mxUtils.bind(this,function(a){null==a&&(h.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(h,
mxResources.get("loading"));this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(h,mxResources.get("noFiles"));else{h.appendChild(m(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 b=a.split("/");if(1<b.length){a=b[0];var e=b[1];3>b.length?(c=a,d=e,g=f=null,p()):this.ui.spinner.spin(h,
mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+e+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();c=a.meta.org;d=a.meta.repo;f=decodeURIComponent(a.meta.ref);g="";q()}),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(h);mxUtils.br(h);for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a){h.appendChild(m(a.full_name,mxUtils.bind(this,function(){c=a.owner.login;d=a.name;f=a.default_branch;g="";q()})));mxUtils.br(h)})(b[e])}if(100==b.length){var k=mxUtils.bind(this,function(){h.scrollTop==h.scrollHeight-h.offsetHeight&&(mxEvent.removeListener(h,"scroll",k),w(a+1))});mxEvent.addListener(h,"scroll",k)}}),t)});w()};
"/"+d,mxUtils.bind(this,function(){g=null;v()})));a||(mxUtils.write(b," / "),b.appendChild(m(decodeURIComponent(f),mxUtils.bind(this,function(){g=null;q()}))));if(null!=g&&0<g.length){var e=g.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(m(e[a],mxUtils.bind(this,function(){g=e.slice(0,a+1).join("/");p()})))})(a)}h.appendChild(b)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
(g=f=d=c=null,v()):this.ui.hideDialog()}))}),p=mxUtils.bind(this,function(){var e=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+d+"/contents/"+g+"?ref="+encodeURIComponent(f),null,"GET");l.okButton.removeAttribute("disabled");h.innerHTML="";this.ui.spinner.spin(h,mxResources.get("loading"));this.executeRequest(e,mxUtils.bind(this,function(e){n();this.ui.spinner.stop();var k=JSON.parse(e.getText());h.appendChild(m("../ [Up]",mxUtils.bind(this,function(){if(""==g)g=null,v();else{var a=g.split("/");
g=a.slice(0,a.length-1).join("/");p()}})));mxUtils.br(h);null==k||0==k.length?mxUtils.write(h,mxResources.get("noFiles")):(e=mxUtils.bind(this,function(e){for(var l=0;l<k.length;l++)mxUtils.bind(this,function(k){e==("dir"==k.type)&&(h.appendChild(m(k.name+("dir"==k.type?"/":""),mxUtils.bind(this,function(){"dir"==k.type?(g=k.path,p()):a&&"file"==k.type&&(this.ui.hideDialog(),b(c+"/"+d+"/"+encodeURIComponent(f)+"/"+k.path))}))),mxUtils.br(h))})(k[l])}),e(!0),a&&e(!1))}),u)}),q=mxUtils.bind(this,function(a){null==
a&&(h.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+d+"/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(h,mxResources.get("loading"));this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();n(!0);b=JSON.parse(b.getText());h.appendChild(m("../ [Up]",mxUtils.bind(this,function(){g=null;v()})));mxUtils.br(h);if(null==b||0==b.length)mxUtils.write(h,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,
function(a){h.appendChild(m(a.name,mxUtils.bind(this,function(){f=a.name;g="";p()})));mxUtils.br(h)})(b[c]);if(100==b.length){var d=mxUtils.bind(this,function(){h.scrollTop==h.scrollHeight-h.offsetHeight&&(mxEvent.removeListener(h,"scroll",d),q(a+1))});mxEvent.addListener(h,"scroll",d)}}}),u)}),v=mxUtils.bind(this,function(a){null==a&&(h.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(h,
mxResources.get("loading"));this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(h,mxResources.get("noFiles"));else{h.appendChild(m(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 b=a.split("/");if(1<b.length){a=b[0];var e=b[1];3>b.length?(c=a,d=e,g=f=null,q()):this.ui.spinner.spin(h,
mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+e+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();c=a.meta.org;d=a.meta.repo;f=decodeURIComponent(a.meta.ref);g="";p()}),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(h);mxUtils.br(h);for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a){h.appendChild(m(a.full_name,mxUtils.bind(this,function(){c=a.owner.login;d=a.name;f=a.default_branch;g="";p()})));mxUtils.br(h)})(b[e])}if(100==b.length){var k=mxUtils.bind(this,function(){h.scrollTop==h.scrollHeight-h.offsetHeight&&(mxEvent.removeListener(h,"scroll",k),v(a+1))});mxEvent.addListener(h,"scroll",k)}}),u)});v()};
GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};function ChatWindow(a,b,c,d,f,g,k,e){this.editorUi=a;this.doc=e.doc;this.rtModel=e.rt;this.chatHistory=e.chatHistory;this.chatMap=e.chatMap;this.configCollabInfo();c=document.createElement("div");c.id="mainDiv";e=document.createElement("div");e.style.padding="3px";c.appendChild(e);var h=document.createElement("div");h.style.paddingLeft="3px";h.style.paddingRight="15px";a.editor.graph.isEnabled()&&c.appendChild(h);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
this.chatArea.style.overflowX="hidden";this.chatArea.style.overflowY="auto";this.chatArea.style.width="98%";this.chatArea.style.resize="none";e.appendChild(this.chatArea);this.chatLineArea=document.createElement("textarea");this.chatLineArea.style.resize="none";this.chatLineArea.rows=1;this.chatLineArea.onkeydown=mxUtils.bind(this,function(a){13==(a.keyCode||window.event.keyCode)&&""!=this.chatLineArea.value&&this.sendMessage()});this.sendBtn=document.createElement("button");this.sendBtn.style.cssFloat=
"right";this.sendBtn.style.styleFloat="right";mxUtils.write(this.sendBtn,mxResources.get("sendMessage"));mxEvent.addListener(this.sendBtn,"click",mxUtils.bind(this,function(a){""!=this.chatLineArea.value&&this.sendMessage()}));h.appendChild(this.chatLineArea);h.appendChild(this.sendBtn);this.window=new mxWindow(b,c,d,f,g,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!0);this.window.setScrollable(!0);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
@ -8241,7 +8241,7 @@ replay:"/plugins/replay.js"};App.getStoredMode=function(){var a=null;null==a&&is
2)?(mxscript(App.DROPBOX_URL),mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=
null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})();
App.main=function(a){var b=null;EditorUi.enableLogging&&(window.onerror=function(a,c,d,f,g){try{if(a!=b&&(null==a||null==c||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){b=a;var e=new Image,h=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";e.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+h+"&v="+encodeURIComponent(EditorUi.VERSION)+
"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=g&&null!=g.stack?"&stack="+encodeURIComponent(g.stack):"")}}catch(q){}});"atlas"==uiTheme&&mxClient.link("stylesheet","styles/atlas.css");if(null!=window.mxscript){"0"!=urlParams.chrome&&mxscript("js/jscolor/jscolor.js");if("1"==urlParams.offline){mxscript("js/shapes.min.js");var c=document.createElement("iframe");c.setAttribute("width",
"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=g&&null!=g.stack?"&stack="+encodeURIComponent(g.stack):"")}}catch(p){}});"atlas"==uiTheme&&mxClient.link("stylesheet","styles/atlas.css");if(null!=window.mxscript){"0"!=urlParams.chrome&&mxscript("js/jscolor/jscolor.js");if("1"==urlParams.offline){mxscript("js/shapes.min.js");var c=document.createElement("iframe");c.setAttribute("width",
"0");c.setAttribute("height","0");c.setAttribute("src","offline.html");document.body.appendChild(c);mxStencilRegistry.stencilSet={};mxStencilRegistry.getStencil=function(a){return mxStencilRegistry.stencils[a]};mxStencilRegistry.loadStencilSet=function(a,b,c){a=a.substring(a.indexOf("/")+1);a="mxgraph."+a.substring(0,a.length-4).replace(/\//g,".");a=mxStencilRegistry.stencilSet[a];null!=a&&mxStencilRegistry.parseStencilSet(a,b,!1)};for(c=mxUtils.load("stencils.xml").getXml().documentElement.firstChild;null!=
c;)"shapes"==c.nodeName&&null!=c.getAttribute("name")&&(mxStencilRegistry.stencilSet[c.getAttribute("name").toLowerCase()]=c,mxStencilRegistry.parseStencilSet(c)),c=c.nextSibling}"0"==urlParams.picker||mxClient.IS_QUIRKS||8==document.documentMode||mxscript(document.location.protocol+"//www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22picker%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22"+mxClient.language+"%22%7D%5D%7D");if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var c=
mxSettings.getPlugins(),d=urlParams.p;(null!=d||null!=c&&0<c.length)&&App.initPluginCallback();if(null!=d)for(var f=d.split(";"),d=0;d<f.length;d++){var g=App.pluginRegistry[f[d]];null!=g?mxscript(g):null!=window.console&&console.log("Unknown plugin:",f[d])}if(null!=c&&0<c.length&&"0"!=urlParams.plugins){f=window.location.protocol+"//"+window.location.host;g=!0;for(d=0;d<c.length&&g;d++)"/"!=c[d].charAt(0)&&c[d].substring(0,f.length)!=f&&(g=!1);if(g||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",
@ -8279,13 +8279,13 @@ k+'" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'
App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);var a=this.getCurrentFile();this.actions.get("revisionHistory").setEnabled(null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile))};App.prototype.updateDraft=function(){isLocalStorage&&null!=localStorage&&localStorage.setItem(".draft",JSON.stringify({modified:(new Date).getTime(),data:this.getFileData()}))};App.prototype.getDraft=function(){return null};
App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var b=this.getRecent();if(null==b)b=[];else for(var c=0;c<b.length;c++)b[c].id==a.id&&b.splice(c,1);null!=b&&(b.unshift(a),b=b.slice(0,5),localStorage.setItem(".recent",JSON.stringify(b)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(b){}return null}};
App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(b){}};App.prototype.removeDraft=function(){if(isLocalStorage&&null!=localStorage&&"0"==urlParams.splash)try{localStorage.removeItem(".draft")}catch(a){}};
App.prototype.onBeforeUnload=function(){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.chromeless){if(a.constructor!=DriveFile&&a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
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.chromeless){if(a.constructor!=DriveFile&&a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.lightbox){var a=this.editor.appName,b=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=b&&(a=(null!=b.getTitle()?b.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],b,c=0;256>c;c++){b=c;for(var d=0;8>d;d++)b=b&1?3988292384^b>>>1:b>>>1;a[c]=b}return a};
App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};
App.prototype.getThumbnail=function(a,b){var c=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var d=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),f=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}if(mxClient.IS_CHROMEAPP||!d.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
function(a){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);b(a)}),a,this.thumbImageCache,"#ffffff",function(){b()},null,null,null,null,null,null,d),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var k=document.createElement("canvas"),e=d.getGraphBounds(),h=a/e.width,h=Math.min(1,Math.min(3*a/(4*e.height),h)),l=Math.floor(e.x),m=Math.floor(e.y);k.setAttribute("width",Math.ceil(h*(e.width+4)));k.setAttribute("height",Math.ceil(h*(e.height+4)));var n=k.getContext("2d");
n.scale(h,h);n.translate(-l,-m);var t=d.background;if(null==t||""==t||t==mxConstants.NONE)t="#ffffff";n.save();n.fillStyle=t;n.fillRect(l,m,Math.ceil(e.width+4),Math.ceil(e.height+4));n.restore();var q=new mxJsCanvas(k),p=new mxAsyncCanvas(this.thumbImageCache);q.images=this.thumbImageCache.images;var w=new mxImageExport;w.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())};w.drawText=function(a,
b){};w.drawState(d.getView().getState(d.model.root),p);p.finish(mxUtils.bind(this,function(){w.drawState(d.getView().getState(d.model.root),q);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);b(k)}));c=!0}}catch(u){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}return c};
n.scale(h,h);n.translate(-l,-m);var u=d.background;if(null==u||""==u||u==mxConstants.NONE)u="#ffffff";n.save();n.fillStyle=u;n.fillRect(l,m,Math.ceil(e.width+4),Math.ceil(e.height+4));n.restore();var p=new mxJsCanvas(k),q=new mxAsyncCanvas(this.thumbImageCache);p.images=this.thumbImageCache.images;var v=new mxImageExport;v.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())};v.drawText=function(a,
b){};v.drawState(d.getView().getState(d.model.root),q);q.finish(mxUtils.bind(this,function(){v.drawState(d.getView().getState(d.model.root),p);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);b(k)}));c=!0}}catch(t){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}return c};
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(b,c){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(c)if(isLocalStorage)localStorage.setItem(".mode",b);else if("undefined"!=typeof Storage){var d=new Date;d.setYear(d.getFullYear()+1);document.cookie="MODE="+b+"; expires="+d.toUTCString()}null!=this.appIcon&&(d=this.getCurrentFile(),b=null!=d?d.getMode():null,b==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):b==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):b==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default"))}})();
@ -8334,9 +8334,9 @@ function(a){h();this.fileCreated(a,c,g,f)}),l)):d==App.MODE_GITHUB&&null!=this.g
!1,k):d==App.MODE_BROWSER?(h(),d=mxUtils.bind(this,function(){var d=new StorageFile(this,b,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,c,g,f)}),l)}),null==localStorage.getItem(a)?d():this.confirm(mxResources.get("replaceIt",[a]),d,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(h(),this.fileCreated(new LocalFile(this,b,a,null==d),c,g,f))}};
App.prototype.fileCreated=function(a,b,c,d){var f=window.location.pathname;null!=b&&0<b.length&&(f+="?libs="+b);f=this.getUrl(f);a.getMode()!=App.MODE_DEVICE&&(f+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var g=a.getData(),g=0<g.length?this.editor.extractGraphModel(mxUtils.parseXml(g).documentElement,!0):null,k=window.location.protocol+"//"+window.location.hostname+f,e=null;if(null!=g&&/\.svg$/i.test(a.getTitle())){e=this.createTemporaryGraph(this.editor.graph.getStylesheet());
document.body.appendChild(e.container);node=g;if(null!=node){var h=null;if("diagram"==node.nodeName)h=node;else if("mxfile"==node.nodeName){var l=node.getElementsByTagName("diagram");if(0<l.length){var h=l[0],m=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?h.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:m.apply(this,arguments)}}}null!=h&&(l=e.decompress(mxUtils.getTextContent(h)),null!=l&&0<l.length&&(node=mxUtils.parseXml(l).documentElement))}l=
this.editor.graph;try{this.editor.graph=e,this.editor.setGraphXml(node)}catch(q){}finally{this.editor.graph=l}}a.setData(this.createFileData(g,e,a,k));null!=e&&e.container.parentNode.removeChild(e.container);var n=mxUtils.bind(this,function(){this.spinner.stop()}),t=mxUtils.bind(this,function(){n();var e=this.getCurrentFile();null==c&&null!=e&&(c=!e.isModified()&&null==e.getMode());var g=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);c&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));
this.editor.graph;try{this.editor.graph=e,this.editor.setGraphXml(node)}catch(p){}finally{this.editor.graph=l}}a.setData(this.createFileData(g,e,a,k));null!=e&&e.container.parentNode.removeChild(e.container);var n=mxUtils.bind(this,function(){this.spinner.stop()}),u=mxUtils.bind(this,function(){n();var e=this.getCurrentFile();null==c&&null!=e&&(c=!e.isModified()&&null==e.getMode());var g=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);c&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));
null!=b&&this.sidebar.showEntries(b)}),h=mxUtils.bind(this,function(){c||null==e||!e.isModified()?g():this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=d&&d();null==c||c?h():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=d&&d(),window.openWindow(f,null,h))});a.constructor==LocalFile||a.constructor==DriveFile?
t():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){t()}),mxUtils.bind(this,function(a){n();this.handleError(a)}))}};
u():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){u()}),mxUtils.bind(this,function(a){n();this.handleError(a)}))}};
App.prototype.loadFile=function(a,b,c){this.hideDialog();var d=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var d=localStorage.getItem(a);if(null!=d)this.fileLoaded(new StorageFile(this,d,a));else throw{message:mxResources.get("fileNotFound")};}catch(h){this.handleError(h,mxResources.get("errorLoadingFile"),
mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=c)this.spinner.stop(),this.fileLoaded(c);else if("R"==a.charAt(0))this.spinner.stop(),d=decodeURIComponent(a.substring(1)),"<"!=d.charAt(0)&&(d=this.editor.graph.decompress(d)),
d=new LocalFile(this,d,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),d.getHash=function(){return a},this.fileLoaded(d);else if("U"==a.charAt(0)){var f=decodeURIComponent(a.substring(1));this.loadTemplate(f,mxUtils.bind(this,function(c){this.spinner.stop();if(null!=c&&0<c.length){var d=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var e=f,g=f.lastIndexOf("."),h=e.lastIndexOf("/");g>h&&0<h&&(e=e.substring(h+1,g),g=f.substring(g),".png"==
@ -8413,9 +8413,9 @@ l.setToggleAction(!0);l.setSelectedCallback(function(){return c.shadowVisible});
function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP?window.open("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?window.open("shortcuts.svg"):window.open("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);
b.init()});a.actions.addAction("quickStart...",function(){window.open("https://youtu.be/Z0D96ZikMkc")});l=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(a,document.body.offsetWidth-380,230,280,120),this.tagsWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):
this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));l=a.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,204,140),this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",
function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){var b=mxUtils.bind(this,function(){if("undefined"!==typeof VsdxExport)try{(new VsdxExport(a)).exportCurrentDiagrams()}catch(u){}});
function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){var b=mxUtils.bind(this,function(){if("undefined"!==typeof VsdxExport)try{(new VsdxExport(a)).exportCurrentDiagrams()}catch(t){}});
"undefined"!==typeof VsdxExport||this.loadingVsdx||a.isOffline()?window.setTimeout(b,0):(this.loadingVsdx=!0,mxscript("/js/vsdx.min.js",b))}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=
!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var t=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=t.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width=
!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var u=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=u.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width=
"16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,d){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"]);else{var e=b.addItem("Search",null,null,d,null,null,!1),f=document.createElement("div");
f.style.display="inline";f.innerHTML=':<form style="display:inline;margin-left:8px;"target="_blank" method="get" action="https://desk.draw.io/support/search/solutions"><input type="text" name="term" size="25"></form>';e.firstChild.nextSibling.appendChild(f);e.style.backgroundColor="whiteSmoke";e.style.cursor="default";var g=f.getElementsByTagName("form")[0],h=f.getElementsByTagName("input")[0];null!=h&&null!=g&&(mxEvent.addListener(g,"submit",function(){if(EditorUi.enableLogging)try{(new Image).src=
(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity=CONFIG&msg=helpsearch:"+encodeURIComponent(h.value)+"&v="+encodeURIComponent(EditorUi.VERSION)}catch(D){}window.setTimeout(function(){a.menubar.hideMenu()},0)}),mxEvent.addGestureListeners(e,function(a){document.activeElement!=h&&h.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)}),window.setTimeout(function(){h.focus()},0));this.addMenuItems(b,["-","quickStart","userManual","keyboardShortcuts",
@ -8463,10 +8463,10 @@ b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(
"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(a.getEditBlankXml(),c)}}));a.actions.addAction("moveToFolder...",
mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+
"...",function(){window.open("http://www.draw.io/app")}));a.actions.put("chromeApp",new Action(mxResources.get("chromeApp")+"...",function(){window.open("https://chrome.google.com/webstore/detail/drawio-desktop/pebppomjfocnoigkeepgbmcifnnlndla")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,
["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var q="horizontalFlow verticalFlow - horizontalTree verticalTree - organic circle - fromText".split(" "),p=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow=
["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var p="horizontalFlow verticalFlow - horizontalTree verticalTree - organic circle - fromText".split(" "),q=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow=
"auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)};a.actions.addAction("insertText",function(){if(c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())){var a=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint(),a=new mxCell("Text",new mxGeometry(a.x,a.y,40,20),"text;html=1;resizable=0;autosize=1;align=left;verticalAlign=top;spacingTop=-4;points=[];");a.vertex=!0;c.startEditingAtCell(c.addCell(a))}},null,null,"Ctrl+Shift+X").isEnabled=g;a.actions.addAction("insertRectangle",
function(){if(c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())){var a=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint(),a=new mxCell("",new mxGeometry(a.x,a.y,120,60),"whiteSpace=wrap;html=1;");a.vertex=!0;c.setSelectionCell(c.addCell(a));c.scrollCellToVisible(c.getSelectionCell())}},null,null,"Ctrl+K").isEnabled=g;a.actions.addAction("insertEllipse",function(){if(c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())){var a=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint(),
a=new mxCell("",new mxGeometry(a.x,a.y,80,80),"ellipse;whiteSpace=wrap;html=1;");a.vertex=!0;c.setSelectionCell(c.addCell(a));c.scrollCellToVisible(c.getSelectionCell())}},null,null,"Ctrl+Shift+K").isEnabled=g;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"insertText insertRectangle insertEllipse - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<q.length;c++)"-"==q[c]?a.addSeparator(b):p(a,b,mxResources.get(q[c])+"...",q[c])})));this.put("openRecent",
a=new mxCell("",new mxGeometry(a.x,a.y,80,80),"ellipse;whiteSpace=wrap;html=1;");a.vertex=!0;c.setSelectionCell(c.addCell(a));c.scrollCellToVisible(c.getSelectionCell())}},null,null,"Ctrl+Shift+K").isEnabled=g;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"insertText insertRectangle insertEllipse - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<p.length;c++)"-"==p[c]?a.addSeparator(b):q(a,b,mxResources.get(p[c])+"...",p[c])})));this.put("openRecent",
new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},
c):k&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):e&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,
function(){a.pickFile(App.MODE_ONEDRIVE)},c):h&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=

File diff suppressed because one or more lines are too long

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

@ -7433,15 +7433,15 @@ encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></
mxResources.get("drawingTooLarge")})}}),g=document.createElement("img");g.setAttribute("src",Editor.facebookImage);g.setAttribute("border","0");k.appendChild(g);k.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");k.style.verticalAlign="bottom";k.style.paddingTop="4px";k.style.minWidth="46px";k.className="geBtn";m.appendChild(k)}7168>f.length&&(k=mxUtils.button("",function(){try{var e="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+
"&url="+encodeURIComponent(b.value);window.open(e)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),g=document.createElement("img"),g.setAttribute("src",Editor.tweetImage),g.setAttribute("border","0"),g.style.marginBottom="5px",k.appendChild(g),k.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),k.style.verticalAlign="bottom",k.style.paddingTop="4px",k.style.minWidth="46px",k.className="geBtn",m.appendChild(k))}g=mxUtils.button(mxResources.get("close"),
function(){a.hideDialog()});m.appendChild(g);k=mxUtils.button(mxResources.get("copy"),function(){b.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?b.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>f.length?mxClient.IS_SF||null!=document.documentMode?g.className="geBtn gePrimaryBtn":(m.appendChild(k),k.className="geBtn gePrimaryBtn",g.className="geBtn"):(m.appendChild(e),g.className="geBtn",e.className=
"geBtn gePrimaryBtn");c.appendChild(m);this.container=c},GoogleSitesDialog=function(a,f){function d(){var b=null!=B.getTitle()?B.getTitle():this.defaultFilename;if(C.checked&&""!=t.value){var a="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=b&&(a+="&title="+encodeURIComponent(b));0<D.length&&(a+="&s="+D);""!=u.value&&"0"!=u.value&&(a+="&border="+u.value);""!=n.value&&(a+="&height="+n.value);a+="&pan="+(v.checked?"1":"0");a+="&zoom="+(p.checked?
"1":"0");a+="&fit="+(z.checked?"1":"0");a+="&resize="+(w.checked?"1":"0");a+="&x0="+Number(k.value);a+="&y0="+e;h.mathEnabled&&(a+="&math=1");x.checked?a+="&edit=_blank":q.checked&&(a+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));g.value=a}else B.constructor==DriveFile||B.constructor==DropboxFile?(a="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?a+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(a+=B.getHash().substring(1),a=B.constructor==DropboxFile?
"geBtn gePrimaryBtn");c.appendChild(m);this.container=c},GoogleSitesDialog=function(a,f){function d(){var b=null!=B.getTitle()?B.getTitle():this.defaultFilename;if(D.checked&&""!=t.value){var a="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=b&&(a+="&title="+encodeURIComponent(b));0<y.length&&(a+="&s="+y);""!=u.value&&"0"!=u.value&&(a+="&border="+u.value);""!=n.value&&(a+="&height="+n.value);a+="&pan="+(v.checked?"1":"0");a+="&zoom="+(p.checked?
"1":"0");a+="&fit="+(A.checked?"1":"0");a+="&resize="+(w.checked?"1":"0");a+="&x0="+Number(k.value);a+="&y0="+e;h.mathEnabled&&(a+="&math=1");x.checked?a+="&edit=_blank":q.checked&&(a+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));g.value=a}else B.constructor==DriveFile||B.constructor==DropboxFile?(a="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?a+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(a+=B.getHash().substring(1),a=B.constructor==DropboxFile?
a+"&type=2":a+"&type=1"),null!=b&&(a+="&title="+encodeURIComponent(b)),""!=n.value&&(b=parseInt(n.value)+parseInt(k.value),a+="&height="+b),g.value=a):g.value=""}var c=document.createElement("div"),h=a.editor.graph,l=h.getGraphBounds(),m=h.view.scale,b=Math.floor(l.x/m-h.view.translate.x),e=Math.floor(l.y/m-h.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","text");g.style.marginBottom="8px";g.style.marginTop=
"2px";g.style.width="410px";c.appendChild(g);mxUtils.br(c);this.init=function(){g.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.setAttribute("size","4");k.style.marginRight="16px";k.style.marginLeft="4px";k.value=b;c.appendChild(k);mxUtils.write(c,mxResources.get("height")+":");var n=document.createElement("input");
n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(l.height/m);c.appendChild(n);mxUtils.br(c);l=document.createElement("hr");l.setAttribute("size","1");l.style.marginBottom="16px";l.style.marginTop="16px";c.appendChild(l);mxUtils.write(c,mxResources.get("publicDiagramUrl")+":");mxUtils.br(c);var t=document.createElement("input");t.setAttribute("type","text");t.setAttribute("size","28");t.style.marginBottom="8px";t.style.marginTop="2px";t.style.width=
"410px";t.value=f||"";c.appendChild(t);mxUtils.br(c);mxUtils.write(c,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";c.appendChild(u);mxUtils.br(c);var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="16px";c.appendChild(v);mxUtils.write(c,mxResources.get("pan")+
" ");var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="8px";c.appendChild(p);mxUtils.write(c,mxResources.get("zoom")+" ");var q=document.createElement("input");q.setAttribute("type","checkbox");q.style.marginLeft="8px";q.setAttribute("title",window.location.href);c.appendChild(q);mxUtils.write(c,mxResources.get("edit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft=
"8px";c.appendChild(x);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="16px";c.appendChild(w);mxUtils.write(c,mxResources.get("resize")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";c.appendChild(z);mxUtils.write(c,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type",
"checkbox");C.style.marginLeft="8px";c.appendChild(C);mxUtils.write(c,mxResources.get("embed")+" ");var D=a.getBasenames().join(";"),B=a.getCurrentFile();mxEvent.addListener(v,"change",d);mxEvent.addListener(p,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(z,"change",d);mxEvent.addListener(q,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(C,"change",d);mxEvent.addListener(n,"change",d);mxEvent.addListener(k,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(t,
"8px";c.appendChild(x);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="16px";c.appendChild(w);mxUtils.write(c,mxResources.get("resize")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";c.appendChild(A);mxUtils.write(c,mxResources.get("fit")+" ");var D=document.createElement("input");D.setAttribute("type",
"checkbox");D.style.marginLeft="8px";c.appendChild(D);mxUtils.write(c,mxResources.get("embed")+" ");var y=a.getBasenames().join(";"),B=a.getCurrentFile();mxEvent.addListener(v,"change",d);mxEvent.addListener(p,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(A,"change",d);mxEvent.addListener(q,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(D,"change",d);mxEvent.addListener(n,"change",d);mxEvent.addListener(k,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(t,
"change",d);d();mxEvent.addListener(g,"click",function(){g.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)});l=document.createElement("div");l.style.paddingTop="12px";l.style.textAlign="right";m=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});m.className="geBtn gePrimaryBtn";l.appendChild(m);c.appendChild(l);this.container=c},CreateGraphDialog=function(a,f,d){var c=document.createElement("div");c.style.textAlign=
"right";this.init=function(){var f=document.createElement("div");f.style.position="relative";f.style.border="1px solid gray";f.style.width="100%";f.style.height="360px";f.style.overflow="hidden";f.style.marginBottom="16px";mxEvent.disableContextMenu(f);c.appendChild(f);var l=new Graph(f);l.setCellsCloneable(!0);l.setPanning(!0);l.setAllowDanglingEdges(!1);l.connectionHandler.select=!1;l.view.setTranslate(20,20);l.border=20;l.panningHandler.useLeftButtonForPanning=!0;var m="curved=1;";l.cellRenderer.installCellOverlayListeners=
function(b,a,e){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(e.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(e){a.fireEvent(new mxEventObject("pointerdown","event",e,"state",b))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchstart",function(e){a.fireEvent(new mxEventObject("pointerdown","event",e,"state",b))})};l.getAllConnectionConstraints=function(){return null};l.connectionHandler.marker.highlight.keepOnTop=
@ -7467,7 +7467,7 @@ p(c4&63)},k=new XMLHttpRequest;k.open("GET",c+function(b){r="";for(d=0;d<b.lengt
g.getModel().beginUpdate();try{cell=g.insertVertex(null,null,b,h.x,h.y,c.width,c.height,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(e.target.result)+";")}finally{g.getModel().endUpdate()}g.setSelectionCell(cell);g.scrollCellToVisible(g.getSelectionCell())};c.src=e.target.result},e.onerror=function(b){a.handleError(b)}):(a.spinner.stop(),a.handleError(e))};k.onerror=function(b){a.handleError(b)};k.send()}}else if("list"==e){if(0<c.length){var g=a.editor.graph,
n=new mxCell(c[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");n.vertex=!0;k=g.getPreferredSizeForCell(n);null!=k&&n.geometry.width<k.width+10&&(n.geometry.width=k.width+10);if(1<c.length)for(var d=1;d<c.length;d++)if("--"==c[d])k=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),
k.vertex=!0,n.geometry.height+=k.geometry.height,n.insert(k);else if(0<c[d].length&&";"!=c[d].charAt(0)){var f=new mxCell(c[d],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");f.vertex=!0;k=g.getPreferredSizeForCell(f);null!=k&&f.geometry.width<k.width&&(f.geometry.width=k.width);n.geometry.width=Math.max(n.geometry.width,f.geometry.width);n.geometry.height+=
f.geometry.height;n.insert(f)}g.setSelectionCells(g.importCells([n],h.x,h.y));g.scrollCellToVisible(g.getSelectionCell())}}else{for(var f=function(b){var a=l[b];null==a&&(a=new mxCell(b,new mxGeometry(0,0,80,30)),a.vertex=!0,l[b]=a,t.push(a));return a},l={},t=[],d=0;d<c.length;d++)if(";"!=c[d].charAt(0)){var m=c[d].split("->");if(2==m.length){var y=f(m[0]),m=f(m[1]),F=new mxCell("",new mxGeometry);F.edge=!0;y.insertEdge(F,!0);m.insertEdge(F,!1);t.push(F)}}if(0<t.length){c=document.createElement("div");
f.geometry.height;n.insert(f)}g.setSelectionCells(g.importCells([n],h.x,h.y));g.scrollCellToVisible(g.getSelectionCell())}}else{for(var f=function(b){var a=l[b];null==a&&(a=new mxCell(b,new mxGeometry(0,0,80,30)),a.vertex=!0,l[b]=a,t.push(a));return a},l={},t=[],d=0;d<c.length;d++)if(";"!=c[d].charAt(0)){var m=c[d].split("->");if(2==m.length){var z=f(m[0]),m=f(m[1]),F=new mxCell("",new mxGeometry);F.edge=!0;z.insertEdge(F,!0);m.insertEdge(F,!1);t.push(F)}}if(0<t.length){c=document.createElement("div");
c.style.visibility="hidden";document.body.appendChild(c);g=new Graph(c);g.getModel().beginUpdate();try{t=g.importCells(t);for(d=0;d<t.length;d++)g.getModel().isVertex(t[d])&&(k=g.getPreferredSizeForCell(t[d]),t[d].geometry.width=Math.max(t[d].geometry.width,k.width),t[d].geometry.height=Math.max(t[d].geometry.height,k.height));n=new mxFastOrganicLayout(g);n.disableEdgeStyle=!1;n.forceConstant=120;n.execute(g.getDefaultParent())}finally{g.getModel().endUpdate()}g.clearCellOverlays();a.editor.graph.setSelectionCells(a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),
h.x,h.y));a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());g.destroy();c.parentNode.removeChild(c)}}}function c(){return"list"==b.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":"plantUmlPng"==b.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
"plantUmlSvg"==b.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":";Example:\na->b\nb->c\nc->a\n"}var h=a.editor.graph.getFreeInsertPoint(),l=document.createElement("div");l.style.textAlign="right";var m=document.createElement("textarea");m.style.resize="none";m.style.width="100%";m.style.height="354px";m.style.marginBottom=
@ -7477,24 +7477,24 @@ b.dataTransfer.files[0];var a=new FileReader;a.onload=function(b){m.value=b.targ
d(m.value,b.value)});l.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||l.appendChild(e);this.container=l},NewDialog=function(a,f,d,c){function h(){if(c)d||a.hideDialog(),c(u,n.value);else{var b=n.value;if(null!=b&&0<b.length){var e=a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null;a.pickFolder(e,function(e){a.createFile(b,u,null!=t&&0<t.length?t:null,null,function(){a.hideDialog()},null,e)},e!=App.MODE_GOOGLE)}}}function l(b,
a,e){null!=v&&(v.style.backgroundColor="transparent",v.style.border="1px solid transparent");u=a;t=e;v=b;v.style.backgroundColor="#e6eff8";v.style.border="1px solid #ccd9ea"}function m(b,a,e,c,g){var k=document.createElement("div");k.className="geTemplate";k.style.height="140px";k.style.width="140px";null!=c&&0<c.length&&k.setAttribute("title",c);if(null!=b&&0<b.length){b.substring(0,b.length-4);k.style.backgroundImage="url("+TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png)";k.style.backgroundPosition=
"center center";k.style.backgroundRepeat="no-repeat";var d=!1;mxEvent.addListener(k,"click",function(e){p.setAttribute("disabled","disabled");k.style.backgroundColor="transparent";k.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+b,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(p.removeAttribute("disabled"),l(k,b.getText(),a),d&&h())}))});mxEvent.addListener(k,"dblclick",function(b){d=!0})}else k.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
mxResources.get(e)+"</td></tr></table>",g&&l(k),mxEvent.addListener(k,"click",function(b){l(k)}),mxEvent.addListener(k,"dblclick",function(b){h()});q.appendChild(k)}function b(){function b(){for(var b=!0;a<C.length&&(b||0!=mxUtils.mod(a,30));)b=C[a++],m(b.url,b.libs,b.title,b.tooltip,b.select),b=!1}var a=0;mxEvent.addListener(q,"scroll",function(a){q.scrollTop+q.clientHeight>=q.scrollHeight&&(b(),mxEvent.consume(a))});var e=null,c;for(c in w){var g=document.createElement("div"),p=mxResources.get(c),
mxResources.get(e)+"</td></tr></table>",g&&l(k),mxEvent.addListener(k,"click",function(b){l(k)}),mxEvent.addListener(k,"dblclick",function(b){h()});q.appendChild(k)}function b(){function b(){for(var b=!0;a<D.length&&(b||0!=mxUtils.mod(a,30));)b=D[a++],m(b.url,b.libs,b.title,b.tooltip,b.select),b=!1}var a=0;mxEvent.addListener(q,"scroll",function(a){q.scrollTop+q.clientHeight>=q.scrollHeight&&(b(),mxEvent.consume(a))});var e=null,c;for(c in w){var g=document.createElement("div"),p=mxResources.get(c),
k=w[c];null==p&&(p=c.substring(0,1).toUpperCase()+c.substring(1));18<p.length&&(p=p.substring(0,18)+"&hellip;");g.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";g.setAttribute("title",p+" ("+k.length+")");mxUtils.write(g,g.getAttribute("title"));x.appendChild(g);null==e&&(e=g,e.style.backgroundColor="#ebf2f9");(function(c,p){mxEvent.addListener(g,"click",function(){e!=p&&(e.style.backgroundColor="",e=p,e.style.backgroundColor=
"#ebf2f9",q.scrollTop=0,q.innerHTML="",a=0,C=w[c],b())})})(c,g)}b()}d=null!=d?d:!0;var e=document.createElement("div");e.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="46px";e.appendChild(g);var k=document.createElement("img");k.setAttribute("border","0");k.setAttribute("align","absmiddle");k.style.width="40px";k.style.height="40px";k.style.marginRight="10px";k.style.paddingBottom="4px";k.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":
"#ebf2f9",q.scrollTop=0,q.innerHTML="",a=0,D=w[c],b())})})(c,g)}b()}d=null!=d?d:!0;var e=document.createElement("div");e.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="46px";e.appendChild(g);var k=document.createElement("img");k.setAttribute("border","0");k.setAttribute("align","absmiddle");k.style.width="40px";k.style.height="40px";k.style.marginRight="10px";k.style.paddingBottom="4px";k.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":
a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!f&&d&&g.appendChild(k);d&&mxUtils.write(g,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");k=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?k=a.drive.extension:
a.mode==App.MODE_DROPBOX&&null!=a.dropbox?k=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?k=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub&&(k=a.gitHub.extension);var n=document.createElement("input");n.setAttribute("value",a.defaultFilename+k);n.style.marginRight="20px";n.style.marginLeft="10px";n.style.width=f?"220px":"450px";this.init=function(){d&&(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",
!1,null))};d&&g.appendChild(n);var t=null,u=null,v=null,p=mxUtils.button(mxResources.get("create"),function(){h()});p.className="geBtn gePrimaryBtn";var q=document.createElement("div");q.style.border="1px solid #d3d3d3";q.style.position="absolute";q.style.left="160px";q.style.right="34px";q.style.top=d?"72px":"40px";q.style.bottom="76px";q.style.margin="6px 0 0 -1px";q.style.padding="6px";q.style.overflow="auto";var x=document.createElement("div");x.style.cssText="position:absolute;left:30px;width:128px;top:72px;bottom:76px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
d||(x.style.top="40px");var w={},z=1;w.basic=[{title:"blankDiagram",select:!0}];var C=w.basic;if(!f){e.appendChild(x);e.appendChild(q);var D=!1;mxUtils.get(TEMPLATE_PATH+"/index.xml",function(a){if(!D){D=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var e=a.getAttribute("url");if(null!=e){var c=e.indexOf("/"),e=e.substring(0,c),c=w[e];null==c&&(z++,c=[],w[e]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),
d||(x.style.top="40px");var w={},A=1;w.basic=[{title:"blankDiagram",select:!0}];var D=w.basic;if(!f){e.appendChild(x);e.appendChild(q);var y=!1;mxUtils.get(TEMPLATE_PATH+"/index.xml",function(a){if(!y){y=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var e=a.getAttribute("url");if(null!=e){var c=e.indexOf("/"),e=e.substring(0,c),c=w[e];null==c&&(A++,c=[],w[e]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),
tooltip:a.getAttribute("url")})}}a=a.nextSibling}b()}})}mxEvent.addListener(n,"keypress",function(b){13==b.keyCode&&h()});g=document.createElement("div");g.style.marginTop=f?"4px":"16px";g.style.textAlign="right";g.style.position="absolute";g.style.left="40px";g.style.bottom="30px";g.style.right="40px";k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});k.className="geBtn";a.editor.cancelFirst&&g.appendChild(k);if(!f&&!a.isOffline()&&d&&null==c){var B=mxUtils.button(mxResources.get("help"),
function(){window.open("https://support.draw.io/display/DO/Creating+and+Opening+Files")});B.className="geBtn";g.appendChild(B)}f||"1"==urlParams.embed||(f=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(n.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},
mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),f.className="geBtn",g.appendChild(f));g.appendChild(p);a.editor.cancelFirst||null!=c||g.appendChild(k);e.appendChild(g);this.container=e},CreateDialog=function(a,f,d,c,h,l,m,b,e,g,k,n){function t(b,e,c,g){function p(){mxEvent.addListener(k,"click",function(){var b=c;if(m){var e=q.value,g=e.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>g){var b=null!=b?b:z.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=
mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),f.className="geBtn",g.appendChild(f));g.appendChild(p);a.editor.cancelFirst||null!=c||g.appendChild(k);e.appendChild(g);this.container=e},CreateDialog=function(a,f,d,c,h,l,m,b,e,g,k,n){function t(b,e,c,g){function p(){mxEvent.addListener(k,"click",function(){var b=c;if(m){var e=q.value,g=e.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>g){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=
a.gitHub.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".xml");0<=g&&(e=e.substring(0,g));q.value=e+p}}u(c)})}var k=document.createElement("a");k.style.overflow="hidden";var d=document.createElement("img");d.src=b;d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="60px";d.style.height="60px";d.style.paddingBottom="6px";k.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";k.className="geBaseButton";
k.style.position="relative";k.style.margin="4px";k.style.padding="8px 8px 10px 8px";k.style.whiteSpace="nowrap";k.appendChild(d);mxClient.IS_QUIRKS&&(k.style.cssFloat="left",k.style.zoom="1");k.style.color="gray";k.style.fontSize="11px";var v=document.createElement("div");k.appendChild(v);mxUtils.write(v,e);if(null!=g&&null==a[g]){d.style.visibility="hidden";mxUtils.setOpacity(v,10);var h=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});h.spin(k);var l=window.setTimeout(function(){null==a[g]&&(h.stop(),k.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(l),mxUtils.setOpacity(v,100),d.style.visibility="",h.stop(),p())}))}else p();x.appendChild(k);++w==n&&(mxUtils.br(x),w=0)}function u(b){var e=q.value;if(null==b||null!=e&&0<e.length)a.hideDialog(),d(e,b)}m=null!=m?m:!0;b=null!=b?b:!0;n=null!=n?n:3;var v=document.createElement("div");null==
c&&a.addLanguageMenu(v);var p=document.createElement("h2");mxUtils.write(p,h||mxResources.get("create"));p.style.marginTop="0px";p.style.marginBottom="24px";v.appendChild(p);mxUtils.write(v,mxResources.get("filename")+":");var q=document.createElement("input");q.setAttribute("value",f);q.style.width="280px";q.style.marginLeft="10px";q.style.marginBottom="20px";this.init=function(){q.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,
null)};v.appendChild(q);mxUtils.br(v);var x=document.createElement("div");x.style.textAlign="center";var w=0;x.style.marginTop="6px";v.appendChild(x);var z=document.createElement("select");z.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(h,mxResources.get("googleDrive")),z.appendChild(h),t(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,
"drive")),null!=a.gitHub&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GITHUB),mxUtils.write(h,mxResources.get("github")),z.appendChild(h),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.DropboxClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(h,mxResources.get("dropbox")),z.appendChild(h),a.mode==App.MODE_DROPBOX&&h.setAttribute("selected","selected"),t(IMAGE_PATH+
"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),"function"===typeof window.OneDriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(h,mxResources.get("oneDrive")),z.appendChild(h),a.mode==App.MODE_ONEDRIVE&&h.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&
!mxClient.IS_IOS)h=document.createElement("option"),h.setAttribute("value",App.MODE_DEVICE),mxUtils.write(h,mxResources.get("device")),z.appendChild(h),a.mode!=App.MODE_DEVICE&&b||h.setAttribute("selected","selected"),k&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);b&&isLocalStorage&&"0"!=urlParams.browser&&(b=document.createElement("option"),b.setAttribute("value",App.MODE_BROWSER),mxUtils.write(b,mxResources.get("browser")),z.appendChild(b),a.mode==App.MODE_BROWSER&&
null)};v.appendChild(q);mxUtils.br(v);var x=document.createElement("div");x.style.textAlign="center";var w=0;x.style.marginTop="6px";v.appendChild(x);var A=document.createElement("select");A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(h,mxResources.get("googleDrive")),A.appendChild(h),t(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,
"drive")),null!=a.gitHub&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GITHUB),mxUtils.write(h,mxResources.get("github")),A.appendChild(h),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.DropboxClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(h,mxResources.get("dropbox")),A.appendChild(h),a.mode==App.MODE_DROPBOX&&h.setAttribute("selected","selected"),t(IMAGE_PATH+
"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),"function"===typeof window.OneDriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(h,mxResources.get("oneDrive")),A.appendChild(h),a.mode==App.MODE_ONEDRIVE&&h.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&
!mxClient.IS_IOS)h=document.createElement("option"),h.setAttribute("value",App.MODE_DEVICE),mxUtils.write(h,mxResources.get("device")),A.appendChild(h),a.mode!=App.MODE_DEVICE&&b||h.setAttribute("selected","selected"),k&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);b&&isLocalStorage&&"0"!=urlParams.browser&&(b=document.createElement("option"),b.setAttribute("value",App.MODE_BROWSER),mxUtils.write(b,mxResources.get("browser")),A.appendChild(b),a.mode==App.MODE_BROWSER&&
b.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="center";null!=g&&(h=mxUtils.button(mxResources.get("help"),function(){window.open(g)}),h.className="geBtn",b.appendChild(h));h=mxUtils.button(mxResources.get("cancel"),function(){null!=c?c():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});h.className="geBtn";a.editor.cancelFirst&&
b.appendChild(h);null==c&&(p=mxUtils.button(mxResources.get("decideLater"),function(){u(null)}),p.className="geBtn",b.appendChild(p));e&&(e=mxUtils.button(mxResources.get("openInNewWindow"),function(){u("_blank")}),e.className="geBtn",b.appendChild(e));mxClient.IS_IOS||(l=mxUtils.button(l||mxResources.get("create"),function(){u(k?"download":App.MODE_DEVICE)}),l.className="geBtn gePrimaryBtn",b.appendChild(l));a.editor.cancelFirst||b.appendChild(h);mxEvent.addListener(q,"keypress",function(b){13==
b.keyCode?u(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});v.appendChild(b);this.container=v},PopupDialog=function(a,f,d,c,h){h=null!=h?h:!0;var l=document.createElement("div");l.style.textAlign="left";mxUtils.write(l,mxResources.get("fileOpenLocation"));mxUtils.br(l);mxUtils.br(l);var m=mxUtils.button(mxResources.get("openInThisWindow"),function(){h&&a.hideDialog();null!=c&&c()});m.className="geBtn";m.style.marginBottom="8px";m.style.width="280px";l.appendChild(m);
@ -7534,22 +7534,22 @@ d.style.marginTop="26px";d.style.textAlign="right";b=mxUtils.button(mxResources.
var RevisionDialog=function(a,f){var d=document.createElement("div"),c=document.createElement("h3");c.style.marginTop="0px";mxUtils.write(c,mxResources.get("revisionHistory"));d.appendChild(c);var h=document.createElement("div");h.style.position="absolute";h.style.overflow="auto";h.style.width="170px";h.style.height="378px";d.appendChild(h);var l=document.createElement("div");l.style.position="absolute";l.style.border="1px solid lightGray";l.style.left="199px";l.style.width="470px";l.style.height=
"376px";l.style.overflow="hidden";mxEvent.disableContextMenu(l);d.appendChild(l);var m=new Graph(l);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;var b=0,e=null,g=0,k=m.getGlobalVariable;m.getGlobalVariable=function(b){return"page"==b&&null!=e&&null!=e[g]?e[g].getAttribute("name"):"pagenumber"==b?g+1:k.apply(this,arguments)};m.getLinkForCell=function(){return null};Editor.MathJaxRender&&
m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,e){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.container)}));var n=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),t=a.getCurrentFile(),u=null,v=null,p=null,q=null,x=mxUtils.button("",function(){null!=p&&m.zoomIn()});x.className="geSprite geSprite-zoomin";x.setAttribute("title",mxResources.get("zoomIn"));
x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var w=mxUtils.button("",function(){null!=p&&m.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var z=mxUtils.button("",function(){null!=p&&(m.maxFitScale=8,m.fit(8),m.center())});z.className=
"geSprite geSprite-fit";z.setAttribute("title",mxResources.get("fit"));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!=p&&(m.zoomActual(),m.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 B=mxUtils.button(mxResources.get("download"),function(){if(null!=p){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,e=mxUtils.getXml(p.documentElement);a.isLocalFileSave()?a.saveLocalFile(e,b,"text/xml"):
(e="undefined"===typeof pako?"&xml="+encodeURIComponent(e):"&data="+encodeURIComponent(a.editor.graph.compress(e)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+e)).simulate(document,"_blank"))}});B.className="geBtn";B.setAttribute("disabled","disabled");var A=mxUtils.button(mxResources.get("restore"),function(){null!=p&&null!=q&&a.confirm(mxResources.get("areYouSure"),function(){a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();
a.replaceFileData(q);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});A.className="geBtn";A.setAttribute("disabled","disabled");var y=document.createElement("select");y.setAttribute("disabled","disabled");y.style.maxWidth="80px";y.style.position="relative";y.style.top="-2px";y.style.verticalAlign="bottom";y.style.marginRight="6px";y.style.display="none";var F=null;mxEvent.addListener(y,"change",function(b){null!=
F&&(F(b),mxEvent.consume(b))});var H=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=p&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(p.documentElement)),window.openWindow(a.getUrl()))});H.className="geBtn";H.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("show"),function(){null!=v&&window.open(v.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled","disabled");c=document.createElement("div");
x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var w=mxUtils.button("",function(){null!=p&&m.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var A=mxUtils.button("",function(){null!=p&&(m.maxFitScale=8,m.fit(8),m.center())});A.className=
"geSprite geSprite-fit";A.setAttribute("title",mxResources.get("fit"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var D=mxUtils.button("",function(){null!=p&&(m.zoomActual(),m.center())});D.className="geSprite geSprite-actualsize";D.setAttribute("title",mxResources.get("actualSize"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var y=
document.createElement("div");y.style.position="absolute";y.style.textAlign="right";y.style.color="gray";y.style.marginTop="10px";y.style.backgroundColor="transparent";y.style.top="440px";y.style.right="32px";y.style.maxWidth="380px";y.style.cursor="default";var B=mxUtils.button(mxResources.get("download"),function(){if(null!=p){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,e=mxUtils.getXml(p.documentElement);a.isLocalFileSave()?a.saveLocalFile(e,b,"text/xml"):
(e="undefined"===typeof pako?"&xml="+encodeURIComponent(e):"&data="+encodeURIComponent(a.editor.graph.compress(e)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+e)).simulate(document,"_blank"))}});B.className="geBtn";B.setAttribute("disabled","disabled");var C=mxUtils.button(mxResources.get("restore"),function(){null!=p&&null!=q&&a.confirm(mxResources.get("areYouSure"),function(){a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(b){a.spinner.stop();
a.replaceFileData(q);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});C.className="geBtn";C.setAttribute("disabled","disabled");var z=document.createElement("select");z.setAttribute("disabled","disabled");z.style.maxWidth="80px";z.style.position="relative";z.style.top="-2px";z.style.verticalAlign="bottom";z.style.marginRight="6px";z.style.display="none";var F=null;mxEvent.addListener(z,"change",function(b){null!=
F&&(F(b),mxEvent.consume(b))});var L=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=p&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(p.documentElement)),window.openWindow(a.getUrl()))});L.className="geBtn";L.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("show"),function(){null!=v&&window.open(v.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled","disabled");c=document.createElement("div");
c.style.position="absolute";c.style.top="482px";c.style.width="640px";c.style.textAlign="right";var E=document.createElement("div");E.className="geToolbarContainer";E.style.backgroundColor="transparent";E.style.padding="2px";E.style.border="none";E.style.left="199px";E.style.top="442px";var M=null;if(null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==window.DropboxFile)l.style.display="none",E.style.display="none",mxUtils.write(h,mxResources.get("notAvailable"));
else if(null!=f&&0<f.length){l.style.cursor="move";var K=document.createElement("table");K.style.border="1px solid lightGray";K.style.borderCollapse="collapse";K.style.borderSpacing="0px";K.style.width="100%";var I=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(b=mxUtils.indexOf(a.pages,a.currentPage));for(var L=f.length-1;0<=L;L--){var N=function(c){var k=new Date(c.modifiedDate),d=null;if(0<=k.getTime()){var h=function(c){n.stop();var f=mxUtils.parseXml(c),
v=a.editor.extractGraphModel(f.documentElement,!0);if(null!=v){var h=function(b){null!=b&&(b=u(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},u=function(b){var a=b.getAttribute("background");if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";l.style.backgroundColor=a;(new mxCodec(b.ownerDocument)).decode(b,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return b};y.style.display="none";y.innerHTML="";p=f;q=c;e=parseSelectFunction=null;g=0;if("mxfile"==
v.nodeName){f=v.getElementsByTagName("diagram");e=[];for(c=0;c<f.length;c++)e.push(f[c]);g=Math.min(b,e.length-1);0<e.length&&h(e[g]);if(1<e.length)for(y.removeAttribute("disabled"),y.style.display="",c=0;c<e.length;c++)f=document.createElement("option"),mxUtils.write(f,e[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),f.setAttribute("value",c),c==g&&f.setAttribute("selected","selected"),y.appendChild(f);F=function(){g=b=parseInt(y.value);h(e[b])}}else u(v);D.innerHTML="";mxUtils.write(D,
k.toLocaleDateString()+" "+k.toLocaleTimeString());D.setAttribute("title",d.getAttribute("title"));x.removeAttribute("disabled");w.removeAttribute("disabled");z.removeAttribute("disabled");C.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&A.removeAttribute("disabled"),B.removeAttribute("disabled"),G.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(x,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(C,60)}else y.style.display=
"none",y.innerHTML="",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var E=document.createElement("td");E.style.padding="6px";E.style.whiteSpace="nowrap";c==f[f.length-1]?mxUtils.write(E,mxResources.get("current")):k.toDateString()===T?mxUtils.write(E,k.toLocaleTimeString()):mxUtils.write(E,k.toLocaleDateString()+" "+k.toLocaleTimeString());d.appendChild(E);
d.setAttribute("title",k.toLocaleDateString()+" "+k.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(b){v!=c&&(n.stop(),null!=u&&(u.style.backgroundColor=""),v=c,u=d,u.style.backgroundColor="#ebf2f9",q=p=null,D.removeAttribute("title"),D.innerHTML=mxResources.get("loading")+"...",l.style.backgroundColor="#ffffff",m.getModel().clear(),A.setAttribute("disabled","disabled"),B.setAttribute("disabled",
"disabled"),x.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),mxUtils.setOpacity(x,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(C,20),n.spin(l),c.getXml(function(b){v==c&&h(b)},function(b){n.stop();y.style.display="none";y.innerHTML="";D.innerHTML="";mxUtils.write(D,
mxResources.get("errorLoadingFile"))}),mxEvent.consume(b))});mxEvent.addListener(d,"dblclick",function(b){G.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(b)},!1);I.appendChild(d)}return d}(f[L]);null!=N&&L==f.length-1&&(M=N)}K.appendChild(I);h.appendChild(K)}else l.style.display="none",E.style.display="none",mxUtils.write(h,mxResources.get("noRevisions"));this.init=function(){null!=M&&M.click()};h=mxUtils.button(mxResources.get("close"),
function(){a.hideDialog()});h.className="geBtn";E.appendChild(y);E.appendChild(x);E.appendChild(w);E.appendChild(C);E.appendChild(z);a.editor.cancelFirst?(c.appendChild(h),c.appendChild(B),c.appendChild(H),c.appendChild(A),c.appendChild(G)):(c.appendChild(B),c.appendChild(H),c.appendChild(A),c.appendChild(G),c.appendChild(h));d.appendChild(c);d.appendChild(E);d.appendChild(D);this.container=d},DraftDialog=function(a,f,d,c,h,l,m){var b=document.createElement("div"),e=document.createElement("div");
else if(null!=f&&0<f.length){l.style.cursor="move";var H=document.createElement("table");H.style.border="1px solid lightGray";H.style.borderCollapse="collapse";H.style.borderSpacing="0px";H.style.width="100%";var J=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(b=mxUtils.indexOf(a.pages,a.currentPage));for(var K=f.length-1;0<=K;K--){var N=function(c){var k=new Date(c.modifiedDate),d=null;if(0<=k.getTime()){var h=function(c){n.stop();var f=mxUtils.parseXml(c),
v=a.editor.extractGraphModel(f.documentElement,!0);if(null!=v){var h=function(b){null!=b&&(b=u(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},u=function(b){var a=b.getAttribute("background");if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";l.style.backgroundColor=a;(new mxCodec(b.ownerDocument)).decode(b,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return b};z.style.display="none";z.innerHTML="";p=f;q=c;e=parseSelectFunction=null;g=0;if("mxfile"==
v.nodeName){f=v.getElementsByTagName("diagram");e=[];for(c=0;c<f.length;c++)e.push(f[c]);g=Math.min(b,e.length-1);0<e.length&&h(e[g]);if(1<e.length)for(z.removeAttribute("disabled"),z.style.display="",c=0;c<e.length;c++)f=document.createElement("option"),mxUtils.write(f,e[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),f.setAttribute("value",c),c==g&&f.setAttribute("selected","selected"),z.appendChild(f);F=function(){g=b=parseInt(z.value);h(e[b])}}else u(v);y.innerHTML="";mxUtils.write(y,
k.toLocaleDateString()+" "+k.toLocaleTimeString());y.setAttribute("title",d.getAttribute("title"));x.removeAttribute("disabled");w.removeAttribute("disabled");A.removeAttribute("disabled");D.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&C.removeAttribute("disabled"),B.removeAttribute("disabled"),G.removeAttribute("disabled"),L.removeAttribute("disabled"));mxUtils.setOpacity(x,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(D,60)}else z.style.display=
"none",z.innerHTML="",y.innerHTML="",mxUtils.write(y,mxResources.get("errorLoadingFile"))},d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var E=document.createElement("td");E.style.padding="6px";E.style.whiteSpace="nowrap";c==f[f.length-1]?mxUtils.write(E,mxResources.get("current")):k.toDateString()===T?mxUtils.write(E,k.toLocaleTimeString()):mxUtils.write(E,k.toLocaleDateString()+" "+k.toLocaleTimeString());d.appendChild(E);
d.setAttribute("title",k.toLocaleDateString()+" "+k.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(b){v!=c&&(n.stop(),null!=u&&(u.style.backgroundColor=""),v=c,u=d,u.style.backgroundColor="#ebf2f9",q=p=null,y.removeAttribute("title"),y.innerHTML=mxResources.get("loading")+"...",l.style.backgroundColor="#ffffff",m.getModel().clear(),C.setAttribute("disabled","disabled"),B.setAttribute("disabled",
"disabled"),x.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),mxUtils.setOpacity(x,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(D,20),n.spin(l),c.getXml(function(b){v==c&&h(b)},function(b){n.stop();z.style.display="none";z.innerHTML="";y.innerHTML="";mxUtils.write(y,
mxResources.get("errorLoadingFile"))}),mxEvent.consume(b))});mxEvent.addListener(d,"dblclick",function(b){G.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(b)},!1);J.appendChild(d)}return d}(f[K]);null!=N&&K==f.length-1&&(M=N)}H.appendChild(J);h.appendChild(H)}else l.style.display="none",E.style.display="none",mxUtils.write(h,mxResources.get("noRevisions"));this.init=function(){null!=M&&M.click()};h=mxUtils.button(mxResources.get("close"),
function(){a.hideDialog()});h.className="geBtn";E.appendChild(z);E.appendChild(x);E.appendChild(w);E.appendChild(D);E.appendChild(A);a.editor.cancelFirst?(c.appendChild(h),c.appendChild(B),c.appendChild(L),c.appendChild(C),c.appendChild(G)):(c.appendChild(B),c.appendChild(L),c.appendChild(C),c.appendChild(G),c.appendChild(h));d.appendChild(c);d.appendChild(E);d.appendChild(y);this.container=d},DraftDialog=function(a,f,d,c,h,l,m){var b=document.createElement("div"),e=document.createElement("div");
e.style.marginTop="0px";e.style.whiteSpace="nowrap";e.style.overflow="auto";mxUtils.write(e,f);b.appendChild(e);var g=document.createElement("div");g.style.position="absolute";g.style.border="1px solid lightGray";g.style.marginTop="10px";g.style.width="640px";g.style.top="46px";g.style.bottom="74px";g.style.overflow="hidden";mxEvent.disableContextMenu(g);b.appendChild(g);var k=new Graph(g);k.setEnabled(!1);k.setPanning(!0);k.panningHandler.ignoreCell=!0;k.panningHandler.useLeftButtonForPanning=!0;
k.minFitScale=null;k.maxFitScale=null;k.centerZoom=!0;f=mxUtils.parseXml(d);var n=a.editor.extractGraphModel(f.documentElement,!0),t=0,u=null,v=k.getGlobalVariable;k.getGlobalVariable=function(b){return"page"==b&&null!=u&&null!=u[t]?u[t].getAttribute("name"):"pagenumber"==b?t+1:v.apply(this,arguments)};k.getLinkForCell=function(){return null};f=mxUtils.button("",function(){k.zoomIn()});f.className="geSprite geSprite-zoomin";f.setAttribute("title",mxResources.get("zoomIn"));f.style.outline="none";
f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);d=mxUtils.button("",function(){k.zoomOut()});d.className="geSprite geSprite-zoomout";d.setAttribute("title",mxResources.get("zoomOut"));d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);e=mxUtils.button("",function(){k.maxFitScale=8;k.fit(8);k.center()});e.className="geSprite geSprite-fit";e.setAttribute("title",mxResources.get("fit"));e.style.outline="none";e.style.border="none";e.style.margin=
@ -7558,7 +7558,7 @@ f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);d=mxUtils.bu
if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";g.style.backgroundColor=a;(new mxCodec(b.ownerDocument)).decode(b,k.getModel());k.maxFitScale=1;k.fit(8);k.center()}}function e(e){null!=e&&(e=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(e))).documentElement));return e}mxEvent.addListener(q,"change",function(b){t=parseInt(q.value);e(u[t]);mxEvent.consume(b)});if("mxfile"==n.nodeName){var c=n.getElementsByTagName("diagram");u=[];for(var p=0;p<c.length;p++)u.push(c[p]);0<u.length&&
e(u[t]);if(1<u.length)for(q.style.display="",p=0;p<u.length;p++)c=document.createElement("option"),mxUtils.write(c,u[p].getAttribute("name")||mxResources.get("pageWithNumber",[p+1])),c.setAttribute("value",p),p==t&&c.setAttribute("selected","selected"),q.appendChild(c)}else b(n)};m.appendChild(q);m.appendChild(f);m.appendChild(d);m.appendChild(p);m.appendChild(e);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});f.className="geBtn";a.editor.cancelFirst?(l.appendChild(f),l.appendChild(h),
l.appendChild(c)):(l.appendChild(c),l.appendChild(h),l.appendChild(f));b.appendChild(l);b.appendChild(m);this.container=b},FindWindow=function(a,f,d,c,h){function l(){var a=b.model.getDescendants(b.model.getRoot()),c=n.value.toLowerCase(),k=t.checked?new RegExp(c):null,d=null;e!=c&&(e=c,g=null);var f=null==g;if(b.isEnabled()&&0<c.length)for(var v=0;v<a.length;v++){var h=b.view.getState(a[v]);if(null!=h&&null!=h.cell.value&&(f||null==d)&&(b.model.isVertex(h.cell)||b.model.isEdge(h.cell))){b.isHtmlLabel(h.cell)?
(u.innerHTML=b.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([u])):label=b.getLabel(h.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var l;if(!(l=null==k&&label.substring(0,c.length)===c)&&(l=null!=k)&&!(l=k.test(label)))a:{l=k;var m=h.cell;if("object"===typeof m.value&&null!=m.value.attributes)for(var m=m.value.attributes,y=0;y<m.length;y++)if("label"!=m[y].nodeName&&l.test(m[y].nodeValue.toLowerCase())){l=!0;break a}l=!1}if(l)if(f){d=h;break}else null==
(u.innerHTML=b.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([u])):label=b.getLabel(h.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var l;if(!(l=null==k&&label.substring(0,c.length)===c)&&(l=null!=k)&&!(l=k.test(label)))a:{l=k;var m=h.cell;if("object"===typeof m.value&&null!=m.value.attributes)for(var m=m.value.attributes,z=0;z<m.length;z++)if("label"!=m[z].nodeName&&l.test(m[z].nodeValue.toLowerCase())){l=!0;break a}l=!1}if(l)if(f){d=h;break}else null==
d&&(d=h)}f=f||h==g}null!=d?(g=d,b.setSelectionCell(g.cell),b.scrollCellToVisible(g.cell)):b.clearSelection();return!b.isEnabled()||0==c.length||null!=d}var m=a.actions.get("find"),b=a.editor.graph,e=null,g=null,k=document.createElement("div");k.style.userSelect="none";k.style.overflow="hidden";k.style.padding="10px";k.style.height="100%";var n=document.createElement("input");n.setAttribute("placeholder",mxResources.get("find"));n.setAttribute("type","text");n.style.marginTop="4px";n.style.marginBottom=
"6px";n.style.width="170px";n.style.fontSize="12px";n.style.borderRadius="4px";n.style.padding="6px";k.appendChild(n);var t=document.createElement("input");t.setAttribute("type","checkbox");k.appendChild(t);mxUtils.write(k,mxResources.get("regularExpression"));var u=document.createElement("div");mxUtils.br(k);var v=mxUtils.button(mxResources.get("reset"),function(){n.value="";n.style.backgroundColor="";e=g=null;n.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight=
"4px";v.style.backgroundColor="#f5f5f5";v.style.backgroundImage="none";v.className="geBtn";k.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{n.style.backgroundColor=l()?"":"#ffcfcf"}catch(p){a.handleError(p)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.style.backgroundColor="#4d90fe";v.style.backgroundImage="none";v.className="geBtn gePrimaryBtn";k.appendChild(v);mxEvent.addListener(n,"keyup",function(b){if(91==b.keyCode||17==b.keyCode)mxEvent.consume(b);
@ -7580,7 +7580,7 @@ c.style.padding="30px";c.appendChild(f);c.appendChild(h);c.appendChild(l);d=docu
document.createElement("span"),f.style.paddingRight="20px",f.appendChild(k),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),k.checked=!0,k.defaultChecked=!0,mxEvent.addListener(f,"click",function(b){mxEvent.getSource(b)!=k&&(k.checked=!k.checked,mxEvent.consume(b))}),mxClient.IS_QUIRKS&&(f.style.position="relative",f.style.top="-6px"),d.appendChild(f);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";var n=mxUtils.button(mxResources.get("apply"),
function(){a.hideDialog();for(var e=[],c=0;c<b.length;c++){var g=b[c].apply(this,arguments);null!=g&&e.push(g)}a.sidebar.showEntries(e.join(";"),k.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var t=document.createElement("table"),u=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";var v=document.createElement("tr");t.style.width="100%";f=document.createElement("td");var n=document.createElement("td"),p=document.createElement("td"),q=mxUtils.bind(this,function(b,
e,c){var g=document.createElement("input");g.type="checkbox";t.appendChild(g);g.checked=a.sidebar.isEntryVisible(c);var p=document.createElement("span");mxUtils.write(p,e);e=document.createElement("div");e.style.display="block";e.appendChild(g);e.appendChild(p);mxEvent.addListener(p,"click",function(b){g.checked=!g.checked;mxEvent.consume(b)});b.appendChild(e);return function(){return g.checked?c:null}});v.appendChild(f);v.appendChild(n);v.appendChild(p);u.appendChild(v);t.appendChild(u);for(var b=
[],x=0,g=0;g<d.length;g++)for(u=0;u<d[g].entries.length;u++)x++;for(var w=[f,n,p],z=0,g=0;g<d.length;g++)(function(a){for(var e=0;e<a.entries.length;e++){var c=a.entries[e];b.push(q(w[Math.floor(z/(x/3))],c.title,c.id));z++}})(d[g]);c.appendChild(t);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,d.appendChild(k),f=document.createElement("span"),
[],x=0,g=0;g<d.length;g++)for(u=0;u<d[g].entries.length;u++)x++;for(var w=[f,n,p],A=0,g=0;g<d.length;g++)(function(a){for(var e=0;e<a.entries.length;e++){var c=a.entries[e];b.push(q(w[Math.floor(A/(x/3))],c.title,c.id));A++}})(d[g]);c.appendChild(t);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,d.appendChild(k),f=document.createElement("span"),
mxUtils.write(f," "+mxResources.get("rememberThisSetting")),d.appendChild(f),mxEvent.addListener(f,"click",function(b){k.checked=!k.checked;mxEvent.consume(b)}));c.appendChild(d);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var e=["search"],c=0;c<b.length;c++){var g=b[c].apply(this,arguments);null!=g&&e.push(g)}a.sidebar.showEntries(0<e.length?e.join(";"):"",k.checked);a.hideDialog()});n.className=
"geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(f),d.appendChild(n)):(d.appendChild(n),d.appendChild(f));c.appendChild(d);this.container=c},PluginsDialog=function(a){function f(){if(0==h.length)c.innerHTML=mxResources.get("noPlugins");else{c.innerHTML="";for(var b=0;b<h.length;b++){var e=document.createElement("span");e.style.whiteSpace="nowrap";var d=document.createElement("span");d.className="geSprite geSprite-delete";
d.style.position="relative";d.style.cursor="pointer";d.style.top="5px";d.style.marginRight="4px";d.style.display="inline-block";e.appendChild(d);mxUtils.write(e,h[b]);c.appendChild(e);mxUtils.br(c);mxEvent.addListener(d,"click",function(b){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+h[b]+'"?',function(){h.splice(b,1);f()})}}(b))}}}var d=document.createElement("div"),c=document.createElement("div");c.style.height="120px";c.style.overflow="auto";var h=mxSettings.getPlugins().slice();
@ -7593,31 +7593,31 @@ u.setAttribute("type","text");u.style.width="100px";u.value=null!=c?c.height:"";
b.appendChild(g);m.appendChild(b);l.appendChild(m);h.appendChild(l);var c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),p=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var b=0;b<f.length;b++){var e=d.getCellGeometry(f[b]);null!=e&&(e=e.clone(),d.isCellMovable(f[b])&&(0<mxUtils.trim(k.value).length&&(e.x=Number(k.value)),0<mxUtils.trim(n.value).length&&(e.y=Number(n.value))),d.isCellResizable(f[b])&&(0<mxUtils.trim(t.value).length&&
(e.width=Number(t.value)),0<mxUtils.trim(u.value).length&&(e.height=Number(u.value))),d.getModel().setGeometry(f[b],e));0<mxUtils.trim(v.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(v.value),[f[b]])}}finally{d.getModel().endUpdate()}});mxEvent.addListener(h,"keypress",function(b){13==b.keyCode&&p.click()});l=document.createElement("div");l.style.marginTop="20px";l.style.textAlign="right";a.editor.cancelFirst?(l.appendChild(c),l.appendChild(p)):(l.appendChild(p),l.appendChild(c));
h.appendChild(l);this.container=h},LibraryDialog=function(a,f,d,c,h,l){function m(b){for(b=document.elementFromPoint(b.clientX,b.clientY);null!=b&&b.parentNode!=u;)b=b.parentNode;var a=null;if(null!=b)for(var e=u.firstChild,a=0;null!=e&&e!=b;)e=e.nextSibling,a++;return a}function b(e,c,g,d,f,n,h,l,x){try{if(null==c||"image/"==c.substring(0,6))if(null==e&&null!=h||null==p[e]){var t=function(){G.innerHTML="";G.style.cursor="pointer";G.style.whiteSpace="nowrap";G.style.textOverflow="ellipsis";mxUtils.write(G,
null!=M.title&&0<M.title.length?M.title:mxResources.get("untitled"));G.style.color=null==M.title||0==M.title.length?"#d0d0d0":""};u.style.backgroundImage="";v.style.display="none";var A=f,y=n;if(f>a.maxImageSize||n>a.maxImageSize){var D=Math.min(1,Math.min(a.maxImageSize/Math.max(1,f)),a.maxImageSize/Math.max(1,n));f*=D;n*=D}A>y?(y=Math.round(100*y/A),A=100):(A=Math.round(100*A/y),y=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=mxClient.IS_QUIRKS?"inline":
"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=e){var F=document.createElement("img");F.setAttribute("src",z.convert(e));F.style.width=A+"px";F.style.height=y+"px";F.style.margin="10px";F.style.paddingBottom=Math.floor((100-y)/2)+"px";F.style.paddingLeft=Math.floor((100-A)/2)+"px";H.appendChild(F)}else if(null!=h){var B=a.stringToCells(a.editor.graph.decompress(h.xml));0<B.length&&(a.sidebar.createThumb(B,
100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var E=document.createElement("img");E.setAttribute("src",Editor.closeImage);E.setAttribute("border","0");E.setAttribute("title",mxResources.get("delete"));E.setAttribute("align","top");E.style.paddingTop="4px";E.style.marginLeft="-22px";E.style.cursor="pointer";mxEvent.addListener(E,"dragstart",function(b){mxEvent.consume(b)});null==e&&null!=h&&(E.style.position="relative");(function(b,
a,e){mxEvent.addListener(E,"click",function(c){p[a]=null;for(var g=0;g<k.length;g++)if(null!=k[g].data&&k[g].data==a||null!=k[g].xml&&null!=e&&k[g].xml==e.xml){k.splice(g,1);break}H.parentNode.removeChild(b);0==k.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(c)});mxEvent.addListener(E,"dblclick",function(b){mxEvent.consume(b)})})(H,e,h);H.appendChild(E);H.style.marginBottom="30px";var G=document.createElement("div");G.style.position="absolute";
G.style.boxSizing="border-box";G.style.bottom="-18px";G.style.left="10px";G.style.right="10px";G.style.backgroundColor="#ffffff";G.style.overflow="hidden";G.style.textAlign="center";var M=null;null!=e?(M={data:e,w:f,h:n,title:x},null!=l&&(M.aspect=l),p[e]=F,k.push(M)):null!=h&&(h.aspect="fixed",k.push(h),M=h);mxEvent.addListener(G,"keydown",function(b){13==b.keyCode&&null!=w&&(w(),w=null,mxEvent.consume(b))});t();H.appendChild(G);mxEvent.addListener(G,"mousedown",function(b){"true"!=G.getAttribute("contentEditable")&&
null!=M.title&&0<M.title.length?M.title:mxResources.get("untitled"));G.style.color=null==M.title||0==M.title.length?"#d0d0d0":""};u.style.backgroundImage="";v.style.display="none";var C=f,z=n;if(f>a.maxImageSize||n>a.maxImageSize){var L=Math.min(1,Math.min(a.maxImageSize/Math.max(1,f)),a.maxImageSize/Math.max(1,n));f*=L;n*=L}C>z?(z=Math.round(100*z/C),C=100):(C=Math.round(100*C/z),z=100);var y=document.createElement("div");y.setAttribute("draggable","true");y.style.display=mxClient.IS_QUIRKS?"inline":
"inline-block";y.style.position="relative";y.style.cursor="move";mxUtils.setPrefixedStyle(y.style,"transition","transform .1s ease-in-out");if(null!=e){var F=document.createElement("img");F.setAttribute("src",A.convert(e));F.style.width=C+"px";F.style.height=z+"px";F.style.margin="10px";F.style.paddingBottom=Math.floor((100-z)/2)+"px";F.style.paddingLeft=Math.floor((100-C)/2)+"px";y.appendChild(F)}else if(null!=h){var B=a.stringToCells(a.editor.graph.decompress(h.xml));0<B.length&&(a.sidebar.createThumb(B,
100,100,y,null,!0,!1),y.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",y.firstChild.style.cursor="")}var E=document.createElement("img");E.setAttribute("src",Editor.closeImage);E.setAttribute("border","0");E.setAttribute("title",mxResources.get("delete"));E.setAttribute("align","top");E.style.paddingTop="4px";E.style.marginLeft="-22px";E.style.cursor="pointer";mxEvent.addListener(E,"dragstart",function(b){mxEvent.consume(b)});null==e&&null!=h&&(E.style.position="relative");(function(b,
a,e){mxEvent.addListener(E,"click",function(c){p[a]=null;for(var g=0;g<k.length;g++)if(null!=k[g].data&&k[g].data==a||null!=k[g].xml&&null!=e&&k[g].xml==e.xml){k.splice(g,1);break}y.parentNode.removeChild(b);0==k.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(c)});mxEvent.addListener(E,"dblclick",function(b){mxEvent.consume(b)})})(y,e,h);y.appendChild(E);y.style.marginBottom="30px";var G=document.createElement("div");G.style.position="absolute";
G.style.boxSizing="border-box";G.style.bottom="-18px";G.style.left="10px";G.style.right="10px";G.style.backgroundColor="#ffffff";G.style.overflow="hidden";G.style.textAlign="center";var M=null;null!=e?(M={data:e,w:f,h:n,title:x},null!=l&&(M.aspect=l),p[e]=F,k.push(M)):null!=h&&(h.aspect="fixed",k.push(h),M=h);mxEvent.addListener(G,"keydown",function(b){13==b.keyCode&&null!=w&&(w(),w=null,mxEvent.consume(b))});t();y.appendChild(G);mxEvent.addListener(G,"mousedown",function(b){"true"!=G.getAttribute("contentEditable")&&
mxEvent.consume(b)});B=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var e=new FilenameDialog(a,M.title||"",mxResources.get("ok"),function(b){null!=b&&(M.title=b,t())},mxResources.get("enterValue"));a.showDialog(e.container,300,80,!0,!0);e.init();mxEvent.consume(b)}else if("true"!=G.getAttribute("contentEditable")){null!=w&&(w(),w=null);if(null==M.title||0==M.title.length)G.innerHTML="";G.style.textOverflow="";G.style.whiteSpace=
"";G.style.cursor="text";G.style.color="";G.setAttribute("contentEditable","true");G.focus();document.execCommand("selectAll",!1,null);w=function(){G.removeAttribute("contentEditable");G.style.cursor="pointer";M.title=G.innerHTML;t()};mxEvent.consume(b)}};mxEvent.addListener(G,"click",B);mxEvent.addListener(H,"dblclick",B);u.appendChild(H);mxEvent.addListener(H,"dragstart",function(b){null==e&&null!=h&&(E.style.visibility="hidden",G.style.visibility="hidden");mxClient.IS_FF&&null!=h.xml&&b.dataTransfer.setData("Text",
h.xml);q=m(b);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);E.style.visibility="";G.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(b){"hidden"==E.style.visibility&&(E.style.visibility="",G.style.visibility="");q=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else C||(C=!0,a.handleError({message:mxResources.get("fileExists")}));else{f=
!1;try{if(a.spinner.stop(),A=mxUtils.parseXml(e),"mxlibrary"==A.documentElement.nodeName){y=JSON.parse(mxUtils.getTextContent(A.documentElement));if(null!=y&&0<y.length)for(var I=0;I<y.length;I++)null!=y[I].xml?b(null,null,0,0,0,0,y[I]):b(y[I].data,null,0,0,y[I].w,y[I].h,null,"fixed",y[I].title);f=!0}else if("mxfile"==A.documentElement.nodeName){for(var K=A.documentElement.getElementsByTagName("diagram"),I=0;I<K.length;I++){var y=mxUtils.getTextContent(K[I]),B=a.stringToCells(a.editor.graph.decompress(y)),
S=a.editor.graph.getBoundingBoxFromGeometry(B);b(null,null,0,0,0,0,{xml:y,w:S.width,h:S.height})}f=!0}}catch(X){}f||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(X){}return null}function e(b){b.dataTransfer.dropEffect=null!=q?"move":"copy";b.stopPropagation();b.preventDefault()}function g(e){e.stopPropagation();e.preventDefault();C=!1;x=m(e);if(null!=q)null!=x&&x<u.children.length?(k.splice(x>q?x-1:x,0,k.splice(q,1)[0]),u.insertBefore(u.children[q],u.children[x])):
(k.push(k.splice(q,1)[0]),u.appendChild(u.children[q]));else if(0<e.dataTransfer.files.length)a.importFiles(e.dataTransfer.files,0,0,a.maxImageSize,D(e));else if(0<=mxUtils.indexOf(e.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(e.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){b(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}e.stopPropagation();e.preventDefault()}
"";G.style.cursor="text";G.style.color="";G.setAttribute("contentEditable","true");G.focus();document.execCommand("selectAll",!1,null);w=function(){G.removeAttribute("contentEditable");G.style.cursor="pointer";M.title=G.innerHTML;t()};mxEvent.consume(b)}};mxEvent.addListener(G,"click",B);mxEvent.addListener(y,"dblclick",B);u.appendChild(y);mxEvent.addListener(y,"dragstart",function(b){null==e&&null!=h&&(E.style.visibility="hidden",G.style.visibility="hidden");mxClient.IS_FF&&null!=h.xml&&b.dataTransfer.setData("Text",
h.xml);q=m(b);mxClient.IS_GC&&(y.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(y.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(y,30);E.style.visibility="";G.style.visibility=""},0)});mxEvent.addListener(y,"dragend",function(b){"hidden"==E.style.visibility&&(E.style.visibility="",G.style.visibility="");q=null;mxUtils.setOpacity(y,100);mxUtils.setPrefixedStyle(y.style,"transform",null)})}else D||(D=!0,a.handleError({message:mxResources.get("fileExists")}));else{f=
!1;try{if(a.spinner.stop(),C=mxUtils.parseXml(e),"mxlibrary"==C.documentElement.nodeName){z=JSON.parse(mxUtils.getTextContent(C.documentElement));if(null!=z&&0<z.length)for(var H=0;H<z.length;H++)null!=z[H].xml?b(null,null,0,0,0,0,z[H]):b(z[H].data,null,0,0,z[H].w,z[H].h,null,"fixed",z[H].title);f=!0}else if("mxfile"==C.documentElement.nodeName){for(var J=C.documentElement.getElementsByTagName("diagram"),H=0;H<J.length;H++){var z=mxUtils.getTextContent(J[H]),B=a.stringToCells(a.editor.graph.decompress(z)),
S=a.editor.graph.getBoundingBoxFromGeometry(B);b(null,null,0,0,0,0,{xml:z,w:S.width,h:S.height})}f=!0}}catch(X){}f||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(X){}return null}function e(b){b.dataTransfer.dropEffect=null!=q?"move":"copy";b.stopPropagation();b.preventDefault()}function g(e){e.stopPropagation();e.preventDefault();D=!1;x=m(e);if(null!=q)null!=x&&x<u.children.length?(k.splice(x>q?x-1:x,0,k.splice(q,1)[0]),u.insertBefore(u.children[q],u.children[x])):
(k.push(k.splice(q,1)[0]),u.appendChild(u.children[q]));else if(0<e.dataTransfer.files.length)a.importFiles(e.dataTransfer.files,0,0,a.maxImageSize,y(e));else if(0<=mxUtils.indexOf(e.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(e.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){b(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}e.stopPropagation();e.preventDefault()}
var k=[];d=document.createElement("div");d.style.height="100%";var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="40px";d.appendChild(n);mxUtils.write(n,mxResources.get("filename")+":");null==f&&(f=a.defaultLibraryName+".xml");var t=document.createElement("input");t.setAttribute("value",f);t.style.marginRight="20px";t.style.marginLeft="10px";t.style.width="500px";null==h||h.isRenamable()||t.setAttribute("disabled","true");this.init=function(){if(null==h||h.isRenamable())t.focus(),
mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};n.appendChild(t);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop="6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==k.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");
var v=document.createElement("div");v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));d.appendChild(v);var p={},q=null,x=null,w=null;f=function(b){"true"!=mxEvent.getSource(b).getAttribute("contentEditable")&&null!=w&&(w(),w=null,mxEvent.consume(b))};mxEvent.addListener(u,"mousedown",f);mxEvent.addListener(u,"pointerdown",f);mxEvent.addListener(u,"touchstart",
f);var z=new mxUrlConverter,C=!1;if(null!=c)for(f=0;f<c.length;f++)n=c[f],b(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(u,"dragleave",function(b){v.style.cursor="";for(var a=mxEvent.getSource(b);null!=a;){if(a==u||a==v){b.stopPropagation();b.preventDefault();break}a=a.parentNode}});var D=function(e){return function(c,g,p,k,d,q,f,n,v){null!=v&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,v.name)?a.parseFile(v,mxUtils.bind(this,function(c){4==c.readyState&&
f);var A=new mxUrlConverter,D=!1;if(null!=c)for(f=0;f<c.length;f++)n=c[f],b(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(u,"dragleave",function(b){v.style.cursor="";for(var a=mxEvent.getSource(b);null!=a;){if(a==u||a==v){b.stopPropagation();b.preventDefault();break}a=a.parentNode}});var y=function(e){return function(c,g,p,k,d,q,f,n,v){null!=v&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,v.name)?a.parseFile(v,mxUtils.bind(this,function(c){4==c.readyState&&
(a.spinner.stop(),200<=c.status&&299>=c.status&&(b(c.responseText,g,p,k,d,q,f,"fixed",mxEvent.isAltDown(e)?null:f.substring(0,f.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(b(c,g,p,k,d,q,f,"fixed",mxEvent.isAltDown(e)?null:f.substring(0,f.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",e);mxEvent.addListener(u,"drop",g);mxEvent.addListener(v,"dragover",e);mxEvent.addListener(v,"drop",g);d.appendChild(u);c=document.createElement("div");
c.style.textAlign="right";c.style.marginTop="20px";f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});f.setAttribute("id","btnCancel");f.className="geBtn";a.editor.cancelFirst&&c.appendChild(f);window.chrome&&chrome.app&&chrome.app.runtime?t.setAttribute("disabled","disabled"):(n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(k),e=t.value;/(\.xml)$/i.test(e)||(e+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,e,"text/xml",null,null,!0):
(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(e)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")}),n.setAttribute("id","btnDownload"),n.className="geBtn",c.appendChild(n));var B=document.createElement("input");B.setAttribute("multiple","multiple");B.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(B,"change",function(b){C=!1;a.importFiles(B.files,0,0,a.maxImageSize,function(a,e,c,g,p,k,d,q,f){D(b)(a,e,c,g,p,k,d,q,f);B.value=""});u.scrollTop=
u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=w&&(w(),w=null);B.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=w&&(w(),w=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,e,c){C=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var g=a.indexOf(",");0<g&&(a=a.substring(0,g)+";base64,"+a.substring(g+1))}b(a,null,0,0,e,c);u.scrollTop=u.scrollHeight}})});
(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(e)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")}),n.setAttribute("id","btnDownload"),n.className="geBtn",c.appendChild(n));var B=document.createElement("input");B.setAttribute("multiple","multiple");B.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(B,"change",function(b){D=!1;a.importFiles(B.files,0,0,a.maxImageSize,function(a,e,c,g,p,k,d,q,f){y(b)(a,e,c,g,p,k,d,q,f);B.value=""});u.scrollTop=
u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=w&&(w(),w=null);B.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=w&&(w(),w=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,e,c){D=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var g=a.indexOf(",");0<g&&(a=a.substring(0,g)+";base64,"+a.substring(g+1))}b(a,null,0,0,e,c);u.scrollTop=u.scrollHeight}})});
n.setAttribute("id","btnAddImageUrl");n.className="geBtn";c.appendChild(n);this.saveBtnClickHandler=function(b,e,c,g){a.saveLibrary(b,e,c,g)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=w&&(w(),w=null);this.saveBtnClickHandler(t.value,k,h,l)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";c.appendChild(n);a.editor.cancelFirst||c.appendChild(f);d.appendChild(c);this.container=d},EditShapeDialog=function(a,f,d,c,h){c=null!=c?c:300;h=null!=h?h:120;var l,
m,b=document.createElement("table"),e=document.createElement("tbody");b.style.cellPadding="4px";l=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan","2");m.style.fontSize="10pt";mxUtils.write(m,d);l.appendChild(m);e.appendChild(l);l=document.createElement("tr");m=document.createElement("td");var g=document.createElement("textarea");g.style.outline="none";g.style.resize="none";g.style.width=c-200+"px";g.style.height=h+"px";this.textarea=g;this.init=function(){g.focus();
g.scrollTop=0};m.appendChild(g);l.appendChild(m);m=document.createElement("td");d=document.createElement("div");d.style.position="relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=h+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);m.appendChild(d);var k=new Graph(d);k.setEnabled(!1);var n=a.editor.graph.cloneCells([f])[0];k.addCells([n]);d=k.view.getState(n);var t="";null!=d.shape&&null!=d.shape.stencil&&(t=mxUtils.getPrettyXml(d.shape.stencil.desc));
mxUtils.write(g,t||"");d=k.getGraphBounds();h=Math.min(160/d.width,(h-40)/d.height);k.view.scaleAndTranslate(h,20/h-d.x,20/h-d.y);l.appendChild(m);e.appendChild(l);l=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan","2");m.style.paddingTop="2px";m.style.whiteSpace="nowrap";m.setAttribute("align","right");h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&m.appendChild(h);a.isOffline()||(d=mxUtils.button(mxResources.get("help"),
function(){window.open("https://desk.draw.io/support/solutions/articles/16000052874")}),d.className="geBtn",m.appendChild(d));var u=function(b,e,c){var p=g.value,k=mxUtils.parseXml(p),p=mxUtils.getPrettyXml(k.documentElement),k=k.documentElement.getElementsByTagName("parsererror");if(null!=k&&0<k.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),k=!b.model.contains(e),!c||k||p!=t){p=a.editor.graph.compress(p);b.getModel().beginUpdate();
try{if(k){var d=a.editor.graph.getInsertPoint();e.geometry.x=d.x;e.geometry.y=d.y;b.addCell(e)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+p+")",[e])}catch(C){throw C;}finally{b.getModel().endUpdate()}k&&b.setSelectionCell(e)}};d=mxUtils.button(mxResources.get("preview"),function(){u(k,n,!1)});d.className="geBtn";m.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,f,!0)});d.className="geBtn gePrimaryBtn";m.appendChild(d);a.editor.cancelFirst||m.appendChild(h);
try{if(k){var d=a.editor.graph.getInsertPoint();e.geometry.x=d.x;e.geometry.y=d.y;b.addCell(e)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+p+")",[e])}catch(D){throw D;}finally{b.getModel().endUpdate()}k&&b.setSelectionCell(e)}};d=mxUtils.button(mxResources.get("preview"),function(){u(k,n,!1)});d.className="geBtn";m.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,f,!0)});d.className="geBtn gePrimaryBtn";m.appendChild(d);a.editor.cancelFirst||m.appendChild(h);
l.appendChild(m);e.appendChild(l);b.appendChild(e);this.container=b},CustomDialog=function(a,f,d,c,h,l){var m=document.createElement("div");m.appendChild(f);f=document.createElement("div");f.style.marginTop="16px";f.style.textAlign="right";var b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c()});b.className="geBtn";a.editor.cancelFirst&&f.appendChild(b);if(!a.isOffline()&&null!=l){var e=mxUtils.button(mxResources.get("help"),function(){window.open(l)});e.className="geBtn";
f.appendChild(e)}h=mxUtils.button(h||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});f.appendChild(h);h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||f.appendChild(b);m.appendChild(f);this.cancelBtn=b;this.okButton=h;this.container=m};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
@ -7673,7 +7673,7 @@ mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.lib
STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];
mxStencilRegistry.libraries.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(b){var a=null;null!=b&&0<b.length&&("ER"==b.substring(0,2)?a="mxgraph.er":"sysML"==b.substring(0,5)&&(a="mxgraph.sysml"));return a};
var u=mxMarker.createMarker;mxMarker.createMarker=function(b,a,e,c,g,k,d,f,n,h){if(null!=e&&null==mxMarker.markers[e]){var p=this.getPackageForType(e);null!=p&&mxStencilRegistry.getStencil(p)}return u.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function e(){u.value=Math.max(1,Math.min(f,Math.max(parseInt(u.value),parseInt(t.value))));t.value=Math.max(1,Math.min(f,Math.min(parseInt(u.value),parseInt(t.value))))}function c(a){function e(a,e,g){var d=a.getGraphBounds(),k=0,f=0,
n=V.get(),p=1/a.pageScale,q=I.checked;if(q)var p=parseInt(O.value),h=parseInt(R.value),p=Math.min(n.height*h/(d.height/a.view.scale),n.width*p/(d.width/a.view.scale));else p=parseInt(K.value)/(100*a.pageScale),isNaN(p)&&(c=1/a.pageScale,K.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*c);n.height=Math.ceil(n.height*c);p*=c;!q&&a.pageVisible?(d=a.getPageLayout(),k-=d.x*n.width,f-=d.y*n.height):q=!0;if(null==e){e=PrintDialog.createPrintPreview(a,p,n,0,k,f,q);e.pageSelector=
n=V.get(),p=1/a.pageScale,q=J.checked;if(q)var p=parseInt(O.value),h=parseInt(R.value),p=Math.min(n.height*h/(d.height/a.view.scale),n.width*p/(d.width/a.view.scale));else p=parseInt(H.value)/(100*a.pageScale),isNaN(p)&&(c=1/a.pageScale,H.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*c);n.height=Math.ceil(n.height*c);p*=c;!q&&a.pageVisible?(d=a.getPageLayout(),k-=d.x*n.width,f-=d.y*n.height):q=!0;if(null==e){e=PrintDialog.createPrintPreview(a,p,n,0,k,f,q);e.pageSelector=
!1;e.mathEnabled=!1;var l=e.writeHead;e.writeHead=function(a){l.apply(this,arguments);null!=b.editor.fontCss&&(a.writeln('<style type="text/css">'),a.writeln(b.editor.fontCss),a.writeln("</style>"))};if("undefined"!==typeof MathJax){var t=e.renderPage;e.renderPage=function(b,a,e,c,g,d){var k=t.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:k.className="geDisableMathJax";return k}}e.open(null,null,g,!0)}else{n=a.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";e.backgroundColor=
n;e.autoOrigin=q;e.appendGraph(a,p,k,f,g,!0)}return e}var c=parseInt(S.value)/100;isNaN(c)&&(c=1,S.value="100 %");var c=.75*c,d=t.value,k=u.value,f=!h.checked,n=null;f&&(f=d==p&&k==p);if(!f&&null!=b.pages&&b.pages.length){var q=0,f=b.pages.length-1;h.checked||(q=parseInt(d)-1,f=parseInt(k)-1);for(var l=q;l<=f;l++){var m=b.pages[l],d=m==b.currentPage?g:null;if(null==d){var d=b.createTemporaryGraph(g.getStylesheet()),k=!0,q=!1,v=null,x=null;null==m.viewState&&null==m.mapping&&null==m.root&&b.updatePageRoot(m);
null!=m.viewState?(k=m.viewState.pageVisible,q=m.viewState.mathEnabled,v=m.viewState.background,x=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(q="0"!=m.mapping.diagramMap.get("mathEnabled"),v=m.mapping.diagramMap.get("background"),x=m.mapping.diagramMap.get("backgroundImage"),x=null!=x&&0<x.length?JSON.parse(x):null);d.background=v;d.backgroundImage=null!=x?new mxImage(x.src,x.width,x.height):null;d.pageVisible=k;d.mathEnabled=q;var w=d.getGlobalVariable;d.getGlobalVariable=
@ -7682,13 +7682,13 @@ f.writeln("TeX: {"),f.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noEr
n.closeDocument();!n.mathEnabled&&a&&PrintDialog.printPreview(n)}var g=b.editor.graph,k=document.createElement("div"),d=document.createElement("h3");d.style.width="100%";d.style.textAlign="center";d.style.marginTop="0px";mxUtils.write(d,a||mxResources.get("print"));k.appendChild(d);var f=1,p=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var h=document.createElement("input");h.style.cssText="margin-right:8px;margin-bottom:8px;";
h.setAttribute("value","all");h.setAttribute("type","radio");h.setAttribute("name","pages-printdialog");n.appendChild(h);d=document.createElement("span");mxUtils.write(d,mxResources.get("printAllPages"));n.appendChild(d);mxUtils.br(n);var l=h.cloneNode(!0);h.setAttribute("checked","checked");l.setAttribute("value","range");n.appendChild(l);d=document.createElement("span");mxUtils.write(d,mxResources.get("pages")+":");n.appendChild(d);var t=document.createElement("input");t.style.cssText="margin:0 8px 0 8px;";
t.setAttribute("value","1");t.setAttribute("type","number");t.setAttribute("min","1");t.style.width="50px";n.appendChild(t);d=document.createElement("span");mxUtils.write(d,mxResources.get("to"));n.appendChild(d);var u=t.cloneNode(!0);n.appendChild(u);mxEvent.addListener(t,"focus",function(){l.checked=!0});mxEvent.addListener(u,"focus",function(){l.checked=!0});mxEvent.addListener(t,"change",e);mxEvent.addListener(u,"change",e);if(null!=b.pages&&(f=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==
b.pages[d]){p=d+1;t.value=p;u.value=p;break}t.setAttribute("max",f);u.setAttribute("max",f);1<f&&k.appendChild(n);var m=document.createElement("div");m.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");m.appendChild(v);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));m.appendChild(d);var K=document.createElement("input");K.style.cssText=
"margin:0 8px 0 8px;";K.setAttribute("value","100 %");K.style.width="50px";m.appendChild(K);mxEvent.addListener(K,"focus",function(){v.checked=!0});k.appendChild(m);var n=n.cloneNode(!1),I=v.cloneNode(!0);I.setAttribute("value","fit");v.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(I);n.appendChild(d);m=document.createElement("table");m.style.display="inline-block";var T=document.createElement("tbody"),
L=document.createElement("tr"),N=L.cloneNode(!0),Q=document.createElement("td"),J=Q.cloneNode(!0),W=Q.cloneNode(!0),P=Q.cloneNode(!0),Y=Q.cloneNode(!0),U=Q.cloneNode(!0);Q.style.textAlign="right";P.style.textAlign="right";mxUtils.write(Q,mxResources.get("fitTo"));var O=document.createElement("input");O.style.cssText="margin:0 8px 0 8px;";O.setAttribute("value","1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";J.appendChild(O);d=document.createElement("span");mxUtils.write(d,
mxResources.get("fitToSheetsAcross"));W.appendChild(d);mxUtils.write(P,mxResources.get("fitToBy"));var R=O.cloneNode(!0);Y.appendChild(R);mxEvent.addListener(O,"focus",function(){I.checked=!0});mxEvent.addListener(R,"focus",function(){I.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));U.appendChild(d);L.appendChild(Q);L.appendChild(J);L.appendChild(W);N.appendChild(P);N.appendChild(Y);N.appendChild(U);T.appendChild(L);T.appendChild(N);m.appendChild(T);
b.pages[d]){p=d+1;t.value=p;u.value=p;break}t.setAttribute("max",f);u.setAttribute("max",f);1<f&&k.appendChild(n);var m=document.createElement("div");m.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");m.appendChild(v);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));m.appendChild(d);var H=document.createElement("input");H.style.cssText=
"margin:0 8px 0 8px;";H.setAttribute("value","100 %");H.style.width="50px";m.appendChild(H);mxEvent.addListener(H,"focus",function(){v.checked=!0});k.appendChild(m);var n=n.cloneNode(!1),J=v.cloneNode(!0);J.setAttribute("value","fit");v.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(J);n.appendChild(d);m=document.createElement("table");m.style.display="inline-block";var T=document.createElement("tbody"),
K=document.createElement("tr"),N=K.cloneNode(!0),Q=document.createElement("td"),I=Q.cloneNode(!0),W=Q.cloneNode(!0),P=Q.cloneNode(!0),Y=Q.cloneNode(!0),U=Q.cloneNode(!0);Q.style.textAlign="right";P.style.textAlign="right";mxUtils.write(Q,mxResources.get("fitTo"));var O=document.createElement("input");O.style.cssText="margin:0 8px 0 8px;";O.setAttribute("value","1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";I.appendChild(O);d=document.createElement("span");mxUtils.write(d,
mxResources.get("fitToSheetsAcross"));W.appendChild(d);mxUtils.write(P,mxResources.get("fitToBy"));var R=O.cloneNode(!0);Y.appendChild(R);mxEvent.addListener(O,"focus",function(){J.checked=!0});mxEvent.addListener(R,"focus",function(){J.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));U.appendChild(d);K.appendChild(Q);K.appendChild(I);K.appendChild(W);N.appendChild(P);N.appendChild(Y);N.appendChild(U);T.appendChild(K);T.appendChild(N);m.appendChild(T);
n.appendChild(m);k.appendChild(n);n=document.createElement("div");d=document.createElement("div");d.style.fontWeight="bold";d.style.marginBottom="12px";mxUtils.write(d,mxResources.get("paperSize"));n.appendChild(d);d=document.createElement("div");d.style.marginBottom="12px";var V=PageSetupDialog.addPageFormatPanel(d,"printdialog",b.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(d);d=document.createElement("span");mxUtils.write(d,mxResources.get("pageScale"));n.appendChild(d);
var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","100 %");S.style.width="60px";n.appendChild(S);k.appendChild(n);d=document.createElement("div");d.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});n.className="geBtn";b.editor.cancelFirst&&d.appendChild(n);b.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),
m.className="geBtn",d.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();c(!1)}),m.className="geBtn",d.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});m.className="geBtn gePrimaryBtn";d.appendChild(m);b.editor.cancelFirst||d.appendChild(n);k.appendChild(d);this.container=k}})();(function(){EditorUi.VERSION="6.8.17";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
m.className="geBtn",d.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();c(!1)}),m.className="geBtn",d.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});m.className="geBtn gePrimaryBtn";d.appendChild(m);b.editor.cancelFirst||d.appendChild(n);k.appendChild(d);this.container=k}})();(function(){EditorUi.VERSION="6.8.18";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=
36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=
1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var b=document.createElement("canvas"),a=new Image;a.onload=function(){try{b.getContext("2d").drawImage(a,0,0);var e=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=
null!=e&&6<e.length}catch(n){}};a.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}try{b=document.createElement("canvas");b.width=b.height=1;var c=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(k){}})();
@ -7716,9 +7716,9 @@ f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![end
!0):null;null!=b&&(a=b);if(null!=a&&"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<b.length||1==b.length&&b[0].hasAttribute("name"))){this.fileNode=a;this.pages=[];for(a=0;a<b.length;a++){var c=new DiagramPage(b[a]);null==c.getName()&&c.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(c)}this.currentPage=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)};EditorUi.prototype.getBaseFilename=function(){var b=this.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||/(\.html)$/i.test(b)||
/(\.svg)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));return b};EditorUi.prototype.downloadFile=function(b,a,c,d,f,h){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var e=this.getBaseFilename(),g=e+"."+b;if("xml"==b){var k='<?xml version="1.0" encoding="UTF-8"?>\n'+(a?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,f));this.saveData(g,b,k,"text/xml")}else if("html"==b)k=this.getHtml2(this.getFileData(!0),this.editor.graph,e),this.saveData(g,b,k,"text/html");
else if("svg"!=b&&"xmlsvg"!=b||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==b?g=e+".png":"jpeg"==b&&(g=e+".jpg"),this.saveRequest(g,b,mxUtils.bind(this,function(a,e){try{var c=this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var g=this.createDownloadRequest(a,b,d,e);this.editor.graph.pageVisible=c;return g}catch(y){this.handleError(y)}}));else{var n=null,l=mxUtils.bind(this,function(b){b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):
else if("svg"!=b&&"xmlsvg"!=b||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==b?g=e+".png":"jpeg"==b&&(g=e+".jpg"),this.saveRequest(g,b,mxUtils.bind(this,function(a,e){try{var c=this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var g=this.createDownloadRequest(a,b,d,e);this.editor.graph.pageVisible=c;return g}catch(z){this.handleError(z)}}));else{var n=null,l=mxUtils.bind(this,function(b){b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):
this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(n)}))});if("svg"==b){var m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);var t=this.editor.graph.getSvg(m,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(t);this.convertImages(t,mxUtils.bind(this,mxUtils.bind(this,function(b){this.spinner.stop();l('<?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(b))})))}else g=e+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(b){this.spinner.stop();l(b)}),d)}}catch(C){this.handleError(C)}};EditorUi.prototype.createDownloadRequest=function(b,a,c,d){var e=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=a);var g="";if(e.width*e.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==a&&(e="1",a="png",null!=this.pages&&null!=this.currentPage))for(var k=
mxUtils.getXml(b))})))}else g=e+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(b){this.spinner.stop();l(b)}),d)}}catch(D){this.handleError(D)}};EditorUi.prototype.createDownloadRequest=function(b,a,c,d){var e=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=a);var g="";if(e.width*e.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==a&&(e="1",a="png",null!=this.pages&&null!=this.currentPage))for(var k=
0;k<this.pages.length;k++)if(this.pages[k]==this.currentPage){g="&from="+k;break}return new mxXmlRequest(EXPORT_URL,"format="+a+g+"&base64="+d+"&embedXml="+e+"&xml="+encodeURIComponent(c)+(null!=b?"&filename="+encodeURIComponent(b):""))};EditorUi.prototype.setMode=function(b,a){this.mode=b};EditorUi.prototype.fileLoaded=function(b){var a=!1;this.hideDialog();var c=this.getCurrentFile();this.setCurrentFile(null);null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.updateUi();this.showSplash()});if(null!=b)try{this.setCurrentFile(b);
b.addListener("descriptorChanged",this.descriptorChangedListener);b.addListener("contentChanged",this.descriptorChangedListener);this.descriptorChanged();b.open();this.setGraphEnabled(!0);this.setMode(b.getMode());this.editor.undoManager.clear();this.updateUi();null==b.realtime&&(b.isEditable()?this.editor.setStatus(""):this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("readOnly"))));this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():(this.editor.graph.selectUnlockedLayer(),
@ -7732,20 +7732,20 @@ null==c&&(c=this.sidebar.palettes.search);null!=c&&(b=c[c.length-1].nextSibling)
"6px"),d.style.border="3px dotted lightGray",d.style.textAlign="center",d.style.padding="8px",d.style.color="#B3B3B3",mxUtils.write(d,mxResources.get("dragElementsHere"))),c.appendChild(d);else for(var e=0;e<a.length;e++){var g=a[e],f=g.data;if(null!=f){var f=this.convertDataUri(f),k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==g.aspect&&(k+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(k+"image="+f,g.w,g.h,"",g.title||"",!1,!1,!1))}else null!=
g.xml&&(f=this.stringToCells(this.editor.graph.decompress(g.xml)),0<f.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(f,g.w,g.h,g.title||"",!0,!1,!1)))}});c=null!=c&&0<c.length?c:b.getTitle();var f=this.sidebar.addPalette(b.getHash(),c,!0,mxUtils.bind(this,function(b){g(a,b)}));this.repositionLibrary(e);var h=f.parentNode.previousSibling;c=h.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=b.title&&h.setAttribute("title",this.getLibraryStorageHint(b)+"\n"+c);var p=document.createElement("div");
p.style.position="absolute";p.style.right="0px";p.style.top="5px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");h.style.position="relative";var q=document.createElement("img");q.setAttribute("src",Dialog.prototype.closeImage);q.setAttribute("title",mxResources.get("close"));q.setAttribute("align","top");q.setAttribute("border","0");q.className="geButton";q.style.marginRight="1px";q.style.marginTop="-1px";p.appendChild(q);var l=null;mxEvent.addListener(q,"click",
mxUtils.bind(this,function(a){if(!mxEvent.isConsumed(a)){var c=mxUtils.bind(this,function(){this.closeLibrary(b)});null!=l?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(a)}}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(b){mxEvent.getSource(b)==f?f.setAttribute("title",mxResources.get("libraryTooltip")):f.removeAttribute("title")}));if(b.isEditable()){var m=this.editor.graph,z=mxUtils.bind(this,
function(c){this.showLibraryDialog(b.getTitle(),f,a,b,b.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){b.setModified(!0);b.isAutosave()?(null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A),A=q.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),h.style.paddingRight=18*p.childNodes.length+"px",this.saveLibrary(b.getTitle(),
a,b,b.getMode(),!0,!0,function(){null!=A&&null!=A.parentNode&&(A.parentNode.removeChild(A),h.style.paddingRight=18*p.childNodes.length+"px")})):null==l&&(l=q.cloneNode(!1),l.setAttribute("src",IMAGE_PATH+"/download.png"),l.setAttribute("title",mxResources.get("save")),p.insertBefore(l,p.firstChild),mxEvent.addListener(l,"click",mxUtils.bind(this,function(c){this.saveLibrary(b.getTitle(),a,b,b.getMode(),b.constructor==LocalLibrary,!0,function(){null==l||b.isModified()||(h.style.paddingRight=18*p.childNodes.length+
"px",l.parentNode.removeChild(l),l=null)});mxEvent.consume(c)})),h.style.paddingRight=18*p.childNodes.length+"px")}),D=mxUtils.bind(this,function(b,c,e,g){b=m.cloneCells(mxUtils.sortCells(m.model.getTopmostCells(b)));for(var k=0;k<b.length;k++){var p=m.getCellGeometry(b[k]);null!=p&&p.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(b,c.width,c.height,g||"",!0,!1,!1));b={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(b))),w:c.width,h:c.height};
null!=g&&(b.title=g);a.push(b);C(e);null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)}),B=mxUtils.bind(this,function(b){if(m.isSelectionEmpty())m.getRubberband().isActive()?(m.getRubberband().execute(b),m.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var a=m.getSelectionCells(),c=m.view.getBounds(a),e=m.view.scale;c.x/=e;c.y/=e;c.width/=e;c.height/=e;c.x-=m.view.translate.x;c.y-=m.view.translate.y;
D(a,c)}mxEvent.consume(b)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},mxUtils.bind(this,function(b){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="hidden",null!=d?d.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",m.panningManager.stop(),m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&
mxUtils.bind(this,function(a){if(!mxEvent.isConsumed(a)){var c=mxUtils.bind(this,function(){this.closeLibrary(b)});null!=l?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(a)}}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(b){mxEvent.getSource(b)==f?f.setAttribute("title",mxResources.get("libraryTooltip")):f.removeAttribute("title")}));if(b.isEditable()){var m=this.editor.graph,A=mxUtils.bind(this,
function(c){this.showLibraryDialog(b.getTitle(),f,a,b,b.getMode());mxEvent.consume(c)}),D=mxUtils.bind(this,function(c){b.setModified(!0);b.isAutosave()?(null!=C&&null!=C.parentNode&&C.parentNode.removeChild(C),C=q.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),h.style.paddingRight=18*p.childNodes.length+"px",this.saveLibrary(b.getTitle(),
a,b,b.getMode(),!0,!0,function(){null!=C&&null!=C.parentNode&&(C.parentNode.removeChild(C),h.style.paddingRight=18*p.childNodes.length+"px")})):null==l&&(l=q.cloneNode(!1),l.setAttribute("src",IMAGE_PATH+"/download.png"),l.setAttribute("title",mxResources.get("save")),p.insertBefore(l,p.firstChild),mxEvent.addListener(l,"click",mxUtils.bind(this,function(c){this.saveLibrary(b.getTitle(),a,b,b.getMode(),b.constructor==LocalLibrary,!0,function(){null==l||b.isModified()||(h.style.paddingRight=18*p.childNodes.length+
"px",l.parentNode.removeChild(l),l=null)});mxEvent.consume(c)})),h.style.paddingRight=18*p.childNodes.length+"px")}),y=mxUtils.bind(this,function(b,c,e,g){b=m.cloneCells(mxUtils.sortCells(m.model.getTopmostCells(b)));for(var k=0;k<b.length;k++){var p=m.getCellGeometry(b[k]);null!=p&&p.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(b,c.width,c.height,g||"",!0,!1,!1));b={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(b))),w:c.width,h:c.height};
null!=g&&(b.title=g);a.push(b);D(e);null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)}),B=mxUtils.bind(this,function(b){if(m.isSelectionEmpty())m.getRubberband().isActive()?(m.getRubberband().execute(b),m.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var a=m.getSelectionCells(),c=m.view.getBounds(a),e=m.view.scale;c.x/=e;c.y/=e;c.width/=e;c.height/=e;c.x-=m.view.translate.x;c.y-=m.view.translate.y;
y(a,c)}mxEvent.consume(b)});f.style.border="3px solid transparent";mxEvent.addGestureListeners(f,function(){},mxUtils.bind(this,function(b){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="hidden",null!=d?d.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)",f.style.cursor="copy",m.panningManager.stop(),m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&
(m.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(b))}),mxUtils.bind(this,function(b){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler&&(f.style.border="3px solid transparent",null!=d&&(d.style.border="3px dotted lightGray"),f.style.cursor="default",this.sidebar.showTooltips=!0,m.panningManager.stop(),m.graphHandler.reset(),m.isMouseDown=!1,m.autoScroll=!0,B(b),mxEvent.consume(b))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(b){m.isMouseDown&&null!=m.graphHandler.shape&&
(m.graphHandler.shape.node.style.visibility="visible",f.style.border="3px solid transparent",f.style.cursor="",m.autoScroll=!0,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!0),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="visible"),null!=d&&(d.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(b){null!=d?d.style.border="3px dotted rgb(254, 137, 12)":f.style.border="3px dotted rgb(254, 137, 12)";
b.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(f,"drop",mxUtils.bind(this,function(b){f.style.border="3px solid transparent";f.style.cursor="";null!=d&&(d.style.border="3px dotted lightGray");0<b.dataTransfer.files.length&&this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,e,k,p,q,n,h,l,m){if(null!=c&&"image/"==e.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,n),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,q,n),b,mxEvent.isAltDown(b)?null:h.substring(0,h.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var t=!1,u=mxUtils.bind(this,function(c,e){if(null!=c&&"text/xml"==e){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(k.documentElement));g(p,f);a=a.concat(p);C(b);
this.spinner.stop();t=!0}catch(V){}else if("mxfile"==k.documentElement.nodeName)try{for(var q=k.documentElement.getElementsByTagName("diagram"),k=0;k<q.length;k++){var p=mxUtils.getTextContent(q[k]),n=this.stringToCells(this.editor.graph.decompress(p)),h=this.editor.graph.getBoundingBoxFromGeometry(n);D(n,new mxRectangle(0,0,h.width,h.height),b)}t=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}t||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,n),c)],c[0].vertex=!0,y(c,new mxRectangle(0,0,q,n),b,mxEvent.isAltDown(b)?null:h.substring(0,h.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var t=!1,u=mxUtils.bind(this,function(c,e){if(null!=c&&"text/xml"==e){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(k.documentElement));g(p,f);a=a.concat(p);D(b);
this.spinner.stop();t=!0}catch(V){}else if("mxfile"==k.documentElement.nodeName)try{for(var q=k.documentElement.getElementsByTagName("diagram"),k=0;k<q.length;k++){var p=mxUtils.getTextContent(q[k]),n=this.stringToCells(this.editor.graph.decompress(p)),h=this.editor.graph.getBoundingBoxFromGeometry(n);y(n,new mxRectangle(0,0,h.width,h.height),b)}t=!0}catch(V){null!=window.console&&console.log("error in drop handler:",V)}}t||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,h)&&null!=m?this.parseFile(m,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?u(b.responseText,"text/xml"):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):u(c,e)}}));b.stopPropagation();b.preventDefault()})),
mxEvent.addListener(f,"dragleave",function(b){null!=d?d.style.border="3px dotted lightGray":(f.style.border="3px solid transparent",f.style.cursor="");b.stopPropagation();b.preventDefault()}));q=q.cloneNode(!1);q.setAttribute("src",IMAGE_PATH+"/edit.gif");q.setAttribute("title",mxResources.get("edit"));p.insertBefore(q,p.firstChild);mxEvent.addListener(q,"click",z);mxEvent.addListener(f,"dblclick",function(b){mxEvent.getSource(b)==f&&z(b)});q=q.cloneNode(!1);q.setAttribute("src",Editor.plusImage);
q.setAttribute("title",mxResources.get("add"));p.insertBefore(q,p.firstChild);this.isOffline()||".scratchpad"!=b.title||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(b){window.open("https://desk.draw.io/support/solutions/articles/16000042367");mxEvent.consume(b)})),p.insertBefore(c,p.firstChild));var A=null;mxEvent.addListener(q,
mxEvent.addListener(f,"dragleave",function(b){null!=d?d.style.border="3px dotted lightGray":(f.style.border="3px solid transparent",f.style.cursor="");b.stopPropagation();b.preventDefault()}));q=q.cloneNode(!1);q.setAttribute("src",IMAGE_PATH+"/edit.gif");q.setAttribute("title",mxResources.get("edit"));p.insertBefore(q,p.firstChild);mxEvent.addListener(q,"click",A);mxEvent.addListener(f,"dblclick",function(b){mxEvent.getSource(b)==f&&A(b)});q=q.cloneNode(!1);q.setAttribute("src",Editor.plusImage);
q.setAttribute("title",mxResources.get("add"));p.insertBefore(q,p.firstChild);this.isOffline()||".scratchpad"!=b.title||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(b){window.open("https://desk.draw.io/support/solutions/articles/16000042367");mxEvent.consume(b)})),p.insertBefore(c,p.firstChild));var C=null;mxEvent.addListener(q,
"click",B)}h.appendChild(p);h.style.paddingRight=18*p.childNodes.length+"px"};"1"==urlParams.offline?EditorUi.prototype.footerHeight=4:("atlas"==uiTheme?("undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=
188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=740>=screen.height?5:46,EditorUi.prototype.createFooter=function(){var b=document.getElementById("geFooter");if(null!=b){b.style.visibility="visible";var a=document.createElement("img");a.setAttribute("border","0");
a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("hide"));b.appendChild(a);mxClient.IS_QUIRKS&&(a.style.position="relative",a.style.styleFloat="right",a.style.top="-30px",a.style.left="164px",a.style.cursor="pointer");mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return b});EditorUi.prototype.hideFooter=function(){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=0,b.style.display="none",this.refresh())};
@ -7782,23 +7782,23 @@ c.join(" "));null!=q&&0<q.length&&(g.edit=q);null!=b?g.url=b:g.xml=this.getFileD
e)+"&"+b:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";
var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var h=document.createElement("span");mxUtils.write(h,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(h);mxUtils.br(g);g.appendChild(k);h=document.createElement("span");mxUtils.write(h,mxResources.get("publicDiagramUrl"));
g.appendChild(h);var q=this.getCurrentFile();null==c&&null!=q&&q.constructor==window.DriveFile&&(h=document.createElement("a"),h.style.paddingLeft="12px",h.style.color="gray",h.setAttribute("href","javascript:void(0);"),mxUtils.write(h,mxResources.get("share")),g.appendChild(h),mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(q.getId())})));f.setAttribute("checked","checked");null==c&&k.setAttribute("disabled","disabled");e.appendChild(g);var l=
this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var z=document.createElement("input");z.setAttribute("type","text");z.style.marginRight="16px";z.style.width="60px";z.style.marginLeft="4px";z.style.marginRight="12px";z.value="100%";e.appendChild(z);var C=this.addCheckbox(e,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(e,mxResources.get("allPages"),g,!g),B=this.addCheckbox(e,mxResources.get("layers"),!0),
A=this.addCheckbox(e,mxResources.get("lightbox"),!0),y=this.addEditButton(e,A),F=y.getEditInput();F.style.marginBottom="16px";mxEvent.addListener(A,"change",function(){A.checked?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled");F.checked&&A.checked?y.getEditSelect().removeAttribute("disabled"):y.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){d(k.checked?c:null,m.checked,z.value,l.getTarget(),l.getColor(),C.checked,D.checked,
B.checked,A.checked,y.getLink())}),null,b,a);this.showDialog(b.container,340,360,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,f,h){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,b||mxResources.get("link"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(g);var k=this.getCurrentFile(),g="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=
this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var A=document.createElement("input");A.setAttribute("type","text");A.style.marginRight="16px";A.style.width="60px";A.style.marginLeft="4px";A.style.marginRight="12px";A.value="100%";e.appendChild(A);var D=this.addCheckbox(e,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,y=y=this.addCheckbox(e,mxResources.get("allPages"),g,!g),B=this.addCheckbox(e,mxResources.get("layers"),!0),
C=this.addCheckbox(e,mxResources.get("lightbox"),!0),z=this.addEditButton(e,C),F=z.getEditInput();F.style.marginBottom="16px";mxEvent.addListener(C,"change",function(){C.checked?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled");F.checked&&C.checked?z.getEditSelect().removeAttribute("disabled"):z.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){d(k.checked?c:null,m.checked,A.value,l.getTarget(),l.getColor(),D.checked,y.checked,
B.checked,C.checked,z.getLink())}),null,b,a);this.showDialog(b.container,340,360,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,f,h){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,b||mxResources.get("link"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(g);var k=this.getCurrentFile(),g="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=
k&&k.constructor==window.DriveFile&&!a){b=80;var g="https://desk.draw.io/support/solutions/articles/16000039384",q=document.createElement("div");q.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));q.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));
l.style.marginTop="12px";l.className="geBtn";q.appendChild(l);e.appendChild(q);l=document.createElement("a");l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));q.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(b){this.spinner.stop();b=new ErrorDialog(this,
null,mxResources.get(null!=b?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(b.container,300,80,!0,!1);b.init()}))}))}var n=null,m=null;if(null!=c||null!=d)b+=30,mxUtils.write(e,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",e.appendChild(n),mxUtils.write(e,mxResources.get("height")+
":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.width="50px",m.style.marginLeft="6px",m.style.marginBottom="10px",m.value=d+"px",e.appendChild(m),mxUtils.br(e);var t=this.addLinkSection(e,h);c=null!=this.pages&&1<this.pages.length;var D=null;if(null==k||k.constructor!=window.DriveFile||a)D=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var B=this.addCheckbox(e,mxResources.get("lightbox"),!0),A=this.addEditButton(e,B),y=A.getEditInput(),F=this.addCheckbox(e,mxResources.get("layers"),
!0);F.style.marginLeft=y.style.marginLeft;F.style.marginBottom="16px";F.style.marginTop="8px";mxEvent.addListener(B,"change",function(){B.checked?(F.removeAttribute("disabled"),y.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"));y.checked&&B.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(t.getTarget(),t.getColor(),null==D?
!0:D.checked,B.checked,A.getLink(),F.checked,null!=n?n.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),g);this.showDialog(a.container,340,246+b,!0,!0);null!=n?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));
":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.width="50px",m.style.marginLeft="6px",m.style.marginBottom="10px",m.value=d+"px",e.appendChild(m),mxUtils.br(e);var t=this.addLinkSection(e,h);c=null!=this.pages&&1<this.pages.length;var y=null;if(null==k||k.constructor!=window.DriveFile||a)y=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var B=this.addCheckbox(e,mxResources.get("lightbox"),!0),C=this.addEditButton(e,B),z=C.getEditInput(),F=this.addCheckbox(e,mxResources.get("layers"),
!0);F.style.marginLeft=z.style.marginLeft;F.style.marginBottom="16px";F.style.marginTop="8px";mxEvent.addListener(B,"change",function(){B.checked?(F.removeAttribute("disabled"),z.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"));z.checked&&B.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(t.getTarget(),t.getColor(),null==y?
!0:y.checked,B.checked,C.getLink(),F.checked,null!=n?n.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),g);this.showDialog(a.container,340,246+b,!0,!0);null!=n?(n.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));
f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(f);var g=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=k&&(k.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!g.checked,null!=k?k.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=function(b,
a,c,d,f,h,l,m){l=null!=l?l:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph,k="jpeg"==m?170:280,n=document.createElement("h3");mxUtils.write(n,b);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(n);mxUtils.write(e,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=
this.lastExportZoom||"100%";e.appendChild(t);mxUtils.write(e,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";e.appendChild(u);mxUtils.br(e);var v=this.addCheckbox(e,mxResources.get("transparentBackground"),g.background==mxConstants.NONE||null==g.background,null,null,"jpeg"!=m),B=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),
A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");h&&(e.appendChild(A),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),k+=26);g.isSelectionEmpty()?A.setAttribute("disabled","disabled"):(A.setAttribute("checked","checked"),A.defaultChecked=!0);var y=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible),F=document.createElement("input");F.style.marginTop="16px";F.style.marginRight="8px";F.setAttribute("type","checkbox");
!this.isOffline()&&this.canvasSupported||F.setAttribute("disabled","disabled");a&&(e.appendChild(F),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),k+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,E=this.addCheckbox(e,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);E.style.marginLeft="24px";E.style.marginBottom="16px";G||(E.style.visibility="hidden");mxEvent.addListener(H,"change",function(){H.checked&&
G?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")});l&&G||E.setAttribute("disabled","disabled");b=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=t.value;f(t.value,v.checked,!B.checked,y.checked,H.checked,F.checked,u.value,A.checked,!E.checked)}),null,c,d);this.showDialog(b.container,320,k,!0,!0);t.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=
function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=a){var k=document.createElement("h3");mxUtils.write(k,a);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(k)}var h=this.addCheckbox(e,mxResources.get("fit"),!0),q=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d,!d),l=this.addCheckbox(e,c),n=this.addCheckbox(e,mxResources.get("lightbox"),!0),m=this.addEditButton(e,n),C=m.getEditInput(),
D=1<g.model.getChildCount(g.model.getRoot()),B=this.addCheckbox(e,mxResources.get("layers"),D,!D);B.style.marginLeft=C.style.marginLeft;B.style.marginBottom="12px";B.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(D&&B.removeAttribute("disabled"),C.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"));C.checked&&n.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});
C=document.createElement("input");C.style.marginTop="16px";C.style.marginRight="8px";C.setAttribute("type","checkbox");h&&(e.appendChild(C),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),k+=26);g.isSelectionEmpty()?C.setAttribute("disabled","disabled"):(C.setAttribute("checked","checked"),C.defaultChecked=!0);var z=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible),F=document.createElement("input");F.style.marginTop="16px";F.style.marginRight="8px";F.setAttribute("type","checkbox");
!this.isOffline()&&this.canvasSupported||F.setAttribute("disabled","disabled");a&&(e.appendChild(F),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),k+=26);var L=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,E=this.addCheckbox(e,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);E.style.marginLeft="24px";E.style.marginBottom="16px";G||(E.style.visibility="hidden");mxEvent.addListener(L,"change",function(){L.checked&&
G?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")});l&&G||E.setAttribute("disabled","disabled");b=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=t.value;f(t.value,v.checked,!B.checked,z.checked,L.checked,F.checked,u.value,C.checked,!E.checked)}),null,c,d);this.showDialog(b.container,320,k,!0,!0);t.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=
function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=a){var k=document.createElement("h3");mxUtils.write(k,a);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(k)}var h=this.addCheckbox(e,mxResources.get("fit"),!0),q=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d,!d),l=this.addCheckbox(e,c),n=this.addCheckbox(e,mxResources.get("lightbox"),!0),m=this.addEditButton(e,n),D=m.getEditInput(),
y=1<g.model.getChildCount(g.model.getRoot()),B=this.addCheckbox(e,mxResources.get("layers"),y,!y);B.style.marginLeft=D.style.marginLeft;B.style.marginBottom="12px";B.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(y&&B.removeAttribute("disabled"),D.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"));D.checked&&n.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});
a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(h.checked,q.checked,l.checked,n.checked,m.getLink(),B.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,h,l,m){function e(a){var e=" ",k="";d&&(e=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
(f?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",k+="cursor:pointer;");b&&(k+="max-width:100%;");var p="";c&&(p=' width="'+Math.round(g.width)+'" height="'+Math.round(g.height)+'"');l('<img src="'+a+'"'+p+(""!=k?' style="'+k+'"':"")+e+"/>")}var g=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(b){var a=d?this.getFileData(!0):null;b=this.createImageDataUri(b,a,"png");e(b)}),null,null,null,mxUtils.bind(this,function(b){m({message:mxResources.get("unknownError")})}),
null,!0,c?2:1,null,a);else if(a=this.getFileData(!0),g.width*g.height<=MAX_AREA&&a.length<=MAX_REQUEST_SIZE){var k="";c&&(k="&w="+Math.round(2*g.width)+"&h="+Math.round(2*g.height));var n=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+k+"&xml="+encodeURIComponent(a));n.send(mxUtils.bind(this,function(){200<=n.getStatus()&&299>=n.getStatus()?e("data:image/png;base64,"+n.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})};
@ -7810,17 +7810,17 @@ c&&a.setAttribute("resource",c);if(null!=f)this.convertImages(a,mxUtils.bind(thi
m,p){p=null!=p?p:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(b){this.spinner.stop();try{this.saveCanvas(b,f?this.getFileData(!0,null,null,null,c,m):null,p)}catch(w){"Invalid image"==w.message?this.downloadFile(p):this.handleError(w)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();
this.handleError(b)}),null,c,b||1,a,d,null,null,h,l)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.loadFonts=function(b){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var a=this.editor.fontCss.split("url("),c=0,d={},f=mxUtils.bind(this,function(){if(0==c){for(var e=[a[0]],f=1;f<a.length;f++){var g=a[f].indexOf(")");e.push("url(");e.push(d[a[f].substring(0,g)]);e.push(a[f].substring(g))}this.editor.resolvedFontCss=e.join("");b()}});if(0<a.length)for(var h=
1;h<a.length;h++){var l=a[h].indexOf(")");mxUtils.bind(this,function(b){if(null==d[b]){d[b]=b;c++;var a="application/x-font-ttf";/(\.svg)($|\?)/i.test(b)?a="image/svg+xml":/(\.otf)($|\?)/i.test(b)?a="application/x-font-opentype":/(\.woff)($|\?)/i.test(b)?a="application/font-woff":/(\.woff2)($|\?)/i.test(b)?a="application/font-woff2":/(\.eot)($|\?)/i.test(b)?a="application/vnd.ms-fontobject":/(\.sfnt)($|\?)/i.test(b)&&(a="application/font-sfnt");var e=b;/^https?:\/\//.test(e)&&!this.isCorsEnabledForUrl(e)&&
(e=PROXY_URL+"?url="+encodeURIComponent(b));this.loadUrl(e,mxUtils.bind(this,function(a){d[b]=a;c--;f()}),mxUtils.bind(this,function(b){c--;f()}),!0,null,"data:"+a+";charset=utf-8;base64,")}})(a[h].substring(0,l))}}else b()};EditorUi.prototype.exportToCanvas=function(b,a,c,d,f,h,l,m,p,q,x,w,z,C){h=null!=h?h:!0;w=null!=w?w:this.editor.graph;z=null!=z?z:0;var e=p?null:w.background;e==mxConstants.NONE&&(e=null);null==e&&(e=d);null==e&&0==p&&(e="#ffffff");this.convertImages(w.getSvg(e,null,null,C,null,
null!=l?l:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var g=document.createElement("canvas"),k=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=a&&(m=h?Math.min(1,Math.min(3*a/(4*l),a/k)):a/k);k=Math.ceil(m*k)+2*z;l=Math.ceil(m*l)+2*z;g.setAttribute("width",k);g.setAttribute("height",l);var p=g.getContext("2d");null!=e&&(p.beginPath(),p.rect(0,0,k,l),p.fillStyle=e,p.fill());p.scale(m,m);p.drawImage(d,z/m,z/m);
(e=PROXY_URL+"?url="+encodeURIComponent(b));this.loadUrl(e,mxUtils.bind(this,function(a){d[b]=a;c--;f()}),mxUtils.bind(this,function(b){c--;f()}),!0,null,"data:"+a+";charset=utf-8;base64,")}})(a[h].substring(0,l))}}else b()};EditorUi.prototype.exportToCanvas=function(b,a,c,d,f,h,l,m,p,q,x,w,A,D){h=null!=h?h:!0;w=null!=w?w:this.editor.graph;A=null!=A?A:0;var e=p?null:w.background;e==mxConstants.NONE&&(e=null);null==e&&(e=d);null==e&&0==p&&(e="#ffffff");this.convertImages(w.getSvg(e,null,null,D,null,
null!=l?l:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var g=document.createElement("canvas"),k=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=a&&(m=h?Math.min(1,Math.min(3*a/(4*l),a/k)):a/k);k=Math.ceil(m*k)+2*A;l=Math.ceil(m*l)+2*A;g.setAttribute("width",k);g.setAttribute("height",l);var p=g.getContext("2d");null!=e&&(p.beginPath(),p.rect(0,0,k,l),p.fillStyle=e,p.fill());p.scale(m,m);p.drawImage(d,A/m,A/m);
b(g)}catch(M){null!=f&&f(M)}});d.onerror=function(b){null!=f&&f(b)};try{q&&this.editor.graph.addSvgShadow(c);var g=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var b=document.createElement("style");b.setAttribute("type","text/css");b.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(b)}this.convertMath(w,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(g)}catch(F){null!=f&&f(F)}}),c,x)};EditorUi.prototype.createImageUrlConverter=
function(){var b=new mxUrlConverter;b.updateBaseUrl();var a=b.convert;b.convert=function(c){null!=c&&("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,b.baseUrl.length)==b.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=a.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return b};EditorUi.prototype.convertImages=function(b,a,c,d){null==d&&(d=this.createImageUrlConverter());var e=0,f=c||{};c=mxUtils.bind(this,function(c,g){for(var k=b.getElementsByTagName(c),
h=0;h<k.length;h++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(g));if(null!=k&&"data:"!=k.substring(0,5)){var h=f[k];null==h?(e++,this.convertImageToDataUri(k,function(d){null!=d&&(f[k]=d,c.setAttribute(g,d));e--;0==e&&a(b)})):c.setAttribute(g,h)}})(k[h])});c("image","xlink:href");c("img","src");0==e&&a(b)};EditorUi.prototype.loadUrl=function(b,a,c,d,f,h){try{var e=d||/(\.png)($|\?)/i.test(b)||/(\.jpe?g)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b);f=null!=f?f:!0;var g=mxUtils.bind(this,
function(){mxUtils.get(b,mxUtils.bind(this,function(b){if(200<=b.getStatus()&&299>=b.getStatus()){if(null!=a){var d=b.getText();if(e){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){b=mxUtilsBinaryToArray(b.request.responseBody).toArray();for(var d=Array(b.length),f=0;f<b.length;f++)d[f]=String.fromCharCode(b[f]);d=d.join("")}h=null!=h?h:"data:image/png;base64,";d=h+this.base64Encode(d)}a(d)}}else null!=c&&c({code:App.ERROR_UNKNOWN})}),function(){null!=
c&&c({code:App.ERROR_UNKNOWN})},e,this.timeout,function(){f&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:g})})});g()}catch(p){null!=c&&c(p)}};EditorUi.prototype.isCorsEnabledForUrl=function(b){return"https?://raw.githubusercontent.com/"===b.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(b)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(b)};EditorUi.prototype.convertImageToDataUri=function(b,a){if(/(\.svg)$/i.test(b))mxUtils.get(b,mxUtils.bind(this,function(b){a(this.createSvgDataUri(b.getText()))}),
function(){a()});else{var c=new Image;c.onload=function(){var b=document.createElement("canvas"),e=b.getContext("2d");b.height=c.height;b.width=c.width;e.drawImage(c,0,0);a(b.toDataURL())};c.onerror=function(){a()};c.src=b}};EditorUi.prototype.importXml=function(b,a,c,d,f){a=null!=a?a:0;c=null!=c?c:0;var e=[];try{var g=this.editor.graph;if(null!=b&&0<b.length){var k=mxUtils.parseXml(b),h=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var l=
h.getElementsByTagName("diagram");if(1==l.length)h=mxUtils.parseXml(g.decompress(mxUtils.getTextContent(l[0]))).documentElement;else if(1<l.length){g.model.beginUpdate();try{for(var m=0;m<l.length;m++){var n=this.updatePageRoot(new DiagramPage(l[m])),z=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[z+1]));g.model.execute(new ChangePage(this,n,n,z))}}finally{g.model.endUpdate()}}}if(null!=h&&"mxGraphModel"===h.nodeName){var C=new mxGraphModel;(new mxCodec(h.ownerDocument)).decode(h,
C);var D=C.getChildCount(C.getRoot());g.model.getChildCount(g.model.getRoot());g.model.beginUpdate();try{b={};for(m=0;m<D;m++){var B=C.getChildAt(C.getRoot(),m);if(1!=D||g.isCellLocked(g.getDefaultParent()))B=g.importCells([B],0,0,g.model.getRoot(),null,b)[0],A=g.model.getChildren(B),g.moveCells(A,a,c),e=e.concat(A);else var A=C.getChildren(B),e=e.concat(g.importCells(A,a,c,g.getDefaultParent(),null,b))}if(d){g.isGridEnabled()&&(a=g.snap(a),c=g.snap(c));var y=g.getBoundingBoxFromGeometry(e,!0);null!=
y&&g.moveCells(e,a-y.x,c-y.y)}}finally{g.model.endUpdate()}}}}catch(F){throw f||this.handleError(F,mxResources.get("invalidOrMissingFile")),F;}return e};EditorUi.prototype.insertLucidChart=function(b,a,c,d){var e=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.pasteLucidChart(b,a,c,d)}catch(t){}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(e,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("/js/diagramly/Extensions.js",e):mxscript("/js/extensions.min.js",
h.getElementsByTagName("diagram");if(1==l.length)h=mxUtils.parseXml(g.decompress(mxUtils.getTextContent(l[0]))).documentElement;else if(1<l.length){g.model.beginUpdate();try{for(var m=0;m<l.length;m++){var n=this.updatePageRoot(new DiagramPage(l[m])),A=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[A+1]));g.model.execute(new ChangePage(this,n,n,A))}}finally{g.model.endUpdate()}}}if(null!=h&&"mxGraphModel"===h.nodeName){var D=new mxGraphModel;(new mxCodec(h.ownerDocument)).decode(h,
D);var y=D.getChildCount(D.getRoot());g.model.getChildCount(g.model.getRoot());g.model.beginUpdate();try{b={};for(m=0;m<y;m++){var B=D.getChildAt(D.getRoot(),m);if(1!=y||g.isCellLocked(g.getDefaultParent()))B=g.importCells([B],0,0,g.model.getRoot(),null,b)[0],C=g.model.getChildren(B),g.moveCells(C,a,c),e=e.concat(C);else var C=D.getChildren(B),e=e.concat(g.importCells(C,a,c,g.getDefaultParent(),null,b))}if(d){g.isGridEnabled()&&(a=g.snap(a),c=g.snap(c));var z=g.getBoundingBoxFromGeometry(e,!0);null!=
z&&g.moveCells(e,a-z.x,c-z.y)}}finally{g.model.endUpdate()}}}}catch(F){throw f||this.handleError(F,mxResources.get("invalidOrMissingFile")),F;}return e};EditorUi.prototype.insertLucidChart=function(b,a,c,d){var e=mxUtils.bind(this,function(){if(this.pasteLucidChart)try{this.pasteLucidChart(b,a,c,d)}catch(t){}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(e,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("/js/diagramly/Extensions.js",e):mxscript("/js/extensions.min.js",
e))};EditorUi.prototype.insertTextAt=function(b,a,c,d,f,h,l){h=null!=h?h:!0;l=null!=l?l:!0;if(null!=b)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b))this.parseFile(new Blob([b.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&200<=b.status&&299>=b.status&&this.editor.graph.setSelectionCells(this.insertTextAt(b.responseText,a,c,!0))}));else if("data:"==b.substring(0,5)||!this.isOffline()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b))){var e=
this.editor.graph;if("data:image/png;base64,"==b.substring(0,22)){var g=this.extractGraphModelFromPng(b),k=this.importXml(g,a,c,h,!0);if(0<k.length)return k}if("data:image/svg+xml;"==b.substring(0,19))try{if(g=null,"data:image/svg+xml;base64,"==b.substring(0,26)?(g=b.substring(b.indexOf(",")+1),g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0)):g=decodeURIComponent(b.substring(b.indexOf(",")+1)),k=this.importXml(g,a,c,h,!0),0<k.length)return k}catch(w){}this.loadImage(b,mxUtils.bind(this,
function(d){if("data:"==b.substring(0,5))this.resizeImage(d,b,mxUtils.bind(this,function(b,d,f){e.setSelectionCell(e.insertVertex(null,null,"",e.snap(a),e.snap(c),d,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(b)+";"))}),l,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),g=Math.round(d.width*f);d=Math.round(d.height*f);e.setSelectionCell(e.insertVertex(null,
@ -7832,42 +7832,42 @@ null!=q?q:!0;var e=!1,g=null;"image"==a.substring(0,5)?(p=!1,"image/png"==a.subs
";")])):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,l)?(e=!0,this.parseFile(null!=p?p:new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){if(4==b.readyState){var a=null;200<=b.status&&299>=b.status&&(b=b.responseText,null!=b&&"<mxlibrary"==b.substring(0,10)?(null!=l&&".vssx"==l.toLowerCase().substring(l.length-5)&&(l=l.substring(0,l.length-5)+".xml"),this.loadLibrary(new LocalLibrary(this,b,l))):a=this.importXml(b,c,d,q));null!=m&&m(a)}}),l)):
/(\.vsd)($|\?)/i.test(l)||(g=this.insertTextAt(this.validateFileData(b),c,d,!0,null,q));e||null==m||m(g);return g};EditorUi.prototype.base64Encode=function(b){for(var a="",c=0,d=b.length,f,h,l;c<d;){f=b.charCodeAt(c++)&255;if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);a+="==";break}h=b.charCodeAt(c++);if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>
2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(h&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);a+="=";break}l=b.charCodeAt(c++);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(h&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(l&192)>>6);
a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,f,h,l,m,p,q,x,w){var e=null!=a&&null!=c;a=null!=a?a:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;q=null!=q?q:this.maxImageBytes;p=null!=p?p:!0;var g=!1;if(!mxClient.IS_CHROMEAPP&&null!=b)for(var k=x||this.resampleThreshold,n=0;n<b.length;n++)if("image/"==b[n].type.substring(0,6)&&b[n].size>k){g=!0;break}var t=mxUtils.bind(this,function(){var g=this.editor.graph,
k=g.gridSize;f=null!=f?f:mxUtils.bind(this,function(b,a,c,d,f,g,k,h,l){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,k)),null):this.importFile(b,a,c,d,f,g,k,h,l,e,w)});h=null!=h?h:mxUtils.bind(this,function(b){g.setSelectionCells(b)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=b.length,t=n,u=[],v=mxUtils.bind(this,function(b,a){u[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(u);else{var c=[];g.getModel().beginUpdate();
try{for(var e=0;e<u.length;e++){var d=u[e]();null!=d&&(c=c.concat(d))}}finally{g.getModel().endUpdate()}}h(c)}}),A=0;A<n;A++)mxUtils.bind(this,function(e){var g=b[e],h=new FileReader;h.onload=mxUtils.bind(this,function(b){if(null==l||l(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var h=b.target.result,m=h.indexOf(","),n=atob(h.substring(m+1)),t=mxUtils.parseXml(n),n=t.getElementsByTagName("svg");if(0<n.length){var n=n[0],u=w?null:n.getAttribute("content");null!=u&&
"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?v(e,mxUtils.bind(this,function(){try{if(h.substring(0,m+1),null!=t){var b=t.getElementsByTagName("svg");if(0<b.length){var l=b[0],p=parseFloat(l.getAttribute("width")),q=parseFloat(l.getAttribute("height")),n=l.getAttribute("viewBox");if(null==n||0==n.length)l.setAttribute("viewBox",
"0 0 "+p+" "+q);else if(isNaN(p)||isNaN(q)){var x=n.split(" ");3<x.length&&(p=parseFloat(x[2]),q=parseFloat(x[3]))}h=this.createSvgDataUri(mxUtils.getXml(b[0]));var u=Math.min(1,Math.min(d/Math.max(1,p)),d/Math.max(1,q));return f(h,g.type,a+e*k,c+e*k,Math.max(1,Math.round(p*u)),Math.max(1,Math.round(q*u)),g.name)}}}catch(fa){}return null})):v(e,mxUtils.bind(this,function(){return f(u,"text/xml",a+e*k,c+e*k,0,0,g.name)}))}}else{n=!1;if("image/png"==g.type){var A=w?null:this.extractGraphModelFromPng(b.target.result);
if(null!=A&&0<A.length){var z=new Image;z.src=b.target.result;v(e,mxUtils.bind(this,function(){return f(A,"text/xml",a+e*k,c+e*k,z.width,z.height,g.name)}));n=!0}}n||(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(b.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,
b.target.result,mxUtils.bind(this,function(h,l,m){v(e,mxUtils.bind(this,function(){if(null!=h&&h.length<q){var n=p&&this.isResampleImage(b.target.result,x)?Math.min(1,Math.min(d/l,d/m)):1;return f(h,g.type,a+e*k,c+e*k,Math.round(l*n),Math.round(m*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),p,d,x)})))}else f(b.target.result,g.type,a+e*k,c+e*k,240,160,g.name,function(b){v(e,function(){return b})})});/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?
f(null,g.type,a+e*k,c+e*k,240,160,g.name,function(b){v(e,function(){return b})},g):"image"==g.type.substring(0,5)?h.readAsDataURL(g):h.readAsText(g)})(A)});g&&p?this.confirmImageResize(function(b){p=b;t()}):t()};EditorUi.prototype.confirmImageResize=function(b){var a=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=function(c,e){c&&(mxSettings.setResizeImages(e),mxSettings.save());a();b(e)},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null;null!=
d?c(!1,d):this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(b){c(b,!0)},function(b){c(b,!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)};EditorUi.prototype.parseFile=function(b,a,c){c=null!=c?c:b.name;var e=new FormData;e.append("format",
"xml");e.append("upfile",b,c);var d=new XMLHttpRequest;d.open("POST",OPEN_URL);d.onreadystatechange=function(){a(d)};d.send(e)};EditorUi.prototype.isResampleImage=function(b,a){a=null!=a?a:this.resampleThreshold;return b.length>a};EditorUi.prototype.resizeImage=function(b,a,c,d,f,h){f=null!=f?f:this.maxImageSize;var e=Math.max(1,b.width),g=Math.max(1,b.height);if(d&&this.isResampleImage(a,h))try{var k=Math.max(e/f,g/f);if(1<k){var l=Math.round(e/k),m=Math.round(g/k),n=document.createElement("canvas");
n.width=l;n.height=m;n.getContext("2d").drawImage(b,0,0,l,m);var t=n.toDataURL();if(t.length<a.length){var C=document.createElement("canvas");C.width=l;C.height=m;var D=C.toDataURL();t!==D&&(a=t,e=l,g=m)}}}catch(B){}c(a,e,g)};EditorUi.prototype.crcTable=[];for(var f=0;256>f;f++)for(var d=f,c=0;8>c;c++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[f]=d;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var e=0;e<d;e++)b=EditorUi.prototype.crcTable[(b^a[c+e])&255]^b>>>8;return b};EditorUi.prototype.writeGraphModelToPng=
a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,f,h,l,m,p,q,x,w){a=null!=a?a:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;q=null!=q?q:this.maxImageBytes;var e=null!=a&&null!=c,g=!0,k=!1;if(!mxClient.IS_CHROMEAPP&&null!=b)for(var n=x||this.resampleThreshold,t=0;t<b.length;t++)if("image/"==b[t].type.substring(0,6)&&b[t].size>n){k=!0;break}var u=mxUtils.bind(this,function(){var k=this.editor.graph,p=k.gridSize;
f=null!=f?f:mxUtils.bind(this,function(b,a,c,d,f,g,k,h,l){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,k)),null):this.importFile(b,a,c,d,f,g,k,h,l,e,w)});h=null!=h?h:mxUtils.bind(this,function(b){k.setSelectionCells(b)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=b.length,t=n,u=[],v=mxUtils.bind(this,function(b,a){u[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(u);else{var c=[];k.getModel().beginUpdate();
try{for(var e=0;e<u.length;e++){var d=u[e]();null!=d&&(c=c.concat(d))}}finally{k.getModel().endUpdate()}}h(c)}}),y=0;y<n;y++)mxUtils.bind(this,function(e){var k=b[e],h=new FileReader;h.onload=mxUtils.bind(this,function(b){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var h=b.target.result,m=h.indexOf(","),n=atob(h.substring(m+1)),t=mxUtils.parseXml(n),n=t.getElementsByTagName("svg");if(0<n.length){var n=n[0],u=w?null:n.getAttribute("content");null!=u&&
"<"!=u.charAt(0)&&"%"!=u.charAt(0)&&(u=unescape(window.atob?atob(u):Base64.decode(u,!0)));null!=u&&"%"==u.charAt(0)&&(u=decodeURIComponent(u));null==u||"<mxfile "!==u.substring(0,8)&&"<mxGraphModel "!==u.substring(0,14)?v(e,mxUtils.bind(this,function(){try{if(h.substring(0,m+1),null!=t){var b=t.getElementsByTagName("svg");if(0<b.length){var g=b[0],l=parseFloat(g.getAttribute("width")),q=parseFloat(g.getAttribute("height")),n=g.getAttribute("viewBox");if(null==n||0==n.length)g.setAttribute("viewBox",
"0 0 "+l+" "+q);else if(isNaN(l)||isNaN(q)){var x=n.split(" ");3<x.length&&(l=parseFloat(x[2]),q=parseFloat(x[3]))}h=this.createSvgDataUri(mxUtils.getXml(b[0]));var u=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,q));return f(h,k.type,a+e*p,c+e*p,Math.max(1,Math.round(l*u)),Math.max(1,Math.round(q*u)),k.name)}}}catch(Z){}return null})):v(e,mxUtils.bind(this,function(){return f(u,"text/xml",a+e*p,c+e*p,0,0,k.name)}))}}else{n=!1;if("image/png"==k.type){var y=w?null:this.extractGraphModelFromPng(b.target.result);
if(null!=y&&0<y.length){var C=new Image;C.src=b.target.result;v(e,mxUtils.bind(this,function(){return f(y,"text/xml",a+e*p,c+e*p,C.width,C.height,k.name)}));n=!0}}n||(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(b.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,
b.target.result,mxUtils.bind(this,function(h,l,m){v(e,mxUtils.bind(this,function(){if(null!=h&&h.length<q){var n=g&&this.isResampleImage(b.target.result,x)?Math.min(1,Math.min(d/l,d/m)):1;return f(h,k.type,a+e*p,c+e*p,Math.round(l*n),Math.round(m*n),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),g,d,x)})))}else f(b.target.result,k.type,a+e*p,c+e*p,240,160,k.name,function(b){v(e,function(){return b})})});/(\.vsdx)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)?
f(null,k.type,a+e*p,c+e*p,240,160,k.name,function(b){v(e,function(){return b})},k):"image"==k.type.substring(0,5)?h.readAsDataURL(k):h.readAsText(k)})(y)});k?this.confirmImageResize(function(b){g=b;u()},p):u()};EditorUi.prototype.confirmImageResize=function(b,a){a=null!=a?a:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=function(a,e){mxSettings.setResizeImages(a?e:null);mxSettings.save();c();b(e)},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():
null;null==d||a?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(b){e(b,!0)},function(b){e(b,!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,d)};EditorUi.prototype.parseFile=function(b,a,c){c=null!=c?c:b.name;var e=new FormData;
e.append("format","xml");e.append("upfile",b,c);var d=new XMLHttpRequest;d.open("POST",OPEN_URL);d.onreadystatechange=function(){a(d)};d.send(e)};EditorUi.prototype.isResampleImage=function(b,a){a=null!=a?a:this.resampleThreshold;return b.length>a};EditorUi.prototype.resizeImage=function(b,a,c,d,f,h){f=null!=f?f:this.maxImageSize;var e=Math.max(1,b.width),g=Math.max(1,b.height);if(d&&this.isResampleImage(a,h))try{var k=Math.max(e/f,g/f);if(1<k){var l=Math.round(e/k),m=Math.round(g/k),n=document.createElement("canvas");
n.width=l;n.height=m;n.getContext("2d").drawImage(b,0,0,l,m);var t=n.toDataURL();if(t.length<a.length){var D=document.createElement("canvas");D.width=l;D.height=m;var y=D.toDataURL();t!==y&&(a=t,e=l,g=m)}}}catch(B){}c(a,e,g)};EditorUi.prototype.crcTable=[];for(var f=0;256>f;f++)for(var d=f,c=0;8>c;c++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[f]=d;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var e=0;e<d;e++)b=EditorUi.prototype.crcTable[(b^a[c+e])&255]^b>>>8;return b};EditorUi.prototype.writeGraphModelToPng=
function(b,a,c,d,f){function e(b,a){var c=k;k+=a;return b.substring(c,k)}function g(b){b=e(b,4);return b.charCodeAt(3)+(b.charCodeAt(2)<<8)+(b.charCodeAt(1)<<16)+(b.charCodeAt(0)<<24)}function h(b){return String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255)}b=b.substring(b.indexOf(",")+1);b=window.atob?atob(b):Base64.decode(b,!0);var k=0;if(e(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=f&&f();else if(e(b,4),"IHDR"!=e(b,4))null!=f&&f();else{e(b,17);f=b.substring(0,
k);do{var l=g(b);if("IDAT"==e(b,4)){f=b.substring(0,k-8);c=c+String.fromCharCode(0)+("zTXt"==a?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,a,0,4);d=this.updateCRC(d,c,0,c.length);f+=h(c.length)+a+c+h(d^4294967295);f+=b.substring(k-8,b.length);break}f+=b.substring(k-8,k-4+l);d=e(b,l);e(b,4)}while(l);return"data:image/png;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(b){var a=null;try{var c=b.substring(b.indexOf(",")+1),d=
window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(b,c,e){b=d.substring(b+8,b+8+e);"zTXt"==c?(e=b.indexOf(String.fromCharCode(0)),"mxGraphModel"==b.substring(0,e)&&(b=this.editor.graph.bytesToString(pako.inflateRaw(b.substring(e+2))).replace(/\+/g," "),null!=b&&0<b.length&&(a=b))):"tEXt"==c&&(b=b.split(String.fromCharCode(0)),1<b.length&&"mxGraphModel"==b[0]&&(a=b[1]));if(null!=a||"IDAT"==c)return!0}))}catch(n){}null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));
null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));return a};EditorUi.prototype.loadImage=function(b,a,c){var e=new Image;e.onload=function(){a(e)};null!=c&&(e.onerror=c);e.src=b};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function b(b){var c=b.indexOf(",");0<c&&(b=a.getPageById(b.substring(c+1)))&&a.selectPage(b)}"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,c=this.editor.graph,d=c.addClickHandler;c.addClickHandler=function(a,
e,f){var g=e;e=function(a,e){if(null==e){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(e=d.getAttribute("href"))}null!=e&&c.isPageLink(e)&&(b(e),mxEvent.consume(a));null!=g&&g(a,e)};d.call(this,a,e,f)};h.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");
var f=c.getGlobalVariable;c.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:f.apply(this,arguments)};var l=c.createLinkForHint;c.createLinkForHint=function(e,d){var f=c.isPageLink(e);if(f){var g=e.indexOf(",");0<g&&(g=a.getPageById(e.substring(g+1)),d=null!=g?g.getName():mxResources.get("pageNotFound"))}g=l.apply(this,arguments);f&&mxEvent.addListener(g,"click",
function(a){b(e);mxEvent.consume(a)});return g};var m=c.labelLinkClicked;c.labelLinkClicked=function(a,e,d){var f=e.getAttribute("href");c.isPageLink(f)?(b(f),mxEvent.consume(d)):m.apply(this,arguments)};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var v=this.actions.get("print");v.setEnabled(!mxClient.IS_IOS||!navigator.standalone);v.visible=v.isEnabled();if(!this.editor.chromeless){var p=function(){window.setTimeout(function(){q.innerHTML=
e,f){var h=e;e=function(a,e){if(null==e){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(e=d.getAttribute("href"))}null!=e&&c.isPageLink(e)&&(b(e),mxEvent.consume(a));null!=h&&h(a,e)};d.call(this,a,e,f)};h.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");
var f=c.getGlobalVariable;c.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:f.apply(this,arguments)};var l=c.createLinkForHint;c.createLinkForHint=function(e,d){var f=c.isPageLink(e);if(f){var h=e.indexOf(",");0<h&&(h=a.getPageById(e.substring(h+1)),d=null!=h?h.getName():mxResources.get("pageNotFound"))}h=l.apply(this,arguments);f&&mxEvent.addListener(h,"click",
function(a){b(e);mxEvent.consume(a)});return h};var m=c.labelLinkClicked;c.labelLinkClicked=function(a,e,d){var f=e.getAttribute("href");c.isPageLink(f)?(b(f),mxEvent.consume(d)):m.apply(this,arguments)};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var v=this.actions.get("print");v.setEnabled(!mxClient.IS_IOS||!navigator.standalone);v.visible=v.isEnabled();if(!this.editor.chromeless){var p=function(){window.setTimeout(function(){q.innerHTML=
"&nbsp;";q.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",mxUtils.bind(this,function(b){var a=
this.editor.graph;if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,e=!1,d=0;d<c.types.length;d++)if("text/"===c.types[d].substring(0,5)){e=!0;break}if(!e){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(a.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(b,c,e,d,f,g){a.insertImage(b,f,g)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()});else{var h=this.editor.graph.getInsertPoint();
this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(I){}}),!1);var q=document.createElement("div");q.style.position="absolute";q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.display="block";q.contentEditable=!0;mxUtils.setOpacity(q,0);q.style.width="1px";q.style.height="1px";q.innerHTML="&nbsp;";var x=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,
this.editor.graph;if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,e=!1,d=0;d<c.types.length;d++)if("text/"===c.types[d].substring(0,5)){e=!0;break}if(!e){var f=c.items;for(index in f){var h=f[index];if("file"===h.kind){if(a.isEditing())this.importFiles([h.getAsFile()],0,0,this.maxImageSize,function(b,c,e,d,f,h){a.insertImage(b,f,h)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()});else{var k=this.editor.graph.getInsertPoint();
this.importFiles([h.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(J){}}),!1);var q=document.createElement("div");q.style.position="absolute";q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.display="block";q.contentEditable=!0;mxUtils.setOpacity(q,0);q.style.width="1px";q.style.height="1px";q.innerHTML="&nbsp;";var x=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,
"keydown",mxUtils.bind(this,function(b){var a=mxEvent.getSource(b);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==a.nodeName||"TEXTAREA"==a.nodeName||!(224==b.keyCode||!mxClient.IS_MAC&&17==b.keyCode||mxClient.IS_MAC&&91==b.keyCode)||x||(q.style.left=c.container.scrollLeft+10+"px",q.style.top=c.container.scrollTop+10+"px",c.container.appendChild(q),x=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){q.focus();document.execCommand("selectAll",!1,null)},
0):(q.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(b){var a=b.keyCode;window.setTimeout(mxUtils.bind(this,function(){!x||224!=a&&17!=a&&91!=a||(x=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),q.parentNode.removeChild(q))}),0)}));mxEvent.addListener(q,"copy",mxUtils.bind(this,function(b){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(q),p())}));mxEvent.addListener(q,"cut",mxUtils.bind(this,function(b){c.isEnabled()&&
(this.copyCells(q,!0),p())}));mxEvent.addListener(q,"paste",mxUtils.bind(this,function(b){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(q.innerHTML="&nbsp;",q.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(b,q);q.innerHTML="&nbsp;"}),0))}),!0);var w=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==q?!0:w.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(b){var a=this.editor.graph,c=a.cellEditor.text2,e=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(b){null!=e&&(e.parentNode.removeChild(e),e=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==e&&(!mxClient.IS_IE||10<document.documentMode)&&(e=this.highlightElement(c));b.stopPropagation();
b.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=e&&(e.parentNode.removeChild(e),e=null);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,function(b,c,e,d,f,g){a.insertImage(b,f,g)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");
b.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=e&&(e.parentNode.removeChild(e),e=null);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,function(b,c,e,d,f,h){a.insertImage(b,f,h)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");
/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(b){var e=Math.max(1,b.width);b=Math.max(1,b.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,e)),d/Math.max(1,b));a.insertImage(decodeURIComponent(c),e*d,b*d)})):document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(b.dataTransfer.types,
"text/plain")&&document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"));b.stopPropagation();b.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){v=document.createElement("div");v.style.position="absolute";v.style.top="95px";v.style.left="250px";v.style.width="2000px";v.style.height="30px";v.style.background="whiteSmoke";document.body.appendChild(v);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";
z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var C=document.createElement("div");C.style.position="absolute";C.style.top="95px";C.style.left="220px";C.style.width="30px";C.style.height="30px";C.style.background="whiteSmoke";document.body.appendChild(C);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,v,!1)}if("1"==urlParams.test){v=document.getElementById("geFooter");null!=v&&(this.styleInput=document.createElement("input"),
"text/plain")&&document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"));b.stopPropagation();b.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){v=document.createElement("div");v.style.position="absolute";v.style.top="95px";v.style.left="250px";v.style.width="2000px";v.style.height="30px";v.style.background="whiteSmoke";document.body.appendChild(v);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";
A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);var D=document.createElement("div");D.style.position="absolute";D.style.top="95px";D.style.left="220px";D.style.width="30px";D.style.height="30px";D.style.background="whiteSmoke";document.body.appendChild(D);this.vRuler=new mxRuler(this.editor.graph,A,!0);this.hRuler=new mxRuler(this.editor.graph,v,!1)}if("1"==urlParams.test){v=document.getElementById("geFooter");null!=v&&(this.styleInput=document.createElement("input"),
this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),v.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,
mxUtils.bind(this,function(b,a){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var D=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:D.apply(this,arguments)}}v=document.getElementById("geInfo");null!=v&&v.parentNode.removeChild(v);if(Graph.fileSupport){var B=
mxUtils.bind(this,function(b,a){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var y=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:y.apply(this,arguments)}}v=document.getElementById("geInfo");null!=v&&v.parentNode.removeChild(v);if(Graph.fileSupport){var B=
null;mxEvent.addListener(c.container,"dragleave",function(b){c.isEnabled()&&(null!=B&&(B.parentNode.removeChild(B),B=null),b.stopPropagation(),b.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(b){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,function(b){null!=B&&(B.parentNode.removeChild(B),
B=null);if(c.isEnabled()){var a=mxUtils.convertPoint(c.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),e=c.view.translate,d=c.view.scale,f=a.x/d-e.x,g=a.y/d-e.y;mxEvent.isAltDown(b)&&(g=f=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var h=0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):null,a=this.extractGraphModelFromEvent(b,
null!=this.pages);if(null!=a)c.setSelectionCells(this.importXml(a,f,g,!0));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")){var k=b.dataTransfer.getData("text/html"),a=document.createElement("div");a.innerHTML=k;var l=null,e=a.getElementsByTagName("img");null!=e&&1==e.length?(k=e[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(l=!0)):(a=a.getElementsByTagName("a"),null!=a&&1==a.length&&(k=a[0].getAttribute("href")));var m=!mxEvent.isControlDown(b),p=mxUtils.bind(this,
function(){c.setSelectionCells(this.insertTextAt(k,f,g,!0,l,null,m))});l&&m&&k.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;p()}):p()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(b){var a=Math.max(1,b.width);b=Math.max(1,b.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,a)),e/Math.max(1,b));c.setSelectionCell(c.insertVertex(null,null,"",f,g,a*e,b*e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
h+";"))}),mxUtils.bind(this,function(b){c.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),f,g,!0))}}b.stopPropagation();b.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();"undefined"!==typeof window.mxSettings&&this.installSettings()};EditorUi.prototype.installSettings=function(){if(isLocalStorage||mxClient.IS_CHROMEAPP)ColorDialog.recentColors=
B=null);if(c.isEnabled()){var a=mxUtils.convertPoint(c.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),e=c.view.translate,d=c.view.scale,f=a.x/d-e.x,h=a.y/d-e.y;mxEvent.isAltDown(b)&&(h=f=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,f,h,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var k=0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):null,a=this.extractGraphModelFromEvent(b,
null!=this.pages);if(null!=a)c.setSelectionCells(this.importXml(a,f,h,!0));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")){var g=b.dataTransfer.getData("text/html"),a=document.createElement("div");a.innerHTML=g;var l=null,e=a.getElementsByTagName("img");null!=e&&1==e.length?(g=e[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)||(l=!0)):(a=a.getElementsByTagName("a"),null!=a&&1==a.length&&(g=a[0].getAttribute("href")));var m=!0,p=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(g,
f,h,!0,l,null,m))});l&&g.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;p()},mxEvent.isControlDown(b)):p()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(b){var a=Math.max(1,b.width);b=Math.max(1,b.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,a)),e/Math.max(1,b));c.setSelectionCell(c.insertVertex(null,null,"",f,h,a*e,b*e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
k+";"))}),mxUtils.bind(this,function(b){c.setSelectionCells(this.insertTextAt(k,f,h,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),f,h,!0))}}b.stopPropagation();b.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();"undefined"!==typeof window.mxSettings&&this.installSettings()};EditorUi.prototype.installSettings=function(){if(isLocalStorage||mxClient.IS_CHROMEAPP)ColorDialog.recentColors=
mxSettings.getRecentColors(),this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle(),this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle(),this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[])),this.addListener("styleChanged",mxUtils.bind(this,function(b,a){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()})),this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()),
this.fireEvent(new mxEventObject("copyConnectChanged")),this.addListener("copyConnectChanged",mxUtils.bind(this,function(b,a){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()})),this.editor.graph.pageFormat=mxSettings.getPageFormat(),this.addListener("pageFormatChanged",mxUtils.bind(this,function(b,a){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()})),this.editor.graph.view.gridColor=mxSettings.getGridColor(),this.addListener("gridColorChanged",
mxUtils.bind(this,function(b,a){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()})),mxClient.IS_CHROMEAPP&&(this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(b,a){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave()),null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search),!this.editor.chromeless&&null!=this.sidebar&&(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||
@ -7890,39 +7890,39 @@ c(mxMarker.getPackageForType(d[mxConstants.STYLE_ENDARROW])));for(var d=e.model.
function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(b,a,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=b&&0<b.length?(this.setFileData(b),this.showLayersDialog()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(b,a){null!=b?b.getPublicUrl(a):a(null)};EditorUi.prototype.createLoadMessage=function(b){var a=
this.editor.graph;return{event:b,pageVisible:a.pageVisible,translate:a.view.translate,scale:a.view.scale,page:a.view.getBackgroundPageBounds(),bounds:a.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(b){var a=null,c=!1,d=!1,f=null,h=mxUtils.bind(this,function(b,a){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){function h(b){if(null!=b&&"function"===typeof b.charAt&&"<"!=b.charAt(0))try{"data:image/svg+xml;base64,"==b.substring(0,26)?b=atob(b.substring(26)):"data:image/svg+xml;utf8,"==b.substring(0,24)&&(b=b.substring(24)),null!=b&&("%"==b.charAt(0)?b=decodeURIComponent(b):"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)))}catch(G){}return b}var g=e.data;if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(H){g=null}if(null==g)return;
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){function h(b){if(null!=b&&"function"===typeof b.charAt&&"<"!=b.charAt(0))try{"data:image/svg+xml;base64,"==b.substring(0,26)?b=atob(b.substring(26)):"data:image/svg+xml;utf8,"==b.substring(0,24)&&(b=b.substring(24)),null!=b&&("%"==b.charAt(0)?b=decodeURIComponent(b):"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)))}catch(G){}return b}var g=e.data;if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(L){g=null}if(null==g)return;
if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();var k=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(b){null!=b&&l.postMessage(JSON.stringify({event:"prompt",value:b,message:g}),"*")},null!=g.titleKey?
mxResources.get(g.titleKey):g.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==g.action){k=null;k="data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):h(g.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();l.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,function(){this.hideDialog();l.postMessage(JSON.stringify({event:"draft",
result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));try{k.init()}catch(H){l.postMessage(JSON.stringify({event:"draft",error:H.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();k=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(a,c){a=a||this.emptyDiagramXml;null!=g.callback?
result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));try{k.init()}catch(L){l.postMessage(JSON.stringify({event:"draft",error:L.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();k=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(a,c){a=a||this.emptyDiagramXml;null!=g.callback?
l.postMessage(JSON.stringify({event:"template",xml:a,blank:a==this.emptyDiagramXml,name:c}),"*"):(b(a,e,a!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));k.init();return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=
g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var m=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var t=this.editor.graph,
u=mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();var a=this.createLoadMessage("export");a.format=g.format;a.xml=encodeURIComponent(n);a.data=b;l.postMessage(JSON.stringify(a),"*")}),v=mxUtils.bind(this,function(b){null==b&&(b=Editor.blankImage);"xmlpng"==g.format&&(b=this.writeGraphModelToPng(b,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);u(b)});if(this.isExportToCanvas()){if(null!=
this.pages&&this.currentPage!=this.pages[0]){var t=this.createTemporaryGraph(t.getStylesheet()),A=t.getGlobalVariable,y=this.pages[0];t.getGlobalVariable=function(b){return"page"==b?y.getName():"pagenumber"==b?1:A.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,function(b){v(b.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
this.pages&&this.currentPage!=this.pages[0]){var t=this.createTemporaryGraph(t.getStylesheet()),C=t.getGlobalVariable,z=this.pages[0];t.getGlobalVariable=function(b){return"page"==b?z.getName():"pagenumber"==b?1:C.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(b){v(b.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?u("data:image/png;base64,"+b.getText()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);m=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),m.xml=mxUtils.getXml(k),m.data=
this.getFileData(null,null,!0,null,null,null,k),m.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);m.xml=this.getFileData(!0);m.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),
"xmlsvg"==g.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(b);l.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(b));l.postMessage(JSON.stringify(m),"*")}));return}k="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));m.data=this.createSvgDataUri(k)}l.postMessage(JSON.stringify(m),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
"12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),this.buttonContainer.appendChild(k)),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{l.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{b(g,e)}catch(H){this.handleError(H)}c=!1;null!=
"12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),this.buttonContainer.appendChild(k)),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):null!=g.xml&&"data:image/png;base64,"==g.xml.substring(0,22)?this.extractGraphModelFromPng(g.xml):g.xml;else{l.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}g=h(g);c=!0;try{b(g,e)}catch(L){this.handleError(L)}c=!1;null!=
urlParams.modified&&this.editor.setStatus("");var F=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=F();d&&null==a&&(a=mxUtils.bind(this,function(b,a){var e=F();if(e!=f&&!c){var d=this.createLoadMessage("autosave");d.xml=e;e=JSON.stringify(d);(window.opener||window.parent).postMessage(e,"*")}f=e}),this.editor.graph.model.addListener(mxEvent.CHANGE,a),this.editor.graph.addListener("gridSizeChanged",
a),this.editor.graph.addListener("shadowVisibleChanged",a),this.addListener("pageFormatChanged",a),this.addListener("pageScaleChanged",a),this.addListener("backgroundColorChanged",a),this.addListener("backgroundImageChanged",a),this.addListener("foldingEnabledChanged",a),this.addListener("mathEnabledChanged",a),this.addListener("gridEnabledChanged",a),this.addListener("guidesEnabledChanged",a),this.addListener("pageViewChanged",a));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||l.postMessage(JSON.stringify(this.createLoadMessage("load")),
"*")}));var l=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";l.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var b=document.createElement("div");b.style.display="inline-block";b.style.position="absolute";b.style.paddingTop="atlas"==uiTheme?"2px":"3px";b.style.paddingLeft="8px";b.style.paddingBottom="2px";var a=document.createElement("button");mxUtils.write(a,mxResources.get("save"));a.setAttribute("title",
mxResources.get("save")+" (Ctrl+S)");a.className="geBigButton";a.style.fontSize="12px";a.style.padding="4px 6px 4px 6px";a.style.borderRadius="3px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));b.appendChild(a);"1"==urlParams.saveAndExit&&(a=document.createElement("a"),mxUtils.write(a,mxResources.get("saveAndExit")),a.setAttribute("title",mxResources.get("saveAndExit")),a.style.fontSize="12px",a.style.marginLeft="6px",a.style.padding="4px",a.style.cursor=
"pointer",mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),b.appendChild(a));a=document.createElement("a");mxUtils.write(a,mxResources.get("exit"));a.setAttribute("title",mxResources.get("exit"));a.style.fontSize="12px";a.style.marginLeft="6px";a.style.marginRight="20px";a.style.padding="4px";a.style.cursor="pointer";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));b.appendChild(a);this.toolbar.container.appendChild(b);
this.toolbar.staticElements.push(b);b.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(b){this.importCsv(b)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(b){try{var a=
b.split("\n"),c=[];if(0<a.length){var d={},f=null,h=null,l="auto",m="auto",p=40,q=40,x=0,w=this.editor.graph;w.getGraphBounds();for(var z=function(){w.setSelectionCells(O);w.scrollCellToVisible(w.getSelectionCell())},C=w.getFreeInsertPoint(),D=C.x,B=C.y,C=B,A=null,y="auto",F=[],H=null,G=null,E=0;E<a.length&&"#"==a[E].charAt(0);){b=a[E];for(E++;E<a.length&&"\\"==b.charAt(b.length-1)&&"#"==a[E].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(a[E].substring(1)),E++;if("#"!=b.charAt(1)){var M=b.indexOf(":");
if(0<M){var K=mxUtils.trim(b.substring(1,M)),I=mxUtils.trim(b.substring(M+1));"label"==K?A=w.sanitizeHtml(I):"style"==K?f=I:"identity"==K&&0<I.length&&"-"!=I?h=I:"width"==K?l=I:"height"==K?m=I:"ignore"==K?G=I.split(","):"connect"==K?F.push(JSON.parse(I)):"link"==K?H=I:"padding"==K?x=parseFloat(I):"edgespacing"==K?p=parseFloat(I):"nodespacing"==K?q=parseFloat(I):"layout"==K&&(y=I)}}}var T=this.editor.csvToArray(a[E]);b=null;if(null!=h)for(var L=0;L<T.length;L++)if(h==T[L]){b=L;break}null==A&&(A="%"+
T[0]+"%");if(null!=F)for(var N=0;N<F.length;N++)null==d[F[N].to]&&(d[F[N].to]={});w.model.beginUpdate();try{for(L=E+1;L<a.length;L++){var Q=this.editor.csvToArray(a[L]);if(Q.length==T.length){var J=null,W=null!=b?Q[b]:null;null!=W&&(J=w.model.getCell(W));null==J&&(J=new mxCell(A,new mxGeometry(D,C,0,0),f||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=W);for(var P=0;P<Q.length;P++)w.setAttributeForCell(J,T[P],Q[P]);w.setAttributeForCell(J,"placeholders","1");J.style=w.replacePlaceholders(J,J.style);
for(N=0;N<F.length;N++)d[F[N].to][J.getAttribute(F[N].to)]=J;null!=H&&"link"!=H&&(w.setLinkForCell(J,J.getAttribute(H)),w.setAttributeForCell(J,H,null));var Y=this.editor.graph.getPreferredSizeForCell(J);J.geometry.width="auto"==l?Y.width+x:parseFloat(l);J.geometry.height="auto"==m?Y.height+x:parseFloat(m);C+=J.geometry.height+q;c.push(w.addCell(J))}}null==f&&w.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var U=c.slice(),O=c.slice(),N=0;N<F.length;N++)for(var R=F[N],L=0;L<c.length;L++){var J=
c[L],V=J.getAttribute(R.from);if(null!=V){w.setAttributeForCell(J,R.from,null);for(var S=V.split(","),P=0;P<S.length;P++){var X=d[R.to][S[P]];null!=X&&(O.push(w.insertEdge(null,null,R.label||"",R.invert?X:J,R.invert?J:X,R.style||w.createCurrentEdgeStyle())),mxUtils.remove(R.invert?J:X,U))}}}if(null!=G)for(L=0;L<c.length;L++)for(J=c[L],P=0;P<G.length;P++)w.setAttributeForCell(J,mxUtils.trim(G[P]),null);var aa=new mxParallelEdgeLayout(w);aa.spacing=p;var ea=function(){aa.execute(w.getDefaultParent());
for(var b=0;b<c.length;b++){var a=w.getCellGeometry(c[b]);a.x=Math.round(w.snap(a.x));a.y=Math.round(w.snap(a.y));"auto"==l&&(a.width=Math.round(w.snap(a.width)));"auto"==m&&(a.height=Math.round(w.snap(a.height)))}};if("circle"==y){var ba=new mxCircleLayout(w);ba.resetEdges=!1;var fa=ba.isVertexIgnored;ba.isVertexIgnored=function(b){return fa.apply(this,arguments)||0>mxUtils.indexOf(c,b)};this.executeLayout(function(){ba.execute(w.getDefaultParent());ea()},!0,z);z=null}else if("horizontaltree"==y||
"verticaltree"==y||"auto"==y&&O.length==2*c.length-1&&1==U.length){w.view.validate();var ca=new mxCompactTreeLayout(w,"horizontaltree"==y);ca.levelDistance=q;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(w.getDefaultParent(),0<U.length?U[0]:null)},!0,z);z=null}else if("horizontalflow"==y||"verticalflow"==y||"auto"==y&&1==U.length){w.view.validate();var da=new mxHierarchicalLayout(w,"horizontalflow"==y?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);da.intraCellSpacing=
q;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(w.getDefaultParent(),O);w.moveCells(O,D,B)},!0,z);z=null}else if("organic"==y||"auto"==y&&O.length>c.length){w.view.validate();var Z=new mxFastOrganicLayout(w);Z.forceConstant=3*q;Z.resetEdges=!1;var ga=Z.isVertexIgnored;Z.isVertexIgnored=function(b){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,b)};aa=new mxParallelEdgeLayout(w);aa.spacing=p;this.executeLayout(function(){Z.execute(w.getDefaultParent());ea()},!0,z);z=null}this.hideDialog()}finally{w.model.endUpdate()}null!=
z&&z()}}catch(ha){this.handleError(ha)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
b.split("\n"),c=[];if(0<a.length){var d={},f=null,h=null,l="auto",m="auto",p=40,q=40,x=0,w=this.editor.graph;w.getGraphBounds();for(var A=function(){w.setSelectionCells(O);w.scrollCellToVisible(w.getSelectionCell())},D=w.getFreeInsertPoint(),y=D.x,B=D.y,D=B,C=null,z="auto",F=[],L=null,G=null,E=0;E<a.length&&"#"==a[E].charAt(0);){b=a[E];for(E++;E<a.length&&"\\"==b.charAt(b.length-1)&&"#"==a[E].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(a[E].substring(1)),E++;if("#"!=b.charAt(1)){var M=b.indexOf(":");
if(0<M){var H=mxUtils.trim(b.substring(1,M)),J=mxUtils.trim(b.substring(M+1));"label"==H?C=w.sanitizeHtml(J):"style"==H?f=J:"identity"==H&&0<J.length&&"-"!=J?h=J:"width"==H?l=J:"height"==H?m=J:"ignore"==H?G=J.split(","):"connect"==H?F.push(JSON.parse(J)):"link"==H?L=J:"padding"==H?x=parseFloat(J):"edgespacing"==H?p=parseFloat(J):"nodespacing"==H?q=parseFloat(J):"layout"==H&&(z=J)}}}var T=this.editor.csvToArray(a[E]);b=null;if(null!=h)for(var K=0;K<T.length;K++)if(h==T[K]){b=K;break}null==C&&(C="%"+
T[0]+"%");if(null!=F)for(var N=0;N<F.length;N++)null==d[F[N].to]&&(d[F[N].to]={});w.model.beginUpdate();try{for(K=E+1;K<a.length;K++){var Q=this.editor.csvToArray(a[K]);if(Q.length==T.length){var I=null,W=null!=b?Q[b]:null;null!=W&&(I=w.model.getCell(W));null==I&&(I=new mxCell(C,new mxGeometry(y,D,0,0),f||"whiteSpace=wrap;html=1;"),I.vertex=!0,I.id=W);for(var P=0;P<Q.length;P++)w.setAttributeForCell(I,T[P],Q[P]);w.setAttributeForCell(I,"placeholders","1");I.style=w.replacePlaceholders(I,I.style);
for(N=0;N<F.length;N++)d[F[N].to][I.getAttribute(F[N].to)]=I;null!=L&&"link"!=L&&(w.setLinkForCell(I,I.getAttribute(L)),w.setAttributeForCell(I,L,null));var Y=this.editor.graph.getPreferredSizeForCell(I);I.geometry.width="auto"==l?Y.width+x:parseFloat(l);I.geometry.height="auto"==m?Y.height+x:parseFloat(m);D+=I.geometry.height+q;c.push(w.addCell(I))}}null==f&&w.fireEvent(new mxEventObject("cellsInserted","cells",c));for(var U=c.slice(),O=c.slice(),N=0;N<F.length;N++)for(var R=F[N],K=0;K<c.length;K++){var I=
c[K],V=I.getAttribute(R.from);if(null!=V){w.setAttributeForCell(I,R.from,null);for(var S=V.split(","),P=0;P<S.length;P++){var X=d[R.to][S[P]];null!=X&&(O.push(w.insertEdge(null,null,R.label||"",R.invert?X:I,R.invert?I:X,R.style||w.createCurrentEdgeStyle())),mxUtils.remove(R.invert?I:X,U))}}}if(null!=G)for(K=0;K<c.length;K++)for(I=c[K],P=0;P<G.length;P++)w.setAttributeForCell(I,mxUtils.trim(G[P]),null);var ba=new mxParallelEdgeLayout(w);ba.spacing=p;var ea=function(){ba.execute(w.getDefaultParent());
for(var b=0;b<c.length;b++){var a=w.getCellGeometry(c[b]);a.x=Math.round(w.snap(a.x));a.y=Math.round(w.snap(a.y));"auto"==l&&(a.width=Math.round(w.snap(a.width)));"auto"==m&&(a.height=Math.round(w.snap(a.height)))}};if("circle"==z){var ca=new mxCircleLayout(w);ca.resetEdges=!1;var fa=ca.isVertexIgnored;ca.isVertexIgnored=function(b){return fa.apply(this,arguments)||0>mxUtils.indexOf(c,b)};this.executeLayout(function(){ca.execute(w.getDefaultParent());ea()},!0,A);A=null}else if("horizontaltree"==z||
"verticaltree"==z||"auto"==z&&O.length==2*c.length-1&&1==U.length){w.view.validate();var Z=new mxCompactTreeLayout(w,"horizontaltree"==z);Z.levelDistance=q;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(w.getDefaultParent(),0<U.length?U[0]:null)},!0,A);A=null}else if("horizontalflow"==z||"verticalflow"==z||"auto"==z&&1==U.length){w.view.validate();var da=new mxHierarchicalLayout(w,"horizontalflow"==z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);da.intraCellSpacing=
q;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(w.getDefaultParent(),O);w.moveCells(O,y,B)},!0,A);A=null}else if("organic"==z||"auto"==z&&O.length>c.length){w.view.validate();var aa=new mxFastOrganicLayout(w);aa.forceConstant=3*q;aa.resetEdges=!1;var ga=aa.isVertexIgnored;aa.isVertexIgnored=function(b){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,b)};ba=new mxParallelEdgeLayout(w);ba.spacing=p;this.executeLayout(function(){aa.execute(w.getDefaultParent());ea()},!0,A);A=null}this.hideDialog()}finally{w.model.endUpdate()}null!=
A&&A()}}catch(ha){this.handleError(ha)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(b=0==a?b+"?":b+"&",null!=urlParams[d]&&(b+=d+"="+urlParams[d],a++))}return b};EditorUi.prototype.showLinkDialog=function(b,a,c){b=new LinkDialog(this,b,a,c,!0);this.showDialog(b.container,420,120,!0,!0);b.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(b){var a=l.apply(this,arguments),c=this.editor.graph,d=a.getSourceGraphBounds;a.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*b.x/a),Math.ceil(this.source.minimumGraphSize.height-2*b.y/a))}return d.apply(this,arguments)};var f=a.getSourceContainerSize;a.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
a-2*b.x),Math.ceil(this.source.minimumGraphSize.height*a-2*b.y))}return f.apply(this,arguments)};a.getOutlineOffset=function(b){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var e=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(a.outline.container.clientWidth/b-(this.source.minimumGraphSize.width-2*e.x))/2)-e.x),Math.round(Math.max(0,(a.outline.container.clientHeight/b-(this.source.minimumGraphSize.height-2*e.y))/2)-e.y-5/b))}return new mxPoint(8/
b,8/b)};var h=a.init;a.init=function(){h.apply(this,arguments);a.outline.view.getBackgroundPageBounds=function(){var b=c.getPageLayout(),a=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+b.x*a.width),this.scale*(this.translate.y+b.y*a.height),this.scale*b.width*a.width,this.scale*b.height*a.height)};a.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(b,c){var e=c.getProperty("change"),d=a.source,f=a.outline;f.pageScale=d.pageScale;f.pageFormat=
d.pageFormat;f.background=d.background;f.pageVisible=d.pageVisible;f.background=d.background;var g=mxUtils.getCurrentStyle(d.container);f.container.style.backgroundColor=g.backgroundColor;null!=d.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=d.view.backgroundPageShape.fill);a.outline.view.clear(e.previousPage.root,!0);a.outline.view.validate()});return a};EditorUi.prototype.getServiceCount=function(b){var a=0;null==this.drive&&"function"!==typeof window.DriveClient||
d.pageFormat;f.background=d.background;f.pageVisible=d.pageVisible;f.background=d.background;var h=mxUtils.getCurrentStyle(d.container);f.container.style.backgroundColor=h.backgroundColor;null!=d.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=d.view.backgroundPageShape.fill);a.outline.view.clear(e.previousPage.root,!0);a.outline.view.validate()});return a};EditorUi.prototype.getServiceCount=function(b){var a=0;null==this.drive&&"function"!==typeof window.DriveClient||
a++;null==this.dropbox&&"function"!==typeof window.DropboxClient||a++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||a++;null!=this.gitHub&&a++;b&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&a++;mxClient.IS_IOS||a++;return a};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var b=this.getCurrentFile(),a=null!=b||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(a);this.menus.get("viewZoom").setEnabled(a);
var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==b||b.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").setEnabled(c);b="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=
b&&b.isEditable();this.actions.get("image").setEnabled(a);this.actions.get("zoomIn").setEnabled(a);this.actions.get("zoomOut").setEnabled(a);this.actions.get("resetView").setEnabled(a);this.menus.get("edit").setEnabled(a);this.menus.get("view").setEnabled(a);this.menus.get("importFrom").setEnabled(b);this.menus.get("arrange").setEnabled(b);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(b),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(b));
@ -7933,8 +7933,8 @@ break;case d.DOWNLOADING:a='<img title="Downloading new version..." border="0" s
arguments);var b=this.editor.graph,a=this.getCurrentFile(),c=null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=a&&a.isEditable()&&a.isAutosaveOptional());this.actions.get("guides").setEnabled(c);this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&
!b.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!b.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(b.getModel().isVertex(b.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!=a);this.actions.get("makeCopy").setEnabled(null!=a&&!a.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&
!a.isRestricted());this.actions.get("publishLink").setEnabled(null!=a&&!a.isRestricted());this.actions.get("tags").setEnabled(null!=a&&a.isEditable());this.menus.get("publish").setEnabled(null!=a&&!a.isRestricted());b=b.view.getState(b.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=b&&null!=b.shape&&null!=b.shape.stencil)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,a,c,d,f,h){var e=b.editor.graph;
if("xml"==c)b.hideDialog(),b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,h)),"image/svg+xml");else{var g=b.getFileData(!0,null,null,null,null,!0),l=e.getGraphBounds(),k=Math.floor(l.width*f/e.view.scale),m=Math.floor(l.height*f/e.view.scale);g.length<=MAX_REQUEST_SIZE&&k*m<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+
(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+k+"&h="+m+"&border="+h+"&xml="+encodeURIComponent(g))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:15,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
if("xml"==c)b.hideDialog(),b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,h)),"image/svg+xml");else{var g=b.getFileData(!0,null,null,null,null,!0),k=e.getGraphBounds(),l=Math.floor(k.width*f/e.view.scale),m=Math.floor(k.height*f/e.view.scale);g.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+
(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+h+"&xml="+encodeURIComponent(g))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:15,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,
a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=a},getRecentColors:function(){return mxSettings.settings.recentColors},
setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},setCurrentVertexStyle:function(a){mxSettings.settings.currentVertexStyle=
@ -7992,7 +7992,7 @@ m+'" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'
App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);var a=this.getCurrentFile();this.actions.get("revisionHistory").setEnabled(null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile))};App.prototype.updateDraft=function(){isLocalStorage&&null!=localStorage&&localStorage.setItem(".draft",JSON.stringify({modified:(new Date).getTime(),data:this.getFileData()}))};App.prototype.getDraft=function(){return null};
App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var f=this.getRecent();if(null==f)f=[];else for(var d=0;d<f.length;d++)f[d].id==a.id&&f.splice(d,1);null!=f&&(f.unshift(a),f=f.slice(0,5),localStorage.setItem(".recent",JSON.stringify(f)))}};App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(f){}return null}};
App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(f){}};App.prototype.removeDraft=function(){if(isLocalStorage&&null!=localStorage&&"0"==urlParams.splash)try{localStorage.removeItem(".draft")}catch(a){}};
App.prototype.onBeforeUnload=function(){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.chromeless){if(a.constructor!=DriveFile&&a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
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.chromeless){if(a.constructor!=DriveFile&&a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.lightbox){var a=this.editor.appName,f=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=f&&(a=(null!=f.getTitle()?f.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],f,d=0;256>d;d++){f=d;for(var c=0;8>c;c++)f=f&1?3988292384^f>>>1:f>>>1;a[d]=f}return a};
App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var f=-1,d=0;d<a.length;d++)f=f>>>8^this.crcTable[(f^a.charCodeAt(d))&255];return(f^-1)>>>0};
App.prototype.getThumbnail=function(a,f){var d=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var c=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),h=c.getGlobalVariable,l=this.pages[0];c.getGlobalVariable=function(b){return"page"==b?l.getName():"pagenumber"==b?1:h.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(l.root)}if(mxClient.IS_CHROMEAPP||!c.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
@ -8032,14 +8032,14 @@ App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGL
function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(b){this.handleError(b,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){window.openNew=!1;window.openKey="open";var d=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));
window.openFile.setConsumer(mxUtils.bind(this,function(c,d){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,c,d):new LocalLibrary(this,c,d))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=d;window.openFile=null})}else{var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",
mxUtils.bind(this,function(){if(null!=c.files)for(var a=0;a<c.files.length;a++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}});c.readAsText(a)})(c.files[a])}));c.click()}};
App.prototype.saveLibrary=function(a,f,d,c,h,l,m){c=null!=c?c:this.mode;h=null!=h?h:!1;l=null!=l?l:!1;var b=this.createLibraryDataFromImages(f),e=mxUtils.bind(this,function(b){this.spinner.stop();null!=m&&m();this.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)});null==d&&c==App.MODE_DEVICE&&(d=new LocalLibrary(this,b,a));if(null==d)this.pickFolder(c,mxUtils.bind(this,function(d){c==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
b,d,mxUtils.bind(this,function(b){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(b,f)}),e,this.drive.libraryMimeType):c==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,b,mxUtils.bind(this,function(b){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(b,f)}),e,d):c==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,b,mxUtils.bind(this,
function(b){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(b,f)}),e,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,b,mxUtils.bind(this,function(b){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(b,f)}),e,d):c==App.MODE_BROWSER?(d=mxUtils.bind(this,function(){var c=new StorageLibrary(this,b,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(c,f)}),e)}),
null==localStorage.getItem(a)?d():this.confirm(mxResources.get("replaceIt",[a]),d)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(h||this.spinner.spin(document.body,mxResources.get("saving"))){d.setData(b);var g=mxUtils.bind(this,function(){d.save(!0,mxUtils.bind(this,function(b){this.spinner.stop();this.hideDialog(!0);l||this.libraryLoaded(d,f);null!=m&&m()}),e)});if(a!=d.getTitle()){var k=d.getHash();d.rename(a,mxUtils.bind(this,function(b){d.constructor!=
App.prototype.saveLibrary=function(a,f,d,c,h,l,m){c=null!=c?c:this.mode;h=null!=h?h:!1;l=null!=l?l:!1;var b=this.createLibraryDataFromImages(f),e=mxUtils.bind(this,function(a){this.spinner.stop();null!=m&&m();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==d&&c==App.MODE_DEVICE&&(d=new LocalLibrary(this,b,a));if(null==d)this.pickFolder(c,mxUtils.bind(this,function(d){c==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
b,d,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,f)}),e,this.drive.libraryMimeType):c==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,f)}),e,d):c==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,b,mxUtils.bind(this,
function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,f)}),e,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,f)}),e,d):c==App.MODE_BROWSER?(d=mxUtils.bind(this,function(){var c=new StorageLibrary(this,b,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(c,f)}),e)}),
null==localStorage.getItem(a)?d():this.confirm(mxResources.get("replaceIt",[a]),d)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(h||this.spinner.spin(document.body,mxResources.get("saving"))){d.setData(b);var g=mxUtils.bind(this,function(){d.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);l||this.libraryLoaded(d,f);null!=m&&m()}),e)});if(a!=d.getTitle()){var k=d.getHash();d.rename(a,mxUtils.bind(this,function(a){d.constructor!=
LocalLibrary&&k!=d.getHash()&&(mxSettings.removeCustomLibrary(k),mxSettings.addCustomLibrary(d.getHash()));this.removeLibrarySidebar(k);g()}),e)}else g()}};
App.prototype.saveFile=function(a){var f=this.getCurrentFile();if(null!=f){var d=mxUtils.bind(this,function(){this.removeDraft();f.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==f.getTitle()||null==this.mode){var c=null!=f.getTitle()?f.getTitle():this.defaultFilename,h=!mxClient.IS_IOS||!navigator.standalone,l=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var m=4>=a?2:3,c=new CreateDialog(this,
c,mxUtils.bind(this,function(b,a){null!=b&&0<b.length&&(null==l&&a==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(b,d)):"download"==a?(new LocalFile(this,null,b)).save():"_blank"==a?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),window.open(this.getUrl(window.location.pathname))):l!=a?this.pickFolder(a,mxUtils.bind(this,function(c){this.createFile(b,this.getFileData(/(\.xml)$/i.test(b)||0>b.indexOf("."),/(\.svg)$/i.test(b),
/(\.html)$/i.test(b)),null,a,d,null==this.mode,c)}),a!==App.MODE_GITHUB):null!=a&&this.save(b,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,h,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,m);this.showDialog(c.container,460,a>m?390:270,!0,!0);c.init()}else this.save(f.getTitle(),d)}};
c,mxUtils.bind(this,function(a,c){null!=a&&0<a.length&&(null==l&&c==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==c?(new LocalFile(this,null,a)).save():"_blank"==c?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),window.open(this.getUrl(window.location.pathname))):l!=c?this.pickFolder(c,mxUtils.bind(this,function(b){this.createFile(a,this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf("."),/(\.svg)$/i.test(a),
/(\.html)$/i.test(a)),null,c,d,null==this.mode,b)}),c!==App.MODE_GITHUB):null!=c&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,h,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,m);this.showDialog(c.container,460,a>m?390:270,!0,!0);c.init()}else this.save(f.getTitle(),d)}};
EditorUi.prototype.loadTemplate=function(a,f,d){var c=a;this.isCorsEnabledForUrl(c)||(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(c){!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&f(a.responseText)}),a):(/(\.png)($|\?)/i.test(a)&&(c=this.extractGraphModelFromPng(c)),
f(c))}),d,/(\.png)($|\?)/i.test(a))};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:null};
App.prototype.createFile=function(a,f,d,c,h,l,m,b){c=b?null:null!=c?c:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){f=null!=f?f:this.emptyDiagramXml;var e=mxUtils.bind(this,function(){this.spinner.stop()}),g=mxUtils.bind(this,function(a){e();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});c==App.MODE_GOOGLE&&null!=this.drive?(m=null!=this.stateArg?this.stateArg.folderId:m,this.drive.insertFile(a,f,m,mxUtils.bind(this,
@ -8114,7 +8114,7 @@ var f=document.createElement("img");f.setAttribute("border","0");f.setAttribute(
"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode);a.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.addAction("exportPdf",function(){a.showDialog((new PrintDialog(a,
mxResources.get("formatPdf"))).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)});a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){a.fileLoaded(null)});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();if(1==d.getSelectionCount()){var b=d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,
640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();if(null==b||b.constructor!=DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile||null==a.dropbox&&b.constructor==DropboxFile)a.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"));else if(a.spinner.spin(document.body,mxResources.get("loading")))if(b.constructor==DropboxFile){var c=a.dropbox.client.filesListRevisions({path:b.stat.path_lower,
limit:100});c.then(mxUtils.bind(this,function(c){a.spinner.stop();try{for(var d=[],e=c.entries.length-1;0<=e;e--)(function(c){d.push({modifiedDate:c.client_modified,fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(D){a.handleError(D)}}));
limit:100});c.then(mxUtils.bind(this,function(c){a.spinner.stop();try{for(var d=[],e=c.entries.length-1;0<=e;e--)(function(c){d.push({modifiedDate:c.client_modified,fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(y){a.handleError(y)}}));
c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-1]===d?b.desc.headRevisionId:d.id}),function(b){a.drive.getXmlFile(b,null,function(a){e(a.getData())},function(a){f(a)})},function(a){f(a)})};d.getUrl=function(){return a.getUrl(window.location.pathname+
"?rev="+d.id+"&chrome=0&edit=_blank")+window.location.hash}})(c.items[d]);d=new RevisionDialog(a,c.items);a.showDialog(d.container,640,480,!0,!0);d.init()},function(b){a.spinner.stop();a.handleError(b)})});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,"Ctrl+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,window.open(window.location.protocol+
"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))});if("undefined"!==typeof MathJax){var g=a.actions.addAction("mathematicalTypesetting",function(){a.setMathEnabled(!a.isMathEnabled())});g.setToggleAction(!0);g.setSelectedCallback(function(){return a.isMathEnabled()});g.isEnabled=l}isLocalStorage&&(g=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),
@ -8131,7 +8131,7 @@ function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVi
!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var t=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=t.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width=
"16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"]);else{var e=b.addItem("Search",null,null,c,null,null,!1),f=document.createElement("div");
f.style.display="inline";f.innerHTML=':<form style="display:inline;margin-left:8px;"target="_blank" method="get" action="https://desk.draw.io/support/search/solutions"><input type="text" name="term" size="25"></form>';e.firstChild.nextSibling.appendChild(f);e.style.backgroundColor="whiteSmoke";e.style.cursor="default";var g=f.getElementsByTagName("form")[0],h=f.getElementsByTagName("input")[0];null!=h&&null!=g&&(mxEvent.addListener(g,"submit",function(){if(EditorUi.enableLogging)try{(new Image).src=
(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity=CONFIG&msg=helpsearch:"+encodeURIComponent(h.value)+"&v="+encodeURIComponent(EditorUi.VERSION)}catch(D){}window.setTimeout(function(){a.menubar.hideMenu()},0)}),mxEvent.addGestureListeners(e,function(a){document.activeElement!=h&&h.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)}),window.setTimeout(function(){h.focus()},0));this.addMenuItems(b,["-","quickStart","userManual","keyboardShortcuts",
(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity=CONFIG&msg=helpsearch:"+encodeURIComponent(h.value)+"&v="+encodeURIComponent(EditorUi.VERSION)}catch(y){}window.setTimeout(function(){a.menubar.hideMenu()},0)}),mxEvent.addGestureListeners(e,function(a){document.activeElement!=h&&h.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)}),window.setTimeout(function(){h.focus()},0));this.addMenuItems(b,["-","quickStart","userManual","keyboardShortcuts",
"-"]);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"]);this.addMenuItems(b,["support","-","about"])}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",
mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),
this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=d.getGraphBounds(),b=d.view.translate,e=d.view.scale;d.insertVertex(c,null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),this.addMenuItems(b,["-","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",
@ -8189,7 +8189,7 @@ d):b&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)
null,null,null,App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)}));this.put("openLibraryFrom",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},
d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):b&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):e&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+
"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,
mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(D){a.handleError(D,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));
mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(y){a.handleError(y,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));
a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,
["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),
c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}this.addMenuItems(b,["autosave","-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&isLocalStorage&&this.addMenuItems(b,

View file

@ -1354,24 +1354,31 @@ App.prototype.removeDraft = function()
*/
App.prototype.onBeforeUnload = function()
{
var file = this.getCurrentFile();
if (file != null)
if (urlParams['embed'] == '1' && this.editor.modified)
{
// KNOWN: Message is ignored by most browsers
if (file.constructor == LocalFile && file.getHash() == '' && !file.isModified() &&
urlParams['nowarn'] != '1' && !this.isDiagramEmpty() && urlParams['url'] == null &&
!this.editor.chromeless)
return mxResources.get('allChangesLost');
}
else
{
var file = this.getCurrentFile();
if (file != null)
{
return mxResources.get('ensureDataSaved');
}
else if (file.constructor != DriveFile && file.isModified())
{
return mxResources.get('allChangesLost');
}
else
{
file.close(true);
// KNOWN: Message is ignored by most browsers
if (file.constructor == LocalFile && file.getHash() == '' && !file.isModified() &&
urlParams['nowarn'] != '1' && !this.isDiagramEmpty() && urlParams['url'] == null &&
!this.editor.chromeless)
{
return mxResources.get('ensureDataSaved');
}
else if (file.constructor != DriveFile && file.isModified())
{
return mxResources.get('allChangesLost');
}
else
{
file.close(true);
}
}
}
};

View file

@ -5373,15 +5373,15 @@
/**
*
*/
EditorUi.prototype.importFiles = function(files, x, y, maxSize, fn, resultFn, filterFn, barrierFn, resizeImages, maxBytes, resampleThreshold, ignoreEmbeddedXml)
EditorUi.prototype.importFiles = function(files, x, y, maxSize, fn, resultFn, filterFn, barrierFn, resizeDialog, maxBytes, resampleThreshold, ignoreEmbeddedXml)
{
var crop = x != null && y != null;
x = (x != null) ? x : 0;
y = (y != null) ? y : 0;
maxSize = (maxSize != null) ? maxSize : this.maxImageSize;
maxBytes = (maxBytes != null) ? maxBytes : this.maxImageBytes;
resizeImages = (resizeImages != null) ? resizeImages : true;
var crop = x != null && y != null;
var resizeImages = true;
// Checks if large images are imported
var largeImages = false;
@ -5684,13 +5684,13 @@
}
});
if (largeImages && resizeImages)
if (largeImages)
{
this.confirmImageResize(function(doResize)
{
resizeImages = doResize;
doImportFiles();
});
}, resizeDialog);
}
else
{
@ -5702,24 +5702,22 @@
* Parses the file using XHR2 via the server. File can be a blob or file object.
* Filename is an optional parameter for blobs (that do not have a filename).
*/
EditorUi.prototype.confirmImageResize = function(fn)
EditorUi.prototype.confirmImageResize = function(fn, force)
{
force = (force != null) ? force : false;
var resume = (this.spinner != null && this.spinner.pause != null) ? this.spinner.pause() : function() {};
var wrapper = function(remember, resize)
{
if (remember)
{
mxSettings.setResizeImages(resize);
mxSettings.save();
}
mxSettings.setResizeImages((remember) ? resize : null);
mxSettings.save();
resume();
fn(resize);
};
var resizeImages = (isLocalStorage || mxClient.IS_CHROMEAPP) ? mxSettings.getResizeImages() : null;
if (resizeImages != null)
if (resizeImages != null && !force)
{
wrapper(false, resizeImages);
}
@ -6538,7 +6536,7 @@
{
queue[i]();
}
}, !mxEvent.isControlDown(evt));
}, mxEvent.isControlDown(evt));
}
else if (mxUtils.indexOf(evt.dataTransfer.types, 'text/uri-list') >= 0)
{
@ -6739,7 +6737,7 @@
if (evt.dataTransfer.files.length > 0)
{
this.importFiles(evt.dataTransfer.files, x, y, this.maxImageSize, null, null, null, null,
!mxEvent.isControlDown(evt), null, null, mxEvent.isShiftDown(evt));
mxEvent.isControlDown(evt), null, null, mxEvent.isShiftDown(evt));
}
else
{
@ -6785,20 +6783,20 @@
}
}
var resizeImages = !mxEvent.isControlDown(evt);
var resizeImages = true;
var doInsert = mxUtils.bind(this, function()
{
graph.setSelectionCells(this.insertTextAt(html, x, y, true, asImage, null, resizeImages));
});
if (asImage && resizeImages && html.length > this.resampleThreshold)
if (asImage && html.length > this.resampleThreshold)
{
this.confirmImageResize(function(doResize)
{
resizeImages = doResize;
doInsert();
});
}, mxEvent.isControlDown(evt));
}
else
{

View file

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

View file

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

540
war/js/viewer.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB