diff --git a/ChangeLog b/ChangeLog index e7854de3..f488503f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +04-MAR-2018: 8.5.3 + +- Gliffy import improvement +- Fix for anchor download issue in Chrome 65 + 31-MAR-2018: 8.5.2 - Add mass gliffy import in Confluence Cloud diff --git a/VERSION b/VERSION index bd0b85a9..6a295953 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.5.2 \ No newline at end of file +8.5.3 \ No newline at end of file diff --git a/etc/slidesaddon/Code.gs b/etc/slidesaddon/Code.gs new file mode 100644 index 00000000..fb679a9f --- /dev/null +++ b/etc/slidesaddon/Code.gs @@ -0,0 +1,606 @@ +/** + * Draw.io Diagrams Docs add-on v1.9 + * Copyright (c) 2018, JGraph Ltd + */ +var EXPORT_URL = "https://exp.draw.io/ImageExport4/export"; +var DRAW_URL = "https://www.draw.io/"; +var SCALING_VALUE = 0.8; // Google Docs seem to be downscaling all images by this amount + +/** + * Creates a menu entry in the Google Docs UI when the document is opened. + */ +function onOpen() +{ + SlidesApp.getUi().createAddonMenu() + .addItem("Insert Diagrams", "insertDiagrams") + .addItem("Update Selected", "updateSelected") + .addItem("Update All", "updateAll") + .addToUi(); +} + +/** + * Runs when the add-on is installed. + */ +function onInstall() +{ + onOpen(); +} + +/** + * Gets the user's OAuth 2.0 access token so that it can be passed to Picker. + * This technique keeps Picker from needing to show its own authorization + * dialog, but is only possible if the OAuth scope that Picker needs is + * available in Apps Script. In this case, the function includes an unused call + * to a DriveApp method to ensure that Apps Script requests access to all files + * in the user's Drive. + * + * @return {string} The user's OAuth 2.0 access token. + */ +function getOAuthToken() { + DriveApp.getRootFolder(); + return ScriptApp.getOAuthToken(); +} + +/** + * Shows a picker and lets the user select multiple diagrams to insert. + */ +function insertDiagrams() +{ + var html = HtmlService.createHtmlOutputFromFile('Picker.html') + .setWidth(620).setHeight(440) + .setSandboxMode(HtmlService.SandboxMode.IFRAME); + SlidesApp.getUi().showModalDialog(html, 'Select draw.io Diagrams'); +} + +/** + * Inserts an image for the given diagram. + */ +function pickerHandler(items) +{ + var app = UiApp.getActiveApplication(); + + // Delay after closing the picker used to show spinner on client-side + app.close(); + + if (items != null && items.length > 0) + { + var inserted = 0; + var errors = []; + + // if there are selected items in the slides, assume they are going to be replaced + // by the newly inserted images + var selectionCoordinates = getSelectionCoordinates(); + var offsetX = selectionCoordinates[0]; + var offsetY = selectionCoordinates[1]; + + deleteSelectedElements(); + + var step = 10; + + for (var i = 0; i < items.length; i++) + { + try + { + if (insertDiagram(items[i].id, items[i].page, offsetX, offsetY) != null) + { + inserted++; + offsetX = offsetX + step; + offsetY = offsetY + step; + } + else + { + errors.push("- " + items[i].name + ": Unknown error"); + } + } + catch (e) + { + errors.push("- " + items[i].name + ": " + e.message); + } + } + + // Shows message only in case of errors + if (errors.length > 0) + { + var msg = ""; + + if (errors.length > 0) + { + msg += errors.length + " insert" + ((errors.length > 1) ? "s" : "") + " failed:\n"; + } + + msg += errors.join("\n"); + SlidesApp.getUi().alert(msg); + } + } +} + +/** + Finds left-most and top-most coordinates of selected page elements; (0,0) by default + @return left-most and top-most coordinates in an array +**/ +function getSelectionCoordinates() +{ + var selection = SlidesApp.getActivePresentation().getSelection(); + switch (selection.getSelectionType()) + { + case SlidesApp.SelectionType.PAGE_ELEMENT: + { + // only interested if selection is containing page elements + var elements = selection.getPageElementRange(); + var top = 1000000; + var left = 1000000; + if (elements) + { + // find the left-most, top-most coordinate of selected elements + var pageElements = elements.getPageElements(); + for (var i = 0; i < pageElements.length; i++) + { + var element = pageElements[i]; + var elementTop = element.getTop(); + var elementLeft = element.getLeft(); + if (top > elementTop) + top = elementTop; + if (left > elementLeft) + left = elementLeft; + } + return [left, top]; + } + } + } + return [0, 0]; +} + +/** + Deletes selected elements +**/ +function deleteSelectedElements() +{ + var selection = SlidesApp.getActivePresentation().getSelection(); + switch (selection.getSelectionType()) + { + case SlidesApp.SelectionType.PAGE_ELEMENT: + { + // only interested if selection is containing page elements + var elements = selection.getPageElementRange(); + if (elements) { + var pageElements = elements.getPageElements(); + // find the left-most, top-most coordinate of selected elements + for (var i = 0; i < pageElements.length; i++) + { + // delete all selected page elements + var element = pageElements[i]; + element.remove(); + } + } + } + } +} + +/** + * Inserts the given diagram at the given position. + */ +function insertDiagram(id, page, offsetX, offsetY) +{ + var scale = 2; + var result = fetchImage(id, page, scale); + + var blob = result[0]; + var w = result[1] * SCALING_VALUE; + var h = result[2] * SCALING_VALUE; + var img = null; + + if (blob != null) + { + var slide = SlidesApp.getActivePresentation().getSelection().getCurrentPage().asSlide(); + var img = slide.insertImage(blob); + img.setLeft(offsetX); + img.setTop(offsetY); + var wmax = SlidesApp.getActivePresentation().getPageWidth(); + var hmax = SlidesApp.getActivePresentation().getPageHeight(); + + var link = createLink(id, page, scale); + img.setLinkUrl(link); + + // Scales to document width if not placeholder + if (w == 0 && h == 0) { + var w = img.getWidth(); + var h = img.getHeight(); + } + + var nw = w; + var nh = h; + + // adjust scale (retina/HiDPI display support) + w /= scale; + h /= scale; + + if (wmax > 0 && w > wmax) + { + var aspect = w / h; + + // Keeps width and aspect + nw = wmax; + nh = wmax / aspect; + } + else if (hmax > 0 && h > hmax) { + var aspect = h / w; + + // Keeps height and aspect + nh = hmax; + nw = hmax / aspect; + } + img.setWidth(w); + img.setHeight(h); + } + else + { + throw new Error("Invalid image " + id); + } + + return img; +} + +/** + * Updates the selected diagrams in-place. + */ +function updateSelected() +{ + var selection = SlidesApp.getActivePresentation().getSelection(); + + if (selection) + { + switch (selection.getSelectionType()) + { + case SlidesApp.SelectionType.PAGE_ELEMENT: + { + var selected = selection.getPageElementRange(); + if (!selected) + return; + + selected = selected.getPageElements(); + + var elts = []; + + // Unwraps selection elements + for (var i = 0; i < selected.length; i++) + { + var pageElement = selected[i]; + switch (pageElement.getPageElementType()) + { + case SlidesApp.PageElementType.IMAGE: + { + elts.push(selected[i].asImage()); + } + } + } + updateElements(elts); + } + } + } + else + { + SlidesApp.getUi().alert("No selection"); + } +} + +/** + * Updates all diagrams in the document. + */ +function updateAll() +{ + // collect all slides + var slides = SlidesApp.getActivePresentation().getSlides(); + var images = []; + for (var i = 0; i < slides.length; i++) + { + // collect all images on all slides + var slide = slides[i]; + var slideImages = slide.getImages(); + images = images.concat(slideImages); + } + updateElements(images); +} + +/** + * Updates all diagrams in the document. + */ +function updateElements(elts) +{ + if (elts != null) + { + var updated = 0; + var errors = []; + + for (var i = 0; i < elts.length; i++) + { + try + { + if (updateElement(elts[i]) != null) + { + updated++; + } + } + catch (e) + { + errors.push("- " + e.message); + } + } + + // Shows status in case of errors or multiple updates + if (errors.length > 0 || updated > 1) + { + var msg = ""; + + if (updated > 0) + { + msg += updated + " diagram" + ((updated > 1) ? "s" : "") + " updated\n"; + } + + if (errors.length > 0) + { + msg += errors.length + " update" + ((errors.length > 1) ? "s" : "") + " failed:\n"; + } + + msg += errors.join("\n"); + SlidesApp.getUi().alert(msg); + } + } +} + +/** + * Returns true if the given URL points to draw.io + */ +function createLink(id, page, scale) +{ + var params = []; + + if (page != null && page != "0") + { + params.push('page=' + page); + } + + // This URL parameter is ignored and is used internally to + // store the retina flag since there is no other storage + if (scale != null && scale != 1) + { + params.push('scale=' + scale); + } + + return DRAW_URL + ((params.length > 0) ? "?" + params.join("&") : "") + "#G" + id; +} + +/** + * Returns true if the given URL points to draw.io + */ +function isValidLink(url) +{ + return url != null && (url.substring(0, DRAW_URL.length) == DRAW_URL || url.substring(0, 22) == "https://drive.draw.io/"); +} + +/** + * Returns the diagram ID for the given URL. + */ +function getDiagramId(url) +{ + return url.substring(url.lastIndexOf("#G") + 2); +} + +/** + * Returns the diagram ID for the given URL. + */ +function getUrlParams(url) +{ + var result = {}; + var idx = url.indexOf("?"); + + if (idx > 0) + { + var idx2 = url.indexOf("#", idx + 1); + + if (idx2 < 0) + { + idx2 = url.length; + } + + if (idx2 > idx) + { + var search = url.substring(idx + 1, idx2); + var tokens = search.split("&"); + + for (var i = 0; i < tokens.length; i++) + { + var idx3 = tokens[i].indexOf('='); + + if (idx3 > 0) + { + result[tokens[i].substring(0, idx3)] = tokens[i].substring(idx3 + 1); + } + } + } + } + + return result; +} + +/** + * Updates the diagram in the given inline image and returns the new inline image. + */ +function updateElement(elt) +{ + var result = null; + + if (elt.getPageElementType() == SlidesApp.PageElementType.IMAGE) + { + var url = elt.getLink(); + if (url != null) + url = url.getUrl(); + + if (url == null) + { + // commenting this out - missing link is most of the time an indicator image is not coming from draw.io + // we probably don't want to have this popping out as an error + // throw new Error("Missing link") + } + else if (isValidLink(url)) + { + var id = getDiagramId(url); + var params = getUrlParams(url); + + if (id != null && id.length > 0) + { + result = updateDiagram(id, params["page"], parseFloat(params["scale"] || 1), elt); + } + else + { + // commenting this out as well - invalid link might indicate image is not coming from draw.io + // throw new Error("Invalid link " + url); + } + } + } + + return result; +} + +/** + * Updates the diagram in the given inline image and returns the new inline image. + */ +function updateDiagram(id, page, scale, elt) +{ + var img = null; + var result = fetchImage(id, page, scale); + + var isOK = false; + + if (result != null) + { + var blob = result[0]; + var w = result[1] / scale; + var h = result[2] / scale; + + if (blob != null) + { + isOK = true; + // There doesn't seem to be a natural way to replace images in SlidesApp + // Slides API seems to only provide means to get a page and a group associated with the image + // Groups only allow removal of elements though, not insertions (seems like a half-baked API) + + // This code just adds a new image to page to the same position as the old image and removes the old image + // TODO: No group information will be preserved right now + // TODO: A question about it was posted here: + // TODO: https://plus.google.com/111221846870143003075/posts/EPAM8HrZhe2 + // TODO: if there is a satisfying answer, it will be implemented + + var page = elt.getParentPage(); + var left = elt.getLeft(); + var top = elt.getTop(); + var width = elt.getWidth(); + var height = elt.getHeight(); + + // This part addresses the possibility of updated diagrams having completely different shapes, + // causing diagrams no longer fitting into page + + // Keep top-left corner, adjust width x height + // keep either original width or height together with new aspect ratio + + if (w == 0 && h == 0) + { + w = width; + h = height; + } + + // make sure dimensions are reasonable + if (w == 0 || h == 0) + throw new Error("One or both image dimensions are zero!"); + + var nw = w; + var nh = h; + + // if aspect w/h < 1, use original width, otherwise use original height + // i.e. the smaller dimension keeps preserved (seems more natural while testing than preserving the larger dimension; can be changed anyway) + var aspect = w / h; + + if (aspect < 1) + { + nw = width; + nh = width / aspect; + } + else + { + nw = height * aspect; + nh = height; + } + + // now check if the image is still not too large + var wmax = SlidesApp.getActivePresentation().getPageWidth(); + var hmax = SlidesApp.getActivePresentation().getPageHeight(); + + if (wmax > 0 && w > wmax) + { + aspect = w / h; + + // Keeps width and aspect + nw = wmax; + nh = wmax / aspect; + } + else if (hmax > 0 && h > hmax) { + aspect = h / w; + + // Keeps height and aspect + nh = hmax; + nw = hmax / aspect; + } + + // make sure image is at least 1 pixel wide/high + nw = Math.max(1, nw); + nh = Math.max(1, nh); + + // replace image with the same link + var img = page.insertImage(blob, left, top, nw, nh); + var link = createLink(id, page, scale); + img.setLinkUrl(link); + + elt.remove(); + } + } + if (!isOK) + { + throw new Error("Invalid image " + id); + } + + return img; +} + +/** + * Fetches the diagram for the given document ID. + */ +function fetchImage(id, page, scale) +{ + var file = DriveApp.getFileById(id); + + if (file != null && file.getSize() > 0) + { + var response = UrlFetchApp.fetch(EXPORT_URL, + { + "method": "post", + "payload": + { + "format": "png", + "scale": scale || "1", +// "border": (scale == 2) ? "1" : "0", // not sure why it was set to 1, it looks better with 0 now, so I commented it out + "border": "0", + "from": page || "0", + "xml": encodeURIComponent(file.getBlob().getDataAsString()) + } + }); + + var headers = response.getHeaders(); + + return [response.getBlob(), headers["content-ex-width"] || 0, headers["content-ex-height"] || 0]; + } + else + { + // Returns an empty, transparent 1x1 PNG image as a placeholder + return Utilities.newBlob(Utilities.base64Decode("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNg+M9QDwADgQF/e5IkGQAAAABJRU5ErkJggg=="), "image/png"); + } +} + diff --git a/etc/slidesaddon/Picker.html b/etc/slidesaddon/Picker.html new file mode 100644 index 00000000..e17936ae --- /dev/null +++ b/etc/slidesaddon/Picker.html @@ -0,0 +1,252 @@ + + + + + + + +
+ +

