diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index a0252ca93f..93f21a1ee5 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -11963,79 +11963,80 @@ null!=F.border&&(this.embedExportBorder=F.border);null!=F.background&&(this.embe this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(J),this.embedFilenameSpan=J);try{F.libs&&this.sidebar.showEntries(F.libs)}catch(aa){}F=null!=F.xmlpng?this.extractGraphModelFromPng(F.xmlpng):null!=F.descriptor?F.descriptor:F.xml}else{if("reloadAllTheTabs"==F.action){var Y=null!=F.xml&&0=aa.status&&"mxUtils.indexOf(y,qa)&&y.push(qa),H.fireEvent(new mxEventObject("cellsInserted","cells",[qa])));k=null!=qa;qa=ma;if(!k)for(sa=0;samxUtils.indexOf(y,Ka)};this.executeLayout(function(){Da.execute(H.getDefaultParent());pa()},!0,X);X=null}else if("horizontaltree"==ha||"verticaltree"==ha||"auto"==ha&&fa.length==2*y.length-1&&1==aa.length){H.view.validate();var za=new mxCompactTreeLayout(H,"horizontaltree"==ha);za.levelDistance=Q;za.edgeRouting=!1;za.resetEdges=!1;this.executeLayout(function(){za.execute(H.getDefaultParent(), -0mxUtils.indexOf(y,Ka)};this.executeLayout(function(){na.execute(H.getDefaultParent());pa()},!0,X);X=null}else if("organic"==ha||"auto"==ha&&fa.length>y.length){H.view.validate();var Na=new mxFastOrganicLayout(H);Na.forceConstant=3*Q;Na.disableEdgeStyle=!1;Na.resetEdges=!1;var Ja=Na.isVertexIgnored;Na.isVertexIgnored=function(Ka){return Ja.apply(this,arguments)||0>mxUtils.indexOf(y,Ka)};this.executeLayout(function(){Na.execute(H.getDefaultParent()); -pa()},!0,X);X=null}}this.hideDialog()}finally{H.model.endUpdate()}null!=X&&X()}}catch(Ka){this.handleError(Ka)}};EditorUi.prototype.getSearch=function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,n)&&null!=urlParams[n]&&(g+=k+n+"="+urlParams[n],k="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0mxUtils.indexOf(k,n)&&(d=0==g?d+"?":d+"&",null!=urlParams[n]&&(d+=n+"="+urlParams[n],g++))}return d};EditorUi.prototype.showLinkDialog=function(d,g,k,n,t){d=new LinkDialog(this,d,g,k,!0,n,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var g=1;null==this.drive&& -"function"!==typeof window.DriveClient||g++;null==this.dropbox&&"function"!==typeof window.DropboxClient||g++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;d&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),g=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g); -this.menus.get("viewZoom").setEnabled(g);var k=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(k);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k)); -d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(g); -this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck= -function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var z=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(d){var g=z.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){g.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){g.refresh()}));return g};var A=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates= -function(){A.apply(this,arguments);var d=this.editor.graph,g=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(n);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(n&&0==k.edges.length&&1==k.vertices.length);this.actions.get("editImage").setEnabled(n&& -k.image&&0';var y={};try{var D=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var V=0;Vt.oldVersion&&y.createObjectStore("objects",{keyPath:"key"}); -2>t.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(D){null!=g&&g(D)}};n.onsuccess=mxUtils.bind(this,function(t){var y=n.result;this.database=y;EditorUi.migrateStorageFiles&&(StorageFile.migrate(y),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(D){if(!D|| -"1"==urlParams.forceMigration){var G=document.createElement("iframe");G.style.display="none";G.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(G);var H=!0,F=!1,V,p=0,v=mxUtils.bind(this,function(){F=!0;this.setDatabaseItem(".drawioMigrated3",!0);G.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),E=mxUtils.bind(this,function(){p++;J()}),J=mxUtils.bind(this,function(){try{if(p>= -V.length)v();else{var L=V[p];StorageFile.getFileContent(this,L,mxUtils.bind(this,function(M){null==M||".scratchpad"==L&&M==this.emptyLibraryXml?G.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[L]}),"*"):E()}),E)}}catch(M){console.log(M)}}),N=mxUtils.bind(this,function(L){try{this.setDatabaseItem(null,[{title:L.title,size:L.data.length,lastModified:Date.now(),type:L.isLib?"L":"F"},{title:L.title,data:L.data}],E,E,["filesInfo","files"])}catch(M){console.log(M)}}); -D=mxUtils.bind(this,function(L){try{if(L.source==G.contentWindow){var M={};try{M=JSON.parse(L.data)}catch(P){}"init"==M.event?(G.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),G.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=M.event||F||(H?null!=M.resp&&0"===n.substring(0,12);n=""===n.substring(0,11);(t|| -n)&&d.push(k)}}return d};EditorUi.prototype.getLocalStorageFile=function(d){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var g=localStorage.getItem(d);return{title:d,data:g,isLib:""===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})(); +else if("Preview"==F.action)"json"==urlParams.proto&&(q=this.createLoadMessage("preview"),q.xml=mxUtils.getXml(this.editor.getGraphXml())),D.postMessage(JSON.stringify(q),"*");else if("Exit"==F.action)this.actions.get("exit").funct();else if("merge"==F.action){var da=this.getCurrentFile();null!=da&&(J=p(F.xml),null!=J&&""!=J&&da.mergeFile(new LocalFile(this,J),function(){D.postMessage(JSON.stringify({event:"merge",message:F}),"*")},function(aa){D.postMessage(JSON.stringify({event:"merge",message:F, +error:aa}),"*")}))}else if("remoteInvokeReady"==F.action)this.handleRemoteInvokeReady(D);else if("remoteInvoke"==F.action)this.handleRemoteInvoke(F,H.origin);else if("remoteInvokeResponse"==F.action)this.handleRemoteInvokeResponse(F);else if("setStyleProperties"===F.action){K=this.editor.graph;if("ResourcesAndContainer"===F.shapes){for(var wa=["RESOURCE","CONTAINER"],Ha=K.getSelectionCells().filter(function(aa){aa=aa.getAttribute("type");return wa.includes(aa)}),xa=$jscomp.makeIterator(Object.entries(F.data)), +Ba=xa.next();!Ba.done;Ba=xa.next()){var ra=$jscomp.makeIterator(Ba.value),ia=ra.next().value,Pa=ra.next().value;"style"===ia&&K.handleCentreonStyleChangeForCells(Ha,Pa);K.setCellStyles(ia,Pa,Ha)}return}for(var sa=K.getSelectionCell(),Aa=K.getModel().getStyle(sa),Ea=$jscomp.makeIterator(Object.entries(F.data)),qa=Ea.next();!qa.done;qa=Ea.next()){var va=$jscomp.makeIterator(qa.value),ma=va.next().value,ta=va.next().value;if(Aa.includes(ma)){var La=new RegExp(ma+"=(.+?);","g");"style"===ma&&K.handleCentreonStyleChange(sa, +Aa,ta);Aa="image"==ma?Aa.replace(La,ma+"="+window.location.origin+ta+";"):Aa.replace(La,ma+"="+ta+";")}}K.getModel().setStyle(sa,Aa)}else if("setDataProperties"===F.action){K=this.editor.graph;sa=K.getSelectionCell();var Ga=K.getModel().getValue(sa);Ga=Ga.cloneNode(!0);void 0!==F&&void 0!==F.data&&Object.entries(F.data).forEach(function(aa){var fa=$jscomp.makeIterator(aa);aa=fa.next().value;fa=fa.next().value;Ga.setAttribute(aa,fa)});if("CONTAINER"===sa.getAttribute("type")&&0=aa.status&&"mxUtils.indexOf(y,qa)&&y.push(qa),H.fireEvent(new mxEventObject("cellsInserted","cells",[qa])));k=null!=qa;qa=ma;if(!k)for(sa=0;samxUtils.indexOf(y,Ka)};this.executeLayout(function(){Da.execute(H.getDefaultParent());pa()},!0,X);X=null}else if("horizontaltree"==ha||"verticaltree"==ha||"auto"==ha&&fa.length==2*y.length- +1&&1==aa.length){H.view.validate();var za=new mxCompactTreeLayout(H,"horizontaltree"==ha);za.levelDistance=Q;za.edgeRouting=!1;za.resetEdges=!1;this.executeLayout(function(){za.execute(H.getDefaultParent(),0mxUtils.indexOf(y,Ka)};this.executeLayout(function(){na.execute(H.getDefaultParent());pa()},!0,X);X=null}else if("organic"==ha||"auto"==ha&&fa.length>y.length){H.view.validate();var Na=new mxFastOrganicLayout(H); +Na.forceConstant=3*Q;Na.disableEdgeStyle=!1;Na.resetEdges=!1;var Ja=Na.isVertexIgnored;Na.isVertexIgnored=function(Ka){return Ja.apply(this,arguments)||0>mxUtils.indexOf(y,Ka)};this.executeLayout(function(){Na.execute(H.getDefaultParent());pa()},!0,X);X=null}}this.hideDialog()}finally{H.model.endUpdate()}null!=X&&X()}}catch(Ka){this.handleError(Ka)}};EditorUi.prototype.getSearch=function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,n)&&null!=urlParams[n]&&(g+=k+n+"="+urlParams[n],k="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0mxUtils.indexOf(k,n)&&(d=0==g?d+"?":d+"&",null!=urlParams[n]&&(d+=n+"="+urlParams[n], +g++))}return d};EditorUi.prototype.showLinkDialog=function(d,g,k,n,t){d=new LinkDialog(this,d,g,k,!0,n,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var g=1;null==this.drive&&"function"!==typeof window.DriveClient||g++;null==this.dropbox&&"function"!==typeof window.DropboxClient||g++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;d&&isLocalStorage&&"1"==urlParams.browser&&g++; +return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),g=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);this.menus.get("viewZoom").setEnabled(g);var k=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k); +k="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(k);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k));d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g); +this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(g);this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d)); +this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var z=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(d){var g=z.apply(this,arguments); +this.addListener("darkModeChanged",mxUtils.bind(this,function(){g.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){g.refresh()}));return g};var A=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){A.apply(this,arguments);var d=this.editor.graph,g=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(n);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional()); +this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(n&&0==k.edges.length&&1==k.vertices.length);this.actions.get("editImage").setEnabled(n&&k.image&&0';var y={};try{var D=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var V=0;V< +F.length;V++){var p=F[V];y[p.id]&&(g[p.id]=p);var v=this.addCheckbox(t,p.title,y[p.id]);(function(E,J){mxEvent.addListener(J,"change",function(){this.checked?g[E.id]=E:delete g[E.id]})})(p,v)}},mxUtils.bind(this,function(F){t.innerText="";var V=document.createElement("div");V.style.padding="8px";V.style.textAlign="center";mxUtils.write(V,mxResources.get("error")+": ");mxUtils.write(V,null!=F&&null!=F.message?F.message:mxResources.get("unknownError"));t.appendChild(V)}));k.appendChild(t);k=new CustomDialog(this, +k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var F=0,V;for(V in g)null==y[V]&&(F++,mxUtils.bind(this,function(p){this.remoteInvoke("getFileContent",[p.downloadUrl],null,mxUtils.bind(this,function(v){F--;0==F&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,v,p))}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){F--;0==F&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[V])); +for(V in y)g[V]||this.closeLibrary(new RemoteLibrary(this,null,y[V]));0==F&&this.spinner.stop()}),null,null,"https://www.diagrams.net/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}}; +EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(d){this.remoteWin=d;for(var g=0;gt.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles= +isLocalStorage)}catch(D){null!=g&&g(D)}};n.onsuccess=mxUtils.bind(this,function(t){var y=n.result;this.database=y;EditorUi.migrateStorageFiles&&(StorageFile.migrate(y),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(D){if(!D||"1"==urlParams.forceMigration){var G=document.createElement("iframe");G.style.display="none";G.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+ +urlParams.forceMigration);document.body.appendChild(G);var H=!0,F=!1,V,p=0,v=mxUtils.bind(this,function(){F=!0;this.setDatabaseItem(".drawioMigrated3",!0);G.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),E=mxUtils.bind(this,function(){p++;J()}),J=mxUtils.bind(this,function(){try{if(p>=V.length)v();else{var L=V[p];StorageFile.getFileContent(this,L,mxUtils.bind(this,function(M){null==M||".scratchpad"==L&&M==this.emptyLibraryXml?G.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke", +funtionName:"getLocalStorageFile",functionArgs:[L]}),"*"):E()}),E)}}catch(M){console.log(M)}}),N=mxUtils.bind(this,function(L){try{this.setDatabaseItem(null,[{title:L.title,size:L.data.length,lastModified:Date.now(),type:L.isLib?"L":"F"},{title:L.title,data:L.data}],E,E,["filesInfo","files"])}catch(M){console.log(M)}});D=mxUtils.bind(this,function(L){try{if(L.source==G.contentWindow){var M={};try{M=JSON.parse(L.data)}catch(P){}"init"==M.event?(G.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}), +"*"),G.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=M.event||F||(H?null!=M.resp&&0"===n.substring(0,12);n=""===n.substring(0,11);(t||n)&&d.push(k)}}return d};EditorUi.prototype.getLocalStorageFile=function(d){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null; +var g=localStorage.getItem(d);return{title:d,data:g,isLib:""===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})(); var CommentsWindow=function(b,e,f,c,l,m){function u(){for(var E=D.getElementsByTagName("div"),J=0,N=0;N=aa.status&&"mxUtils.indexOf(v,ua)&&v.push(ua),F.fireEvent(new mxEventObject("cellsInserted","cells",[ua])));g=null!=ua;ua=qa;if(!g)for(ya=0;yamxUtils.indexOf(v,Ka)};this.executeLayout(function(){Ca.execute(F.getDefaultParent());na()},!0,X);X=null}else if("horizontaltree"==ha||"verticaltree"==ha||"auto"==ha&&ea.length==2*v.length-1&&1==aa.length){F.view.validate();var ta=new mxCompactTreeLayout(F,"horizontaltree"==ha);ta.levelDistance=O;ta.edgeRouting=!1;ta.resetEdges=!1;this.executeLayout(function(){ta.execute(F.getDefaultParent(), -0mxUtils.indexOf(v,Ka)};this.executeLayout(function(){ma.execute(F.getDefaultParent());na()},!0,X);X=null}else if("organic"==ha||"auto"==ha&&ea.length>v.length){F.view.validate();var Na=new mxFastOrganicLayout(F);Na.forceConstant=3*O;Na.disableEdgeStyle=!1;Na.resetEdges=!1;var Ia=Na.isVertexIgnored;Na.isVertexIgnored=function(Ka){return Ia.apply(this,arguments)||0>mxUtils.indexOf(v,Ka)};this.executeLayout(function(){Na.execute(F.getDefaultParent()); -na()},!0,X);X=null}}this.hideDialog()}finally{F.model.endUpdate()}null!=X&&X()}}catch(Ka){this.handleError(Ka)}};EditorUi.prototype.getSearch=function(c){var e="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0mxUtils.indexOf(c,p)&&null!=urlParams[p]&&(e+=g+p+"="+urlParams[p],g="&")}else e=window.location.search;return e};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var e=0mxUtils.indexOf(g,p)&&(c=0==e?c+"?":c+"&",null!=urlParams[p]&&(c+=p+"="+urlParams[p],e++))}return c};EditorUi.prototype.showLinkDialog=function(c,e,g,p,n){c=new LinkDialog(this,c,e,g,!0,p,n);this.showDialog(c.container,560,130,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var e=1;null==this.drive&& -"function"!==typeof window.DriveClient||e++;null==this.dropbox&&"function"!==typeof window.DropboxClient||e++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||e++;null!=this.gitHub&&e++;null!=this.gitLab&&e++;c&&isLocalStorage&&"1"==urlParams.browser&&e++;return e};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),e=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(e); -this.menus.get("viewZoom").setEnabled(e);var g=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!g);this.actions.get("print").setEnabled(!g);this.menus.get("exportAs").setEnabled(!g);this.menus.get("embed").setEnabled(!g);g="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(g);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(g),this.menus.get("newLibrary").setEnabled(g)); -c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(e);this.actions.get("zoomIn").setEnabled(e);this.actions.get("zoomOut").setEnabled(e);this.actions.get("smartFit").setEnabled(e);this.actions.get("resetView").setEnabled(e);this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&c);this.actions.get("redo").setEnabled(this.canRedo()&&c);this.menus.get("edit").setEnabled(e); -this.menus.get("view").setEnabled(e);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(c),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(c));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck= -function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var J=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(c){var e=J.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){e.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){e.refresh()}));return e};var D=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates= -function(){D.apply(this,arguments);var c=this.editor.graph,e=this.getCurrentFile(),g=this.getSelectionState(),p=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(p);this.actions.get("autosave").setEnabled(null!=e&&e.isEditable()&&e.isAutosaveOptional());this.actions.get("guides").setEnabled(p);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("editConnectionPoints").setEnabled(p&&0==g.edges.length&&1==g.vertices.length);this.actions.get("editImage").setEnabled(p&& -g.image&&0';var v={};try{var y=mxSettings.getCustomLibraries();for(c=0;c'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var U=0;Un.oldVersion&&v.createObjectStore("objects",{keyPath:"key"}); -2>n.oldVersion&&(v.createObjectStore("files",{keyPath:"title"}),v.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(y){null!=e&&e(y)}};p.onsuccess=mxUtils.bind(this,function(n){var v=p.result;this.database=v;EditorUi.migrateStorageFiles&&(StorageFile.migrate(v),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(y){if(!y|| -"1"==urlParams.forceMigration){var C=document.createElement("iframe");C.style.display="none";C.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(C);var F=!0,B=!1,U,l=0,q=mxUtils.bind(this,function(){B=!0;this.setDatabaseItem(".drawioMigrated3",!0);C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),z=mxUtils.bind(this,function(){l++;G()}),G=mxUtils.bind(this,function(){try{if(l>= -U.length)q();else{var L=U[l];StorageFile.getFileContent(this,L,mxUtils.bind(this,function(K){null==K||".scratchpad"==L&&K==this.emptyLibraryXml?C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[L]}),"*"):z()}),z)}}catch(K){console.log(K)}}),M=mxUtils.bind(this,function(L){try{this.setDatabaseItem(null,[{title:L.title,size:L.data.length,lastModified:Date.now(),type:L.isLib?"L":"F"},{title:L.title,data:L.data}],z,z,["filesInfo","files"])}catch(K){console.log(K)}}); -y=mxUtils.bind(this,function(L){try{if(L.source==C.contentWindow){var K={};try{K=JSON.parse(L.data)}catch(P){}"init"==K.event?(C.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=K.event||B||(F?null!=K.resp&&0"===p.substring(0,12);p=""===p.substring(0,11);(n|| -p)&&c.push(g)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var e=localStorage.getItem(c);return{title:c,data:e,isLib:""===e.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})(); +else if("Preview"==B.action)"json"==urlParams.proto&&(m=this.createLoadMessage("preview"),m.xml=mxUtils.getXml(this.editor.getGraphXml())),y.postMessage(JSON.stringify(m),"*");else if("Exit"==B.action)this.actions.get("exit").funct();else if("merge"==B.action){var da=this.getCurrentFile();null!=da&&(G=l(B.xml),null!=G&&""!=G&&da.mergeFile(new LocalFile(this,G),function(){y.postMessage(JSON.stringify({event:"merge",message:B}),"*")},function(aa){y.postMessage(JSON.stringify({event:"merge",message:B, +error:aa}),"*")}))}else if("remoteInvokeReady"==B.action)this.handleRemoteInvokeReady(y);else if("remoteInvoke"==B.action)this.handleRemoteInvoke(B,F.origin);else if("remoteInvokeResponse"==B.action)this.handleRemoteInvokeResponse(B);else if("setStyleProperties"===B.action){H=this.editor.graph;if("ResourcesAndContainer"===B.shapes){for(var wa=["RESOURCE","CONTAINER"],Ga=H.getSelectionCells().filter(function(aa){aa=aa.getAttribute("type");return wa.includes(aa)}),va=$jscomp.makeIterator(Object.entries(B.data)), +Ba=va.next();!Ba.done;Ba=va.next()){var pa=$jscomp.makeIterator(Ba.value),ia=pa.next().value,Qa=pa.next().value;"style"===ia&&H.handleCentreonStyleChangeForCells(Ga,Qa);H.setCellStyles(ia,Qa,Ga)}return}for(var ya=H.getSelectionCell(),Da=H.getModel().getStyle(ya),Ja=$jscomp.makeIterator(Object.entries(B.data)),ua=Ja.next();!ua.done;ua=Ja.next()){var Aa=$jscomp.makeIterator(ua.value),qa=Aa.next().value,ra=Aa.next().value;if(Da.includes(qa)){var Ma=new RegExp(qa+"=(.+?);","g");"style"===qa&&H.handleCentreonStyleChange(ya, +Da,ra);Da="image"==qa?Da.replace(Ma,qa+"="+window.location.origin+ra+";"):Da.replace(Ma,qa+"="+ra+";")}}H.getModel().setStyle(ya,Da)}else if("setDataProperties"===B.action){H=this.editor.graph;ya=H.getSelectionCell();var Ha=H.getModel().getValue(ya);Ha=Ha.cloneNode(!0);void 0!==B&&void 0!==B.data&&Object.entries(B.data).forEach(function(aa){var ea=$jscomp.makeIterator(aa);aa=ea.next().value;ea=ea.next().value;Ha.setAttribute(aa,ea)});if("CONTAINER"===ya.getAttribute("type")&&0=aa.status&&"mxUtils.indexOf(v,ua)&&v.push(ua),F.fireEvent(new mxEventObject("cellsInserted","cells",[ua])));g=null!=ua;ua=qa;if(!g)for(ya=0;yamxUtils.indexOf(v,Ka)};this.executeLayout(function(){Ca.execute(F.getDefaultParent());na()},!0,X);X=null}else if("horizontaltree"==ha||"verticaltree"==ha||"auto"==ha&&ea.length==2*v.length- +1&&1==aa.length){F.view.validate();var ta=new mxCompactTreeLayout(F,"horizontaltree"==ha);ta.levelDistance=O;ta.edgeRouting=!1;ta.resetEdges=!1;this.executeLayout(function(){ta.execute(F.getDefaultParent(),0mxUtils.indexOf(v,Ka)};this.executeLayout(function(){ma.execute(F.getDefaultParent());na()},!0,X);X=null}else if("organic"==ha||"auto"==ha&&ea.length>v.length){F.view.validate();var Na=new mxFastOrganicLayout(F); +Na.forceConstant=3*O;Na.disableEdgeStyle=!1;Na.resetEdges=!1;var Ia=Na.isVertexIgnored;Na.isVertexIgnored=function(Ka){return Ia.apply(this,arguments)||0>mxUtils.indexOf(v,Ka)};this.executeLayout(function(){Na.execute(F.getDefaultParent());na()},!0,X);X=null}}this.hideDialog()}finally{F.model.endUpdate()}null!=X&&X()}}catch(Ka){this.handleError(Ka)}};EditorUi.prototype.getSearch=function(c){var e="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0mxUtils.indexOf(c,p)&&null!=urlParams[p]&&(e+=g+p+"="+urlParams[p],g="&")}else e=window.location.search;return e};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var e=0mxUtils.indexOf(g,p)&&(c=0==e?c+"?":c+"&",null!=urlParams[p]&&(c+=p+"="+urlParams[p], +e++))}return c};EditorUi.prototype.showLinkDialog=function(c,e,g,p,n){c=new LinkDialog(this,c,e,g,!0,p,n);this.showDialog(c.container,560,130,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var e=1;null==this.drive&&"function"!==typeof window.DriveClient||e++;null==this.dropbox&&"function"!==typeof window.DropboxClient||e++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||e++;null!=this.gitHub&&e++;null!=this.gitLab&&e++;c&&isLocalStorage&&"1"==urlParams.browser&&e++; +return e};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),e=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(e);this.menus.get("viewZoom").setEnabled(e);var g=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!g);this.actions.get("print").setEnabled(!g);this.menus.get("exportAs").setEnabled(!g);this.menus.get("embed").setEnabled(!g); +g="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(g);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(g),this.menus.get("newLibrary").setEnabled(g));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(e);this.actions.get("zoomIn").setEnabled(e);this.actions.get("zoomOut").setEnabled(e);this.actions.get("smartFit").setEnabled(e);this.actions.get("resetView").setEnabled(e); +this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&c);this.actions.get("redo").setEnabled(this.canRedo()&&c);this.menus.get("edit").setEnabled(e);this.menus.get("view").setEnabled(e);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(c),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(c)); +this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var J=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(c){var e=J.apply(this,arguments); +this.addListener("darkModeChanged",mxUtils.bind(this,function(){e.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){e.refresh()}));return e};var D=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){D.apply(this,arguments);var c=this.editor.graph,e=this.getCurrentFile(),g=this.getSelectionState(),p=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(p);this.actions.get("autosave").setEnabled(null!=e&&e.isEditable()&&e.isAutosaveOptional()); +this.actions.get("guides").setEnabled(p);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("editConnectionPoints").setEnabled(p&&0==g.edges.length&&1==g.vertices.length);this.actions.get("editImage").setEnabled(p&&g.image&&0';var v={};try{var y=mxSettings.getCustomLibraries();for(c=0;c'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var U=0;U< +B.length;U++){var l=B[U];v[l.id]&&(e[l.id]=l);var q=this.addCheckbox(n,l.title,v[l.id]);(function(z,G){mxEvent.addListener(G,"change",function(){this.checked?e[z.id]=z:delete e[z.id]})})(l,q)}},mxUtils.bind(this,function(B){n.innerText="";var U=document.createElement("div");U.style.padding="8px";U.style.textAlign="center";mxUtils.write(U,mxResources.get("error")+": ");mxUtils.write(U,null!=B&&null!=B.message?B.message:mxResources.get("unknownError"));n.appendChild(U)}));g.appendChild(n);g=new CustomDialog(this, +g,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var B=0,U;for(U in e)null==v[U]&&(B++,mxUtils.bind(this,function(l){this.remoteInvoke("getFileContent",[l.downloadUrl],null,mxUtils.bind(this,function(q){B--;0==B&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,q,l))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){B--;0==B&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(e[U])); +for(U in v)e[U]||this.closeLibrary(new RemoteLibrary(this,null,v[U]));0==B&&this.spinner.stop()}),null,null,"https://www.diagrams.net/doc/faq/custom-libraries-confluence-cloud");this.showDialog(g.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}}; +EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var e=0;en.oldVersion&&v.createObjectStore("objects",{keyPath:"key"});2>n.oldVersion&&(v.createObjectStore("files",{keyPath:"title"}),v.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles= +isLocalStorage)}catch(y){null!=e&&e(y)}};p.onsuccess=mxUtils.bind(this,function(n){var v=p.result;this.database=v;EditorUi.migrateStorageFiles&&(StorageFile.migrate(v),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(y){if(!y||"1"==urlParams.forceMigration){var C=document.createElement("iframe");C.style.display="none";C.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+ +urlParams.forceMigration);document.body.appendChild(C);var F=!0,B=!1,U,l=0,q=mxUtils.bind(this,function(){B=!0;this.setDatabaseItem(".drawioMigrated3",!0);C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),z=mxUtils.bind(this,function(){l++;G()}),G=mxUtils.bind(this,function(){try{if(l>=U.length)q();else{var L=U[l];StorageFile.getFileContent(this,L,mxUtils.bind(this,function(K){null==K||".scratchpad"==L&&K==this.emptyLibraryXml?C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke", +funtionName:"getLocalStorageFile",functionArgs:[L]}),"*"):z()}),z)}}catch(K){console.log(K)}}),M=mxUtils.bind(this,function(L){try{this.setDatabaseItem(null,[{title:L.title,size:L.data.length,lastModified:Date.now(),type:L.isLib?"L":"F"},{title:L.title,data:L.data}],z,z,["filesInfo","files"])}catch(K){console.log(K)}});y=mxUtils.bind(this,function(L){try{if(L.source==C.contentWindow){var K={};try{K=JSON.parse(L.data)}catch(P){}"init"==K.event?(C.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}), +"*"),C.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=K.event||B||(F?null!=K.resp&&0"===p.substring(0,12);p=""===p.substring(0,11);(n||p)&&c.push(g)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null; +var e=localStorage.getItem(c);return{title:c,data:e,isLib:""===e.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})(); var CommentsWindow=function(b,f,k,d,t,u){function A(){for(var z=y.getElementsByTagName("div"),G=0,M=0;M=pa.status&&"mxUtils.indexOf(C,N)&&C.push(N),M.fireEvent(new mxEventObject("cellsInserted","cells",[N])));g=null!=N;N=aa;if(!g)for(Ma=0;MamxUtils.indexOf(C,Za)};this.executeLayout(function(){ab.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("horizontaltree"==Ha||"verticaltree"==Ha||"auto"==Ha&&Aa.length==2*C.length-1&&1==pa.length){M.view.validate();var Ya=new mxCompactTreeLayout(M,"horizontaltree"==Ha);Ya.levelDistance=W;Ya.edgeRouting=!1;Ya.resetEdges=!1;this.executeLayout(function(){Ya.execute(M.getDefaultParent(),0mxUtils.indexOf(C,Za)};this.executeLayout(function(){nb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("organic"==Ha||"auto"==Ha&&Aa.length>C.length){M.view.validate();var wb=new mxFastOrganicLayout(M);wb.forceConstant=3*W;wb.disableEdgeStyle=!1;wb.resetEdges=!1;var cb=wb.isVertexIgnored;wb.isVertexIgnored=function(Za){return cb.apply(this,arguments)||0>mxUtils.indexOf(C,Za)};this.executeLayout(function(){wb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}}this.hideDialog()}finally{M.model.endUpdate()}null!= -sa&&sa()}}catch(Za){this.handleError(Za)}};EditorUi.prototype.getSearch=function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,v)&&null!=urlParams[v]&&(f+=g+v+"="+urlParams[v],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var f=0mxUtils.indexOf(g,v)&&(d=0==f?d+"?":d+"&",null!=urlParams[v]&&(d+=v+"="+urlParams[v],f++))}return d};EditorUi.prototype.showLinkDialog=function(d,f,g,v,t){d=new LinkDialog(this,d,f,g,!0,v,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient|| -f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;d&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),f=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var g=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!g); -this.actions.get("print").setEnabled(!g);this.menus.get("exportAs").setEnabled(!g);this.menus.get("embed").setEnabled(!g);g="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(g);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(g),this.menus.get("newLibrary").setEnabled(g));d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f); -this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d), -null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var E=EditorUi.prototype.createSidebar; -EditorUi.prototype.createSidebar=function(d){var f=E.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){f.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){f.refresh()}));return f};var I=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){I.apply(this,arguments);var d=this.editor.graph,f=this.getCurrentFile(),g=this.getSelectionState(),v=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(v); -this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(v);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(v&&0==g.edges.length&&1==g.vertices.length);this.actions.get("editImage").setEnabled(v&&g.image&&0';var C={};try{var H=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+ -"";else for(var ha=0;hat.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(C.createObjectStore("files", -{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};v.onsuccess=mxUtils.bind(this,function(t){var C=v.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(H){if(!H||"1"==urlParams.forceMigration){var Q= -document.createElement("iframe");Q.style.display="none";Q.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(Q);var M=!0,F=!1,ha,ja=0,ia=mxUtils.bind(this,function(){F=!0;this.setDatabaseItem(".drawioMigrated3",!0);Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){ja++;ma()}),ma=mxUtils.bind(this,function(){try{if(ja>=ha.length)ia();else{var S= -ha[ja];StorageFile.getFileContent(this,S,mxUtils.bind(this,function(U){null==U||".scratchpad"==S&&U==this.emptyLibraryXml?Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[S]}),"*"):da()}),da)}}catch(U){console.log(U)}}),qa=mxUtils.bind(this,function(S){try{this.setDatabaseItem(null,[{title:S.title,size:S.data.length,lastModified:Date.now(),type:S.isLib?"L":"F"},{title:S.title,data:S.data}],da,da,["filesInfo","files"])}catch(U){console.log(U)}}); -H=mxUtils.bind(this,function(S){try{if(S.source==Q.contentWindow){var U={};try{U=JSON.parse(S.data)}catch(R){}"init"==U.event?(Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=U.event||F||(M?null!=U.resp&&0=pa.status&&"mxUtils.indexOf(C,N)&&C.push(N),M.fireEvent(new mxEventObject("cellsInserted","cells",[N])));g=null!=N;N=aa;if(!g)for(Ma=0;MamxUtils.indexOf(C,Za)};this.executeLayout(function(){ab.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("horizontaltree"==Ha||"verticaltree"==Ha||"auto"==Ha&&Aa.length==2*C.length- +1&&1==pa.length){M.view.validate();var Ya=new mxCompactTreeLayout(M,"horizontaltree"==Ha);Ya.levelDistance=W;Ya.edgeRouting=!1;Ya.resetEdges=!1;this.executeLayout(function(){Ya.execute(M.getDefaultParent(),0mxUtils.indexOf(C,Za)};this.executeLayout(function(){nb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("organic"==Ha||"auto"==Ha&&Aa.length>C.length){M.view.validate();var wb=new mxFastOrganicLayout(M); +wb.forceConstant=3*W;wb.disableEdgeStyle=!1;wb.resetEdges=!1;var cb=wb.isVertexIgnored;wb.isVertexIgnored=function(Za){return cb.apply(this,arguments)||0>mxUtils.indexOf(C,Za)};this.executeLayout(function(){wb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}}this.hideDialog()}finally{M.model.endUpdate()}null!=sa&&sa()}}catch(Za){this.handleError(Za)}};EditorUi.prototype.getSearch=function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,v)&&null!=urlParams[v]&&(f+=g+v+"="+urlParams[v],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var f=0mxUtils.indexOf(g,v)&&(d=0==f?d+"?":d+"&",null!=urlParams[v]&&(d+=v+"="+ +urlParams[v],f++))}return d};EditorUi.prototype.showLinkDialog=function(d,f,g,v,t){d=new LinkDialog(this,d,f,g,!0,v,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;d&&isLocalStorage&&"1"==urlParams.browser&& +f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),f=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var g=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!g);this.actions.get("print").setEnabled(!g);this.menus.get("exportAs").setEnabled(!g);this.menus.get("embed").setEnabled(!g); +g="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(g);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(g),this.menus.get("newLibrary").setEnabled(g));d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f); +this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d)); +this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var E=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(d){var f=E.apply(this,arguments); +this.addListener("darkModeChanged",mxUtils.bind(this,function(){f.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){f.refresh()}));return f};var I=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){I.apply(this,arguments);var d=this.editor.graph,f=this.getCurrentFile(),g=this.getSelectionState(),v=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(v);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional()); +this.actions.get("guides").setEnabled(v);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(v&&0==g.edges.length&&1==g.vertices.length);this.actions.get("editImage").setEnabled(v&&g.image&&0';var C={};try{var H=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var ha=0;ha< +F.length;ha++){var ja=F[ha];C[ja.id]&&(f[ja.id]=ja);var ia=this.addCheckbox(t,ja.title,C[ja.id]);(function(da,ma){mxEvent.addListener(ma,"change",function(){this.checked?f[da.id]=da:delete f[da.id]})})(ja,ia)}},mxUtils.bind(this,function(F){t.innerText="";var ha=document.createElement("div");ha.style.padding="8px";ha.style.textAlign="center";mxUtils.write(ha,mxResources.get("error")+": ");mxUtils.write(ha,null!=F&&null!=F.message?F.message:mxResources.get("unknownError"));t.appendChild(ha)}));g.appendChild(t); +g=new CustomDialog(this,g,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var F=0,ha;for(ha in f)null==C[ha]&&(F++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ia){F--;0==F&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ia,ja))}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){F--;0==F&&this.spinner.stop();this.handleError(null, +mxResources.get("errorLoadingFile"))}))})(f[ha]));for(ha in C)f[ha]||this.closeLibrary(new RemoteLibrary(this,null,C[ha]));0==F&&this.spinner.stop()}),null,null,"https://www.diagrams.net/doc/faq/custom-libraries-confluence-cloud");this.showDialog(g.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]}, +setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(d){this.remoteWin=d;for(var f=0;ft.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo", +{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};v.onsuccess=mxUtils.bind(this,function(t){var C=v.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(H){if(!H||"1"==urlParams.forceMigration){var Q=document.createElement("iframe");Q.style.display= +"none";Q.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(Q);var M=!0,F=!1,ha,ja=0,ia=mxUtils.bind(this,function(){F=!0;this.setDatabaseItem(".drawioMigrated3",!0);Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){ja++;ma()}),ma=mxUtils.bind(this,function(){try{if(ja>=ha.length)ia();else{var S=ha[ja];StorageFile.getFileContent(this,S, +mxUtils.bind(this,function(U){null==U||".scratchpad"==S&&U==this.emptyLibraryXml?Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[S]}),"*"):da()}),da)}}catch(U){console.log(U)}}),qa=mxUtils.bind(this,function(S){try{this.setDatabaseItem(null,[{title:S.title,size:S.data.length,lastModified:Date.now(),type:S.isLib?"L":"F"},{title:S.title,data:S.data}],da,da,["filesInfo","files"])}catch(U){console.log(U)}});H=mxUtils.bind(this,function(S){try{if(S.source== +Q.contentWindow){var U={};try{U=JSON.parse(S.data)}catch(R){}"init"==U.event?(Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=U.event||F||(M?null!=U.resp&&0=pa.status&&"mxUtils.indexOf(C,N)&&C.push(N),M.fireEvent(new mxEventObject("cellsInserted","cells",[N])));g=null!=N;N=aa;if(!g)for(Ma=0;MamxUtils.indexOf(C,Za)};this.executeLayout(function(){ab.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("horizontaltree"==Ha||"verticaltree"==Ha||"auto"==Ha&&Aa.length==2*C.length-1&&1==pa.length){M.view.validate();var Ya=new mxCompactTreeLayout(M,"horizontaltree"==Ha);Ya.levelDistance=W;Ya.edgeRouting=!1;Ya.resetEdges=!1;this.executeLayout(function(){Ya.execute(M.getDefaultParent(),0mxUtils.indexOf(C,Za)};this.executeLayout(function(){nb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("organic"==Ha||"auto"==Ha&&Aa.length>C.length){M.view.validate();var wb=new mxFastOrganicLayout(M);wb.forceConstant=3*W;wb.disableEdgeStyle=!1;wb.resetEdges=!1;var cb=wb.isVertexIgnored;wb.isVertexIgnored=function(Za){return cb.apply(this,arguments)||0>mxUtils.indexOf(C,Za)};this.executeLayout(function(){wb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}}this.hideDialog()}finally{M.model.endUpdate()}null!= -sa&&sa()}}catch(Za){this.handleError(Za)}};EditorUi.prototype.getSearch=function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,v)&&null!=urlParams[v]&&(f+=g+v+"="+urlParams[v],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var f=0mxUtils.indexOf(g,v)&&(d=0==f?d+"?":d+"&",null!=urlParams[v]&&(d+=v+"="+urlParams[v],f++))}return d};EditorUi.prototype.showLinkDialog=function(d,f,g,v,t){d=new LinkDialog(this,d,f,g,!0,v,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient|| -f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;d&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),f=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var g=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!g); -this.actions.get("print").setEnabled(!g);this.menus.get("exportAs").setEnabled(!g);this.menus.get("embed").setEnabled(!g);g="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(g);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(g),this.menus.get("newLibrary").setEnabled(g));d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f); -this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d), -null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d));this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var E=EditorUi.prototype.createSidebar; -EditorUi.prototype.createSidebar=function(d){var f=E.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){f.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){f.refresh()}));return f};var I=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){I.apply(this,arguments);var d=this.editor.graph,f=this.getCurrentFile(),g=this.getSelectionState(),v=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(v); -this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(v);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(v&&0==g.edges.length&&1==g.vertices.length);this.actions.get("editImage").setEnabled(v&&g.image&&0';var C={};try{var H=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+ -"";else for(var ha=0;hat.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(C.createObjectStore("files", -{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};v.onsuccess=mxUtils.bind(this,function(t){var C=v.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(H){if(!H||"1"==urlParams.forceMigration){var Q= -document.createElement("iframe");Q.style.display="none";Q.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(Q);var M=!0,F=!1,ha,ja=0,ia=mxUtils.bind(this,function(){F=!0;this.setDatabaseItem(".drawioMigrated3",!0);Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){ja++;ma()}),ma=mxUtils.bind(this,function(){try{if(ja>=ha.length)ia();else{var S= -ha[ja];StorageFile.getFileContent(this,S,mxUtils.bind(this,function(U){null==U||".scratchpad"==S&&U==this.emptyLibraryXml?Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[S]}),"*"):da()}),da)}}catch(U){console.log(U)}}),qa=mxUtils.bind(this,function(S){try{this.setDatabaseItem(null,[{title:S.title,size:S.data.length,lastModified:Date.now(),type:S.isLib?"L":"F"},{title:S.title,data:S.data}],da,da,["filesInfo","files"])}catch(U){console.log(U)}}); -H=mxUtils.bind(this,function(S){try{if(S.source==Q.contentWindow){var U={};try{U=JSON.parse(S.data)}catch(R){}"init"==U.event?(Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=U.event||F||(M?null!=U.resp&&0=pa.status&&"mxUtils.indexOf(C,N)&&C.push(N),M.fireEvent(new mxEventObject("cellsInserted","cells",[N])));g=null!=N;N=aa;if(!g)for(Ma=0;MamxUtils.indexOf(C,Za)};this.executeLayout(function(){ab.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("horizontaltree"==Ha||"verticaltree"==Ha||"auto"==Ha&&Aa.length==2*C.length- +1&&1==pa.length){M.view.validate();var Ya=new mxCompactTreeLayout(M,"horizontaltree"==Ha);Ya.levelDistance=W;Ya.edgeRouting=!1;Ya.resetEdges=!1;this.executeLayout(function(){Ya.execute(M.getDefaultParent(),0mxUtils.indexOf(C,Za)};this.executeLayout(function(){nb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}else if("organic"==Ha||"auto"==Ha&&Aa.length>C.length){M.view.validate();var wb=new mxFastOrganicLayout(M); +wb.forceConstant=3*W;wb.disableEdgeStyle=!1;wb.resetEdges=!1;var cb=wb.isVertexIgnored;wb.isVertexIgnored=function(Za){return cb.apply(this,arguments)||0>mxUtils.indexOf(C,Za)};this.executeLayout(function(){wb.execute(M.getDefaultParent());Pa()},!0,sa);sa=null}}this.hideDialog()}finally{M.model.endUpdate()}null!=sa&&sa()}}catch(Za){this.handleError(Za)}};EditorUi.prototype.getSearch=function(d){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0mxUtils.indexOf(d,v)&&null!=urlParams[v]&&(f+=g+v+"="+urlParams[v],g="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var f=0mxUtils.indexOf(g,v)&&(d=0==f?d+"?":d+"&",null!=urlParams[v]&&(d+=v+"="+ +urlParams[v],f++))}return d};EditorUi.prototype.showLinkDialog=function(d,f,g,v,t){d=new LinkDialog(this,d,f,g,!0,v,t);this.showDialog(d.container,560,130,!0,!0);d.init()};EditorUi.prototype.getServiceCount=function(d){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;d&&isLocalStorage&&"1"==urlParams.browser&& +f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var d=this.getCurrentFile(),f=null!=d||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var g=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==d||d.isRestricted());this.actions.get("makeCopy").setEnabled(!g);this.actions.get("print").setEnabled(!g);this.menus.get("exportAs").setEnabled(!g);this.menus.get("embed").setEnabled(!g); +g="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(g);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(g),this.menus.get("newLibrary").setEnabled(g));d="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&d.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f); +this.actions.get("toggleDarkMode").setEnabled("atlas"!=Editor.currentTheme);this.actions.get("undo").setEnabled(this.canUndo()&&d);this.actions.get("redo").setEnabled(this.canRedo()&&d);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(d);this.menus.get("arrange").setEnabled(d);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(d),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(d)); +this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var d=this.getCurrentFile();return null!=d&&d.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var E=EditorUi.prototype.createSidebar;EditorUi.prototype.createSidebar=function(d){var f=E.apply(this,arguments); +this.addListener("darkModeChanged",mxUtils.bind(this,function(){f.refresh()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){f.refresh()}));return f};var I=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){I.apply(this,arguments);var d=this.editor.graph,f=this.getCurrentFile(),g=this.getSelectionState(),v=this.isDiagramActive();this.actions.get("pageSetup").setEnabled(v);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional()); +this.actions.get("guides").setEnabled(v);this.actions.get("editData").setEnabled(d.isEnabled());this.actions.get("editConnectionPoints").setEnabled(v&&0==g.edges.length&&1==g.vertices.length);this.actions.get("editImage").setEnabled(v&&g.image&&0';var C={};try{var H=mxSettings.getCustomLibraries();for(d=0;d'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"";else for(var ha=0;ha< +F.length;ha++){var ja=F[ha];C[ja.id]&&(f[ja.id]=ja);var ia=this.addCheckbox(t,ja.title,C[ja.id]);(function(da,ma){mxEvent.addListener(ma,"change",function(){this.checked?f[da.id]=da:delete f[da.id]})})(ja,ia)}},mxUtils.bind(this,function(F){t.innerText="";var ha=document.createElement("div");ha.style.padding="8px";ha.style.textAlign="center";mxUtils.write(ha,mxResources.get("error")+": ");mxUtils.write(ha,null!=F&&null!=F.message?F.message:mxResources.get("unknownError"));t.appendChild(ha)}));g.appendChild(t); +g=new CustomDialog(this,g,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var F=0,ha;for(ha in f)null==C[ha]&&(F++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ia){F--;0==F&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ia,ja))}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){F--;0==F&&this.spinner.stop();this.handleError(null, +mxResources.get("errorLoadingFile"))}))})(f[ha]));for(ha in C)f[ha]||this.closeLibrary(new RemoteLibrary(this,null,C[ha]));0==F&&this.spinner.stop()}),null,null,"https://www.diagrams.net/doc/faq/custom-libraries-confluence-cloud");this.showDialog(g.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]}, +setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(d){this.remoteWin=d;for(var f=0;ft.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo", +{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};v.onsuccess=mxUtils.bind(this,function(t){var C=v.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(H){if(!H||"1"==urlParams.forceMigration){var Q=document.createElement("iframe");Q.style.display= +"none";Q.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(Q);var M=!0,F=!1,ha,ja=0,ia=mxUtils.bind(this,function(){F=!0;this.setDatabaseItem(".drawioMigrated3",!0);Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){ja++;ma()}),ma=mxUtils.bind(this,function(){try{if(ja>=ha.length)ia();else{var S=ha[ja];StorageFile.getFileContent(this,S, +mxUtils.bind(this,function(U){null==U||".scratchpad"==S&&U==this.emptyLibraryXml?Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[S]}),"*"):da()}),da)}}catch(U){console.log(U)}}),qa=mxUtils.bind(this,function(S){try{this.setDatabaseItem(null,[{title:S.title,size:S.data.length,lastModified:Date.now(),type:S.isLib?"L":"F"},{title:S.title,data:S.data}],da,da,["filesInfo","files"])}catch(U){console.log(U)}});H=mxUtils.bind(this,function(S){try{if(S.source== +Q.contentWindow){var U={};try{U=JSON.parse(S.data)}catch(R){}"init"==U.event?(Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),Q.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=U.event||F||(M?null!=U.resp&&0