Loading...

+
+ + + + diff --git a/etc/slidesaddon/README b/etc/slidesaddon/README new file mode 100644 index 00000000..869ab11b --- /dev/null +++ b/etc/slidesaddon/README @@ -0,0 +1,15 @@ +For Testing: + +As david.benson@appsscripttesting.com use (see Tools, Script Editor): +- TBA - + +For Deployment: + +As david@jgraph.com use (see Tools, Script Editor): +- TBA - + +Open the web app script in the script editor. +Make the changes you wanted. Test the code to ensure it functions as intended and is bug-free. +Click File > Manage Versions. Enter a new version description and click Save New Version. Click OK to close the dialog. +Click Publish > Deploy as Docs add-on. Update the Project version to the new version you just created. +Click Update. diff --git a/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties b/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties index 8bd99af6..d9e1d5f7 100644 --- a/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties +++ b/src/main/java/com/mxgraph/io/gliffy/importer/gliffyTranslation.properties @@ -1121,8 +1121,7 @@ com.gliffy.shape.network.network_v3.business.comm_link=mxgraph.networks.comm_lin com.gliffy.shape.network.network_v3.business.user=image;image=img/lib/clip_art/people/Tech_Man_128x128.png com.gliffy.shape.network.network_v3.business.user_female=image;image=img/lib/clip_art/people/Worker_Woman_128x128.png com.gliffy.shape.network.network_v3.business.user_male=image;image=img/lib/clip_art/people/Tech_Man_128x128.png -#composite -com.gliffy.shape.network.network_v3.business.user_group=rect +com.gliffy.shape.network.network_v3.business.user_group=mxgraph.networks.users;strokeColor=#ffffff com.gliffy.shape.network.network_v3.business.server=image;image=img/lib/clip_art/computers/Server_Tower_128x128.png com.gliffy.shape.network.network_v3.business.database_server=image;image=img/lib/clip_art/computers/Server_Tower_128x128.png com.gliffy.shape.network.network_v3.business.mail_server=image;image=img/lib/clip_art/computers/Server_Tower_128x128.png @@ -1141,7 +1140,7 @@ com.gliffy.shape.network.network_v3.business.mainframe=image;image=img/lib/clip_ com.gliffy.shape.network.network_v3.business.rack_server_1u=image;image=img/lib/clip_art/computers/Server_128x128.png com.gliffy.shape.network.network_v3.business.multi_u_server=image;image=img/lib/clip_art/computers/Server_128x128.png com.gliffy.shape.network.network_v3.business.rack=image;image=img/lib/clip_art/computers/Server_Rack_Empty_128x128.png -#com.gliffy.shape.network.network_v3.business.telephone= +com.gliffy.shape.network.network_v3.business.telephone=image;image=img/lib/clip_art/telecommunication/iPhone_128x128.png #com.gliffy.shape.network.network_v3.business.flash_drive= #It needs a new modern icon to match the remaining icons com.gliffy.shape.network.network_v3.business.tape_backup=mxgraph.networks.tape_storage;strokeColor=#ffffff diff --git a/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.63.jar.REMOVED.git-id b/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.63.jar.REMOVED.git-id new file mode 100644 index 00000000..e0985f6f --- /dev/null +++ b/src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.63.jar.REMOVED.git-id @@ -0,0 +1 @@ +b481dc044032344482ba6dee7389828d0f8596a7 \ No newline at end of file diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest index 5460179f..f15b5452 100644 --- a/src/main/webapp/cache.manifest +++ b/src/main/webapp/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 03/31/2018 02:35 PM +# 04/04/2018 01:26 PM app.html index.html?offline=1 diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 68899de8..9fe07c4b 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -96,9 +96,9 @@ ea;m.wa=m.normalizeRCData=e;m.xa=m.sanitize=function(a,b,d,e){return Q(a,ea(b,d, l--,_+=n[s++]<>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Zr||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i>=7;i8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d,e,f,g,k,l,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m>2,d=(d&3)<<4|e>>4,k=(e&15)<<2|f>>6,l=f&63,isNaN(e)?k=l=64:isNaN(f)&&(l=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,k,l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g, "");l>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):(127d?b+= -String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;cd?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img"; -window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.mxLoadResources=window.mxLoadResources||!1; -window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); +String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0,d;for(c1=c2=0;cd?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.draw.io/VsdConverter/api/converter";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy"; +window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":"https://www.draw.io/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia"; +window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",fil:"Filipino",fr:"Français",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"Русский",sr:"Српски",uk:"Українська",he:"עברית",ar:"العربية",th:"ไทย", ko:"한국어",ja:"日本語",zh:"中文(中国)","zh-tw":"中文(台灣)"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} @@ -6652,12 +6652,12 @@ function(){x("_blank")}),m.className="geBtn",l.appendChild(m));mxClient.IS_IOS|| f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=c&&c()});h.className="geBtn";h.style.marginBottom="8px";h.style.width="280px";f.appendChild(h);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=d&&d();a.openLink(b)});l.className="geBtn gePrimaryBtn";l.style.width=h.style.width;f.appendChild(l);mxUtils.br(f); mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,b,d,c,e,f){f=null!=f?f:!0;var h=a.editor.graph,l=document.createElement("div");mxUtils.write(l,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 m=document.createElement("input");m.setAttribute("value", d);m.setAttribute("type","text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title", -mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){m.value="";m.focus()});b.appendChild(m);b.appendChild(d);l.appendChild(b);var g=function(b,d,g,k){var e="data:"==b.substring(0,5);!a.isOffline()||e&&"undefined"===typeof chrome? -0'; +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.5.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml=''; EditorUi.prototype.emptyLibraryXml="[]";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.svgBrokenImage=Graph.createSvgImage(10,10,'');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;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");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(u){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&& @@ -6898,86 +6898,87 @@ a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.cre function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c=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!=g?g.style.border="3px dotted lightGray":(f.style.border="3px solid transparent", -f.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",IMAGE_PATH+"/edit.gif");h.setAttribute("title",mxResources.get("edit"));t.insertBefore(h,t.firstChild);mxEvent.addListener(h,"click",G);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&G(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));t.insertBefore(c,t.firstChild);mxEvent.addListener(c,"click",H);this.isOffline()||".scratchpad"!= -a.title||null==EditorUi.scratchpadHelpLink||(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){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),t.insertBefore(c,t.firstChild))}n.appendChild(t);n.style.paddingRight=18*t.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight= -4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,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.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"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):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a", -Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor= -"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))}; -EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0, -!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null== -this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this, -function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=e)if(null!=e.retry&&(g=mxResources.get("cancel"),k=function(){d();e.retry()}),"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));else if(404==e.code||404==e.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var f=window.location.hash;null!=f&&"#G"==f.substring(0,2)&&(f=f.substring(2), -a+=' '+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"")}else e.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=e.message?a=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error&&(a=mxUtils.htmlEntities(e.response.error));this.showError(b,a,g,c,k)}else null!=c&&c()};EditorUi.prototype.showError= -function(a,b,c,d,e,f,h){a=new ErrorDialog(this,a,b,c,d,e,f,h);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e){var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){g();null!=b&&b()},function(){g();null!=c&&c()},d,e)).container, -340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=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,e){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 g=document.createElement("a"),k=!mxClient.IS_SF&&"undefined"!==typeof g.download;if(k||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?g.download=b:g.setAttribute("target","_blank"); -document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(x){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(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),g=Array(e),k=0;k"+a+""):d.document.write(''),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), -this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding= -"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var e=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});e.spin(this.exportDialog); -this.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, -function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c, -a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,g){return this.createEchoRequest(c,a,d,e,b,g)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,f,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), -mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,h,null,null,4'}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 g="#0000ff",k= -null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(g||"none",function(a){g=a;c()});mxEvent.consume(a)}));c();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return g},getTarget:function(){return d.value},focus:function(){d.focus()}}}; -EditorUi.prototype.createLink=function(a,b,c,d,e,f,h,l){var g=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0';a=null!=a?"&fetch="+encodeURIComponent(a):"";z(b,'